{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 1: Interference of Light"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.1, Page number 1-11"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "i = 45        #angle of incidence(degrees)\n",
      "t = 4*10**-5  #thickness of film(cm)\n",
      "u = 1.2\n",
      "\n",
      "#Calculations & Result\n",
      "r = math.degrees(math.asin(math.sin(i*math.pi/180)/u))\n",
      "for n in range(1,4):\n",
      "    lamda = (2*u*t*math.cos(r*math.pi/180))/n\n",
      "    print \"For n = %d, wavelength = %.2f A\"%(n,lamda/10**-8)\n",
      "print \"Since the visible range of wavelengths lie between 4000 to 7000 A, none of the obtained wavelengths lie in this range\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For n = 1, wavelength = 7756.29 A\n",
        "For n = 2, wavelength = 3878.14 A\n",
        "For n = 3, wavelength = 2585.43 A\n",
        "Since the visible range of wavelengths lie between 4000 to 7000 A, none of the obtained wavelengths lie in this range\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.2, Page number 1-12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 90        #angle of refraction(degrees)\n",
      "t = 5*10**-5  #thickness of film(cm)\n",
      "u = 1.33\n",
      "\n",
      "#Calculations & Result\n",
      "for n in range(1,4):\n",
      "    lamda = (4*u*t*int(math.cos(math.radians(90))))/((2*n)-1)\n",
      "    print \"For n = %d, wavelength = %.2f A\"%(n,lamda)\n",
      "print \"Since the visible range of wavelengths lie between 4000 to 7000 A, none of the obtained wavelengths do not lie in this range\"\n",
      "\n",
      "print \"\\nPlease note: Since r=90, cos(r)=0\\nHence, the answers given in the textbook are incorrect\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For n = 1, wavelength = 0.00 A\n",
        "For n = 2, wavelength = 0.00 A\n",
        "For n = 3, wavelength = 0.00 A\n",
        "Since the visible range of wavelengths lie between 4000 to 7000 A, none of the obtained wavelengths do not lie in this range\n",
        "\n",
        "Please note: Since r=90, cos(r)=0\n",
        "Hence, the answers given in the textbook are incorrect\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.3, Page number 1-12"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "i = 45           #angle of incidence(degrees)\n",
      "t = 1.5*10**-4   #thickness of film(cm)\n",
      "lamda = 5*10**-5 #wavelength(cm)\n",
      "u = 4./3.        #refractive index\n",
      "\n",
      "#Calculations\n",
      "r = math.degrees(math.asin(math.sin(i*math.pi/180)/u))\n",
      "n = (2*u*t*math.cos(r*math.pi/180))/lamda\n",
      "\n",
      "#Result\n",
      "print \"The order of interfernce is %.2f, close to 7\"%n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The order of interfernce is 6.78, close to 7\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2.4, Pae number 1-13"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "i = 45              #angle of incidence(degrees)\n",
      "lamda = 5896*10**-8 #wavelength(cm)\n",
      "u = 1.33            #refractive index\n",
      "n = 1\n",
      "\n",
      "#Calculations\n",
      "r = math.degrees(math.asin(math.sin(i*math.pi/180)/u))\n",
      "t = ((2*n-1)*lamda)/(2*u*math.cos(r*math.pi/180)*2)\n",
      "\n",
      "#Result\n",
      "print \"The required thickness is\",round((t/1E-5),2),\"*10^-5 cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required thickness is 1.31 *10^-5 cm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.5, Page number 1-14"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "lamda1 = 7000  #wavelength(A)\n",
      "lamda2 = 5000  #wavelength(A)\n",
      "u = 1.3        #R.I. of oil\n",
      "\n",
      "#Calculations\n",
      "'''\n",
      "2utcosr = (2n-1)7000/2   ----(1)\n",
      "2utcosr = (2n+1)5000/2   ----(2)\n",
      "Divinding (1) by (2), we get the following expression\n",
      "1 = (2n+1)5000\n",
      "    -----------\n",
      "    (2n-1)7000\n",
      "Solving the above expression, we get,\n",
      "'''\n",
      "n = 12000/4000\n",
      "t = ((2*n-1)*lamda)/(2*u*math.cos(r*math.pi/180)*2)\n",
      "\n",
      "#Result\n",
      "print \"The required thickness is\",round((t/1E-5),4),\"*10^-5 cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required thickness is 6.6936 *10^-5 cm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.6, Page number 1-15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "i = 30              #angle of incidence(degrees)\n",
      "lamda = 5890*10**-8 #wavelength(cm)\n",
      "u = 1.46            #refractive index\n",
      "n = 8\n",
      "\n",
      "#Calculations\n",
      "r = math.degrees(math.asin(math.sin(i*math.pi/180)/u))\n",
      "t = (n*lamda)/(2*u*math.cos(r*math.pi/180))\n",
      "\n",
      "#Result\n",
      "print \"The required thickness is\",round((t/1E-4),3),\"*10^-4 cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required thickness is 1.718 *10^-4 cm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.7, Page number 1-15"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 60              #angle of refraction(degrees)\n",
      "lamda = 5890*10**-8 #wavelength(cm)\n",
      "u = 1.5             #refractive index\n",
      "n = 1               #for minimumm thickness\n",
      "\n",
      "#Calculations\n",
      "#For r = 60\n",
      "t1 = (n*lamda)/(2*u*math.cos(r*math.pi/180))\n",
      "\n",
      "#For normal incidence \n",
      "r = 0\n",
      "t2 = (n*lamda)/(2*u*math.cos(r*math.pi/180))\n",
      "\n",
      "#Result\n",
      "print \"For r = 60, the required thickness is\",round((t1/1E-5),2),\"*10^-5 cm\"\n",
      "print \"For r = 0, the required thickness is\",round((t2/1E-5),2),\"*10^-5 cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For r = 60, the required thickness is 3.93 *10^-5 cm\n",
        "For r = 0, the required thickness is 1.96 *10^-5 cm\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.8, Page number 1-16"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 0               #for normal incidence(degrees)\n",
      "lamda = 5.5*10**-5  #wavelength(cm)\n",
      "n = 1               #for minimumm thickness\n",
      "A = 10**4           #area(cm^2)\n",
      "V = 0.2             #volume(cc)\n",
      "\n",
      "#Calculations\n",
      "t = V/A\n",
      "#for nth dark band,\n",
      "u = (n*lamda)/(2*t*math.cos(r*math.pi/180))\n",
      "\n",
      "#Result\n",
      "print \"Refractive index =\",u"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index = 1.375\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.2.9, Page number 1-17"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "r = 60        #angle of incidence(degrees)\n",
      "t = 2*10**-7  #thickness of film(cm)\n",
      "u = 1.2\n",
      "\n",
      "#Calculations & Result\n",
      "for n in range(1,4):\n",
      "    lamda = (4*u*t*math.cos(r*math.pi/180))/(2*n-1)\n",
      "    print \"For n = %d, wavelength = %.2f A\"%(n,lamda/10**-10)\n",
      "print \"Since the visible range of wavelengths lie between 4000 to 7000 A, the wavelength in the visible spectrum is 4800 A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For n = 1, wavelength = 4800.00 A\n",
        "For n = 2, wavelength = 1600.00 A\n",
        "For n = 3, wavelength = 960.00 A\n",
        "Since the visible range of wavelengths lie between 4000 to 7000 A, the wavelength in the visible spectrum is 4800 A\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.1, Page number 1-21"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "a = 40.       #angle(sec)\n",
      "lamda = 1.2  #distance between fringes(cm)\n",
      "alpha = 10   #no. of fringes\n",
      "\n",
      "#Calculations\n",
      "Bair = lamda/alpha          #cm\n",
      "alpha = (a*math.pi)/(3600*180)   #radians\n",
      "lamda = 2*alpha*Bair\n",
      "\n",
      "#Result\n",
      "print \"Wavelength of monochromatic light =\",round((lamda/1E-8),1),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of monochromatic light = 4654.2 A\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.2, Page number 1-22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "lamda = 5893*10**-8   #wavelength(cm)\n",
      "u = 1.52              #refractive index\n",
      "B = 0.1               #fringe spacing(cm)\n",
      "\n",
      "#Calculations\n",
      "alpha = (lamda/(2*u*B))*180*3600/math.pi   #seconds\n",
      "\n",
      "#Result\n",
      "print \"Angle of wedge =\",round(alpha,2),\"secs\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Angle of wedge = 39.98 secs\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.3, Page number 1-22"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "u = 1.4              #refractive index\n",
      "B = 0.25             #fringe spacing(cm)\n",
      "a = 20               #angle(secs)\n",
      "\n",
      "#Calculations\n",
      "alpha = (a*math.pi)/(3600*180)  #radians\n",
      "lamda = 2*u*alpha*B\n",
      "\n",
      "#Result\n",
      "print \"Wavelength of light =\",round((lamda/1E-8),2),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength of light = 6787.39 A\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.4, Page number 1-23"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "u = 1.5              #refractive index\n",
      "lamda = 5.82*10**-5  #wavelength(cm)\n",
      "a = 20               #angle(secs)\n",
      "\n",
      "#Calculations\n",
      "alpha = (a*math.pi)/(3600*180)  #radians\n",
      "B = lamda/(2*u*alpha)\n",
      "N = 1/B\n",
      "\n",
      "#Result\n",
      "print \"Number of interfernce fronges pr cm is\",round(N)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of interfernce fronges pr cm is 5.0\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.5, Page number 1-24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "u = 1                #refractive index for air film\n",
      "lamda = 6*10**-5     #wavelength(cm)\n",
      "B = 1./10            #distance between fringes(cm)\n",
      "\n",
      "#Calculations\n",
      "alpha = lamda/(2*u*B)  #radians\n",
      "d = alpha*10\n",
      "\n",
      "#Result\n",
      "print \"Daimeter of wire =\",d,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Daimeter of wire = 0.003 cm\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.3.6, Page number 1-24"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "alpha = 0.01*10**-1/10   #angle(radians)\n",
      "u = 1                    #refractive index for air film\n",
      "lamda = 5900*10**-10     #wavlength(m)\n",
      "\n",
      "#Calculation\n",
      "B = lamda/(2*u*alpha)\n",
      "\n",
      "#Result\n",
      "print \"Seperation between fringes is\",B/10**-3,\"mm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Seperation between fringes is 2.95 mm\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.1, Page number 1-32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "n = 40\n",
      "\n",
      "#Calculation\n",
      "#Equating the equation 4*R*n*lamda=4*4R*n*lamda, we get\n",
      "\n",
      "N = (4*4*n)/4\n",
      "\n",
      "#result\n",
      "print \"Ring number =\",N"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Ring number = 160\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.2, Page number 1-32"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "n = 10\n",
      "Dn = 0.5         #diameter of dark ring(cm)\n",
      "lamda = 5*10**-5 #waelength(cm)\n",
      "\n",
      "#Calculations\n",
      "R = Dn**2/(4*n*lamda)\n",
      "\n",
      "#Result\n",
      "print \"Radius of curvature =\",R,\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radius of curvature = 125.0 cm\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.3, Page number 1-33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "n = 5\n",
      "p = 10\n",
      "D5 = 0.336          #diameter of 5th ring(cm)\n",
      "lamda = 5890*10**-8 #waelength(cm)\n",
      "D15 = 0.59          #diameter of 15th ringcm\n",
      "\n",
      "#Calculations\n",
      "R = (D15**2-D5**2)/(4*p*lamda)\n",
      "\n",
      "#Result\n",
      "print \"Radius of curvature =\",round(R,2),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Radius of curvature = 99.83 cm\n"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.4, Page number 1-33"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "Dn = 0.42     #diameter of dark ring(cm)\n",
      "p = 8 \n",
      "R = 200       #radius of curvature(cm)\n",
      "Dn8 = 0.7     #diameter of (n+8)th ring(cm)\n",
      "\n",
      "#Calculations\n",
      "lamda = (Dn8**2-Dn**2)/(4*R*p)\n",
      "\n",
      "#Result\n",
      "print \"Wavelength =\",lamda/1E-8,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavelength = 4900.0 A\n"
       ]
      }
     ],
     "prompt_number": 36
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.5, Page number 1-34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "Dn = 0.218             #cm\n",
      "Dn10 = 0.451           #cm\n",
      "lamda = 5893*10**-8    #wavelength(cm)\n",
      "R = 90                 #radius of curvature(cm)\n",
      "p = 10\n",
      "\n",
      "#Calculation\n",
      "u = (4*p*lamda*R)/(Dn10**2-Dn**2)\n",
      "\n",
      "#Result\n",
      "print \"Refractive index =\",round(u,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index = 1.361\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.6, Page number 1-34"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Varaible declaration\n",
      "D5 = 0.42     #diameter of dark ring(cm)\n",
      "\n",
      "#Calculations\n",
      "'''\n",
      "For 5th dark ring,\n",
      "D5^2 = 20*R*lamda  -----1\n",
      "\n",
      "For 10th dark ring,\n",
      "D10^2 = 40*R*lamda -----2\n",
      "\n",
      "Substituting 1 in 2,\n",
      "'''\n",
      "\n",
      "D10 = math.sqrt((40*D5**2)/20)\n",
      "\n",
      "#Result\n",
      "print \"Diameter of the 10th dark ring =\",round(D10,3),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter of the 10th dark ring = 0.594 cm\n"
       ]
      }
     ],
     "prompt_number": 35
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.7, Page number 1-35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "lamda_n = 6000    #wavelength of nth ring(A)\n",
      "lamda_n1 = 5000   #wavelength for (n+1)th ring(cm)\n",
      "\n",
      "#Calculations\n",
      "'''\n",
      "Dn^2 = 4*R*n*lamda_n ---1\n",
      "\n",
      "Dn+1^2 = 4*R(n+1)*lamda_n1  ---2\n",
      "\n",
      "Equating 1 and 2, we get,\n",
      "'''\n",
      "\n",
      "n = 5\n",
      "R = 2\n",
      "Dn = math.sqrt(4*R*n*lamda_n*10**-8)\n",
      "\n",
      "#Result\n",
      "print \"Diameter =\",round(Dn,3),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter = 0.049 cm\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.8, Page number 1-35"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Varaible declaration\n",
      "Dair = 2.3   #diameter of ring in air(cm)\n",
      "Dliq = 2     #diameter of ring in liquid(cm)\n",
      "\n",
      "#Calculations\n",
      "u = Dair**2/Dliq**2\n",
      "\n",
      "#Result\n",
      "print \"Refractive index =\",u"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Refractive index = 1.3225\n"
       ]
      }
     ],
     "prompt_number": 43
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.11, Page number 1-37"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "D4 = 0.4    #diameter of 4th ring(cm)\n",
      "D12 = 0.7   #diameter of 12th ring(cm)\n",
      "\n",
      "#Calculations\n",
      "'''\n",
      "For D4, \n",
      "D4 = math.sqrt(4R*4*lamda)\n",
      "'''\n",
      "rt_Rl = 0.1\n",
      "R = 80      \n",
      "\n",
      "#For D20,\n",
      "D20 = math.sqrt(R)*rt_Rl\n",
      "\n",
      "#Result\n",
      "print \"Diameter of 20th ring =\",round(D20,3),\"cm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Diameter of 20th ring = 0.894 cm\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.4.12, Page number 1-36"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration \n",
      "n = 5\n",
      "p = 10\n",
      "D5 = 0.336          #diameter of 5th ring(cm)\n",
      "D15 = 0.590         #diameter of 15th ring(cm)\n",
      "R = 100             #radius of curvature(cm)\n",
      "\n",
      "#Calculations\n",
      "lamda = (D15**2-D5**2)/(4*R*p)\n",
      "\n",
      "#Result\n",
      "print \"Wavlength =\",lamda/1E-8,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Wavlength = 5880.1 A\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.7.1, Page number 1-42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "lamda = 560 #wavelength(nm)\n",
      "u = 2       #refractive index\n",
      "\n",
      "#Calculations\n",
      "lamda_dash = lamda/u\n",
      "t = lamda_dash/4\n",
      "\n",
      "#Result\n",
      "print \"Thickness of film =\",t,\"nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thickness of film = 70 nm\n"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1.7.2, Page number 1-42"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Variable declaration\n",
      "lamda = 6000 #wavelength(E)\n",
      "u = 1.2       #refractive index\n",
      "\n",
      "#Calculations\n",
      "lamda_dash = lamda/u\n",
      "t = lamda_dash/4\n",
      "\n",
      "#Result\n",
      "print \"Thickness of film =\",t,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Thickness of film = 1250.0 A\n"
       ]
      }
     ],
     "prompt_number": 56
    }
   ],
   "metadata": {}
  }
 ]
}