{ "metadata": { "celltoolbar": "Raw Cell Format", "name": "", "signature": "sha256:14402c55600f1e126f448a3051d0be67f94e08a364b1fb28e55e9829f2141c24" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 1: Elements of Optics And Quantum Physics" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.1,Page number 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#Given\n", "\n", "print\"(i) t1=d/c\";\n", "print\"(ii) t2=[(d-5)/c]+[5/v2]\";\n", "print\" v2=c/n2\";\n", "print\" t2=(d+2.5)/c\";\n", "print\"(iii)delta_t=t2-t1=(d+2.5-d)/c\";\n", "c=3*10**8; #Speed of light in m/s\n", "delta_t=2.5*10**-2/c; #converted 2.5 cm into meters\n", "print\"The time difference\",\"{0:.3e}\".format(delta_t),\"s\" ;\n", "print\"Arrival time difference of two monochromatic beams is\",delta_t*10**12,\"ps\";\n", "# Answer misprinted in the book\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(i) t1=d/c\n", "(ii) t2=[(d-5)/c]+[5/v2]\n", " v2=c/n2\n", " t2=(d+2.5)/c\n", "(iii)delta_t=t2-t1=(d+2.5-d)/c\n", "The time difference 8.333e-11 s\n", "Arrival time difference of two monochromatic beams is 83.3333333333 ps\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.2,Page number 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "#Applying Snell's law\n", "a=1*math.sin(428)/1.333; #a=sin(w2)\n", "print\"Angle of refraction is\",round(math.degrees(math.asin(a)),3),\"degree\";\n", "\n", "c=3*10**8; #speed of light in m/s\n", "n2=1.333; #refractive index of 2nd medium\n", "v2=c/n2; #velocity in second medium in m/s\n", "n1=1; #refractive index of 1st medium\n", "l1=620; #in nm wavelength\n", "\n", "print\"Velocity of optical ray through medium second\",\"{0:.3e}\".format(v2),\"m/s\";\n", "\n", "l2= (n1*l1)/n2; #wavelength in 2nd medium in nm\n", "print\"Wavelenght of optical ray through medium second\",round(l2,4),\"nm\"; #Result\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Angle of refraction is 30.512 degree\n", "Velocity of optical ray through medium second 2.251e+08 m/s\n", "Wavelenght of optical ray through medium second 465.1163 nm\n" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.3,Page number 5" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "n1=1; #refractive index of air\n", "n2=1.56; #refractive index of medium\n", "w1=60; #in deg C\n", "#using snell's law\n", "a= n1*sin(w1*math.pi/180)/n2; #a=sin(w1)\n", "w2=math.degrees(math.asin(a)); #in degree\n", "print\"Angle of refraction is\",round(w2,4),\"degree\";\n", "B=w1-w2; #in degree\n", "print\"Angle of deviation is\",round(B,4),\"degree\";\n", "# The answer doesn't match because of priting errorsin calculation as sin(608)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Angle of refraction is 33.7207 degree\n", "Angle of deviation is 26.2793 degree\n" ] } ], "prompt_number": 12 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.4,Page number 6" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "print\"Solution (i)\";\n", "w=5/12.5; #tan(w)=5/12.5;\n", "print\"The value of tan(w2) is\",w;\n", "w2=math.atan(w)*180/math.pi;\n", "\n", "print\"The value of w2 is\",round(w2,4),\"degree\";\n", "print\"The value of sin(w2) is\",round(math.sin(w2*math.pi/180),4);\n", "\n", "print\"Solution (ii)\";\n", "#Applying snell's law\n", "n1=1.05;\n", "n2=1.5;\n", "w1=(n2*sin(w2*math.pi/180))/n1; #a=sin(w1)\n", "print\"The value of sin(w1) is\",round(w1,4);\n", "print\"The value of w1 is\",round(math.degrees(math.asin(w1)),4),\"degree\";\n", "#value of w1\n", "#tan(w1)=(p-x)12.5;\n", "k=0.62*12.5;\n", "d=1.05*((12.5)**2+(k)**2)**0.5 +1.5*(12.5**2+5**2)**0.5; #d=1.05[(h1)^2+(k)^2]^0.5 +n2(h2**2+x**2)^0.5;\n", "print\"The optical distance is\",round(d,4),\"cm\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "The value of tan(w2) is 0.4\n", "The value of w2 is 21.8014 degree\n", "The value of sin(w2) is 0.3714\n", "Solution (ii)\n", "The value of sin(w1) is 0.5306\n", "The value of w1 is 32.0432 degree\n", "The optical distance is 35.6373 cm\n" ] } ], "prompt_number": 22 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.5,Page number 11" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "c=3*10**8;\n", "print\"Solution (i)\";\n", "ri=1.5; #refractive index\n", "u=830; # in nm\n", "l=u/ri; #in nm\n", "print\"Wavelength is\",round(l,4),\"nm\\n\";\n", "\n", "print\"Solution (ii)\";\n", "l=round(l); # rounding to nearest integer\n", "f=c/(l*10**-9)*10**-12; #in THz\n", "print\"frequency is\",round(f,4),\"THz\\n\";\n", "\n", "print\"Solution (iii)\";\n", "f=round(f); #rounding to nearest integer\n", "v=l*10**-9*f*10**12; #in m/s\n", "print\"phase velocity is\",\"{0:.3e}\".format(v),\"m/s\";\n", "\n", "#answer is getting rounding off due to larger calculation\n", "\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "Wavelength is 553.3333 nm\n", "\n", "Solution (ii)\n", "frequency is 542.4955 THz\n", "\n", "Solution (iii)\n", "phase velocity is 2.997e+08 m/s\n" ] } ], "prompt_number": 24 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.6,Page number 12" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "print\"Solution (i)\";\n", "l=720; #wavelength in nm\n", "n=1.5; #refractive index\n", "lm=l/n;\n", "print\"Wavelenth is\",lm,\"nm\"; #result\n", "\n", "print\"Solution (ii)\";\n", "c=3*10**8; #in m/s speed of light\n", "u=c/n;\n", "print\"Velocity is\",\"{0:.3e}\".format(u),\"m/s\"; #result\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "Wavelenth is 480.0 nm\n", "Solution (ii)\n", "Velocity is 2.000e+08 m/s\n" ] } ], "prompt_number": 26 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.7,Page number 12" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "print\"Solution (i)\";\n", "c=3*10**8; #in m/s speed of light\n", "l=640; #in nm\n", "u=2.2*10**8; #in m/s\n", "lm=u*l/c; #wavelenth in medium\n", "print\"The wavelength is\",round(lm,4),\"nm\"; #The answer in the book is misprinted\n", "\n", "print\"Solution (ii)\";\n", "n=l/lm; #refractive index\n", "print\"Refractive Index is\",round(n,4); #The answer in the book is misprinted\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "The wavelength is 469.3333 nm\n", "Solution (ii)\n", "Refractive Index is 1.3636\n" ] } ], "prompt_number": 29 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.8,Page number 12" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "#k=aa+as=6.3;\n", "#Given values from research\n", "k=6.3; #combined attenuation due to absorption and scattering\n", "d=25; #in cm\n", "print\"Solution (ii)\";\n", "#Io/Ii=exp(-(ao+ai)*d); d in m\n", "j=math.e**(-(k)*d/100); #Io/Ii ratio\n", "print\"Io is\",round(j,4),\"of Ii\"; #result" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (ii)\n", "Io is 0.207 of Ii\n" ] } ], "prompt_number": 30 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.9,Page number 13" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "# Given formula Io/Ii=exp(-(ao+ai)*d);\n", "# k=aa+as=63.1;\n", "# Io/Ii=1.5\n", "d=log(0.15)/-63.1; #length of tube\n", "print\"Length of tube, d =\",round(d*100,4),\"cm\"; #Result\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Length of tube, d = 3.0065 cm\n" ] } ], "prompt_number": 32 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.10,Page number 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "\n", "#p=m/{m+[2*n/(1-n)^2]^2};\n", "\n", "m=5; #no. of reflective plates\n", "n=1.33; #refractive indices\n", "p=m/(m+(2*n/(1-(n)**2))**2); #degree of polarisation\n", "print\"The degree of polarisation is\",round(p,1);\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The degree of polarisation is 0.3\n" ] } ], "prompt_number": 35 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.11,Page number 26" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "\n", "#m= p*{m+[2*n/(1-n)^2]^2};\n", "\n", "n=1.5; #refractive indices\n", "p=0.45; #degree of polarisation\n", "m=(p*(2*n/(1-n**2))**2)/(1-p);\n", "print\"Thus it will require\",round(m,4),\"reflective plate to achive a degree of polarization equal to 0.45\"; \n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Thus it will require 4.7127 reflective plate to achive a degree of polarization equal to 0.45\n" ] } ], "prompt_number": 41 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.12,Page number 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "#I1/I0=cos(w)^2\n", "#k=I1/I0;\n", "\n", "w=30; #angle bw polarizer and analyser in degee\n", "k=math.cos(w*math.pi/180)**2;\n", "print\"The ratio of optical ray intensity ,I1/I0=\",k; #Result\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The ratio of optical ray intensity ,I1/I0= 0.75\n" ] } ], "prompt_number": 43 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.13,Page number 27" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given data\n", "\n", "#I1/I0=cos(w)^2\n", "#Given I1/I0=0.55\n", "\n", "k=math.sqrt(0.55); #from above formulae\n", "\n", "print\"The angle bw polarizer and analyser , w is\",round(math.degrees(math.acos(k)),4),\"degree\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The angle bw polarizer and analyser , w is 42.1304 degree\n" ] } ], "prompt_number": 48 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.14,Page number 29" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "print\"Solution (i)\";\n", "ne=1.4; #refractive index\n", "no=1.25; #refractive index\n", "c=3*10**8; #in m/s\n", "T=2*10**-5; #in m\n", "l=740; #in nm\n", "t=(ne-no)*T/c; #time difference\n", "print\"Time difference, t is\",t*10**12,\"ps\";\n", "print\"Solution (ii)\";\n", "le=l/ne; \n", "lo=l/no;\n", "fi=2*math.pi*T*(1/le-1/lo)*10**9;\n", "print\"Phase difference is\",round(fi,4),\"rad\"; \n", "# Answer misprinted in book" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "Time difference, t is 0.01 ps\n", "Solution (ii)\n", "Phase difference is 25.4724 rad\n" ] } ], "prompt_number": 51 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.15,Page number 31" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given \n", "\n", "#E=h*v=h*c/l;\n", "\n", "E=3; #In KeV\n", "#1eV=1.6*10^-19\n", "h=6.63*10**-34; #plank constant in J/s\n", "c=3*10**8; # speed of light in m/s\n", "l=h*c/(E*10**3*1.6*10**-19); #wavelength in nm\n", "print\"wavelength of a electromagnetic radiation is\",round(l*10**9,4),\"nm\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "wavelength of a electromagnetic radiation is 0.4144 nm\n" ] } ], "prompt_number": 53 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.16,Page number 31" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "\n", "print\"Solution (i)\";\n", "l=670 #in nm\n", "h=6.63*10**-34; #plank constant in J/s\n", "c=3*10**17 #speed of light in nm/sec\n", "Ek=0.75 #In eV\n", "phi=(h*c/l)/(1.6*10**-19) -Ek;\n", "phi=round(phi*10)/10; #round to 1 decimal point\n", "print\"Characteristic of material =\",phi,\"eV\";\n", "\n", "print\"Solution (ii)\";\n", "fc=phi*1.6*10**-19/h*10**-12; #frequency in THz#result\n", "fc=round(fc);\n", "print\"Cuttoff frequency is =\",fc,\"THz\";\n", "lc=c/(fc*10**12); #in nm\n", "print\"Cuttoff wavelength is =\",round(lc,4),\"nm\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "Characteristic of material = 1.1 eV\n", "Solution (ii)\n", "Cuttoff frequency is = 265.0 THz\n", "Cuttoff wavelength is = 1132.0755 nm\n" ] } ], "prompt_number": 62 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.17,Page number 31" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "\n", "print\"Solution (i)\";\n", "l=0.045; #wavelength in nm\n", "h=6.63*10**-34; #planks constant in J/s\n", "c=3*10**8; #speed of light in m/s\n", "E=h*c/l/10**-9; #energy of photon in eV\n", "print\"E =\",\"{0:.3e}\".format(E),\"J\";\n", "\n", "E1=E/(1.6*10**-19); # energy in joule\n", "print\"E =\",\"{0:.3e}\".format(E1),\"eV\";\n", " \n", "e=1.6*10**-19; # charge of electron\n", "\n", "print\"Solution (ii)\";\n", "V=E/e;\n", "print\"Required voltage is =\",V/1000,\"KV\";\n", "\n", "#Value of wavelenght in problem is .45 but in the solution is .045 \n", "#the value considered above is .045\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "E = 4.420e-15 J\n", "E = 2.762e+04 eV\n", "Solution (ii)\n", "Required voltage is = 27.625 KV\n" ] } ], "prompt_number": 59 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 1.18,Page number 36" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import math\n", "\n", "#given\n", "\n", "print\"Solution (i)\";\n", "x=620 # difference in particle momentum In nm\n", "h=6.63*10**-34 # planks constant In J/s\n", "#p=h/(4*pi*x);\n", "#m*v=h/(4*pi*x);\n", "m=9.11*10**-31 #mass of electron in kg \n", "v=h /(4*math.pi* x *10**-9*m); #electron velocity\n", "print\"The uncertanity in electron velocity is\",round(v,4),\"m/s\";\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Solution (i)\n", "The uncertanity in electron velocity is 93.41 m/s\n" ] } ], "prompt_number": 61 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }