{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#5: Laser"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 5.1, Page number 124"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The ratio of propulsion of the two states in a laser is 1.3893 *10**-30\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "t=300;    #temperature(K)\n",
    "w=698.3*10**-9;   #wavelength of photon(m)\n",
    "h=6.625*10**-34;  #Planck's constant(m^2 Kg/sec)\n",
    "c=3*10**8;     #velocity of light(m/s)\n",
    "Kb=1.38*10**-23;   #Boltzmann's constant(m^2 Kg.s^-2 k^-1)\n",
    "\n",
    "#Calculation\n",
    "Ratio=math.exp((-h*c)/(w*Kb*t));    #ratio of propulsion of the two states in a laser\n",
    "\n",
    "#Result\n",
    "print \"The ratio of propulsion of the two states in a laser is\",round(Ratio*10**30,4),\"*10**-30\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 5.2, Page number 133"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The band gap for lnp laser diode is 0.8014 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "w=1.55*10**-6;   #wavelength of light emission(m)\n",
    "h=6.625*10**-34;  #Planck's constant(m^2 Kg/sec)\n",
    "c=3*10**8;    #velocity of light(m/s)\n",
    "e=1.6*10**-19;   #charge of electron(c)\n",
    "\n",
    "#Calculation\n",
    "Eg=(h*c)/(w*e);    #band gap(eV)\n",
    "\n",
    "#Result\n",
    "print \"The band gap for lnp laser diode is\",round(Eg,4),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 5.3, Page number 133"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The long wavelength limit of an extrinsic semiconductor is 6.2109 *10**-5 m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "E=0.02*1.6*10**-19;    #Ionisation energy(J)\n",
    "h=6.625*10**-34;    #Planck's constant(m^2 Kg/sec)\n",
    "c=3*10**8;        #velocity of light(m/s)\n",
    "\n",
    "#Calculation\n",
    "w=h*c/E;       #long wavelength limit of an extrinsic semiconductor(m)\n",
    "\n",
    "#Result\n",
    "print \"The long wavelength limit of an extrinsic semiconductor is\",round(w*10**5,4),\"*10**-5 m\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 5.4, Page number 133"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The number of photons emitted per minute is 6.562 *10**17 photons/minute\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "E=3.5*10**-3*60;    #power output(J/min)\n",
    "w=0.621*10**-6;     #wavelength of light(m)\n",
    "h=6.625*10**-34;    #Planck's constant(m^2 Kg/sec)\n",
    "c=3*10**8;       #velocity of light(m/s)\n",
    "\n",
    "#Calculation\n",
    "e=h*c/w;      #energy emitted by one photon(J)\n",
    "n=E/e;     #The number of photons emitted per minute(photons/minute)\n",
    "\n",
    "#Result\n",
    "print \"The number of photons emitted per minute is\",round(n/10**17,3),\"*10**17 photons/minute\""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}