5: Diffraction

Example number 5.1, Page number 86

In [3]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=1;
lamda=600*10**-9;                 #wavelength(m)
theta=35;                          #angle at which first minimum falls(degrees)

#Calculation                        
theta=theta*math.pi/180;      #angle at which first minimum falls(radian)
d=((n*lamda)/math.sin(theta))*10**6;      #width of the slit(micro m)

#Result
print "The width of the slit is",round(d,2),"micro m"
The width of the slit is 1.05 micro m

Example number 5.2, Page number 86

In [5]:
#importing modules
import math
from __future__ import division

#Variable declaration
D=0.95;                          #distance of the screen from the slit(m)
lamda=589*10**-9;                #wavelength(m)
d=0.5*10**-3;                     #width of the slit(m)

#Calculation                        
y=((2*D*lamda)/d)*10**3;         #width of a central band(mm)

#Result
print "The width of the central band is",round(y,2),"mm"
The width of the central band is 2.24 mm

Example number 5.3, Page number 86

In [8]:
#importing modules
import math
from __future__ import division

#Variable declaration
D=1.1;                        #distance of the screen from the slit(m)
lamda=589*10**-9;             #wavelength(m)
y=4.5*10**-3;                  #distance of first minimum on either side of central maximum(m)

#Calculation                        
d=((D*lamda)/y)*10**3         #slit width(mm)

#Result
print "The slit width is",round(d,3),"mm"
The slit width is 0.144 mm

Example number 5.4, Page number 86

In [11]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=4;
lamda=589.6*10**-9;                  #wavelength(m)
D=0.95;                              #distance of the screen from the slit(m)
w=0.28*10**-3;                        #width of the slit(m)

#Calculation                        
d=((n*lamda*D)/w)*10**3;     #distance between centres(mm)

#Result
print "The distance between centres of central maximum and the fourth dark fringe is",int(d),"mm"
The distance between centres of central maximum and the fourth dark fringe is 8 mm

Example number 5.5, Page number 86

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
s=5*math.pi/2;                           #secondary maximum

#Calculation                        
I=(math.sin(s)/s)**2;                      #I2/I0

#Result
print "Ratio of intensities of central & second secondary maximum is",round(I,3)
Ratio of intensities of central & second secondary maximum is 0.016

Example number 5.6, Page number 86

In [16]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=450*10**-9;                  #wavelength(m)
n=2;
dlambda=1*10**-9;                   #difference in wavelength(m)

#Calculation                        
N=lamda/(n*dlambda);               #minimum number of lines per cm 

#Result
print "The minimum number of lines per cm is",N/2
The minimum number of lines per cm is 112.5

Example number 5.7, Page number 86

In [22]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=1;
lamda=650*10**-9;                       #wavelength(m)
d=2*10**-6;                              #width of the slit(m)

#Calculation                        
theta=math.asin((n*lamda)/d);                #angle at which first minimum will be observed(radian)
theta=theta*180/math.pi;      #angle at which first minimum will be observed(degrees)

#Result
print "The angle at which first minimum will be observed is",round(theta,3),"degrees"
The angle at which first minimum will be observed is 18.966 degrees

Example number 5.8, Page number 87

In [24]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=600*10**-9;                           #wavelength(m)
y=2*10**-3;                                 #width of the central band(m)
D=1;                                       #distance of the screen from the slit(m)

#Calculation                        
d=((2*D*lamda)/y)*10**3;                    #slit width(mm)

#Result
print "The slit width is",d,"mm"
The slit width is 0.6 mm

Example number 5.9, Page number 87

In [27]:
#importing modules
import math
from __future__ import division

#Variable declaration
y=6*10**-3;                     #first minimum is observed(m)
d=90*10**-6;                    #slit width(m)
D=0.98;                        #distance of the screen from the slit(m)

#Calculation                        
lamda=((y*d)/D)*10**9;           #wavelength(nm)

#Result
print "The wavelength of light used is",int(lamda),"nm"
The wavelength of light used is 551 nm

Example number 5.10, Page number 87

In [41]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=1;
lambda1=450*10**-9;                   #wavelength of first spectral line(m)
d=1/5000;                    #number of lines

#Calculation                        
theta1=math.asin((n*lambda1)/d);    
theta1=round(theta1*10**2*180/math.pi);
theta2=theta1+2.97;
theta2=theta2*math.pi/180;
lambda2=d*math.sin(theta2)/n;    #wavelength of second spectral line(nm)

#Result
print "The wavelength of second spectral line is",int(lambda2*10**7),"nm"
The wavelength of second spectral line is 550 nm

Example number 5.11, Page number 87

In [45]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=3;
lamda=700*10**-9;              #wavelength(m)
theta=90;         #angle(degrees)

#Calculation                        
theta=theta*math.pi/180;     #angle(radian)
d=n*lamda/math.sin(theta);    #grating element(m)

#Result
print "The minimum grating element required to observe the entire third order spectrum is",d*10**6,"*10**-6 m"
The minimum grating element required to observe the entire third order spectrum is 2.1 *10**-6 m