{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3: Characterisation of material"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1, page no-89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# wavelength and frequency of X-rays\n",
      "\n",
      "import math\n",
      "#Variable Declaration\n",
      "h=6.626*10**-34                    # Planck's constant\n",
      "e=1.6*10**-19                      # charge of an electron\n",
      "c=3.0*10**8                        # speed of light\n",
      "v=10000.0                          # Applied potential difference\n",
      "\n",
      "#Calculation\n",
      "lam_min=(h*c)/(e*v)\n",
      "V=c/lam_min\n",
      "\n",
      "#Result\n",
      "print('\\n(i)\\nThe wavelength of X-rays emitted Lamda_min = %.2f A\u00b0\\n(ii)\\nThe frequency of X-ray beam emitted is %.1f*10^18 Hz'%(lam_min*10**10,V*10**-18))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(i)\n",
        "The wavelength of X-rays emitted Lamda_min = 1.24 A\u00b0\n",
        "(ii)\n",
        "The frequency of X-ray beam emitted is 2.4*10^18 Hz\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, page no-89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# wavelength and velocity of electrons\n",
      "\n",
      "import math\n",
      "#Variable Declaration\n",
      "\n",
      "v=10000.0                     # Applied potential difference\n",
      "i=2*10**-3                    # Current\n",
      "e=1.6*10**-19                 # charge of an electron\n",
      "t=1.0                         # time in second\n",
      "m=9.1*10**-31                 # mass of an electrons\n",
      "\n",
      "#(i)\n",
      "\n",
      "#Calculation\n",
      "n=i*t/e\n",
      "\n",
      "#Result\n",
      "print('The no of electrons striking the target per second =%.2f *10^16'%(n*10**-16))\n",
      "\n",
      "#(ii)\n",
      "\n",
      "#Calculation\n",
      "v1=math.sqrt(2*e*v/m)\n",
      "\n",
      "#(iii)\n",
      "\n",
      "#Calculation\n",
      "lam=12400.0/v\n",
      "\n",
      "#Result\n",
      "print('\\n(ii)\\nThe velocity of electron =%.2f*10^7 m/s\\n(iii)\\nWavelength of x-rays=%.2f A\u00b0'%(v1*10**-7,lam))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The no of electrons striking the target per second =1.25 *10^16\n",
        "\n",
        "(ii)\n",
        "The velocity of electron =5.93*10^7 m/s\n",
        "(iii)\n",
        "Wavelength of x-rays=1.24 A\u00b0\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, page no-90"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# wavelength and angle for 2nd order bragg reflection\n",
      "\n",
      "import math\n",
      "#variable Declaration\n",
      "d=5.6534*10**-10             # interplanar spacing\n",
      "theta=13.6666                # glancing angle\n",
      "n=1.0                        # order of diffraction\n",
      "\n",
      "#(i)\n",
      "#Calculation\n",
      "lam=2*d*math.sin(theta*math.pi/180)/n\n",
      "\n",
      "#Result \n",
      "print('\\n(i)\\nWavelength of the X-rays, Lambda =%.3f*10^-10 m'%(lam*10**10))\n",
      "\n",
      "#(ii)\n",
      "#calculation\n",
      "n=2.0\n",
      "theta=math.asin(n*lam/(2*d))\n",
      "theta=theta*180/math.pi\n",
      "\n",
      "#Result\n",
      "print('\\n(ii)\\n2nd order Bragg reflection at angle Theta2 = %f\u00b0'%theta)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(i)\n",
        "Lambda =2.671*10^-10 m\n",
        "\n",
        "(ii)\n",
        "2nd order Bragg reflection at angle Theta2 = 28.199528\u00b0\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, page no-91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Grating spacing and glancing angle\n",
      "\n",
      "import math\n",
      "#Variable Declaration\n",
      "v=24800.0                    # Applied potential difference\n",
      "n=1.0                        # order of diffraction\n",
      "lam=1.54*10**-10             # wavelength of the X-ray beam\n",
      "ga=15.8                      # glancing angle\n",
      "\n",
      "#(i)\n",
      "\n",
      "#calculation\n",
      "d=n*lam/(2*math.sin(ga*math.pi/180))\n",
      "\n",
      "#Result\n",
      "print('\\n(i)\\nGrating spacing for NaCl crystal =%.3f *10^-10 m'%(d*10**10))\n",
      "\n",
      "#(ii)\n",
      "\n",
      "#calculation\n",
      "lam_min=12400.0/v\n",
      "lam_min=lam_min*10**-10\n",
      "theta=math.asin(n*lam_min/(2*d))\n",
      "theta=theta*180/math.pi\n",
      "\n",
      "#Result\n",
      "print('\\n(ii)\\nGlancing angle for minimum wavelength = %.3f degrees'%theta)\n",
      "# Glancing angle in the book is in the degree second format"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "(i)\n",
        "Grating spacing for NaCl crystal =2.828 *10^-10 m\n",
        "\n",
        "(ii)\n",
        "Glancing angle for minimum wavelength = 5.072 degrees\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5, page no-92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# wavelength of radiation\n",
      "\n",
      "import math\n",
      "#variable Declaration\n",
      "lam=0.7078 *10**-10                   # wavelength of Ka line from molybdenum\n",
      "wt=42.0                               # Atomic number of molybdenum\n",
      "wt1=48.0                              # Atomic number of cadmium\n",
      "\n",
      "#calculation\n",
      "lam1=(lam*(wt-1)**2)/(wt1-1)**2\n",
      "\n",
      "#Result\n",
      "print('\\nWavelength of cadmium radiation is %.4f A\u00b0'%(lam1*10**10))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Wavelength of cadmium radiation is 0.5386 A\u00b0\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6, page no-92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Energy of thermal neutron\n",
      "\n",
      "import math\n",
      "#Variable Declaration\n",
      "lam=10.0**-10                           # Wavelength of neutron\n",
      "h=6.626*10**-34                         # Planck's constant\n",
      "m=1.675*10**-27                         # mass of an electron\n",
      "e1=1.602*10**-19                        # charge of an electron\n",
      "\n",
      "#calculation\n",
      "e=(h**2)/(2*m*lam**2)\n",
      "e=e/e1\n",
      "\n",
      "#Result\n",
      "print('\\nThe energy of thermal neutron with wavelength 1 A\u00b0 is %.2f eV'%e)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "The energy of thermal neutron with wavelength 1A\u00b0 is 0.08 eV\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8, page no-94"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# effect of temperature on wavelength\n",
      "\n",
      "import math\n",
      "#Variable Declaration\n",
      "lam=0.1                                # Wavelength of neutron in nm\n",
      "\n",
      "#calculation\n",
      "T=(2.516**2)/(lam)**2\n",
      "\n",
      "#Result\n",
      "print('Temperature of thermal neutron corresponding to 1 A\u00b0 is %.0f K'%T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature of thermal neutron corresponding to 1 A\u00b0 is 633 K\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}