{
 "metadata": {
  "name": "",
  "signature": "sha256:614bd66037ed01713a261d0e06bb9f5175d6e2a9e3ef900d57af3a2e6efdf43f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "2: Interference and Diffraction"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.1, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "t = 12*10**-5;         #thickness of mica sheet(cm)\n",
      "lamda = 6000;          #wavelength(Angstrom)\n",
      "n = 1;\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-10;       #wavelength(m)\n",
      "mew_1 = n*lamda/t;\n",
      "mew = mew_1+1;            #refractive index of mica\n",
      "\n",
      "#Result\n",
      "print \"refractive index of mica is\",mew\n",
      "print \"answer given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "refractive index of mica is 1.005\n",
        "answer given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.2, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "D = 0.53;       #distance of fringes from slit(m)\n",
      "lamda = 5890;      #wavelength of light(angstrom)\n",
      "two_d = 0.6*10**-3;     #separation of slits(m)\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-10;          #wavelength(m)\n",
      "beta = D*lamda/two_d;           #width of fringes(m)\n",
      "beta = beta*10**3;\n",
      "beta = math.ceil(beta*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"width of fringes is\",beta,\"*10**-3 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "width of fringes is 0.521 *10**-3 m\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.3, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "beta = 9*10**-4;       #width of fringes(m)\n",
      "d1 = 75;          #distance of fringes from biprism(cm)\n",
      "d2 = 5;           #distance of biprism from slit(cm)\n",
      "lamda = 5890;      #wavelength of light(angstrom)\n",
      "two_d = 0.6*10**-3;     #separation of slits(m)\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-10;          #wavelength(m)\n",
      "d1 = d1*10**-2;                 #distance of fringes from biprism(m)\n",
      "d2 = d2*10**-2;                 #distance of biprism from slit(m)\n",
      "D = d1+d2;                   #distance of fringes from slit(m)\n",
      "two_d = D*lamda/beta;         #separation of slits(m)\n",
      "two_d = two_d*10**4;\n",
      "two_d = math.ceil(two_d*10**2)/10**2;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"distance between slits is\",two_d,\"*10**-4 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "distance between slits is 5.24 *10**-4 m\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.4, Page number 75"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 6*10**-7;       #wavelength(m)\n",
      "t = 7.2*10**-6;         #thickness(m)\n",
      "n = 6;\n",
      "\n",
      "#Calculation\n",
      "mew_1 = n*lamda/t;\n",
      "mew = mew_1+1;            #refractive index of sheet\n",
      "\n",
      "#Result\n",
      "print \"refractive index of sheet is\",mew"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "refractive index of sheet is 1.5\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.5, Page number 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "beta = 3;        #fringe separation(mm)\n",
      "mew = 1;         #refractive index\n",
      "lamda = 6000;      #wavelength(angstrom)\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-10;         #wavelength(m)\n",
      "beta = beta*10**-3;         #fringe separation(m)\n",
      "theta = lamda/(2*mew*beta);       #angle between plates(sec)\n",
      "theeta = theta*180*3600/math.pi;     #angle between plates(sec \")\n",
      "theta = theta*10**4;\n",
      "theeta = math.ceil(theeta*10**3)/10**3;   #rounding off to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"angle between plates is\",theta,\"*10**-4 sec or\",theeta,\"'\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "angle between plates is 1.0 *10**-4 sec or 20.627 '\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.6, Page number 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 5900*10**-7;      #wavelength of light(m)\n",
      "mew = 1;             #refractive index\n",
      "n = 7.4;             #number of fringes\n",
      "\n",
      "#Calculation\n",
      "t2_t1 = n*lamda/(2*mew);       #difference of film thickness(m)\n",
      "t2_t1 = t2_t1*10**2;\n",
      "\n",
      "#Result\n",
      "print \"difference of film thickness is\",t2_t1,\"*10**-2 m\"\n",
      "print \"answer given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "difference of film thickness is 0.2183 *10**-2 m\n",
        "answer given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.7, Page number 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 5.9*10**-7;          #wavelength of light(m)\n",
      "n = 10;             #10th ring\n",
      "D10 = 0.5;     #diameter of 10th ring(cm)\n",
      "\n",
      "#Calculation\n",
      "D10 = D10*10**-2;      #diameter of 10th ring(m)\n",
      "R = D10**2/(4*n*lamda);        #radius of curvature of lens(m)\n",
      "R = math.ceil(R*10**4)/10**4;   #rounding off to 4 decimals\n",
      "t = D10**2/(8*R);           #thickness of the air film(m)\n",
      "\n",
      "#Result\n",
      "print \"radius of curvature of lens is\",R,\"m\"\n",
      "print \"thickness of the air film is\",round(t/1e-6,2),\"*10**-6 m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "radius of curvature of lens is 1.0594 m\n",
        "thickness of the air film is 2.95 *10**-6 m\n"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.8, Page number 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n = 20;          #number of fringes\n",
      "lamda = 5890;         #wavelength(angstrom)\n",
      "\n",
      "#Calculation\n",
      "lamda = lamda*10**-8;         #wavelength(cm)\n",
      "t = n*lamda/2;                #thickness of wire(cm)\n",
      "t = t*10**4;\n",
      "\n",
      "#Result\n",
      "print \"thickness of wire is\",t,\"*10**-4 cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "thickness of wire is 5.89 *10**-4 cm\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.9, Page number 77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 5880;        #wavelength(angstrom)\n",
      "n = 1;         #number of fringes\n",
      "mew = 1.5;      #refractive index\n",
      "r = 60;          #angle of refraction(degree)\n",
      "\n",
      "#Calculation\n",
      "r = r*math.pi/180;        #angle of refraction(radian)\n",
      "lamda = lamda*10**-10;         #wavelength(m)\n",
      "t = n*lamda/(2*mew*math.cos(r));       #smallest thickness of the plate(m)\n",
      "t = t*10**10;          #smallest thickness of the plate(angstrom)\n",
      "\n",
      "#Result\n",
      "print \"smallest thickness of the plate is\",t,\"angstrom\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "smallest thickness of the plate is 3920.0 angstrom\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.10, Page number 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n1 = 4;          #fourth ring\n",
      "n2 = 12;         #12th ring\n",
      "n3 = 20;         #20th ring\n",
      "D4 = 0.4;        #diameter of 4th ring(cm)\n",
      "D12 = 0.7;       #diameter of 12th ring(cm)\n",
      "\n",
      "#Calculation\n",
      "p1 = n2-n1;\n",
      "p2 = n3-n2;\n",
      "#D12**2-D4**2 = 4*p1*lamda*R and D20**2-D12**2 = 4*p2*lamda*R\n",
      "#therefore D12**2-D4**2 = D20**2-D12**2\n",
      "D20 = math.sqrt((2*D12**2)-(D4**2));       #diameter of 20th ring(cm)\n",
      "D20 = math.ceil(D20*100)/100;   #rounding off to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"diameter of 20th ring is\",D20,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diameter of 20th ring is 0.91 cm\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 2.11, Page number 78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda1 = 6*10**-5;        #wavelength of light 1(cm)\n",
      "lamda2 = 4.5*10**-5;      #wavelength of light 2(cm)\n",
      "R = 90;          #radius of curvature(cm)\n",
      "\n",
      "#Calculation\n",
      "n = lamda2/(lamda1-lamda2);           #number of fringes\n",
      "Dn = math.sqrt(4*n*lamda1*R);         #diameter of nth ring(cm)\n",
      "Dn = math.ceil(Dn*10**4)/10**4;   #rounding off to 4 decimals\n",
      "\n",
      "\n",
      "#Result\n",
      "print \"diameter of nth ring is\",Dn,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "diameter of nth ring is 0.2546 cm\n"
       ]
      }
     ],
     "prompt_number": 53
    }
   ],
   "metadata": {}
  }
 ]
}