{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 2:Particle properties of waves"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.1,Page no:61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration \n",
      "Ft= 660  #frequency of tuning fork, Hz\n",
      "Fo= 5.00*(10**14)  #frquency of atomic oscillator, Hz\n",
      "Ef= 0.04  #vibrational energy of tuning fork, J\n",
      "h= 6.63*(10**(-34))  #Planck's constant, J.s\n",
      "\n",
      "#Calculation\n",
      "E1= h*Ft  #Total energy of tuning fork, J\n",
      "E2= h*Fo  #Total energy of atomic oscillator, J\n",
      "E2= E2/(1.60*(10**(-19)))  #converting to eV\n",
      "\n",
      "#Result\n",
      "print\"(a).Energy of tuning fork is:%.3g\"%E1,\"J\"\n",
      "print\"(b).Energy of atomic oscillator is:\",round(E2,2),\"eV(approx)\"\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Energy of tuning fork is:4.38e-31 J\n",
        "(b).Energy of atomic oscillator is: 2.07 eV(approx)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.2,Page no:66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration  \n",
      "l= 350  #Wavelength of UV light, nm\n",
      "i= 1.00  #intensity of UV  light, W/m**2\n",
      "\n",
      "#Part (a)\n",
      "l= l*10**(-9)  #converting to m\n",
      "Ep= (1.24*(10**(-6)))/l  #energy of photon, using Eqn (2.11) on Page 66, e.V\n",
      "t= 2.2  #work function of Potassium surface, eV\n",
      " \n",
      "#Calculation\n",
      "KEmax= Ep-t #Max KE of the phototelectrons, eV\n",
      "\n",
      "#Part (b) \n",
      "A= 1.00  #Surface area, cm**2\n",
      "A= A* 10**(-4)  #converting to m**2\n",
      "E= 5.68*(10**(-19))  #Photon energy, J\n",
      "Np= i*A/E  #number of incident photon, per second\n",
      "Ne= (0.0050)*Np  #number of photoeectrons emitted, per second\n",
      "\n",
      "#Result\n",
      "print\"(a).Maximum KE of photoelectrin is: \",round(KEmax,1),\"eV\"\n",
      "print\"(b).Rate of emission of photoelectrons is:%.2g\"%Ne,\"photoelectrons/s\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Maximum KE of photoelectrin is:  1.3 eV\n",
        "(b).Rate of emission of photoelectrons is:8.8e+11 photoelectrons/s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.3,Page no:72"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration  \n",
      "AP= 50000  #Accelerating potential of the x-ray machine, V\n",
      "l= (1.24*(10**(-6)))/AP*(10**(9))   #Minimum wavelength, nm\n",
      "\n",
      "#Calculation\n",
      "Fmax= 3*(10**8)/(l*(10**(-9)))   #Maximum frequency, Hz\n",
      "\n",
      "#Result\n",
      "print\"Minimum wavelength possible is: \",l,\"nm\"\n",
      "print\"Maximum frequency possible is: %.3g\"%Fmax,\"Hz\"\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum wavelength possible is:  0.0248 nm\n",
        "Maximum frequency possible is: 1.21e+19 Hz\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.4,Page no:78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration  \n",
      "#part (a)\n",
      "l= 10.0  #wavelength of x-ray, pm\n",
      "r= 45.0  #angle of scattered articles, degree\n",
      "lc= 2.426*(10**(-12))  #Compton wavelength for electron, m\n",
      "\n",
      "#Calculation\n",
      "import math\n",
      "k= math.cos(math.radians(45)) \n",
      "lc= lc* 10.0**12  # converting to pm\n",
      "print \n",
      "l2= l+ lc*(1.0-k) #using Eqn 2.23\n",
      "#Part (b)\n",
      "lmax= l+(lc*2)  #for (1-k)=2\n",
      "#Part (c)\n",
      "h= 6.63*(10**(-34))  #Planck's constant, J.s\n",
      "c= 3*10**8  #velocity of light, m/s\n",
      "c=c*10**12  #converting to pm/s\n",
      "KEmax= (h*c)*((1/l)-(1/lmax))  #J\n",
      "\n",
      "#Result\n",
      "print\"(a):The wavelength of scattered x-ray is: \",round(l2,1),\"pm\"\n",
      "print\"(b):Maximum wavelength is: \",round(lmax,1),\"pm\"\n",
      "print\"(c):The maximum KE of recoil electrons is:%.3g\"%KEmax,\"J\"\n",
      "print\"which is equal to \",round(KEmax/1.6021773e-16,1),\"keV(approx)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(a):The wavelength of scattered x-ray is:  10.7 pm\n",
        "(b):Maximum wavelength is:  14.9 pm\n",
        "(c):The maximum KE of recoil electrons is:6.5e-15 J\n",
        "which is equal to  40.6 keV(approx)\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.6,Page no:82"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration \n",
      "c=3.0*10**8  #velocity of light, m/s\n",
      "v= 0.5*c  #velocity of electron and positron, m/s\n",
      "y= 1.0/math.sqrt(1.0-(v/c**2))  #gamma, for relativistic momentum\n",
      "m=0.511/c**2  #MeV/c**2\n",
      "\n",
      "#Calculation\n",
      "p1_p2=((2*m*c*c**2)*(v/c**2))/(math.sqrt(1-(v/c)**2))\n",
      "p1_plus_p2=(2.0*m*(c**2))/math.sqrt(1.0-(v/c)**2.0)\n",
      "p1=(p1_p2+p1_plus_p2)/2.0\n",
      "p2=p1_plus_p2-p1\n",
      "E1=p1   #MeV\n",
      "E2=p2   #MeV\n",
      "\n",
      "#Result\n",
      "print\"The Energy of first photon is,E1=\",round(E1,3),\"MeV\"\n",
      "print\"The Energyof second photon is:,E2=\",round(E2,3),\"MeV\"\n",
      "\n",
      "print\"NOTE:There is a mistake in the formula given in the book for p1_p2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Energy of first photon is,E1= 0.885 MeV\n",
        "The Energyof second photon is:,E2= 0.295 MeV\n",
        "NOTE:There is a mistake in the formula given in the book for p1_p2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.7,Page no:85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration \n",
      "M= 4.9  #Linear attenuation coefficient for gamma ray in water, m**(-1)\n",
      "I= 2.0  #Original intensity of gamma ray, MeV\n",
      "\n",
      "#Calculation\n",
      "#Part (a)\n",
      "x= 10.0  #distance travelled under water, cm\n",
      "x= x/100.0  #converting to m\n",
      "Irel= math.exp(-(M*x))  #Relative intensity\n",
      "#Part(b)\n",
      "Ip= I/100  #Present intensity, 1 percent of Original, MeV\n",
      "x2= math.log(I/Ip)/M  #distance travelled, m\n",
      "\n",
      "#Result\n",
      "print\"(a)Relative intensity of the beam is: \",round(Irel,2)\n",
      "print\"(b)The distance travelled by the beam is:\",round(x2,2),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Relative intensity of the beam is:  0.61\n",
        "(b)The distance travelled by the beam is: 0.94 m\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2.8,Page no:86"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration  \n",
      "H= 22.5  #Height of fall, m\n",
      "F= 7.3*(10**14)  #Original frequency, Hz\n",
      "c= 3*(10**8)  #velocity of light, m/s\n",
      "g= 9.8  #Acceleration due to gravity, m/s**2\n",
      "\n",
      "#Calculation\n",
      "Frel= g*H*F/(c**2)  #Change in frequency, Hz\n",
      "\n",
      "#Result\n",
      "print\"The change in frquency of a photon fallin through 22.5 m is: \",round(Frel,1), \"Hz\"\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The change in frquency of a photon fallin through 22.5 m is:  1.8 Hz\n"
       ]
      }
     ],
     "prompt_number": 8
    }
   ],
   "metadata": {}
  }
 ]
}