{
 "metadata": {
  "name": "",
  "signature": "sha256:6026027db1bd8b07217b92e949d13ab4629f8d5523088409bf01dbeddbd9764c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4: Optical sources and transmitter circuits"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1 , Page no:67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "tau_r=12*10**-9;  #radiative recombination time in s\n",
      "tau_nr=35*10**-9;  #non-radiative recombination time in s\n",
      "n1=3.5;  #refractive index of semiconductor\n",
      "n2=1;  #refractive index of air\n",
      "d=0.4*10**-6;  #active later thickness in m\n",
      "V=8;  #recombination velocity\n",
      "\n",
      "#CALCULATIONS\n",
      "eta_int=1/(1+(tau_r/tau_nr));  #internal quantum efficiency\n",
      "tau=1/((tau_r**-1)+(tau_nr**-1)+(2*V/d));  #total recombination time in s\n",
      "f=math.sqrt(3)/(2*3.14*tau);  #bandwidth in Hz\n",
      "F3=((n1-n2)**2/(n1+n2)**2);  #fresnel reflection \n",
      "eta_ext=eta_int*(1-F3);  #external quantum efficiency\n",
      "\n",
      "#RESULTS\n",
      "print\"internal quantum efficiency=\",round(eta_int,5);  #The answers vary due to round off error\n",
      "print\"total recombination time =\",round(tau*1e9,5),\"ns\";  #multiplication by 1e9 to convert unit from s to ns//The answers vary due to round off error\n",
      "print\"bandwidth =\",round(f*1e-6,5),\"MHz\";  #multiplication by 1e-6 to convert unit from Hz to MHz///The answers vary due to round off error\n",
      "print\"fresnel reflection=\",round(F3,5);  #The answers vary due to round off error\n",
      "print\"external quantum efficiency=\",round(eta_ext,5);  #The answers vary due to round off error"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "internal quantum efficiency= 0.74468\n",
        "total recombination time = 6.58307 ns\n",
        "bandwidth = 41.89598 MHz\n",
        "fresnel reflection= 0.30864\n",
        "external quantum efficiency= 0.51484\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2 , Page no:67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "lambda1=1.3;  #wavelength of laser in um\n",
      "w=5;  #active layer width in um\n",
      "d=2;  #active layer thickness in um\n",
      "n1=3.5;  #refractive index of core\n",
      "n2=3.49;  #refractive index of cladding\n",
      "\n",
      "#CALCULATIONS\n",
      "k0=2*3.14/lambda1;  #propagation constant\n",
      "row=0.3;  #confinement factor\n",
      "neff=math.sqrt(n2**2+row);  #effective refractive index\n",
      "D=k0*d*(math.sqrt(n1**2-n2**2));  #normalized thickness\n",
      "W=k0*w*(math.sqrt(neff**2-n2**2));  #normalized width// the answer given in textbook is wrong\n",
      "Wlat=w*(math.sqrt(2*math.log(2)))*(0.32+2.1*(W**-1.5));  #Full width lateral at half maximum in um/ the answer given in textbook is wrong\n",
      "Wtra=d*(math.sqrt(2*math.log(2)))*(0.32+2.1*(D**-1.5));  #Full width transverse at half maximum in um/ the answer given in textbook is wrong\n",
      "\n",
      "#RESULTS\n",
      "print\"Normalized thickness=\",round(D,5);  #The answers vary due to round off error\n",
      "print\"Normalized width =\",round(W,5);  #multiplication by 1e9 to convert unit from s to ns/// the answer given in textbook is wrong\n",
      "print\"Full width lateral at half maximum =\",round(Wlat,5),\"um\";  #multiplication by 1e-6 to convert unit from Hz to MHz//// the answer given in textbook is wrong\n",
      "print\"Full width transverse at half maximum =\",round(Wtra,5),\"um\";  #multiplication by 1e-6 to convert unit from Hz to MHz//// the answer given in textbook is wrong"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Normalized thickness= 2.55438\n",
        "Normalized width = 13.22961\n",
        "Full width lateral at half maximum = 2.14078 um\n",
        "Full width transverse at half maximum = 1.96484 um\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3 , Page no:68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "Eg=1.3;  #band gap energy in eV\n",
      "l=0.4;  #cavity length in mm\n",
      "R1=0.5;  #reflectivities on ends\n",
      "R2=0.5;  #reflectivities on ends\n",
      "alpha=3;  #loss coefficient in /mm\n",
      "current_density=30*10**5;  #current density in amp/m^2\n",
      "area=0.2*0.5*10**-6;  #laser active area in m^2\n",
      "\n",
      "#CALCULATIONS\n",
      "lambda1=1.24/Eg;  #emission wavelength in um\n",
      "gth=alpha+(1/(2*l))*math.log(1/(R1*R2));  #Threshold Gain\n",
      "threshold_current=current_density*area;  #threshold current in A\n",
      "\n",
      "#RESULTS\n",
      "print\"Emission wavelength =\",round(lambda1,5),\"nm\";  #multiplication by 1e3 to convert unit from um to nm\n",
      "print\"Threshold Gain=\",round(gth,5),\"/mm\";\n",
      "print\"Threshold current =\",round(threshold_current*1e3,5),\"mA\";  #for converting unit from A to mA"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Emission wavelength = 0.95385 nm\n",
        "Threshold Gain= 4.73287 /mm\n",
        "Threshold current = 300.0 mA\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4 , Page no:68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#initialisation of variables\n",
      "lamda=0.85*10**-6;  #wavelength of operation in m\n",
      "delta_lamda=36*10**-9;  #spectral width in m\n",
      "\n",
      "#CALCULATIONS\n",
      "fractional_width=delta_lamda/lamda;  #fractional width \n",
      "\n",
      "#RESULTS\n",
      "print\"Fractional width=\", round(fractional_width*100,5),\"percent\";  #multiplication by 100 to represent information in percentage"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Fractional width= 4.23529 percent\n"
       ]
      }
     ],
     "prompt_number": 4
    }
   ],
   "metadata": {}
  }
 ]
}