{
 "metadata": {
  "name": "",
  "signature": "sha256:5b9d1e914dbb4b0e0e0650025bfed9ebb154ac3184f6c3eb08f9fb1b53400e59"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3: The Experimental Basis of Quantum Physics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1, Page 87"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "E = 1.2e+004;    # Electric field, V/m\n",
      "B = 8.8e-004;    # Magnetic field, T\n",
      "l = 0.05;    # Length of the deflection plates, m\n",
      "v0 = E/B;    # Initial velocity of the electron, m/s\n",
      "theta = 30;    # Angular deflection of the electron, degrees\n",
      "\n",
      "#Calculations\n",
      "q_ratio_m = E*math.tan(theta*math.pi/180)/(B**2*l);    # Specific charge of the electron, C/kg\n",
      "\n",
      "#Results\n",
      "print \"The initial velocity of the electron = %3.1e m/s\"%v0\n",
      "print \"The specific charge of the electron = %3.1e C/kg\"%q_ratio_m"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The initial velocity of the electron = 1.4e+07 m/s\n",
        "The specific charge of the electron = 1.8e+11 C/kg\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, Page 94"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy\n",
      "\n",
      "def check_visible(l):\n",
      "    if l >= 400 and l < 700:\n",
      "        return 1\n",
      "    else:\n",
      "        return 0\n",
      "    \n",
      "R_H = 1.0968e+007;    # Rydberg constanr, per metre\n",
      "f = numpy.zeros(7)\n",
      "# Lyman series\n",
      "print \"\\nFor Lyman series, the wavelengths are:\\n\"\n",
      "n = 1.;    # The lowest level of Lyman series\n",
      "for k in range(2,4):\n",
      "    l = 1./(R_H*(1./n**2-1./k**2))/1.e-009;\n",
      "    print \"k = %d, %5.1f nm\"%(k, l);\n",
      "    f[k-1] = check_visible(l); \n",
      "    if f[k-1] == 1:\n",
      "        print(\" (Visible) \\n\");\n",
      "    else:\n",
      "        print(\" (Ultraviolet)\\n\");\n",
      "    \n",
      "    \n",
      "if f[0]  == 1 or f[1]  == 1 or f[2] == 1:\n",
      "    print(\"Some wavelengths of Lyman series fall in the visible region.\\n\")\n",
      "else:\n",
      "    print(\"All the wavelengths of Lyman series fall in the UV-region.\\n\")\n",
      "    \n",
      "\n",
      "# Balmer series\n",
      "print(\"\\nFor Balmer series, the wavelengths are:\\n\")\n",
      "n = 2;    # The lowest level of Balmer series\n",
      "for k in range(3,8):\n",
      "    l = 1./(R_H*(1./n**2.-1./k**2))/1.e-009;\n",
      "    print \"k = %d, %5.1f nm\"%(k, l);\n",
      "    f[k-1] = check_visible(l);\n",
      "    if f[k-1] == 1:\n",
      "        print(\" (Visible) \\n\");\n",
      "    else:\n",
      "        print(\" (Ultraviolet)\\n\");\n",
      "    \n",
      "# Paschen series\n",
      "print(\"\\nFor Paschen series, the wavelengths are:\\n\")\n",
      "n = 3.;    # The lowest level of Lyman series\n",
      "for k in range(4,6):\n",
      "    l = 1./(R_H*(1./n**2-1./k**2))/1e-009;\n",
      "    print \"k = %d, %5.1f nm\"%( k, l);\n",
      "    f[k-1] = check_visible(l); \n",
      "    if f[k-1] == 1:\n",
      "        print(\" (Visible) \\n\");\n",
      "    else:\n",
      "        print(\" (Infrared)\\n\");\n",
      "    \n",
      "# For limiting member\n",
      "k = numpy.inf;\n",
      "l = 1/(R_H*(1/n**2-1/k**2))/1e-009;\n",
      "print \"k = %f, %5.1f nm\"%(numpy.inf, l);\n",
      "f[5] = check_visible(l);\n",
      "if f[5] == 1:\n",
      "    print(\" (Visible) \\n\");\n",
      "else:\n",
      "    print(\" (Infrared)\\n\");\n",
      "   \n",
      "if f[3]  == 1 or f[4]  == 1 or f[5] == 1:\n",
      "    print(\"Some wavelengths of Paschen series fall in the visible region.\")\n",
      "else:\n",
      "    print(\"All the wavelengths of Paschen series fall in the IR-region.\")\n",
      "    \n",
      "        "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "For Lyman series, the wavelengths are:\n",
        "\n",
        "k = 2, 121.6 nm\n",
        " (Ultraviolet)\n",
        "\n",
        "k = 3, 102.6 nm\n",
        " (Ultraviolet)\n",
        "\n",
        "All the wavelengths of Lyman series fall in the UV-region.\n",
        "\n",
        "\n",
        "For Balmer series, the wavelengths are:\n",
        "\n",
        "k = 3, 656.5 nm\n",
        " (Visible) \n",
        "\n",
        "k = 4, 486.3 nm\n",
        " (Visible) \n",
        "\n",
        "k = 5, 434.2 nm\n",
        " (Visible) \n",
        "\n",
        "k = 6, 410.3 nm\n",
        " (Visible) \n",
        "\n",
        "k = 7, 397.1 nm\n",
        " (Ultraviolet)\n",
        "\n",
        "\n",
        "For Paschen series, the wavelengths are:\n",
        "\n",
        "k = 4, 1875.6 nm\n",
        " (Infrared)\n",
        "\n",
        "k = 5, 1282.1 nm\n",
        " (Infrared)\n",
        "\n",
        "k = inf, 820.6 nm\n",
        " (Infrared)\n",
        "\n",
        "All the wavelengths of Paschen series fall in the IR-region.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, Page 98"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "T = 1600 + 273;    # Temperature of the furnace, K\n",
      "b = 2.898e-003;    # Wein's constant, m-K\n",
      "\n",
      "#Calculation\n",
      "lamda_max = math.ceil(b/(T*1e-009));    # Maximum wavelength from Wein's Displacement Law, nm\n",
      "\n",
      "#Results\n",
      "print \"The maximum wavelength emitted from the heated furnace = %4d nm\"%lamda_max\n",
      "print \"This wavelength falls in the IR-region.\"\n",
      "\n",
      "#answers differ due to rounding errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The maximum wavelength emitted from the heated furnace = 1548 nm\n",
        "This wavelength falls in the IR-region.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5, Page 98"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "lambda_max = 500e-009;    # Maximum intensity wavelength emitted by the sun, m\n",
      "b = 2.898e-003;    # Wein's constant, m-K\n",
      "sigma = 5.67e-008;    # Stefan's constant, W/Sq.m-K^4\n",
      "r = 6.96e+008;    # Radius of the sun, m\n",
      "r_E = 6.37e+006;    # Radius of the earth, m\n",
      "R_E = 1.49e+011;    # Mean-earth sun distance, m\n",
      "\n",
      "#Calculations\n",
      "S = 4*math.pi*r**2;    # Surface area of the sun, Sq.m\n",
      "T_sun = b/lambda_max;    # The temperature of the sun's surface, K\n",
      "R_T = sigma*T_sun**4;    # Power per unit area radiated by the sun, W/Sq.m\n",
      "P_sun = R_T*S;    # The total power radiated from the sun's surface, W\n",
      "F = r_E**2/(4*R_E**2);    # Fraction of sun's radiation received by Earth\n",
      "P_Earth_received = P_sun*F;    # The radiation received by the Earth from the sun, W\n",
      "U_Earth = P_Earth_received*60*60*24;    # The radiation received by the Earth from the sun in one day, J\n",
      "R_Earth = P_Earth_received/(math.pi*r_E**2);    # Power received by the Earth per unit of exposed area, W/Sq.m\n",
      "\n",
      "#Results\n",
      "print \"The surface temperature of the sun = %4d K\"%math.ceil(T_sun)\n",
      "print \"The power per unit area emitted from the surface of the sun = %4.2e W/Sq.m\"%R_T\n",
      "print \"The energy received by the Earth each day from the radiation of sun = %4.2e J\"%U_Earth\n",
      "print \"The power received by the Earth per unit of exposed area = %4d W/Sq.m\"%math.ceil(R_Earth)\n",
      "\n",
      "#Answers differ due to rounding errors"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The surface temperature of the sun = 5796 K\n",
        "The power per unit area emitted from the surface of the sun = 6.40e+07 W/Sq.m\n",
        "The energy received by the Earth each day from the radiation of sun = 1.54e+22 J\n",
        "The power received by the Earth per unit of exposed area = 1397 W/Sq.m\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10, Page 106"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "phi = 2.36;    # Work function of sodium, eV\n",
      "N_A = 6.02e+023;    # Avogadro's number\n",
      "e = 1.6e-019;    # Energy equivalent of 1 eV, J\n",
      "I = 1e-008;    # Intensity of incident radiation, W/Sq.m\n",
      "K = 1.00;    # Kinetic energy of the ejected photoelectron, eV\n",
      "rho = 0.97;    # Density of Na atoms, g/cc\n",
      "M = 23;    # Gram atomic mass of Na, g/mol\n",
      "\n",
      "#Calculations\n",
      "n = N_A*1e+006/M*rho;    # Number of Na atoms per unit volume, atoms/metre-cube\n",
      "# Assume a cubic structure, then 1/d^3 = n, solving for d\n",
      "d = (1./n)**(1./3);    # Thickness of one layer of sodium atoms, m\n",
      "N = n*d;    # Number of exposed atoms per Sq.m\n",
      "R = I/(N*e);    # Rate of energy received by each atom, eV/s\n",
      "t = (phi+K)/R;    # Time needed to absorb 3.36 eV energy\n",
      "\n",
      "#Result\n",
      "print \"The exposure time of light to produce the photoelectron of %4.2f kinetic energy = %4.1f years\"%(K, t/(60*60*24*365.25))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The exposure time of light to produce the photoelectron of 1.00 kinetic energy = 14.7 years\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.11, Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "phi = 2.93;    # Work function of lithium, eV\n",
      "lamda = 400e-009;    # Wavelength of incident light, m\n",
      "e = 1.6e-019;    # Energy equivalent of 1 eV, J\n",
      "c = 2.998e+008;    # Speed of light in vacuum, m/s\n",
      "h = 6.626e-034;    # Planck's constant, Js\n",
      "\n",
      "#Calculations\n",
      "E = h*c/(lamda*e);    # Energy of incident light, eV\n",
      "V0 = E - phi;    # Stopping potential, V\n",
      "\n",
      "#Results\n",
      "print \"The energy of incident photons = %4.2f eV\"%E\n",
      "print \"The stopping potential = %4.2f V\"%V0"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The energy of incident photons = 3.10 eV\n",
        "The stopping potential = 0.17 V\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12, Page 109"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "phi = 2.93;    # Work function of lithium, eV\n",
      "c = 2.998e+008;    # Speed of light in vacuum, m/s\n",
      "K = 3.00;    # Kinetic energy of photoelectron, eV\n",
      "E = phi + K;    # Total energy of the incident light, eV\n",
      "h = 6.626e-034;    # Planck's constant, Js\n",
      "e = 1.6e-019;    # Energy equivalent of 1 eV, J\n",
      "\n",
      "#Calculations\n",
      "f = E*e/h;    # Frequency of incident light, Hz\n",
      "lamda = c/f;    # Wavelength of the incident light, m\n",
      "\n",
      "#Results\n",
      "print \"The frequency of incident light = %4.2e Hz\"%f\n",
      "print \"The wavelength of the incident light = %4.2f nm\"%(lamda/1e-009)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The frequency of incident light = 1.43e+15 Hz\n",
        "The wavelength of the incident light = 209.37 nm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.13, Page 110"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "lamda = 350;    # Wavelength of incident light, nm\n",
      "e = 1.6e-019;    # Energy equivalent of 1 eV, J\n",
      "E = 1.250e+003/lamda;    # Total energy of the incident light, eV\n",
      "I = 1e-008;    # Intensity of incident light, W/Sq.m\n",
      "\n",
      "#Calculations\n",
      "# As Intensity, I = N*E, solving for N\n",
      "N = I/(E*e);    # The number of photons in the light beam\n",
      "\n",
      "#Results\n",
      "print \"The number of photons in the light beam = %3.1e photons/Sq.m/s\"%N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The number of photons in the light beam = 1.8e+10 photons/Sq.m/s\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.15, Page 113"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "e = 1.6e-019;    # Energy equivalent of 1 eV, J\n",
      "c = 2.998e+008;    # Speed of light in vacuum, m/s\n",
      "h = 6.626e-034;    # Planck's constant, Js\n",
      "V0 = 35e+003;    # Electron acceleration voltage, V\n",
      "\n",
      "#Calculations\n",
      "lambda_min = h*c/(e*V0);    # Duane-Hunt rule for wavelength, m\n",
      "\n",
      "#Result\n",
      "print \"The minimum wavelength of X-rays = %4.2e m\"%lambda_min"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The minimum wavelength of X-rays = 3.55e-11 m\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.16, Page 116"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "c = 2.998e+008;    # Speed of light in vacuum, m/s\n",
      "h = 6.626e-034;    # Planck's constant, Js\n",
      "m_e = 9.11e-031;    # Rest mass of an electron, kg\n",
      "lamda = 0.050;    # Wavelength of the X-ray, nm\n",
      "theta = 180;    # The angle at which the recoil electron Ke becomes the largest, degree\n",
      "\n",
      "#Calculations\n",
      "E_x_ray = 1.240e+003/lamda;    # Energy of the X-ray, eV\n",
      "lambda_prime = lamda + (1-math.cos(theta*math.pi/180))*h/(m_e*c*1e-009);    # The largest wavelength of the scattered photon, nm\n",
      "E_prime_x_ray = 1.240e+003/lambda_prime;    # Energy of the scattered photon, eV\n",
      "K = (E_x_ray - E_prime_x_ray)/1e+003;    # Kinetic energy of the most energetic recoil electron, keV\n",
      "if (E_prime_x_ray < E_x_ray):\n",
      "    print \"The X-ray is Compton-scattered by the electron.\"\n",
      "else:\n",
      "    print \"The X-ray is not Compton-scattered by the electron.\"\n",
      "\n",
      "#Results\n",
      "print \"The largest wavelength of the scattered photon = %5.3f nm\"%lambda_prime\n",
      "print \"The kinetic energy of the most energetic recoil electron = %3.1f keV\"%K\n",
      "print \"The angle at which the recoil electron energy is the largest = %d degrees\"%theta"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The X-ray is Compton-scattered by the electron.\n",
        "The largest wavelength of the scattered photon = 0.055 nm\n",
        "The kinetic energy of the most energetic recoil electron = 2.2 keV\n",
        "The angle at which the recoil electron energy is the largest = 180 degrees\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}