{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 4: Diffraction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.10: Diffraction_of_Xrays.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "//Given:\n", "N = 15000;//Number of lines per inch\n", "a_plus_b = (2.54/N)*10^8 ;//Grating period in A\n", "lambda = 1 ; //Wavelength in A\n", "//Grating equation :(a+b)*sin(theta_n) = n*lambda\n", "//First order maximum \n", "theta1 = asind(lambda/a_plus_b); // angle in degrees\n", "printf('The first order maximum will be obtained at : %.4f degrees .\n\n',theta1);\n", "\n", "" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.11: Resolution_of_human_eye.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "//Given:\n", "lambda = 6000; //Wwavelength in A\n", "mu = 1.33; //Refractive index for cornea\n", "D = 2; //Diameter of pupil in mm\n", "//Yellow light wavelength in eye:\n", "lambda1 = lambda/mu ; //Wavelength in A\n", "//The angular resolution \n", "//1 A = 1.0*10^-7 mm\n", "theta_c = (1.22*lambda1*10^-7)/D; // angle in rad\n", "//Maximum value for L\n", "L = 1/tan(theta_c); // in mm\n", "printf('Maximum value for L should be : %.1f mm',L);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.4: Interference_minima.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "//Given :\n", "d = 8.8*10^-2 ; // slit width in mm\n", "b = 0.7;// seperation between slits in mm\n", "lambda = 6328 ; //Wavelength in A\n", "//First diffraction minima is possible, when d*sin(theta) = lambda\n", "// 1 A = 1.0*10^-7 mm\n", "theta = asind((lambda*10^-7)/d); // angle in degrees\n", "printf('theta = %.3f degrees .\n\n',theta);\n", "//interference minima is possible , when sin(theta) = ((p + 1/2)*lambda)/b\n", "for p = 0 : 10\n", " //1 A = 1.0*10^-7 mm\n", " theta1 = asind((p + 1/2)*(lambda*10^-7/b)); // angle in degrees \n", " printf('When p = %d \n',p);\n", " printf('theta = %.3f degrees . \n\n',theta1);\n", " if(theta1 > theta)\n", " printf(' When p >= %d , theta > %.3f degrees .\n\nBetween the first two diffraction minima , %d interference minima are possible.',p,theta,2*p);\n", " break;\n", " end\n", "end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.6: Angles_of_Diffraction.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "//Given :\n", "// a+b = (2.54/N)cm\n", "N = 15000;//grating has 15000 lines\n", "a_plus_b = 2.54/N ; // grating element in cm\n", "//Grating equation, (a+b)*sin(theta_n) = n*lambda, we get : theta_n = asind((n*lamba)/(a+b))\n", "printf('For line D1 and Wavelength 5890 A:\n\n');\n", "printf(' Angles at which first order and second order maxima will be observed are :\n');\n", "lambda1 = 5890; //Wavelength in A\n", "for n = 1:2 // First and second order maxima\n", "// 1 A = 1.0*10^-7 mm\n", "theta1_n = asind((n*lambda1*10^-8)/a_plus_b);// angle in degrees\n", "printf(' Order :%d ,%.3f degrees \n',n,theta1_n);\n", "end\n", "printf('For line D2 and Wavelength 5895.9 A :\n\n');\n", "printf(' Angles at which first order and second order maxima will be observed are :\n');\n", "lambda2 = 5895.9 ; //Wavelength in A\n", "for n1 = 1:2 //First and second order maxima\n", "// 1 A = 1.0*10^-7 mm\n", " theta2_n = asind((n1*lambda2*10^-8)/a_plus_b);// angle in degrees\n", " printf('Order : %d, %.3f degrees \n',n1,theta2_n); \n", "end\n", "printf(' When n = 3, sin(theta)= ((n*lambda*10^-8)/a_plus_b)>1 , which falls outside the sine range, hence third order maximum is not visible');" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.8: Dispersion_and_resolving_power.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "// Given :\n", "//(a) 15000 lines per inch \n", "N1 = 15000; //15000 lines per inch\n", "a1_plus_b1 = (2.54/N1)*10^8 ; //grating element in A\n", "lambda1 = 5890; //Wavelength in A\n", "lambda2 = 5895.9 ; // Wavelength in A\n", "deltalambda1 = lambda2-lambda1; //in A\n", "//For first order\n", "n =1;\n", "theta1 = 20.355; // in degrees\n", "deltatheta1 = ((n*deltalambda1)/((a1_plus_b1)*cosd(theta1)));// dispersion in degrees/A\n", "rp1 = n*N1; // resolving power\n", "\n", "\n", "//(b)15000 lines per cm\n", "// 1 cm = 0.393701 inches, so We have 15000 lines per 0.393701 inches. \n", "//Therefore, For 1 inch we have 15000/0.393701 = 38099.979 or 38100 lines\n", "N2 = 38100 ; //38100 lines per inch\n", "a2_plus_b2 = (2.54/N2)*10^8 ; //grating element in A\n", "//For first order\n", "theta_1 = asind((n*lambda1)/(a2_plus_b2));// in degrees\n", "deltatheta_1 = ((n*deltalambda1)/((a2_plus_b2)*cosd(theta_1)));// dispersion in degrees/A\n", "rp2 = n*15000; // resolving power\n", "\n", "\n", "//(c)5906 lines per cm\n", "// 1 cm = 0.393701 inches, so We have 5906 lines per 0.393701 inches. \n", "//Therefore, For 1 inch we have 5906/0.393701 = 15001.232 or 15001 lines\n", "N3 = 15001; //15001 lines per inch\n", "a3_plus_b3 = (2.54/N3)*10^8; //grating element in A\n", "//For first order\n", "theta__1 = asind((n*lambda1)/(a3_plus_b3)); // in degrees\n", "deltatheta__1 = ((n*deltalambda1)/((a3_plus_b3)*cosd(theta__1))); // dispersion in degrees/A\n", "rp3 = n*5906; // resolving power\n", "\n", "printf(' Number of lines \tGrating element (in A)\t Angle of diffraction(degrees)\t Dispersion (degrees/A) \t Resolving Power\n');\n", "printf('%d /inch\t\t\t %.0f\t\t %.2f \t\t\t\t %.2f x 10^-3\t\t\t %d\n',N1,a1_plus_b1,theta1,deltatheta1*10^3,rp1);\n", "printf('%d /cm\t\t\t %.0f\t\t %.2f \t\t\t\t %.2f x 10^-3\t\t\t %d\n',15000,a2_plus_b2,theta_1,deltatheta_1*10^3,rp2);\n", "printf('%d /cm\t\t\t %.0f\t\t %.2f \t\t\t\t %.2f x 10^-3\t\t\t %d\n',5906,a3_plus_b3,theta__1,deltatheta__1*10^3,rp3);\n", "// Error in textbook for dispersion values . Error in decimal point placement ." ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 4.9: Determination_of_separation_of_lines.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "clc();\n", "clear;\n", "//Given:\n", "//Wavelength\n", "n=1; // first order diffraction\n", "lambda1 = 4680 ;// Wavelength in A\n", "lambda2 = 4800; //Wavelength in A\n", "lambda3 = 5770 ; // Wave;ength in A\n", "// First order diffraction angle\n", "theta1 = 28.0; // angle in degrees\n", "theta2 = 28.7; // angle in degrees\n", "theta3 = 35.5; //angle in degrees\n", "//Grating equation : (a+b) = n*lambda/sin(theta) \n", "a1_plus_b1 = (n*lambda1)/sind(theta1); //spacing in A\n", "a2_plus_b2 = (n*lambda2)/sind(theta2); //spacing in A\n", "a3_plus_b3 = (n*lambda3)/sind(theta3); //spacing in A\n", "mean_spacing = (a1_plus_b1 + a2_plus_b2 + a3_plus_b3)/3; // mean spacing in A \n", "printf('(a)Wavelength :%d A \n Angle of 1st order Diffraction : %.1f degrees \n Spacing = %.1f A\n\n',lambda1,theta1,a1_plus_b1);\n", "printf('(b)Wavelength :%d A \n Angle of 1st order Diffraction : %.1f degrees \n Spacing = %.1f A\n\n',lambda2,theta2,a2_plus_b2);\n", "printf('(c)Wavelength :%d A \n Angle of 1st order Diffraction : %.1f degrees \n Spacing = %.1f A\n\n',lambda3,theta3,a3_plus_b3);\n", "printf('Mean Spacing = %.1f A',mean_spacing);" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }