{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 20: X-Ray"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.1, Page 20.7"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "V1 = 40e3 # voltage in first case in V\n",
      "V2 = 20e3 # voltage in second case in V\n",
      "V3 = 100e3 # voltage in second in V\n",
      "\n",
      "#Calculations\n",
      "v1 = 0.593e6 * sqrt(V1)\n",
      "lambda1 = 12400 / V1\n",
      "v2 = 0.593e6 * sqrt(V2)\n",
      "lambda2 = 12400 / V2\n",
      "v3 = 0.593e6 * sqrt(V3)\n",
      "lambda3 = 12400 / V3\n",
      "\n",
      "#Results\n",
      "print \"Max. speed of electrons at %d Volts is %.3e m/sec\\nMax. speed of electrons at %d Volts is %.2e m/sec/sec\\nMax. speed of electrons at %d Volts is %.3e m/sec\\nShortest wavelength of x-ray = %.2f A\\nShortest wavelength of x-ray = %.2f A\\nShortest wavelength of x-ray = %.3f A\"%(V1,v1,V2,v2,V3,v3,lambda1,lambda2,lambda3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Max. speed of electrons at 40000 Volts is 1.186e+08 m/sec\n",
        "Max. speed of electrons at 20000 Volts is 8.39e+07 m/sec/sec\n",
        "Max. speed of electrons at 100000 Volts is 1.875e+08 m/sec\n",
        "Shortest wavelength of x-ray = 0.31 A\n",
        "Shortest wavelength of x-ray = 0.62 A\n",
        "Shortest wavelength of x-ray = 0.124 A\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.2, Page 20.7\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "V = 30e3 # voltage in V\n",
      "lambda_min = 0.414e-10 # shortest wavelength in m\n",
      "e = 1.6e-19 # charge on an electron in C\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "h = (e * V * lambda_min) / c\n",
      "\n",
      "#Result\n",
      "print \"Planck constant is %.3e J sec\"%h"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Planck constant is 6.624e-34 J sec\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.3, Page 20.8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "V = 25e3 # voltage in V\n",
      "\n",
      "#Calculations\n",
      "lambda_min = 12400 / V\n",
      "\n",
      "#Result\n",
      "print \"Minimum wavelength of x-ray is %.3f A\"%lambda_min"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum wavelength of x-ray is 0.496 A\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.4, Page 20.8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "V = 13.6e3 # voltage in V\n",
      "\n",
      "#Calculations\n",
      "v = 0.593e6*sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"Maximum speed of electron is %.2e m/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum speed of electron is 6.92e+07 m/sec\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.5, Page 20.8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "V = 10e3 # voltage in V\n",
      "i = 2e-3 # current in amp\n",
      "\n",
      "#Calculations\n",
      "v = 0.593e6*sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"Velocity of electron is %.2e m/sec\"%v"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity of electron is 5.93e+07 m/sec\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.6, Page 20.8"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given\n",
      "V = 9.8e3 # voltage in V\n",
      "i = 2e-3 # current in amp\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "lamda = 12400 / V\n",
      "f = c / (lamda*10**-10)\n",
      "\n",
      "#Results\n",
      "print \"Highest frequency is %.2e Hz\\nMinimum wavelength is %.2f A\"%(f,lamda)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Highest frequency is 2.37e+18 Hz\n",
        "Minimum wavelength is 1.27 A\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.7, Page 20.9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import *\n",
      "\n",
      "# Given \n",
      "V = 12.4e3 # voltage in V\n",
      "i = 2e-3 # current in amp\n",
      "e = 1.6e-19 # charge on an electron in C\n",
      "\n",
      "#Calculations\n",
      "n = i / e\n",
      "v = 0.593e6*sqrt(V)\n",
      "\n",
      "#Result\n",
      "print \"Number of electrons striking the target per sec is %.2e\\nSpeed of electrons is %.1e m/sec\"%(n,v)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of electrons striking the target per sec is 1.25e+16\n",
        "Speed of electrons is 6.6e+07 m/sec\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.8, Page 20.9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "V = 10e3 # voltage in V\n",
      "i = 15e-3 # current in amp\n",
      "e = 1.6e-19 # charge on an electron in C\n",
      "\n",
      "#Calculations\n",
      "n = i / e\n",
      "lamda = 12400 / V \n",
      "\n",
      "#Results\n",
      "print \"Number of electrons striking the anode per sec is %.2e\\nMinimum wavelength produced  is %.2f A\"%(n,lamda)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of electrons striking the anode per sec is 9.38e+16\n",
        "Minimum wavelength produced  is 1.24 A\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.9, Page 20.9"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "V = 50e3 # voltage in V\n",
      "i = 1e-3 # current in amp\n",
      "e = 1.6e-19 # charge on an electron in C\n",
      "\n",
      "#Calculations\n",
      "n = i / e\n",
      "\n",
      "#Result\n",
      "print \"Number of electrons striking the anode per sec is %.2e\"%n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of electrons striking the anode per sec is 6.25e+15\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.10, Page 20.10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "lambda1 = 40e-12 # minimum wavelength in first case in m\n",
      "lambda2 = 1e-10 # minimum wavelength in second case in m\n",
      "\n",
      "#Calculations\n",
      "V1 = 12400e-10 / lambda1\n",
      "V2 = 12400e-10 / lambda2\n",
      "\n",
      "#Results\n",
      "print \"Applied voltage to get wavelength of %.e meter is %.f KV\\nApplied voltage to get wavelength of %.e meter is %.1f KV\"%(lambda1,V1/10**3,lambda2,V2/10**3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Applied voltage to get wavelength of 4e-11 meter is 31 KV\n",
        "Applied voltage to get wavelength of 1e-10 meter is 12.4 KV\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.11, Page 20.10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "V1 = 44e3 # voltage in first case in V\n",
      "V2 = 50e3 # voltage in second case in V\n",
      "lambda1 = 0.284e-10 # shortest wavelength in first case in m\n",
      "lambda2 = 0.248e-10 # shortest wavelength in second case in m\n",
      "e = 1.6e-19 # charge on an electron in C\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "h1 = e * V1 * lambda1 / c\n",
      "h2 = e * V2 * lambda2 / c\n",
      "\n",
      "#Results\n",
      "print \"Planck constant is %.2e J sec if shortest wavelength is %.3e m \\nPlanck constant is %.3e Jsec if shortest wavelength is %.3e m \"%(h1,lambda1,h2,lambda2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Planck constant is 6.66e-34 J sec if shortest wavelength is 2.840e-11 m \n",
        "Planck constant is 6.613e-34 Jsec if shortest wavelength is 2.480e-11 m \n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.12, Page 20.10"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "lamda = 1e-11 # K-absorption limit for uranium in m\n",
      "\n",
      "#Calculations\n",
      "V = 12400e-10 / lamda\n",
      "\n",
      "#Result\n",
      "print \"Excitation potential is %d kV\"%(V/10**3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Excitation potential is 124 kV\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.13, Page 20.11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "lamda = 1.4e-11 # K-absorption edge for lead in m\n",
      "V = 88.6e3 # minimum voltage required for producing k-lines in V\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "r = V * lamda / c\n",
      "\n",
      "#Result\n",
      "print \"The value of the ratio of h/e = %.3e Jsec/C\"%r"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of the ratio of h/e = 4.135e-15 Jsec/C\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.14, Page 20.11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 92 # atomic no. of atom\n",
      "Rh = 1.1e5 # Rydberg constant in cm^-1\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "lamda = 1 / (Rh *(Z-1)**2 * (1 - (1 / 2**2)))\n",
      "\n",
      "#Result\n",
      "print \"Wavelength of K line = %.2f A\"%(lamda*1e8)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of K line = 0.11 A\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.15, Page 20.11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 42 # atomic no. of Mo\n",
      "lamda = 0.71e-10 # wavelength in m\n",
      "Z_ = 29 # atomic no. of Cu\n",
      "\n",
      "#Calculations\n",
      "lambda_ = (Z-1)**2 * lamda / (Z_-1)**2\n",
      "\n",
      "#Result\n",
      "print \"Wavelength of the corresponding radiation of Cu is %.2f A\"%(lambda_*1e10)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of the corresponding radiation of Cu is 1.52 A\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.16, Page 20.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 79 # atomic no. of element\n",
      "b = 1 # a constant\n",
      "a = 2.468e15 # a constant in per sec\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "f = a * (Z - b)**2\n",
      "lamda = c / f\n",
      "\n",
      "#Result\n",
      "print \"Wavelength of x-ray is %.4f A\"%(lamda*1e10)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of x-ray is 0.1998 A\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.17, Page 20.12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 29 # atomic no. of Cu\n",
      "R = 1.097e7 # Rydberg constant in m^-1\n",
      "c = 3e8 # speed of light in m/sec\n",
      "h = 6.62e-34 # Planck constant in J sec\n",
      "\n",
      "#Calculations\n",
      "f = 3./4 * (R * c) * (Z-1)**2\n",
      "E = h * f / 1.6e-16\n",
      "E_L = 0.931 # let E_L = 0.931 KeV\n",
      "E_ = E + E_L\n",
      "\n",
      "#Result\n",
      "print \"Ionization potential of K-shell electron of Cu is %.3f keV\"%E_"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ionization potential of K-shell electron of Cu is 8.938 keV\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.18, Page 20.13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 79 # atomic no. of anticathode\n",
      "R = 1.097e7 # Rydberg constant in m^-1\n",
      "c = 3e8 # speed of light in m/sec\n",
      "\n",
      "#Calculations\n",
      "f = 3./4 * (R * c) * (Z-1)**2\n",
      "\n",
      "#Result\n",
      "print \"Frequency of k line is %.3e Hz\"%f"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Frequency of k line is 1.502e+19 Hz\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 20.19, Page 20.13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " \n",
      "# Given \n",
      "Z = 27 # atomic no. of Co\n",
      "R = 1.097e7 # Rydberg constant in m^-1\n",
      "c = 3e8 # speed of light in m/sec\n",
      "h = 6.62e-34 # Planck constant in J sec\n",
      "\n",
      "#Calculations\n",
      "f = 3./4 * (R * c) * (Z-1)**2\n",
      "E = h * f\n",
      "lamda = c / f\n",
      "\n",
      "#Results\n",
      "print \"Energy is %.2f keV\\nWavelength of x-ray is %.2f A\"%(E / 1.6e-16,lamda*1e10)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Energy is 6.90 keV\n",
        "Wavelength of x-ray is 1.80 A\n"
       ]
      }
     ],
     "prompt_number": 24
    }
   ],
   "metadata": {}
  }
 ]
}