summaryrefslogtreecommitdiff
path: root/Engineering_Physics/Chapter4_1.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Physics/Chapter4_1.ipynb')
-rw-r--r--Engineering_Physics/Chapter4_1.ipynb217
1 files changed, 217 insertions, 0 deletions
diff --git a/Engineering_Physics/Chapter4_1.ipynb b/Engineering_Physics/Chapter4_1.ipynb
new file mode 100644
index 00000000..4cd8a196
--- /dev/null
+++ b/Engineering_Physics/Chapter4_1.ipynb
@@ -0,0 +1,217 @@
+{
+ "metadata": {
+ "name": "Chapter4"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": "4: Diffraction"
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.1, Page number 91"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the velocity of light\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nD = 50; #Distance between source and the screen(cm)\nlamda = 6563; #Wavelength of light of parallel rays(A)\nd = 0.385; #Width of the slit(mm)\nn1 = 1; #Order of diffraction for first minimum\nn2 = 5; #Order of diffraction for fifth minimum\n\n#Calculation\nlamda = lamda*10**-8; #Wavelength of light of parallel rays(cm)\nd = d*10**-1; #Width of the slit(cm)\n#As sin(theta1) = n*lambda/d = x1/D, solving for x1\nx1 = n1*lamda*D/d; #Distance from the centre of the principal maximum to the first minimum(cm)\nx1 = x1*10; #Distance from the centre of the principal maximum to the first minimum(mm)\nx1 = math.ceil(x1*10**3)/10**3; #rounding off the value of x1 to 3 decimals\nx2 = n2*lamda*D/d; #Distance from the centre of the principal maximum to the fifth minimum(cm)\nx2 = x2*10; #Distance from the centre of the principal maximum to the fifth minimum(mm)\nx2 = math.ceil(x2*10**3)/10**3; #rounding off the value of x2 to 3 decimals\n\n#Result\nprint \"The Distance from the centre of the principal maximum to the first minimum is\",x1, \"mm\"\nprint \"The Distance from the centre of the principal maximum to the fifth minimum is\",x2, \"mm\"\n\n#answer for x2 given in the book is wrong",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The Distance from the centre of the principal maximum to the first minimum is 0.853 mm\nThe Distance from the centre of the principal maximum to the fifth minimum is 4.262 mm\n"
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.2, Page number 91"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the radii of first two dark rings\n\n#importing modules\nfrom __future__ import division\nimport math\n\n#Variable declaration\nD = 0.04; #Diameter of circular aperture(cm)\nf = 20; #Focal length of convex lens(cm)\nlamda = 6000; #Wavelength of light used(A)\n\n#Calculation\nlamda = lamda*10**-8; #Wavelength of light used(cm)\n#We have sin(theta) = 1.22*lambda/D = theta, for small theta\n#For first dark ring\ntheta = 1.22*lamda/D; #The half angular width at central maximum(rad)\nr1 = theta*f; #The half width of central maximum for first dark ring(cm)\nr1 = r1*10**2;\n#We have sin(theta) = 5.136*lambda/(%pi*D) = theta, for small theta\n#For second dark ring\ntheta = 5.136*lamda/(math.pi*D); #The half angular width at central maximum(rad)\nr2 = theta*f; #The half width of central maximum for second dark ring(cm)\nr2 = r2*10**2;\nr2 = math.ceil(r2*100)/100; #rounding off the value of r2 to 2 decimals\n\n#Result\nprint \"The radius of first dark ring is\",r1,\"*10**-2 cm\"\nprint \"The radius of second dark ring is\",r2,\"*10**-2 cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The radius of first dark ring is 3.66 *10**-2 cm\nThe radius of second dark ring is 4.91 *10**-2 cm\n"
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.3, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the angle at which the light produces a second order maximum\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nn = 2; #Order of diffraction\nlamda = 650; #Wavelength of light used(nm)\nd = 1.2*10**-3; #Distance between two consecutive slits of grating(cm)\n\n#Calculation\n#We have sin(theta) = n*N*lambda = n*lambda/d, solving for theta\nlamda = lamda*10**-9; #Wavelength of light used(m)\nd = d*10**-2; #Distance between two consecutive slits of grating(m)\na=n*lamda/d;\ntheta = math.asin(a); #Angle at which the 650 nm light produces a second order maximum(rad)\ntheta = theta*57.2957795; #angle in degrees\ntheta = math.ceil(theta*10**2)/10**2; #rounding off the value of theta to 2 decimals\n\n#Result\nprint \"The angle at which the light produces a second order maximum is\",theta, \"degrees\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The angle at which the light produces a second order maximum is 6.22 degrees\n"
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.4, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the highest order of spectra\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 650; #Wavelength of light used(nm)\nN = 6000; #Number of lines per cm on grating\ntheta = 90; #Angle at which the highest spectral order is obtained(degrees)\n\n#Calculation\ntheta = theta*0.0174532925; #Angle at which the highest spectral order is obtained(rad)\n#We have sin(theta) = n*N*lambda, solving for n\nlamda = lamda*10**-9; #Wavelength of light used(m)\nN = N*10**2; #Number of lines per m on grating\nn = math.sin(theta)/(N*lamda); #The highest order of spectra with diffraction grating\nn = math.ceil(n*10**3)/10**3; #rounding off the value of theta to 3 decimals\ni,d = divmod(n, 1); #divides the value of n into integer and decimal parts where i is integer\n\n#Result\nprint \"value of n is\",n\nprint \"The highest order of spectra obtained with diffraction grating is\",i\n",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "value of n is 2.565\nThe highest order of spectra obtained with diffraction grating is 2.0\n"
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.5, Page number 92"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To show that the blue line and red line overlap\n\n#importing modules\nimport math\n\n#Variable declaration\nN = 4000; #Number of lines per cm on grating\n#For Blue Line\nlamda1 = 450; #Wavelength of blue light(nm)\nn1 = 3; #Order of diffraction spectrum\n#For Red Line\nlamda2 = 700; #Wavelength of red light(nm)\nn2 = 2; #Order of diffraction spectrum\n\n#Calculation\nN = N*10**2; #Number of lines per m on grating\nlamda1 = lamda1*10**-9; #Wavelength of blue light(m)\nlamda2 = lamda2*10**-9; #Wavelength of red light(m)\n#We have sin(theta) = n*N*lambda, solving for sin(theta)\nsin_theta_3 = n1*N*lamda1; #Sine of angle at third order diffraction \nsin_theta_2 = n2*N*lamda2; #Sine of angle at second order diffraction\n\n#Result\nprint \"Sine of angle at third order diffraction is\",sin_theta_3\nprint \"Sine of angle at second order diffraction is\",sin_theta_2 \n#Check for overlapping\nif (sin_theta_2-sin_theta_3)<0.05:\n print \"The two orders overlap\"\nelse:\n print \"The two orders do not overlap\" ",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "Sine of angle at third order diffraction is 0.54\nSine of angle at second order diffraction is 0.56\nThe two orders overlap\n"
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.6, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the width of first order spectrum on the screen\n\n#importing modules\nimport math\n\n#Variable declaration\nn = 1; #Order of diffraction spectrum\nN = 6000; #Number of lines per cm on diffraction grating\nD = 2; #Distance of screen from the source(m)\nlamda1 = 400; #Wavelength of blue light(nm)\nlamda2 = 750; #Wavelength of blue light(nm)\n\n#Calculation\nN = N*10**2; #Number of lines per m on grating\nlamda1 = lamda1*10**-9; #Wavelength of blue light(m)\nlamda2 = lamda2*10**-9; #Wavelength of blue light(m)\n#We have sin(theta1) = n*N*lamda1, solving for theta1\ntheta1 = math.asin(n*N*lamda1); #Angle at first order diffraction for Blue light(rad)\ntheta1_d = theta1*57.2957795; #Angle at first order diffraction for Blue light(degrees)\ntheta2 = math.asin(n*N*lamda2); #Angle at first order diffraction for Red light(rad)\ntheta2_d = theta2*57.2957795; #Angle at first order diffraction for Red light(degrees)\nx1 = D*math.tan(theta1); #Half width position at central maximum for blue color(m)\nx2 = D*math.tan(theta2); #Half width position at central maximum for red color(m)\nx = x2-x1; #width of first order spectrum on the screen(m)\nx = x*10**2; #width of first order spectrum on the screen(cm)\nx = math.ceil(x*10**2)/10**2; #rounding off the value of x to 2 decimals\n\n#Result\nprint \"The width of first order spectrum on the screen is\",x, \"cm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The width of first order spectrum on the screen is 51.34 cm\n"
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.7, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the least separation between wavelengths\n\n#importing modules\nimport math\n\n#Variable declaration\nw = 5; #Width of the grating(cm)\nN = 32; #Number of lines per mm on grating\nlamda = 640; #Wavelength of light(nm)\nn = 2; #Order of diffraction\n\n#Calculation\nN= N*10; #Number of lines per cm on grating\nN0 = w*N; #Total number of lines on the grating\nd_lambda = lamda/(n*N0); #Separation between wavelengths(nm)\n\n#Result\nprint \"The separation between wavelengths which the grating can just resolve is\",d_lambda, \"nm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation between wavelengths which the grating can just resolve is 0.2 nm\n"
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.8, Page number 93"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the separation of the centres of the images in the focal plane\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda = 550; #Wavelength of light(nm)\nD = 3.2; #Diameter of circular lens(cm)\nf = 24; #Focal length of the lens(cm) \n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of light(m)\nD = D*10**-2; #Diameter of circular lens(m)\ntheta_min = 1.22*lamda/D; #Minimum angle of resolution provided by the lens(rad)\n#As delta_x/f = theta_min, solving for delta_x\nf = f*10**-2; #Focal length of the lens(m) \ndelta_x = theta_min*f; #Separation of the centres of the images in the focal plane of lens(m)\ndelta_x = delta_x*10**6; #Separation of the centres of the images in the focal plane of lens(micro m)\n \n#Result\nprint \"The separation of the centres of the images in the focal plane is\",round(delta_x), \"micro-metre\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The separation of the centres of the images in the focal plane is 5.0 micro-metre\n"
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": "Example number 4.9, Page number 94"
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "#To calculate the linear separation between two points\n\n#importing modules\nimport math\nfrom __future__ import division\n\n#Variable declaration\nlamda = 550; #Wavelength of light(nm)\nD = 20; #Diameter of objective of telescope(cm)\nd = 6; #Distance of two points from the objective of telescope(km)\n\n#Calculation\nlamda = lamda*10**-9; #Wavelength of light(m)\nD = D*10**-2; #Diameter of objective of telescope(m)\nd = d*10**3; #Distance of two points from the objective of telescope(m)\ntheta = 1.22*lamda/D; #Angular separation between two points(rad)\nx = theta*d; #Linear separation between two points(m)\nx = x*10**3; #Linear separation between two points(mm)\n\n#Result\nprint \"The linear separation between two points is\",x, \"mm\"",
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": "The linear separation between two points is 20.13 mm\n"
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": "",
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file