{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# 2: Diffraction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 1, Page number 73" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "number of lines per centimeter is 5000\n", "answer given in the book is wrong\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=5*10**-5; #wavelength(cm)\n", "k=2; #order\n", "theta=30*math.pi/180; #angle(radian)\n", "\n", "#Calculation\n", "e=k*lamda/math.sin(theta); #number of lines(cm)\n", "n=1/e; #number of lines per centimeter \n", "\n", "#Result\n", "print \"number of lines per centimeter is\",int(round(n))\n", "print \"answer given in the book is wrong\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 2, Page number 73" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "difference in angles of deviation is 46.7 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=5000*10**-8; #wavelength(cm)\n", "e=1/6000; #number of lines(cm)\n", "\n", "#Calculation\n", "theta1=math.asin(lamda/e)*180/math.pi; #angle for 1st order(degrees) \n", "theta2=math.asin(3*lamda/e)*180/math.pi; #angle for 3rd order(degrees) \n", "theta=round(theta2,1)-round(theta1,1); #difference in angles of deviation(degrees)\n", "\n", "#Result\n", "print \"difference in angles of deviation is\",theta,\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 3, Page number 74" ] }, { "cell_type": "code", "execution_count": 29, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "minimum number of lines per cm is 196.33\n", "answer given in the book varies due to rounding off errors\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=5890*10**-5; #wavelength(cm)\n", "dlamda=6*10**-5; #difference in wavelength(cm)\n", "k=2; #order\n", "w=2.5; #width(cm)\n", "\n", "#Calculation\n", "N=lamda/(k*dlamda*w); #minimum number of lines per cm\n", "\n", "#Result\n", "print \"minimum number of lines per cm is\",round(N,2)\n", "print \"answer given in the book varies due to rounding off errors\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 4, Page number 74" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "number of lines required for resolution is 982 and number of lines on grating is 850\n", "hence lines will not be resolved\n", "number of lines required for resolution is 491 and number of lines on grating is 850\n", "hence lines will appear resolved\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=5890*10**-8; #wavelength(cm)\n", "dlamda=6*10**-8; #difference in wavelength(cm)\n", "w=2; #width(cm)\n", "n=425; #number of lines on grating\n", "k=2; #order\n", "\n", "#Calculation\n", "N=w*n; #number of lines on grating \n", "N1=int(round(lamda/dlamda)); #number of lines required for resolution\n", "N2=int(round(lamda/(k*dlamda))); #number of lines required for resolution\n", "\n", "#Result\n", "print \"number of lines required for resolution is\",N1,\"and number of lines on grating is\",N\n", "print \"hence lines will not be resolved\"\n", "print \"number of lines required for resolution is\",N2,\"and number of lines on grating is\",N\n", "print \"hence lines will appear resolved\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 5, Page number 75" ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "angle of separation is 16 minutes\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda1=5016*10**-8; #wavelength(cm)\n", "lamda2=5048*10**-8; #difference in wavelength(cm)\n", "k=2; #order\n", "n=15000; #number of lines/inch\n", "\n", "#Calculation\n", "e=2.54/n; \n", "theta1=math.asin(2*lamda1/e)*180/math.pi; #angle for 1st wavelength(degrees) \n", "theta2=math.asin(2*lamda2/e)*180/math.pi; #angle for 2nd wavelength(degrees) \n", "theta=int(60*(theta2-theta1)); #angle of separation(minutes)\n", "\n", "#Result\n", "print \"angle of separation is\",theta,\"minutes\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 6, Page number 75" ] }, { "cell_type": "code", "execution_count": 46, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "dispersive power of grating is 15000\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n=4000; #number of lines/cm\n", "lamda=5000*10**-8; #wavelength(cm)\n", "k=3; #order\n", "\n", "#Calculation\n", "e=1/n; \n", "sintheta=k*lamda/e; \n", "costheta=math.sqrt(1-sintheta**2);\n", "dthetabydlamda=k*n/costheta; #dispersive power of grating\n", "\n", "#Result\n", "print \"dispersive power of grating is\",int(dthetabydlamda)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 7, Page number 76" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "highest order of spectrum is 3\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n=5000; #number of lines/cm\n", "lamda=6000*10**-8; #wavelength(cm)\n", "\n", "#Calculation\n", "e=1/n; \n", "k=e/lamda; #highest order of spectrum\n", "\n", "#Result\n", "print \"highest order of spectrum is\",int(k)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 8, Page number 76" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wavelength of lines is 6061.7 *10**-8 cm\n", "answer given in the book varies due to rounding off errors\n", "minimum grating width required is 4.2 cm\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "theta=10*math.pi/180; #angle(radian)\n", "dtheta=3*math.pi/(60*60*180); #difference of angle(radian)\n", "dlamda=5*10**-9; #wavelength(cm)\n", "k=2;\n", "\n", "#Calculation\n", "lamda=math.sin(theta)*dlamda/(math.cos(theta)*dtheta); \n", "lamdanew=lamda+dlamda; #wavelength of lines(cm)\n", "N=lamda/(dlamda*k);\n", "Ne=N*k*lamda/math.sin(theta); #minimum grating width required(cm)\n", "\n", "#Result\n", "print \"wavelength of lines is\",round(lamda*10**8,1),\"*10**-8 cm\"\n", "print \"answer given in the book varies due to rounding off errors\"\n", "print \"minimum grating width required is\",round(Ne,1),\"cm\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 9, Page number 77" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "grating element is 5 *10**-4 cm\n", "resolving power is 10000\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=5000*10**-8; #wavelength(cm)\n", "sintheta1=0.2;\n", "sintheta2=0.3;\n", "w=2.5; #width of grating(cm)\n", "\n", "#Calculation\n", "e=lamda/(sintheta2-sintheta1); #grating element is\n", "N=2*w/e; #resolving power\n", "\n", "#Result\n", "print \"grating element is\",int(e*10**4),\"*10**-4\",\"cm\"\n", "print \"resolving power is\",int(round(N))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 10, Page number 77" ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "width of central maxima is 1.33 mm\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "d=2; #diffraction observed(m)\n", "lamda=500*10**-9; #wavelength(m)\n", "a=1.5*10**-3; #slit width(m)\n", "\n", "#Calculation\n", "w=2*d*lamda/a; #width of central maxima(m)\n", "\n", "#Result\n", "print \"width of central maxima is\",round(w*10**3,2),\"mm\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 11, Page number 77" ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "slit width is 0.2 mm\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "d=2; #diffraction observed(m)\n", "lamda=500*10**-9; #wavelength(m)\n", "x=5*10**-3; #width of central maxima(m)\n", "\n", "#Calculation\n", "a=d*lamda/x; #slit width(m)\n", "\n", "#Result\n", "print \"slit width is\",a*10**3,\"mm\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 12, Page number 78" ] }, { "cell_type": "code", "execution_count": 65, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "half angular width is 30 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "lamda=6000*10**-10; #wavelength(m)\n", "a=12*10**-7; #slit width(m)\n", "\n", "#Calculation\n", "theta=math.asin(lamda/a)*180/math.pi; #half angular width(degrees)\n", "\n", "#Result\n", "print \"half angular width is\",int(theta),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 13, Page number 78" ] }, { "cell_type": "code", "execution_count": 67, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "the orders 6 12 18 etc will be missing\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "b=0.8; #distance(mm)\n", "a=0.16; #slit width(mm)\n", "p1=1;\n", "p2=2;\n", "p3=3;\n", "\n", "#Calculation\n", "nbyp=(a+b)/a; #ratio of missing orders\n", "n1=int(nbyp*p1);\n", "n2=int(nbyp*p2);\n", "n3=int(nbyp*p3); #missing orders\n", "\n", "#Result\n", "print \"the orders\",n1,n2,n3,\"etc will be missing\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 14, Page number 79" ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "angular separation is 2.48 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "N=6000*10**2; #number of lines/m\n", "m=3; #order\n", "lamda1=500*10**-9; #wavelength(m)\n", "lamda2=510*10**-9; #wavelength(m)\n", "\n", "#Calculation\n", "sintheta1=m*N*lamda1; \n", "theta1=math.asin(sintheta1)*180/math.pi; #angle(degrees)\n", "sintheta2=m*N*lamda2; \n", "theta2=math.asin(sintheta2)*180/math.pi; #angle(degrees)\n", "theta=theta2-theta1; #angular separation(degrees)\n", "\n", "#Result\n", "print \"angular separation is\",round(theta,2),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 15, Page number 79" ] }, { "cell_type": "code", "execution_count": 77, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "highest order that can be seen is 2\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "N=15000/2.54*10**2; #number of lines/cm\n", "lamda=600*10**-9; #wavelength(m)\n", "\n", "#Calculation\n", "m=1/(N*lamda); #highest order that can be seen\n", "\n", "#Result\n", "print \"highest order that can be seen is\",int(m)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 16, Page number 79" ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "angular separation is 0.018 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "N=10000/2*10**2; #number of lines/m\n", "m=1; #order\n", "lamda1=5890*10**-10; #wavelength(m)\n", "lamda2=5896*10**-10; #wavelength(m)\n", "\n", "#Calculation\n", "sintheta1=m*N*lamda1; \n", "theta1=math.asin(sintheta1)*180/math.pi; #angle(degrees)\n", "sintheta2=m*N*lamda2; \n", "theta2=math.asin(sintheta2)*180/math.pi; #angle(degrees)\n", "theta=theta2-theta1; #angular separation(degrees)\n", "\n", "#Result\n", "print \"angular separation is\",round(theta,3),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 17, Page number 80" ] }, { "cell_type": "code", "execution_count": 90, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "slit width is 2.51 *10**-4 cm\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "theta=15*math.pi/180; #angle(radian)\n", "lamda=6500*10**-8; #wavelength(cm) \n", "n=1; #order\n", "\n", "#Calculation\n", "a=n*lamda/math.sin(theta); #slit width(cm)\n", "\n", "#Result\n", "print \"slit width is\",round(a*10**4,2),\"*10**-4 cm\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 18, Page number 80" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wavelength of light is 4524 angstrom\n", "answer given in the book is wrong\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "theta=15*math.pi/180; #angle(radian)\n", "a=2.5*10**-6; #slit width(m)\n", "\n", "#Calculation\n", "lamda=a*math.pi*math.sin(theta)*10**10/(1.43*math.pi); #wavelength of light(angstrom)\n", "\n", "#Result\n", "print \"wavelength of light is\",int(lamda),\"angstrom\"\n", "print \"answer given in the book is wrong\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 19, Page number 81" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wavelength of spectral line is 5882 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n=2; #order\n", "N=4250; #grating lines(lines/cm)\n", "theta=30*math.pi/180; #angle(radian)\n", "\n", "#Calculation\n", "e=1/N;\n", "lamda=e*math.sin(theta)*10**8/n; #wavelength of spectral line(angstrom)\n", "\n", "#Result\n", "print \"wavelength of spectral line is\",int(lamda),\"angstrom\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 20, Page number 81" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "angular separation is 36.8699 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n=1; #order\n", "a=1*10**-6; #slit width(m)\n", "lamda=600*10**-9; #wavelength of spectral line(m)\n", "\n", "#Calculation\n", "theta=math.asin(n*lamda/a)*180/math.pi; #angular separation(degrees)\n", "\n", "#Result\n", "print \"angular separation is\",round(theta,4),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 21, Page number 82" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2 orders can be seen\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "N=10520; #grating lines(lines/cm)\n", "theta=90*math.pi/180; #angle(radian)\n", "lamda=5*10**-5; #wavelength of spectral line(cm)\n", "\n", "#Calculation\n", "e=1/N;\n", "n=e*math.sin(theta)/lamda; #order\n", "\n", "#Result\n", "print int(round(n)),\"orders can be seen\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 22, Page number 82" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "slit width is 0.857 *10**-4 m\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "x=4.2*10**-3; #distance(m)\n", "D=60*10**-2; #screen slit distance(m)\n", "lamda=6000*10**-10; #wavelength(m)\n", "\n", "#Calculation\n", "d=D*lamda/x; #slit width(m) \n", "\n", "#Result\n", "print \"slit width is\",round(d*10**4,3),\"*10**-4 m\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 23, Page number 83" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "possible order of spectra is 3\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "N=15000/2.54; #number of lines(per cm)\n", "lamda=6000*10**-8; #wavelength(cm)\n", "\n", "#Calculation\n", "d=1/N; #slit width(m) \n", "m=d/lamda; #possible order of spectra \n", "\n", "#Result\n", "print \"possible order of spectra is\",int(round(m))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 24, Page number 83" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "wavelength of light is 6000 angstrom\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "D=150; #slit screen distance(cm)\n", "d=0.03; #separation(cm)\n", "beta=0.3; #fringe separation(cm)\n", "\n", "#Calculation\n", "lamda=d*beta*10**8/D; #wavelength of light(angstrom)\n", "\n", "#Result\n", "print \"wavelength of light is\",int(round(lamda)),\"angstrom\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }