{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 3: Inadequacy of Classical Physics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 1, Page number 128"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "maximum energy of photoelectron is 3.038 *10**-19 J\n",
      "maximum velocity of electron is 8.17 *10**5 ms-1\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "me=9.1*10**-31;           #mass of electron(kg)\n",
    "h=6.6*10**-34;            #planks constant(Js)\n",
    "c=3*10**8;                #velocity(m/sec)\n",
    "lamda=1700*10**-10;       #wavelength(m)\n",
    "lamda0=2300*10**-10;      #wavelength(m)\n",
    "\n",
    "#Calculations\n",
    "KE=h*c*((1/lamda)-(1/lamda0));       #maximum energy of photoelectron(J)\n",
    "vmax=math.sqrt(2*KE/me);             #maximum velocity of electron(ms-1)\n",
    "\n",
    "#Result\n",
    "print \"maximum energy of photoelectron is\",round(KE*10**19,3),\"*10**-19 J\"\n",
    "print \"maximum velocity of electron is\",round(vmax/10**5,2),\"*10**5 ms-1\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 2, Page number 128"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "threshold wavelength is 5380 angstrom\n",
      "since wavelength of orange light is more, photoelectric effect doesn't take place\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",
    "W=2.3*e;                  #work function(J)\n",
    "h=6.6*10**-34;            #planks constant(Js)\n",
    "c=3*10**8;                #velocity(m/sec)\n",
    "lamda=6850;               #wavelength of orange light(angstrom)\n",
    "\n",
    "#Calculations\n",
    "lamda0=h*c/W;             #threshold wavelength(m)\n",
    "\n",
    "#Result\n",
    "print \"threshold wavelength is\",int(lamda0*10**10),\"angstrom\"\n",
    "print \"since wavelength of orange light is more, photoelectric effect doesn't take place\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 3, Page number 129"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "retarding potential is 1.175 volts\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",
    "W=1.3*e;                  #work function(J)\n",
    "h=6.6*10**-34;            #planks constant(Js)\n",
    "new=6*10**14;             #frequency(Hertz)\n",
    "\n",
    "#Calculations\n",
    "V0=((h*new)-W)/e;         #retarding potential(volts)\n",
    "\n",
    "#Result\n",
    "print \"retarding potential is\",V0,\"volts\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 4, Page number 129"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "work function is 1.28 eV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "h=6.6*10**-34;            #planks constant(Js)\n",
    "e=1.6*10**-19;            #charge(coulomb)\n",
    "c=3*10**8;                #velocity(m/sec)\n",
    "lamda=3*10**-7;           #wavelength(m)\n",
    "me=9.1*10**-31;           #mass of electron(kg)\n",
    "v=1*10**6;                #velocity(m/sec)\n",
    "\n",
    "#Calculations\n",
    "W=(h*c/lamda)-(me*v**2/2);      #work function(J)\n",
    "W=W/e;                          #work function(eV)\n",
    "\n",
    "#Result\n",
    "print \"work function is\",round(W,2),\"eV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 5, Page number 129"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "photoelectric current is 1.86 micro ampere\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "h=6.6*10**-34;            #planks constant(Js)\n",
    "e=1.6*10**-19;            #charge(coulomb)\n",
    "c=3*10**8;                #velocity(m/sec)\n",
    "lamda=4600*10**-10;       #wavelength(m)\n",
    "qe=0.5;                   #efficiency(%)\n",
    "\n",
    "#Calculations\n",
    "E=h*c/lamda;              #energy(J)\n",
    "n=10**-3/E;               #number of photons/second\n",
    "i=n*qe*e*10**6/100;       #photoelectric current(micro ampere)\n",
    "\n",
    "#Result\n",
    "print \"photoelectric current is\",round(i,2),\"micro ampere\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 6, Page number 130"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "planck's constant is 6.61 *10**-34 joule second\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "T1=3*10**-19;             #temperature(J)\n",
    "T2=1*10**-19;             #temperature(J)\n",
    "c=3*10**8;                #velocity(m/sec)\n",
    "lamda1=3350;              #wavelength(m)\n",
    "lamda2=5060;              #wavelength(m)\n",
    "\n",
    "#Calculations\n",
    "x=10**10*((1/lamda1)-(1/lamda2));\n",
    "h=(T1-T2)/(c*x);          #planck's constant(joule second)\n",
    "\n",
    "#Result\n",
    "print \"planck's constant is\",round(h*10**34,2),\"*10**-34 joule second\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 7, Page number 131"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of scattered radiation is 3.0121 angstrom\n",
      "energy of recoil electron is 2.66 *10**-18 joule\n",
      "answers given in the book are wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "c=3*10**8;               #velocity of light(m/sec)\n",
    "m0=9.1*10**-31;          #mass(kg)\n",
    "h=6.62*10**-34;          #planks constant(Js)\n",
    "theta=60*math.pi/180;    #angle(radian)\n",
    "lamda=3*10**-10;         #wavelength(angstrom)\n",
    "lamda_dash=3.058;        #wavelength(angstrom)\n",
    "\n",
    "#Calculations\n",
    "lamda_sr=h/(m0*c);   \n",
    "lamda_dash=lamda+(lamda_sr*(1-math.cos(theta)));   #wavelength of scattered radiation(m)    \n",
    "lamda_dash=round(lamda_dash*10**10,4)*10**-10;     #wavelength of scattered radiation(m)\n",
    "E=h*c*((1/lamda)-(1/lamda_dash));                  #energy of recoil electron(joule)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of scattered radiation is\",lamda_dash*10**10,\"angstrom\"\n",
    "print \"energy of recoil electron is\",round(E*10**18,2),\"*10**-18 joule\"\n",
    "print \"answers given in the book are wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 8, Page number 132"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of scattered radiation is 2.003 angstrom\n",
      "velocity of recoil electron is 0.0188 *10**8 ms-1\n",
      "answer for velocity given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "c=3*10**8;               #velocity of light(m/sec)\n",
    "m0=9.1*10**-31;          #mass(kg)\n",
    "h=6.62*10**-34;          #planks constant(Js)\n",
    "theta=30*math.pi/180;    #angle(radian)\n",
    "lamda=2*10**-10;         #wavelength(angstrom)\n",
    "\n",
    "#Calculations\n",
    "lamda_sr=h/(m0*c);   \n",
    "lamda_dash=lamda+(lamda_sr*(1-math.cos(theta)));   #wavelength of scattered radiation(m)    \n",
    "E=h*c*((1/lamda)-(1/lamda_dash));                  #energy of recoil electron(joule)\n",
    "x=1+(E/(m0*c**2));\n",
    "v=c*math.sqrt(1-((1/x)**2));                       #velocity of recoil electron(m/sec)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of scattered radiation is\",round(lamda_dash*10**10,3),\"angstrom\"\n",
    "print \"velocity of recoil electron is\",round(v/10**8,4),\"*10**8 ms-1\"\n",
    "print \"answer for velocity given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 9, Page number 133"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of scattered photon is 3.024 angstrom\n",
      "energy of recoil electron is 0.5 *10**-17 joules\n",
      "direction of recoil electron is 44 degrees 46 minutes\n",
      "answer for angle given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "c=3*10**8;               #velocity of light(m/sec)\n",
    "e=1.6*10**-19;           #charge(coulomb)\n",
    "m0=9.1*10**-31;          #mass(kg)\n",
    "h=6.62*10**-34;          #planks constant(Js)\n",
    "theta=90*math.pi/180;    #angle(radian)\n",
    "lamda=3*10**-10;         #wavelength(m)   \n",
    "\n",
    "#Calculations\n",
    "lamda_dash=lamda+(h*(1-math.cos(theta))/(m0*c));   #wavelength of scattered photon(m)    \n",
    "E=h*c*((1/lamda)-(1/lamda_dash));                  #energy of recoil electron(joule)\n",
    "x=h/(lamda*m0*c);\n",
    "tanphi=lamda*math.sin(theta)/(lamda_dash-(lamda*math.cos(theta)));\n",
    "phi=math.atan(tanphi);                             #direction of recoil electron(radian)\n",
    "phi=phi*180/math.pi;                               #direction of recoil electron(degrees)\n",
    "phim=60*(phi-int(phi));                            #angle(minutes)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of scattered photon is\",round(lamda_dash*10**10,3),\"angstrom\"\n",
    "print \"energy of recoil electron is\",round(E*10**17,1),\"*10**-17 joules\"\n",
    "print \"direction of recoil electron is\",int(phi),\"degrees\",int(phim),\"minutes\"\n",
    "print \"answer for angle given in the book is wrong\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 10, Page number 134"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "energy of scattered photon is 0.226 MeV\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "c=3*10**8;               #velocity of light(m/sec)\n",
    "e=1.6*10**-19;           #charge(coulomb)\n",
    "m0=9.1*10**-31;          #mass(kg)\n",
    "h=6.62*10**-34;          #planks constant(Js)\n",
    "theta=180*math.pi/180;   #angle(radian)\n",
    "E=1.96*10**6*e;          #energy of scattered photon(J)\n",
    "\n",
    "#Calculations\n",
    "lamda=h*c/E;             #wavelength(m)\n",
    "delta_lamda=2*h/(m0*c);   \n",
    "lamda_dash=lamda+delta_lamda;   #wavelength of scattered photon(m)    \n",
    "Edash=h*c/(e*lamda_dash);       #energy of scattered photon(eV)\n",
    "\n",
    "#Result\n",
    "print \"energy of scattered photon is\",round(Edash/10**6,3),\"MeV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example number 11, Page number 135"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "wavelength of scattered radiation is 4.9e-12 m\n",
      "energy of recoil electron is 3.9592 *10**-14 Joules\n",
      "direction of recoil electron is 27 degrees 47 minutes\n",
      "answer for energy and direction of recoil electron and given in the book is wrong\n"
     ]
    }
   ],
   "source": [
    "#importing modules\n",
    "import math\n",
    "from __future__ import division\n",
    "\n",
    "#Variable declaration  \n",
    "c=3*10**8;               #velocity of light(m/sec)\n",
    "e=1.6*10**-19;           #charge(coulomb)\n",
    "m0=9.1*10**-31;          #mass(kg)\n",
    "h=6.6*10**-34;           #planks constant(Js)\n",
    "theta=90*math.pi/180;    #angle(radian)\n",
    "E=500*10**3*e;           #energy of scattered photon(J)\n",
    "\n",
    "#Calculations\n",
    "lamda=h*c/E;             #wavelength(m)\n",
    "delta_lamda=h*(1-math.cos(theta))/(m0*c);   \n",
    "lamda_dash=lamda+delta_lamda;           #wavelength of scattered radiation(m) \n",
    "lamda_dash=round(lamda_dash*10**12,1)*10**-12;   #wavelength of scattered radiation(m) \n",
    "E=h*c*((1/lamda)-(1/lamda_dash));       #energy of recoil electron(J)\n",
    "tanphi=lamda*math.sin(theta)/(lamda_dash-(lamda*math.cos(theta)));\n",
    "phi=math.atan(tanphi);                             #direction of recoil electron(radian)\n",
    "phi=phi*180/math.pi;                               #direction of recoil electron(degrees)\n",
    "phim=60*(phi-int(phi));                            #angle(minutes)\n",
    "\n",
    "#Result\n",
    "print \"wavelength of scattered radiation is\",lamda_dash,\"m\"\n",
    "print \"energy of recoil electron is\",round(E*10**14,4),\"*10**-14 Joules\"\n",
    "print \"direction of recoil electron is\",int(round(phi)),\"degrees\",int(phim),\"minutes\"\n",
    "print \"answer for energy and direction of recoil electron and given in the book is wrong\""
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
