{
 "metadata": {
  "name": "",
  "signature": "sha256:a1fc86a1745331cbb94487da02761804f9fca4fd4c628ee53c6bfd5a750d81a6"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Optical Fiber Communication System"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1: PgNo-339"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "tr=40.0     # rediative life time in ns\n",
      "tnr=60.0    # nonrediative life time in ns\n",
      "i=35*math.pow(10,-3) # drive current in amp\n",
      "y=0.85*math.pow(10,-6)# wavelength in m\n",
      "h=6.626*math.pow(10,-34)# plank constant\n",
      "c=3*math.pow(10,8)# the speed of light in m/s\n",
      "eq=1.602*math.pow(10,-19)# charge\n",
      "\n",
      "# calculations\n",
      "t=tr*tnr/(tr+tnr)# total carrier recombination lifetime ns\n",
      "ni=t/tr     # internal quantam efficiency\n",
      "pil=(ni*h*c*i)/(eq*y)# internal power in watt\n",
      "p_int=pil*math.pow(10,3)# internal power in mW\n",
      "\n",
      "# Results\n",
      "print ('%s %.f %s' %(\" The total carrier recombination lifetime = \",t,\"ns\"))\n",
      "print ('%s %.2f %s' %(\"\\n The internal power = \",p_int,\"mW\"))\n",
      "print (\"\\n The answer is wrong in textbook \")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The total carrier recombination lifetime =  24 ns\n",
        "\n",
        " The internal power =  30.66 mW\n",
        "\n",
        " The answer is wrong in textbook \n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2: PgNo-341"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "tr=30.0 # rediative life time in ns\n",
      "tnr=50.0  # nonrediative life time in ns\n",
      "i=40*math.pow(10,-3)  # drive current in amp\n",
      "pil=28.4*math.pow(10,-3) # internal power in watt\n",
      "h=6.626*math.pow(10,-34) # plank constant\n",
      "c=3*math.pow(10,8)  # the speed of light in m/s\n",
      "eq=1.602*math.pow(10,-19) # charge\n",
      "t=tr*tnr/(tr+tnr) # total carrier recombination lifetime ns\n",
      "ni=t/tr    # internal quantam efficiency\n",
      "y=(ni*h*c*i)/(eq*pil) # peak emission wavelength in m\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The total carrier recombination lifetime = \",t,\"ns\"))\n",
      "print ('%s %.2f %s' %(\"\\n The peak emission wavelength = \",y*pow(10,6),\"um\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The total carrier recombination lifetime =  18.75 ns\n",
        "\n",
        " The peak emission wavelength =  1.09 um\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3: PgNo-345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "nx=3.6  # refractive index\n",
      "Fn=0.68 # transmission factor\n",
      "pe_pi=(Fn)/(4*math.pow(nx,2))\n",
      "pi_p=0.3\n",
      "nep=pe_pi*pi_p # external power efficiency\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\"The external power efficiency = \",nep*100,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The external power efficiency =  0.39 %\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4: PgNo-347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "n=3.6 # core refractive index\n",
      "NA=0.15 # numerical aperture\n",
      "nc=math.pow(NA,2) # coupling efficiency\n",
      "l_s=-10*math.log(nc)/math.log(10) # loss in db\n",
      "pe_pi=0.023*0.0013  # from ex 8.3\n",
      "pc=-10*math.log(pe_pi)/math.log(10) # loss in decibels relative to Pint\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The coupling efficiency = \",nc*100,\"%\"))\n",
      "print ('%s %.3f %s' %(\"\\n The loss = \",l_s,\"db\"))\n",
      "print ('%s %.2f %s' %(\"\\n The loss in decibels relative to Pint= \",pc,\"db\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The coupling efficiency =  2.25 %\n",
        "\n",
        " The loss =  16.478 db\n",
        "\n",
        " The loss in decibels relative to Pint=  45.24 db\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5: PgNo-348"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "r=45*math.pow(10,-6) # radius in m\n",
      "NA=0.3 # numerical aperture\n",
      "rd=40 # radiance\n",
      "A=3.14*math.pow((r*100),2) # area in cm^2\n",
      "pe=3.14*(1-r)*A*rd*math.pow(NA,2) # optical power coupled into the fiber\n",
      "Pe=pe*math.pow(10,4) # optical power coupled into the fiber uW\n",
      "\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The optical power coupled into the fiber = \",Pe,\"uW\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The optical power coupled into the fiber =  7.187 uW\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6: PgNo-351"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "pc=150*math.pow(10,-6) # coupling power W\n",
      "p=20*math.pow(10,-3)*2 # optical power W\n",
      "npc=pc/p # overall efficiency\n",
      "Npc=npc*100 # percentage of overall efficiency\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The percentage of overall efficiency = \",Npc,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The percentage of overall efficiency =  0.37 %\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7: PgNo-357"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "n=1.5 # refractive index\n",
      "L=0.05  #crystal length in m\n",
      "y=0.5*math.pow(10,-6) #  wavelength in m\n",
      "c=3*math.pow(10,8) # speed of light in m/s\n",
      "q=2*n*L/y # the number of longitudinal modes\n",
      "df=c/(2*n*L) # frequency separation of the modes in Hz\n",
      "Df=df/math.pow(10,9) # frequency separation of the modes in GHz\n",
      "\n",
      "# Results\n",
      "print ('%s %d ' %(\" The number of longitudinal modes = \",q))\n",
      "print ('%s %.2f %s' %(\"\\n The frequency separation of the modes = \",Df,\"GHz\"))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The number of longitudinal modes =  300000 \n",
        "\n",
        " The frequency separation of the modes =  2.00 GHz\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8: PgNo-358"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable declaration\n",
      "Eg=1.43 # bandgap energy in eV\n",
      "dy=0.15*math.pow(10,-9);\n",
      "c=3*math.pow(10,8) # speed of light in m/s\n",
      "y=1.24/Eg  # in um\n",
      "y1=y*math.pow(10,-6) # wavelength of optical emission in m\n",
      "df=(c*dy)/math.pow(y1,2) # the line width in Hz\n",
      "Df=df/math.pow(10,9) # the line width in GHz\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The wavelength of optical emission  = \",y,\"um\"))\n",
      "print ('%s %.4f %s' %(\"\\n The frequency separation of the modes = \",Df,\"GHz\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The wavelength of optical emission  =  0.87 um\n",
        "\n",
        " The frequency separation of the modes =  59.8468 GHz\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9: PgNo-362"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "n=3.6 # refractive index\n",
      "c=3*math.pow(10,8)# speed of light in m/s\n",
      "y=0.85*math.pow(10,-6)# wavelength in m\n",
      "df=275*math.pow(10,9) # frequency separation of the modes in Hz\n",
      "L=c/(2*n*df) # crystal length in m\n",
      "L1=L*math.pow(10,6) # crystal length in um\n",
      "q=2*n*L/y # the number of longitudinal modes\n",
      "\n",
      "# results\n",
      "print ('%s %.2f %s' %(\" The crystal length = \",L1,\"um\"))\n",
      "print ('%s %d' %(\"\\n The the number of longitudinal modes = \",int(q)))\n",
      "print (\"\\n answer is wrong in textbook \")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The crystal length =  151.52 um\n",
        "\n",
        " The the number of longitudinal modes =  1283\n",
        "\n",
        " answer is wrong in textbook \n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10: PgNo-364"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "nt=0.20# total efficiency\n",
      "Eg=1.43# bandgap energy in eV\n",
      "V=2.2# applied voltage in volts\n",
      "nep=(nt*Eg)/V# external power efficiency\n",
      "Nep=nep*100#  percentage of external power efficiency\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The external power efficiency = \",Nep,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The external power efficiency =  13.00 %\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11: PgNo-367"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "h=0.35*math.pow(10,-3)# irradiance W/cm^2\n",
      "po=0.45*math.pow(10,-3)# power output in watt\n",
      "d=1.5 # separation distance in cm\n",
      "x=math.sqrt((4*po)/(3.14*math.pow(d,2)*h)) # divergence angle in radians\n",
      "X=(x*180)/3.14 # divergence angle in degree\n",
      "\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The divergence angle = \",X,\"degree \"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The divergence angle =  48.909 degree \n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12: PgNo-369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "ni=0.09 # normal efficiency\n",
      "d=2*2.54 # separation distance in cm\n",
      "x=0.2 # divergence angle in radians\n",
      "vf=2.0 # forward voltage in volts\n",
      "i_f=65*math.pow(10,-3) # forward current in amp\n",
      "pil=vf*i_f # input power in Watt\n",
      "po=ni*pil # output power in Watt\n",
      "H=4*po/(3.14*math.pow(d,2)*math.pow(x,2)) # irradiance in watt/cm^2\n",
      "H1=H*1000 # irradiance in mwatt/cm^2\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The irradiance = \",H1,\"mwatt/cm^2 \"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The irradiance =  14.44 mwatt/cm^2 \n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13: PgNo-372"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# variable declaration\n",
      "tr=3.5 # relative life time in ms\n",
      "tnr=50 # nonrelative life time in ms\n",
      "ni=tnr/(tr+tnr) # internal quantam efficiency\n",
      "\n",
      "# results\n",
      "print ('%s %.2f %s' %(\" The internal quantam efficiency = \",ni*100,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The internal quantam efficiency =  93.46 %\n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14: PgNo-375"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# initialisation of variables\n",
      "ni=0.15 # internal quantam efficiency\n",
      "vf=2.0  # forward voltage in volts\n",
      "i_f=15*math.pow(10,-3) # forward current in amp\n",
      "x=25    # acceptance angle in degree\n",
      "pil=vf*i_f # input power in Watt\n",
      "po=ni*pil # output power in Watt\n",
      "NA=(math.sin(x*math.pi/180))\n",
      "nc=math.pow(NA,2) # numerical aperture\n",
      "pf=nc*po # optical power coupled into optical fiber in w\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The optical power coupled into optical fiber = \",pf*1000,\"mW\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The optical power coupled into optical fiber =  0.80 mW\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15: PgNo-378"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "tnr=10  # nonrediative life time in ns\n",
      "n_inj=0.80 # injection efficiency\n",
      "n_ex=0.60 # extraction efficiency\n",
      "nt=0.025 # total efficiency\n",
      "nr=nt/(n_inj*n_ex) # non rediative life time in ns\n",
      "tr=((1/nr)-1)*tnr # rediative life time in ns\n",
      "# Results\n",
      "print ('%s %.1f %s' %(\" The rediative life time = \",tr,\"ns\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The rediative life time =  182.0 ns\n"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 16: PgNo-381"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "tr=30*math.pow(10,-9) # rise time in s\n",
      "Bw=0.35/tr # bandwidth in Hz\n",
      "\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The bandwidth = \",Bw/math.pow(10,6),\"MHz\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The bandwidth =  11.667 MHz\n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17: PgNo-384"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "y=630*math.pow(10,-9)# operating wavelength in m\n",
      "w=25*math.pow(10,-6) # spot size in m\n",
      "x=2*y/(math.pi*w) # divergence angle in radians\n",
      "x1=x*180/math.pi #  divergence angle in degree\n",
      "\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The  divergence angle = \",x,\"radians\"))\n",
      "print ('%s %.3f %s' %(\"\\n The  divergence angle = \",x1,\"degree\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The  divergence angle =  0.016 radians\n",
        "\n",
        " The  divergence angle =  0.919 degree\n"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 18: PgNo-388"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "y1=550*math.pow(10,-3)# peak of eyes response in um\n",
      "y2=10.6 # standard wavelength in um\n",
      "y3=2.39 # predominant IR line of He-Ne laser in um\n",
      "E1=1.24/y1 # energy in electron volts\n",
      "E2=1.24/y2 # energy in electron volts\n",
      "E3=1.24/y3 # energy in electron volts\n",
      "\n",
      "# results\n",
      "print ('%s %.3f %s' %(\" The  energy = \",E1,\"electron volts\"))\n",
      "print ('%s %.3f %s' %(\"\\n The energy = \",E2,\"electron volts\"))\n",
      "print ('%s %.3f %s' %(\"\\n The energy = \",E3,\"electron volts\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The  energy =  2.255 electron volts\n",
        "\n",
        " The energy =  0.117 electron volts\n",
        "\n",
        " The energy =  0.519 electron volts\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 19: PgNo-391"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# variable initialisation\n",
      "Eg=1.4 # energy in electron volts\n",
      "y=1.24/Eg # cut off wavelength in um\n",
      "y1=y*1000 # cut off wavelength in nm\n",
      "# Results\n",
      "print ('%s %.4f %s' %(\" The  cut off wavelength = \",y1,\"nm\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The  cut off wavelength =  885.7143 nm\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20: PgNo-394"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "y=1200*math.pow(10,-9)# operating wavelength in m\n",
      "w=5*math.pow(10,-6)# spot size in m\n",
      "x=2*y/(math.pi*w)# divergence angle in radians\n",
      "x1=x*180/math.pi #  divergence angle in degree\n",
      "\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The  divergence angle = \",x,\"radians\"))\n",
      "print ('%s %.3f %s' %(\"\\n The  divergence angle = \",x1,\"degree\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The  divergence angle =  0.153 radians\n",
        "\n",
        " The  divergence angle =  8.754 degree\n"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 21: PgNo-395"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "n1=1.48 # core refractive index\n",
      "n2=1.46 # cladding refractive index \n",
      "NA=math.sqrt(math.pow(n1,2)-math.pow(n2,2)) # numerical aperture\n",
      "xa=(math.asin(NA))*(180/math.pi) # acceptance angle in degree\n",
      "nc=math.pow(NA,2) # coupling efficiency\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The  acceptance angle = \",xa,\"degree\"))\n",
      "print ('%s %.2f %s' %(\"\\n The coupling efficiency = \",nc*100,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The  acceptance angle =  14.03 degree\n",
        "\n",
        " The coupling efficiency =  5.88 %\n"
       ]
      }
     ],
     "prompt_number": 53
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 22: PgNo-398"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "c=3*math.pow(10,8)  # speed of light in m/s\n",
      "n=3.66 # for GaAs\n",
      "L=150*math.pow(10,-6) # cavity length in m\n",
      "dv=c/(2*n*L) #frequency separation in Hz\n",
      "dv1=dv/math.pow(10,12) # frequency separation in GHz\n",
      "h=6.64*math.pow(10,-34) # plank constant\n",
      "q=1.6*math.pow(10,-19) # charge of an electron\n",
      "dE=(h*dv)/q # energy separation eV\n",
      "\n",
      "# Results\n",
      "print ('%s %.4f %s' %(\" The frequency separation = \",dv1,\"GHz\"))\n",
      "print ('%s %.3f %s' %(\"\\n The energy separation = \",dE*1000,\"meV\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The frequency separation =  0.2732 GHz\n",
        "\n",
        " The energy separation =  1.134 meV\n"
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 23: PgNo-400"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# variable initialisation\n",
      "po=2*math.pow(10,-3)# optical power in watts\n",
      "I=100*math.pow(10,-3)# current in amp\n",
      "V=2 # applied voltage in volt\n",
      "pe=I*V # electrical power in watts\n",
      "n=(po/pe)*100 # conversion efficiency\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The conversion efficiency = \",n,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The conversion efficiency =  1.00 %\n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24: PgNo-403"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# variable initialisation\n",
      "c=3*math.pow(10,8)  # speed of light in m/s\n",
      "h=6.64*math.pow(10,-34) # plank constant\n",
      "Eg=1.43 # gap energy in eV\n",
      "y=(1.24*math.pow(10,-6))/Eg # wavelength in m\n",
      "dy=0.1*math.pow(10,-9) # in m\n",
      "df=(dy*c)/math.pow(y,2) # width in Hz\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The wavelength = \",y*pow(10,6),\"um\"))\n",
      "print ('%s %.4f %s' %(\"\\n The width = \",df/pow(10,9),\"GHz\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The wavelength =  0.867 um\n",
        "\n",
        " The width =  39.8979 GHz\n"
       ]
      }
     ],
     "prompt_number": 56
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 25: PgNo-407"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable declaration\n",
      "tr=25.0 # rediative life time in ns\n",
      "tnr=90.0 # nonrediative life time in ns\n",
      "i=3.5*math.pow(10,-3) # drive current in amp\n",
      "y=1.31*math.pow(10,-6) # wavelength in m\n",
      "h=6.625*math.pow(10,-34) # plank constant\n",
      "c=3*math.pow(10,8) # the speed of light in m/s\n",
      "eq=1.6*math.pow(10,-19 )# charge\n",
      "t=tr*tnr/(tr+tnr) # total carrier recombination lifetime ns\n",
      "ni=t/tr # internal quantam efficiency\n",
      "pil=(ni*h*c*i)/(eq*y) # internal power in watt\n",
      "p_int=pil*pow(10,3) # internal power in mW\n",
      "P=p_int/(ni*(ni+1)) # power emitted in mW\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The total carrier recombination lifetime = \",t,\"ns\"))\n",
      "print ('%s %.2f ' %(\"\\n The internal quantam efficiency = \", ni))\n",
      "print ('%s %.2f %s' %(\"\\n The internal power = \",p_int,\"mW\"))\n",
      "print ('%s %.2f %s' %(\"\\n The power emitted = \",P,\"mW\"))\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The total carrier recombination lifetime =  19.57 ns\n",
        "\n",
        " The internal quantam efficiency =  0.78 \n",
        "\n",
        " The internal power =  2.60 mW\n",
        "\n",
        " The power emitted =  1.86 mW\n"
       ]
      }
     ],
     "prompt_number": 57
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 26: PgNo-409"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "nt=0.18 # total efficiency\n",
      "Eg=1.43 # band gape energy eV\n",
      "V=2.5 # appied voltage in volt\n",
      "n_ex=(nt*(Eg/V))*100 # external efficiency\n",
      "\n",
      "# Results\n",
      "print ('%s %.2f %s' %(\" The external efficiency = \",n_ex,\"%\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The external efficiency =  10.30 %\n"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 27: PgNo-411"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "c=3*math.pow(10,8)   # speed of light in m/s\n",
      "n=3.6      # for GaAs\n",
      "df=278*math.pow(10,9)  # separation in Hz\n",
      "y=0.87*math.pow(10,-6) # wavelength in m\n",
      "L=c/(2*n*df) # cavity length in m\n",
      "l=L*math.pow(10,6) # cavity length in um\n",
      "L1=math.floor(l)*math.pow(10,-6) # cavity length in m\n",
      "q=(2*n*L1)/y  # number of longitudinal modes\n",
      "# Results\n",
      "print ('%s %.3f %s' %(\" The cavity length = \",l,\"um\"))\n",
      "print ('%s %d' %( \"\\n The number of longitudinal modes = \",int(q)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The cavity length =  149.880 um\n",
        "\n",
        " The number of longitudinal modes =  1233\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 28: PgNo-415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Initialisation of variables\n",
      "ac=14 # acceptance angle in degree\n",
      "nc=math.pow((math.sin(ac*math.pi/180)),2) # coupling efficiency\n",
      "l_s=-10*math.log(nc)/math.log(10) # loss in decibels\n",
      "\n",
      "# results\n",
      "print ('%s %.3f ' %(\" The coupling efficiency = \",nc))\n",
      "print ('%s %.3f %s' %(\"\\n The loss = \",l_s,\"decibels\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The coupling efficiency =  0.059 \n",
        "\n",
        " The loss =  12.326 decibels\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 29: PgNo-417"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "# Variable initialisation\n",
      "c=3*math.pow(10,8)# speed of light in m/s\n",
      "n=3.7 # for GaAs\n",
      "L=500*math.pow(10,-6) # cavity length in m\n",
      "y=850*math.pow(10,-9)\n",
      "df=c/(2*n*L) #frequency separation in Hz\n",
      "df1=df/math.pow(10,9)  # frequency separation in GHz\n",
      "dy=(y*y)/(2*L*n) # wavelength in m\n",
      "dy1=dy*math.pow(10,9) # wavelength in nm\n",
      "\n",
      "# Resultsh\n",
      "print ('%s %.4f %s' %(\" The frequency separation = \",df1,\"GHz\"))\n",
      "print ('%s %.3f %s' %(\"\\n The wavelength separation = \",dy1,\"nm\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The frequency separation =  81.0811 GHz\n",
        "\n",
        " The wavelength separation =  0.195 nm\n"
       ]
      }
     ],
     "prompt_number": 61
    }
   ],
   "metadata": {}
  }
 ]
}