# Chapter 2: Diffraction of light¶

## Example 2.1,Page number 2-30¶

In [6]:
import math

#Given Data:
m=4       #order
N=1./5000*10**-2    #N=(a+b) grating element(cm)

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
#for longest wavelength, sin(theta)=1
lamda=(N/m)     #longest wavelength
print"The longest wavelength is =" ,lamda,"m"

The longest wavelength is = 5e-07 m


## Example 2.2,Page number 2-30¶

In [22]:
import math

#Given Data:
m=1                #order
lamda=6.5*10**-7      #Wavelength of red light
theta=30*3.142/180   #angle of diffraction

#Calculations:

#We know, a*sin(theta)=m*lamda
a=m*lamda/math.sin(theta)   #width of slit
print"width of slit is = ",a,"m"

width of slit is =  1.29984715296e-06 m


## Example 2.3,Page number 2-31¶

In [7]:
import math

#Given Data:
m=1                #order
lamda=4*10**-7        #Wavelength of light
a=10**-6            #width of slit

#Calculations:

#We know, a*sin(theta)=m*lamda
theta=math.asin(m*lamda/a)*180/3.142    #angular position in first minima
print"angular position in first minima is =",theta,"degrees"

angular position in first minima is = 23.5751216716 degrees


## Example 2.4,Page number 2-31¶

In [8]:
import math

#Given Data:
m=1                 #order
lamda1=4*10**-7       #Wavelength of light
lamda2=7*10**-7       #Wavelength of light
n=1./6000*10**-2       #n=(a+b) grating element

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
theta1=math.asin(m*lamda1/n)*(180/3.142)   #angle of diffraction
theta2=math.asin(m*lamda2/n)*(180/3.142)   #angle of diffraction
d=theta2-theta1                  #angular breadth of first order visible spectrum
print"angular breadth of first order visible spectrum is = ",d,"degrees"

angular breadth of first order visible spectrum is =  10.9466277612 degrees


## Example 2.5,Page number 2-31¶

In [1]:
import math

#Given Data:
m=1                         #order
lamda=6.56*10**-7           #Wavelength of red light
theta=18.25*math.pi/180    #angle of diffraction
W=2*10**-2                 #width of grating

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
N=math.sin(theta)/(m*lamda)   #N-number of lines per m, N=1/(a+b)
Tn=N*W                     #Total number of lines on grating
print"Total number of lines on grating is =",Tn

Total number of lines on grating is = 9547.67702694


## Example 2.7,Page number 2-33¶

In [13]:
import math

#Given Data:
GE=2.54/15000*10**-2       #GE=(a+b) grating element
lamda1=4*10**-7            #Wavelength of light
lamda2=7*10**-7            #Wavelength of light

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
theta11=math.asin(1*lamda1/GE)*180/math.pi       #angular position of first minima for lamda1
theta12=math.asin(2*lamda1/GE)*180/math.pi       #angular position of second minima for lamda1
theta13=math.asin(3*lamda1/GE)*180/math.pi       #angular position of third minima for lamda1

theta21=math.asin(1*lamda2/GE)*180/math.pi       #angular position of first minima for lamda2
theta22=math.asin(2*lamda2/GE)*180/math.pi       #angular position of second minima for lamda2
theta23=math.asin(1)*180/math.pi                 #angular position of third minima for lamda2

print"Thus the angular position for lamda1 and lamda2 are as follows:"
print"First order:",theta11,"degrees"
print"",theta21,"degrees --Isolated"

print"Second order:",theta12,"degrees"
print"",theta22,"degrees --Overlap"

print"Third order: ",theta13,"degrees"
print"",theta23," degrees --Overlap "

Thus the angular position for lamda1 and lamda2 are as follows:
First order: 13.6635763633 degrees
24.4177053663 degrees --Isolated
Second order: 28.1928605617 degrees
55.7685229906 degrees --Overlap
Third order:  45.1261086702 degrees
90.0  degrees --Overlap


## Example 2.8,Page number 2-34¶

In [16]:
import math

#Given Data:
lamda=5.893*10**-7        #Wavelength of light
d=0.01*10**-2             #width of slit (a=d)
f=1                      #distance between screen and slit

#Calculations:
x=f*lamda/d              #separation between central maxima and first minima
print"Separation between central maxima and first minima is = ",x,"m"

 Separation between central maxima and first minima is =  0.005893 m


## Example 2.9,Page number 2-34¶

In [1]:
import math

#Given Data:
m=1                 #order
lamda=6*10**-7        #Wavelength of light
a=12*10**-7         #width of slit

#Calculations:

#We know, a*sin(theta)=m*lamda
theta=math.asin(m*lamda/a)*180/math.pi    #angular position in first minima
print"Half angular width of first maxima is =",theta,"Degrees"

Half angular width of first maxima is = 30.0 Degrees


## Example 2.10,Page number 2-34¶

In [19]:
import math

#Given Data:
lamda=6*10**-7          #Wavelength of light
a=0.02*10**-2           #width of slit (a=d)
f=2                    #distance between screen and slit

#Calculations:

#We know, a*sin(theta)=m*lamda, here m=1
theta=math.asin(lamda/a)*180*60/math.pi      #angular position in first minima (1 degree=60 minutes)
print"Total angular width is =",2*theta,"minutes"

x=f*lamda/a              #separation between central maxima and first minima
print"Linear width is = ",2*x,"m"

Total angular width is = 20.6265115646 minutes
Linear width is =  0.012 m


## Example 2.11,Page number 2-35¶

In [20]:
import math

#Given Data:
a=0.14*10**-3         #width of slit
n=2                   #order
y=1.6*10**-2          #separation between second dark band and central bright band
D=2                   #distance between screen and slit

#Calculations:

theta=y/D            #from diagram

#We know, a*sin(theta)=n*lamda
#here sin(theta)=theta
lamda=a*theta/n       #wavelength of light
print"wavelength of light is =",lamda,"m"

wavelength of light is = 5.6e-07 m


## Example 2.13,Page number 2-36¶

In [21]:
import math

#Given Data:
lamda=6.328*10**-7        #Wavelength of light
N=1./6000*10**-2           #N=(a+b) grating element

#Calculations:

#We know, N*sin(theta)=m*lamda
theta1=math.asin(1*lamda/N)*180/math.pi    #angular position in first order maxima,m=1
print"Angular position in first order maxima is =",theta1,"Degrees"

theta2=math.asin(2*lamda/N)*180/math.pi    #angular position in second order maxima,m=2
print"Angular position in second order maxima is = ",theta2,"Degrees"

Angular position in first order maxima is = 22.3138625335 Degrees
Angular position in second order maxima is =  49.4078093436 Degrees


## Example 2.14,Page number 2-37¶

In [9]:
import math

#Given Data:
lamda1=6*10**-7         #wavelength of yellow light
lamda2=4.8*10**-7       #wavelength of blue light
theta=(math.asin(3/4))    #angle of diffraction

#Calculations:

#for consecutive bands, n*lamda1=(n+1)*lamda2. thus,
n=lamda2/(lamda1-lamda2)   #order

#We know, (a+b)*sin(theta)=m*lamda
N=n*lamda1/(3./4)    #N=(a+b) grating element
print"Grating element (a+b) is =",N,"m"

Grating element (a+b) is = 3.2e-06 m


## Example 2.15.1,Page number 2-54¶

In [7]:
import math

#Given Data:
a=0.2*10**-3          #width of slit
n=1                   #order
y=0.5*10**-2          #separation between first minima and central bright band
D=2                   #distance between screen and slit

#Calculations:

theta=y/D            #from diagram

#We know, a*sin(theta)=n*lamda
#here sin(theta)=theta
lamda=a*theta/n       #wavelength of light
print"wavelength of light is = ",lamda,"m"

wavelength of light is =  5e-07 m


## Example 2.15.2,Page number 2-55¶

In [20]:
import math

#Given Data:
lamda1=5.4*10**-7              #Wavelength of light
lamda2=4.05*10**-7             #Wavelength of light
theta=30*math.pi/180          #angle of diffraction

#Calculations:
#We know, (a+b)*sin(theta)=n*lamda
#n*lamda1=(n+1)*lamda2, we get
n=3
N=math.sin(theta)/(n*lamda1)*10**-2      #Number of lines per m= 1/(a+b)*10^-2
print"Number of lines per cm is = ",N

Number of lines per cm is =  3086.41975309


## Example 2.15.4,Page number 2-56¶

In [21]:
import math

#Given Data:
GE=1./6000*10**-2               #GE=(a+b) grating element
lamda1=5.893*10**-7             #Wavelength of light
lamda2=5.896*10**-7             #Wavelength of light
m=2                             #order

#Calculations:
theta1=math.asin(m*lamda1/GE)*180/math.pi     #angular position in first minima
theta2=math.asin(m*lamda2/GE)*180/math.pi     #angular position in second minima

a_s=(theta2-theta1)            #Angular separation in minutes
print"Angular separation is =",a_s,"Degrees"

dlamda=lamda2-lamda1            #difference in wavelength
lamda=(lamda2+lamda1)/2         #Mean wavelength

#We know that R.P.=lamda/dlamda=m*N
N=lamda/dlamda/m                 #Number of lines on grating for first order
print"Number of lines on grating for first order is =",N
print"But, number of lines per cm on grating is 6000. \n Which is greater than number of lines per cm needed for resolution."
print"Hence, both lines will be well resolved in 2nd order."

Angular separation is = 0.0291798772234 Degrees
Number of lines on grating for first order is = 982.416666667
But, number of lines per cm on grating is 6000.
Which is greater than number of lines per cm needed for resolution.
Hence, both lines will be well resolved in 2nd order.


## Example 2.17,Page number 2-39¶

In [26]:
import math

#Given Data:
d=0.04*10**-2       #Separation between slits
D=1.7              #distance between screen and slit
B=0.25*10**-2       #Fringe spacing

#Calculations:
#We know,B=D*lamda/d
lamda=B*d/D         #Wavelength of light
print"Wavelength of light is = ",lamda,"m"

#The condition for missing order is,
#(a+b)/a = m/n
b=0.04*10**-2       #Separation in slits
a=0.08*10**-3       #Slit width
n=(a+b)/a          #missing orders for m=1,2,3

n1=1*n
n2=2*n
n3=3*n
print"Missing orders are =",n1,",",n2,",",n3

Wavelength of light is =  5.88235294118e-07 m
Missing orders are = 6.0 , 12.0 , 18.0


## Example 2.18,Page number 2-39¶

In [2]:
import math

#Given Data:
N=2.54/2620*10**-2     #N=(a+b) grating element
lamda=5*10**-7           #Wavelength of red light

#Calculations:

#We know, (a+b)*sin(theta)=n*lamda
#maximum value of sin(theta)=1
n=N/lamda               #Maximum number of orders visible
print"Maximum number of orders visible is =",n

Maximum number of orders visible is = 19.3893129771


## Example 2.19,Page number 2-40¶

In [5]:
import math

#Given Data:
N=1./4000*10**-2       #N=(a+b) grating element
lamda1=5*10**-7         #Wavelength of light
lamda2=7.5*10**-7       #Wavelength of light

#Calculations:

#We know, (a+b)*sin(theta)=n*lamda
#maximum value of sin(theta)=1
n1=N/lamda1               #Maximum number of orders visible
n2=N/lamda2               #Maximum number of orders visible
print"The observed number of orders range between =",n2,"to",n1

The observed number of orders range between = 3.33333333333 to 5.0


## Example 2.20,Page number 2-40¶

In [6]:
import math

#Given Data:
n=5                #order
lamda=6*10**-7     #Wavelength of light

#Calculations:
#We know, a*sin(theta)=n*lamda
#n*lamda=n1*lamda1
lamda1=n*lamda/4        #for n1=4
print"For n1=4 wavelength is =",lamda1,"m"

lamda2=n*lamda/5        #for n1=5
print"For n1=5 wavelength is =",lamda2,"m"

lamda3=n*lamda/6        #for n1=6
print"For n1=5 wavelength is =",lamda3,"m"

lamda4=n*lamda/7        #for n1=7
print"For n1=5 wavelength is =",lamda4,"m"

lamda5=n*lamda/8        #for n1=8
print"For n1=5 wavelength is =",lamda5,"m"

print"So,in the grating spectrum spectrum lines with wavelengths n1=6 and n1=7 will coincide with fifth order line of 6*10^-7 m"

For n1=4 wavelength is = 7.5e-07 m
For n1=5 wavelength is = 6e-07 m
For n1=5 wavelength is = 5e-07 m
For n1=5 wavelength is = 4.28571428571e-07 m
For n1=5 wavelength is = 3.75e-07 m
So,in the grating spectrum spectrum lines with wavelengths n1=6 and n1=7 will coincide with fifth order line of 6*10^-7 m


## Example 2.21,Page number 2-41¶

In [13]:
import math

#Given Data:
GE=18000*10**-10         #GE=(a+b) grating element
lamda=5*10**-7             #Wavelength of red light

#Calculations:
DP1=1./sqrt(GE**2-lamda**2)*10**-10        #Dispersive power
print"Dispersive power for first order is =",DP1,"rad/Angstrom"

m=3
DP2=1/sqrt((GE/m)**2-lamda**2)*10**-10    #Dispersive power
print"Dispersive power for second order is =",DP2,"rad/Angstrom"

Dispersive power for first order is = 5.78314931966e-05 rad/Angstrom
Dispersive power for second order is = 0.000301511344578 rad/Angstrom


## Example 2.22,Page number 2-42¶

In [15]:
import math

#Given Data:
N=2.54/15000*10**-2      #N=(a+b) grating element
lamda=5.9*10**-7         #Wavelength of light
m=2                      #order
f=25*10**-2              #focal length of lens

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
theta=math.asin(m*lamda/N)      #angular position in first minima

ld=f*Ad*10**-8                 #linear dispersion (dx/dl) in cm/angstrom
print"Linear dispersion in spectrograph is =",ld,"cm/angstrom"

dlamda=(5896-5890)               #difference in wavelength
dx=ld*dlamda*10**-2              #separation between spectral lines in meter
print"Separation between spectral lines is =",dx,"m"

Linear dispersion in spectrograph is = 0.00411696586101 cm/angstrom
Separation between spectral lines is = 0.00024701795166 m


## Example 2.23,Page number 2-47¶

In [16]:
import math

#Given Data:
m=1                              #order
lamda1=5.89*10**-7               #Wavelength of light
lamda2=5.896*10**-7              #Wavelength of light

#Calculations:
dlamda=lamda2-lamda1                #difference in wavelength
lamda=(lamda2+lamda1)/2             #Mean wavelength

#We know that R.P.=m*N=lamda/dlamda
N=lamda/dlamda/m                  #minimum number of lines which will just resolve
print"Minimum number of lines which will just resolve is =",N

Minimum number of lines which will just resolve is = 982.166666667


## Example 2.24,Page number 2-47¶

In [19]:
import math

#Given Data:
N=5*5000           #N=W/(a+b) Number of lines on grating
m=2               #order
lamda=6*10**-7    #Wavelength of light

#Calculations:
#(i)
RP=m*N             #Resolving power
print"(i)Resolving power is =",RP

#(ii)
#We know that R.P.=lamda/dlamda
dlamda=lamda/RP       #Smallest wavelength which can be resolved
print"(ii)Smallest wavelength which can be resolved is =",dlamda,"m"

(i)Resolving power is = 50000
(ii)Smallest wavelength which can be resolved is = 1.2e-11 m


## Example 2.25,Page number 2-48¶

In [22]:
import math

#Given Data:
GE=1./4000*10**-2         #GE=(a+b) grating element
lamda=5*10**-7             #Wavelength of red light
m=3                      #order

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
theta=math.asin(m*lamda/GE)    #ngular position in first minima

DP=m/(GE*math.cos(theta))*10**-2     #Dispersive power
print"Dispersive power is =",DP

Dispersive power is = 15000.0


## Example 2.26,Page number 2-48¶

In [23]:
import math

#Given Data:
m=2                  #order
lamda=6*10**-7       #Wavelength of light
dlamda=6*10**-10     #difference in wavelength
W=2*10**-2           #Width of surface

#Calculations:

#We know that R.P.=lamda/dlamda=m*N
N=lamda/dlamda/m     #Number of lines on grating
GE=W/N               #Grating element=(a+b)
print"Grating element is =",GE,"cm"

Grating element is = 4e-05 cm


## Example 2.27,Page number 2-49¶

In [25]:
import math

#Given Data:
m=2                           #order
lamda1=5.77*10**-7            #Wavelength of light
lamda2=5.791*10**-7           #Wavelength of light
GE=1./6000*10**-2             #GE=(a+b) grating element

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
theta1=math.asin(m*lamda1/GE)*180/math.pi      #angular position in first minima
theta2=math.asin(m*lamda2/GE)*180/math.pi      #angular position in second minima

a_s=(theta2-theta1)*60         #Angular separation in minutes
print"Angular separation is = ",a_s,"minutes"

Angular separation is =  12.0270825521 minutes


## Example 2.28,Page number 2-49¶

In [26]:
import math

#Given Data:
n=1                 #order
lam=5.89*10**-7     #Wavelength of light
a=0.3*10**-3        #width of slit

#Calculations:

#We know, a*sin(theta)=n*lamda
theta1=math.asin(n*lamda/a)*180/math.pi*60    #angular position in first dark band in minutes
print"Angular position in first dark band is = ",theta1,"mimutes"

#We know,for bright band   a*sin(theta)=(2n+1)*lamda/2
theta2=math.asin(1.5*lamda/a)*180/math.pi*60    #angular position in first bright band in minutes
print"Angular position in first bright band is =",theta2,"minutes"

Angular position in first dark band is =  6.87549812524 mimutes
Angular position in first bright band is = 10.3132557823 minutes


## Example 2.29,Page number 2-50¶

In [28]:
import math

#Given Data:
GE=2.54/16000*10**-2      #GE=(a+b) grating element
lamda=6*10**-7             #Wavelength of light

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
#maximum value of sin(theta)=1
m=GE/lamda                 #Maximum order of spectra
print"Maximum order of spectra is =",m

Maximum order of spectra is = 2.64583333333


## Example 2.30,Page number 2-50¶

In [29]:
import math

#Given Data:
GE=1./5000*10**-2        #GE=(a+b) grating element
lamda=5.89*10**-7         #Wavelength of light
N=3*5000               #N=W/(a+b) Number of lines on grating

#Calculations:

#We know, (a+b)*sin(theta)=m*lamda
#maximum value of sin(theta)=1
m=GE/lamda               #Maximum order of spectra
print"Maximum order of spectra is =",m

RP=3*N                 #Resolving power (round of m to 3)
print"Resolving power is =",RP

Maximum order of spectra is = 3.39558573854
Resolving power is = 45000


## Example 2.32,Page number 2-52¶

In [30]:
import math

#Given Data:
lamda1=5.89*10**-7               #Wavelength of light
lamda2=5.896*10**-7              #Wavelength of light

#Calculations:
dlamda=lamda2-lamda1                #difference in wavelength
lamda=(lamda2+lamda1)/2             #Mean wavelength

#(i)
m1=1               #first order
#We know that R.P.=lamda/dlamda=m*N
N1=lamda/dlamda/m1      #Number of lines on grating
print"(i)Number of lines on grating for first order is =",N1

#(ii)
m2=2               #second order
#We know that R.P.=lamda/dlamda=m*N
N2=lamda/dlamda/m2    #Number of lines on grating
print"(ii)Number of lines on grating for second order is =",N2

(i)Number of lines on grating for first order is = 982.166666667
(ii)Number of lines on grating for second order is = 491.083333333


## Example 2.33,Page number 2-52¶

In [31]:
import math

#Given Data:
m=1                    #order
lamda=6.553*10**-7     #Wavelength of light
dlamda=1.8*10**-10     #difference in wavelength

#Calculations:

#We know that R.P.=lam/dlam=m*N
N=lamda/dlamda/m        #Number of lines on grating
print"Number of lines on grating is =",N

Number of lines on grating is = 3640.55555556


## Example 2.34,Page number 2-53¶

In [32]:
import math

#Given Data:
lamda1=5.14034*10**-7               #Wavelength of light
lamda2=5.14085*10**-7               #Wavelength of light

#Calculations:
dlamda=lamda2-lamda1                #difference in wavelength
lamda=(lamda2+lamda1)/2             #Mean wavelength

#We know that R.P.=lamda/dlamda=m*N
N=lamda/dlamda/1       #Number of lines on grating
print"Number of lines on grating for first order is =",N

#Hence R.P. for second order should be
RP1=2*N
print"Resolving power in second order should be is= ",RP1

#But here,

lamda3=8.03720*10**-7               #Wavelength of light
lamda4=8.03750*10**-7               #Wavelength of light
dlamda2=lamda4-lamda3               #difference in wavelength
lamda2=(lamda4+lamda3)/2            #Mean wavelength

RP2=lamda2/dlamda2
print"Resolving power in second order is= ",RP2

print"So, the grating will not be able to resolve 8.0372*10^-7 and 8.03750*10^-7 in second order."
print"Because Resolving power is greter than actual Resolving power."

Number of lines on grating for first order is = 10079.5980392
Resolving power in second order should be is=  20159.1960784
Resolving power in second order is=  26791.1666667
So, the grating will not be able to resolve 8.0372*10^-7 and 8.03750*10^-7 in second order.
Because Resolving power is greter than actual Resolving power.


## Example 2.35,Page number 2-53¶

In [33]:
import math

#For grating , Condition of maxima is (a+b)sin(theta)=n*lamda
#Given (a+b) < 2*lamda
#For maximum order, sin(90)=1
#So, n must be less than 2
#i.e. only first order possible if width of grating element is less than twice the wavelength
print"Hence, Only first order possible if width of grating element is less than twice the wavelength."

Hence, Only first order possible if width of grating element is less than twice the wavelength.


## Example 2.36,Page number 2-54¶

In [35]:
import math

#Given Data:
n=1                 #order
lamda=5.89*10**-7   #Wavelength of light
a=0.3*10**-3        #width of slit

#Calculations:

#We know, a*sin(theta)=n*lamda
theta1=math.asin(n*lam/a)*180/math.pi    #angular position in first dark band
print"Angular position in first dark band is =",theta1,"Degrees"

#We know,for bright band   a*sin(theta)=(2n+1)*lamda/2
theta2=math.asin(1.5*lamda/a)*180/math.pi    #angular position in first bright band
print"Angular position in first bright band is =",theta2,"Degrees"

Angular position in first dark band is = 0.112490786047 Degrees
Angular position in first bright band is = 0.168736314576 Degrees