{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "#11: Laser"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "##Example number 11.1, Page number 246"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "matter wave energy is 2.06 *10**-5 eV\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "e=1.6*10**-19;     #charge(coulomb)\n",
    "v=3*10**3;   #velocity of matter wave(m/s)\n",
    "h=6.6*10**-34;    #plank's constant(Js)\n",
    "lamda=600*10**-9;    #wavelength(m)\n",
    "\n",
    "#Calculation\n",
    "Ej=h*v/lamda;    #matter wave energy(J)\n",
    "E=Ej/e;      #matter wave energy(eV)\n",
    "\n",
    "#Result\n",
    "print \"matter wave energy is\",round(E*10**5,2),\"*10**-5 eV\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "##Example number 11.2, Page number 246"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of photon is 41250.0 nm\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "e=1.6*10**-19;     #charge(coulomb)\n",
    "c=3*10**10;   #velocity of light(m/s)\n",
    "h=6.6*10**-34;    #plank's constant(Js)\n",
    "Eg=3;    #energy gap(eV)\n",
    "\n",
    "#Calculation\n",
    "lamda=h*c*10**9/(Eg*e);     #wavelength of photon(nm)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of photon is\",lamda,\"nm\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.3, Page number 246"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio in higher and lower energy is 1.7081 *10**-47\n",
      "answer given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "e=1.6*10**-19;     #charge(coulomb)\n",
    "E2_E1=3*e;    #energy gap(J)\n",
    "Kb=1.38*10**-23;    #boltzmann constant(J/K)\n",
    "T=323;    #temperature(K)\n",
    "\n",
    "#Calculation\n",
    "n=math.exp(-E2_E1/(Kb*T));    #ratio in higher and lower energy\n",
    "\n",
    "#Result\n",
    "print \"ratio in higher and lower energy is\",round(n*10**47,4),\"*10**-47\"\n",
    "print \"answer given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.4, Page number 247"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio of emission is 3.2 *10**-13\n",
      "answer varies due to rounding off errors\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "c=2.998*10**8;     #velocity of light(m/s)\n",
    "Kb=1.381*10**-23;    #boltzmann constant(J/K)\n",
    "T=1000;    #temperature(K)\n",
    "h=6.626*10**-34;    #plank's constant(Js)\n",
    "lamda=0.5*10**-6;   #wavelength(m)\n",
    "\n",
    "#Calculation\n",
    "v=c/lamda;    #frequency(Hz)\n",
    "BA=1/(math.exp(h*v/(Kb*T))-1);      #ratio of emission\n",
    "\n",
    "#Result\n",
    "print \"ratio of emission is\",round(BA*10**13,1),\"*10**-13\"\n",
    "print \"answer varies due to rounding off errors\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Example number 11.5, Page number 247"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength is 0.87 micro m\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration\n",
    "c=2.998*10**8;     #velocity of light(m/s)\n",
    "h=6.626*10**-34;    #plank's constant(Js)\n",
    "e=1.602*10**-19;     #charge(coulomb)\n",
    "Eg=1.43;    #energy gap(eV)   \n",
    "\n",
    "#Calculation\n",
    "lamda=h*c*10**6/(Eg*e);        #wavelength(micro m)\n",
    "\n",
    "#Result\n",
    "print \"wavelength is\",round(lamda,2),\"micro m\""
   ]
  }
 ],
 "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
}
