{
 "metadata": {
  "name": "Chapter 2(s)"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Chapter 2: Lasers"
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 1, Page No: 2.40"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Number of electron hole pairs\n\nimport math\n\n# Variable Declaration\nA           = 4*10**-6;              #  Receiving area of photo detector\nI           = 200;                   # Intensity in W/m^2\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 0.4*10**-6;             # wavelength of light in m\n\n#Calculations\nv           = c/lamda;              # frequency\nNOP         = I*A/(h*v)             # number of photons\n\n#since each photon generates an electron hole pair, the number of photons is equal to number of electron hole pairs\n\n# Result\n\nprint 'Number of electron hole pairs = %3.2e '%NOP;\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Number of electron hole pairs = 1.61e+15 \n"
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 2, Page No:2.40"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Wavelength\n\nimport math\n\n# Variable Declaration\nEg          = 2.8;                   # bandgap energy in eV\nh           = 6.625*10**-34;          # plank's constant\nc           = 3*10**8;                # vel. of light in m/s\nq           = 1.602*10**-19;          # charge of electron\n\n# Calculations\nE           = Eg*q                 # eV to joules conversion\nlamda       = h*c/E;               # wavelength\n\n#Result\nprint 'wavelength = %3.1f' %(lamda*10**10), '\u00c5(Blue Colour)';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "wavelength = 4430.8 \u00c5(Blue Colour)\n"
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 3, Page No:2.41"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Energy bandgap\n\nimport math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # plank's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 1.55*10**-6;            # wavelength of light in m\nq           = 1.6*10**-19;            # charge of electron\n\n#Calculations\nEg          = (h*c)/lamda;           # band gap energy in joules\nE           = Eg/q                   # bang gap energy in eV\n\n# Result\nprint 'Energy bandgap Eg   = %3.4f'%E, 'eV';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Energy bandgap Eg   = 0.8014 eV\n"
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 4, Page No:2.41"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Number of photons required to do one Joule of work\n\nimport math\n\n# Variable Declaration\nh           = 6.625*10**-34;         # plank's constant\nc           = 3*10**8;               # vel. of light in m/s\nlamda       = 4961*10**-10;          # wavelength of light in m\n\n# Calculations\nE           = (h*c)/lamda;           # energy in joules\nN           = 1/E\n\n# Result\nprint 'Number of photons required to do one Joule of work  = %3.4e'%N,'/m^3';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Number of photons required to do one Joule of work  = 2.4961e+18 /m^3\n"
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 5, Page No:2.41"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Wavelength Limit\n# import math\n\n# Variable Declaration\nE           = 0.02;                 # ionisation energy in eV\nh           = 6.625*10**-34;         # plank's constant\nc           = 3*10**8;               # vel. of light in m/s\nq           = 1.6*10**-19;           # charge of electron\n\n# Calculations\n\nlamda       = h*c/(E*q)              # long wavelength limit in m\n\n# Result\n\nprint 'long wavelength limit = %3.3e' %lamda,' m';\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "long wavelength limit = 6.211e-05  m\n"
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Example 6, Page No:2.42"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Wavelength\n\nimport math;\n\n# Variable Declaration\nE           = 1.44;                 # Bandgap energy in eV\nh           = 6.625*10**-34;        # plank's constant\nc           = 3*10**8;              # vel. of light in m/s\nq           = 1.6*10**-19;          # charge of electron\n\n# Calculations\n\nlamda       = h*c/(E*q)              # Wavelength of GaAs laser\n\n# Result\nprint 'Wavelength of GaAs laser = %3.1f'%(lamda*10**10),' \u00c5';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Wavelength of GaAs laser = 8626.3  \u00c5\n"
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 1, Page No:2.42"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding Energy of the first excited state\n\nimport math;\n\n# Variable Declaration\nh           = 6.625*10**-34;         # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 5890*10**-10;           # wavelength of light in m\nq           = 1.6*10**-19;            # charge of electron\n\n\n# Calculations\nEg          = (h*c)/lamda;          # energy in joules\nE           = Eg/q                  # energy in eV\n\n# Result\nprint 'Energy of the first excited state  = %3.3f' %E,'eV';\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Energy of the first excited state  = 2.109 eV\n"
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 2, Page No:2.43"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding The ratio between the stimulated emission and apontaneous emission\n\nimport math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 5890*10**-10;           # wavelength of light in m\nk           = 1.38*10**-23;           # Boltzmann constant\nTc          = 280                     # Temperature in centigrades\n\n# Calculations\nT           = Tc+273;               # temperature in kelvin\nR           = 1/((math.exp((h*c)/(k*T*lamda))) - 1);     # ratio of stimulated emission to spontaneous emission\n\n# Result\nprint 'The ratio between the stimulated emission and apontaneous emission = %3.3e' %R;",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The ratio between the stimulated emission and apontaneous emission = 6.264e-20\n"
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 3, Page No:2.43"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding The No. of Photons emitted per minute\n\nimport math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 6328*10**-10;           # wavelength of He-Ne laser source in m\nq           = 1.6*10**-19;            # charge of electron\nP           = 3*10**-3                # output power of the He-Ne source in watts or J/sec\n\n\n# Calculations\nv           = c/lamda               # frequency of the photon emitted by the laser beam\nE           = h*v;                  # energy of a photon in joules\nPo          = P*60;                 # conversion from J/sec to J/min\nN           = Po/E;                 # No of photons emitted per minute \n\n# Result\nprint 'The No. of Photons emitted per minute = %3.3e' %N, 'photons/minute';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The No. of Photons emitted per minute = 5.731e+17 photons/minute\n"
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 4, Page No:2.44"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# Finding The No. of Photons emitted per hour\n\nimport math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 9.6*10**-6;             # wavelength of CO2 laser source in m\nq           = 1.6*10**-19;            # charge of electron\nP           = 10*10**3                # output power of the CO2 laser source in watts or J/sec\n\n\n# Calculations\nv           = c/lamda               # frequency of the photon emitted by the laser beam\nE           = h*v;                  # energy of a photon in joules\nPo          = P*60*60;              # conversion fro J/sec to J/hour\nN           = Po/E;                 # No of photons emitted per hour \n\n# Result\nprint 'The No. of Photons emitted per hour = %3.3e'%N,' photons/hour';\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The No. of Photons emitted per hour = 1.739e+27  photons/hour\n"
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 5, Page No:2.45"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 10*10**-2;              # wavelength for microwave region in m\nT           = 300                     # Temperature in Kelvin\nKb          = 1.38*10**-23            # Boltzmann constant\n\n# Calculations\n#  let R    = Rsp/Rst \nR           = math.exp((h*c)/(lamda*Kb*T)) - 1 ;     # ratio of spontaneous to stimulated emission\nif R<1:\n    print 'Since the spontaneous emission is lesser than stimulated emission \\n hence MASER action is possible at thermal equilibrium'",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Since the spontaneous emission is lesser than stimulated emission \n hence MASER action is possible at thermal equilibrium\n"
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 6, Page No:2.45"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math;\n\n# Variable Declaration\nh           = 6.625*10**-34;          # planck's constant\nc           = 3*10**8;                # vel. of light in m/s\nlamda       = 5000*10*8-10;           # wavelength for optical region in m\nT           = 300                     # Temperature in Kelvin\nKb          = 1.38*10**-23            # Boltzmann constant\n\n# Calculations\n# let R    = Rsp/Rst \nR           = math.exp((h*c)/(lamda*Kb*T)) - 1;     # ratio of spontaneous to stimulated emission\nif R<1:\n    print 'Since the spontaneous emission is lesser than stimulated emission \\n hence LASER action is possible at thermal equilibrium'\nelse:\n    print 'Since the spontaneous emission is more predominant than stimulated emission\\nhence LASER action is not possible at optical frequencies under thermal equilibrium';\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Since the spontaneous emission is lesser than stimulated emission \n hence LASER action is possible at thermal equilibrium\n"
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": "Addl_Example 7, Page No:2.46"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "import math\n\n# Variable Declaration\nh           = 6.625*10**-34;         # plank's constant\nc           = 3*10**8;               # vel. of light in m/s\nlamda       = 5511.11*10**-10;        # wavelength of green LED light in m\nq           = 1.6*10**-19;            # charge of electron\n\n# Calculations\nEg          = (h*c)/lamda;          # band gap energy in joules\nE           = Eg/q                  # bang gap energy in eV\n\n# Result\nprint ' Eg   = %3.2f' %E,'eV';",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": " Eg   = 2.25 eV\n"
      }
     ],
     "prompt_number": 38
    }
   ],
   "metadata": {}
  }
 ]
}