# Chapter 2: Diffraction of Light¶

## Example 2.2.1, Page number 2-10¶

In :
import math

#Variable declaration
theta = 30          #angle(degrees)
n = 1
lamda = 6500*10**-8 #wavelength(cm)

#Calculations
a = (n*lamda)/math.sin(theta*math.pi/180)

#Result
print "a =",a/1e-4,"*10^-4 cm"

a = 1.3 *10^-4 cm


## Example 2.2.2, Page number 2-10¶

In :
import math

#Variable declaration
a = 6*10**-4        #width of slit(cm)
n = 1               #first order
lamda = 6000*10**-8 #wavelength(cm)

#Calculations
def deg_to_dms(deg):
d = int(deg)
md = abs(deg - d) * 60
m = int(md)
sd = (md - m) * 60
sd=round(sd,2)
return [d, m, sd]

theta = (math.asin((n*lamda)/a))*180/math.pi
d = 2*theta   #angular seperation

#Result
print "Angular seperation between the 1st order minima is",deg_to_dms(d)

Angular seperation between the 1st order minima is [11, 28, 42.03]


## Example 2.2.3, Page number 2-11¶

In :
import math

#Variable declaration
n1 = 2       #for second minimum
n2 = 3       #for third minimum
lamda = 4000 #wavelength(A)

#Calculations
'''For 2nd order,
a sin0 = n1*lamda

For 3rd order,
a sin0 = n2*lamda'''

lamda = (n2*lamda)/n1

#Result
print "Wavelength =",lamda,"A"

Wavelength = 6000 A


## Example 2.2.4, Page number 2-11¶

In :
import math

#Variable declaration
a = 0.16*10**-3      #width of slit(cm)
n = 1                #first order
lamda = 5600*10**-10 #wavelength(cm)

#Calculations
def deg_to_dms(deg):
d = int(deg)
md = abs(deg - d) * 60
m = int(md)
sd = (md - m) * 60
sd=round(sd,2)
return [d, m, sd]

theta = (math.asin((n*lamda)/a))*180/math.pi

#Result
print "Half angular width=",deg_to_dms(theta)

Half angular width= [0, 12, 1.93]


## Example 2.2.5, Page number 2-11¶

In :
import math

#Variable declaration
a = 12*10**-5        #width of slit(cm)
n = 1                #first order
lamda = 6000*10**-8  #wavelength(cm)

#Calculations
theta = (math.asin((n*lamda)/a))*180/math.pi

#Result
print "Half angular width=",(theta),"degrees"

Half angular width= 30.0 degrees


## Example 2.2.6, Page number 2-12¶

In :
import math

#Variable declaration
a = 2*10**-6         #width of slit(cm)
n = 1                #first order
lamda = 6500*10**-10 #wavelength(cm)

#Calculations
theta = (math.asin((n*lamda)/a))*180/math.pi

#Result
print "Angle theta =",round(theta,2),"degrees"

Angle theta = 18.97 degrees


## Example 2.3.1, Page number 2-16¶

In :
#Variable declaration
a = 0.16  #width(mm)
b = 0.8   #distance(mm)

#Calculations & Results
m = ((a+b)/a)

for n in range(1,4):
print "m =",m*n


m = 6.0
m = 12.0
m = 18.0


## Example 2.4.1, Page number 2-24¶

In :
#Variable declaration
lamda1 = 5*10**-5 #cm
lamda2 = 7*10**-5 #cm
a_plus_b = 1./4000 #cm

#Calculations
m_max1 = a_plus_b/lamda1
m_max2 = round((a_plus_b/lamda2),1)

#Results
print m_max2,"orders are visible for 7000 A and",m_max1,"orders for 5000 A and either",m_max2,",4 or",m_max1,"for intermediate wavelengths"

3.6 orders are visible for 7000 A and 5.0 orders for 5000 A and either 3.6 ,4 or 5.0 for intermediate wavelengths


## Example 2.4.2, Page number 2-24¶

In :
#Variable declaration
theta = 30   #angle of diffraction(degrees)
lamda1 = 5400*10**-8  #cm
lamda2 = 4050*10**-8  #cm

#Calculations
m = lamda2/(lamda1-lamda2)
a_plus_b = (m*lamda1)/math.sin(theta*math.pi/180)
N = 1/a_plus_b

#Result
print "Number of lines per cm =",round(N,2)

Number of lines per cm = 3086.42


## Example 2.4.3, Page number 2-25¶

In :
#Variable declaration
lamda = 4992 #A
m1 = 3       #for 3rd order
m2 = 4       #for 4th order

#Calculations
'''For m = 3,
(a+b)sin0 = 3*lamda

For m = 4,
(a+b)sin0 = 4*lamda'''

l = (m2*lamda)/m1

#Results
print "Wavelength =",l,"A"

Wavelength = 6656 A


## Example 2.4.4, Page number 2-25¶

In :
#Variable declaration
lamda = 6328*10**-8 #wavelength(cm)
m1 = 1
m2 = 2
a_plus_b = 1./6000  #cm

#Calculations
theta1 = math.asin((m1*lamda)/a_plus_b)*180/math.pi
theta2 = math.asin((m2*lamda)/a_plus_b)*180/math.pi

#Result
print "01 =",round(theta1,2),"degrees"
print "02 =",round(theta2,2),"degrees"

01 = 22.31 degrees
02 = 49.41 degrees


## Example 2.4.5, Page number 2-26¶

In :
import math

#Variable declaration
m = 2              #2nd order
lamda = 5*10**-5   #wavelength(cm)
theta = 30

#Calculations
a_plus_b = (m*lamda)/math.sin(theta*math.pi/180)
N = 1/a_plus_b

#Result
print "The number of lines/cm of the grating surface is",N

The number of lines/cm of the grating surface is 5000.0


## Example 2.4.6, Page number 2-26¶

In :
import math

#Variable declaration
m = 3              #3rd order
a_plus_b = 1./7000 #no. of lines/cm
sin0 = 1

#Calculation
lamda = (a_plus_b*sin0)/m

#Result
print "Wavelength =",round(lamda/1e-8),"A"

Wavelength = 4762.0 A


## Example 2.4.7, Page number 2-26¶

In :
import math

#Variable declaration
m = 1                 #1st order
lamda = 6560*10**-8   #wavelength(cm)
theta = 16+12./60

#Calculations
a_plus_b = (m*lamda)/math.sin(theta*math.pi/180)
N = 1/a_plus_b
w = 2*N

#Result
print "The total number of lines is",round(w)

The total number of lines is 8506.0


## Example 2.4.8, Page number 2-27¶

In :
import math

#Variable declaration
m = 1                 #1st order
lamda = 6.56*10**-5   #wavelength(cm)
theta = 18+14./60

#Calculations
a_plus_b = (m*lamda)/math.sin(theta*math.pi/180)
N = 1/a_plus_b
w = 2*N

#Result
print "The total number of lines is",round(w,1)

The total number of lines is 9539.3


## Example 2.4.9, Page number 2-27¶

In :
#Variable declaration
lamda = 6*10**-5    #wavelength(cm)
a_plus_b = 1./5000  #cm

#Calculations
m_max = a_plus_b/lamda

#Result
print "Order =",round(m_max)

Order = 3.0


## Example 2.4.10, Page number 2-28¶

In :
#Variable declaration
lamda = 6000*10**-8    #wavelength(cm)
a_plus_b = 1./5000     #cm

#Calculations
m_max = a_plus_b/lamda

#Result
print "m_max =",round(m_max)

#The rest of the solution is theoretical

m_max = 3.0


## Example 2.4.11, Page number 2-28¶

In :
import math

#Variable declaration
m = 1                 #1st order
lamda = 5790*10**-8   #wavelength(cm)
theta = 19.994

#Calculations
a_plus_b = (m*lamda)/math.sin(theta*math.pi/180)
N = 1/a_plus_b
w = 2.54*N

#Result
print "The total number of lines is",round(w)

The total number of lines is 15000.0


## Example 2.6.1, Page number 2-31¶

In :
import math

#Varaible declaration
n = 3000./0.5           #no. of lines per cm
m = 2                   #for 2nd order
lamda1 = 5893*10**-8    #wavelength(cm)
lamda2 = 5896*10**-8    #wavelength(cm)

#Calculations
a_plus_b = 1/n
theta1 = math.degrees(math.asin((2*lamda1)/(a_plus_b)))
theta2 = math.degrees(math.asin((2*lamda2)/(a_plus_b)))
d = theta2-theta1       #angular seperation
N = lamda1*10**8/(m*3)

#Result
print "Since N=",round(N),"which is smaller than 3000 lines, the two lines will be resolved in the second order"

Since N= 982.0 which is smaller than 3000 lines, the two lines will be resolved in the second order


## Example 2.6.2, Page number 2-32¶

In :
import math

#Varaible declaration
m = 3          #for 3rd order
lamda = 481    #wavelength(nm)
n = 620        #no. of ruling per mm
w = 5.05       #width(mm)

#Calculations
N = n*w
dl = lamda/(m*N)

#Result
print "Smallest wavelength interval =",round(dl,4),"nm"

Smallest wavelength interval = 0.0512 nm


## Example 2.6.3, Page number 2-33¶

In :
import math

#Varaible declaration
m = 2          #for 2nd order
lamda = 5890   #wavelength(A)
dl = 6         #A
n = 500.       #no. of lines per cm

#Calculations
N = lamda/(dl*m)
W = N/n

#Result
print "Least width =",W,"cm"

Least width = 0.98 cm


## Example 2.6.4, Page number 2-33¶

In :
#Varaible declaration
N = 3*5000               #no. of lines per cm
a_plus_b = 1./5000       #cm
lamda = 5890*10**-8 #wavelength(cm)

#Calculations
m_max = round(a_plus_b/lamda)
RP = m_max*N

#Result
print "Maximum value of resolving power =",RP

Maximum value of resolving power = 45000.0


## Example 2.6.5, Page number 2-34¶

In :
#Varaible declaration
m = 2          #for 2nd order
lamda = 5890   #wavelength(A)
dl = 6         #A
w = 3.         #width of a line(cm)

#Calculations
lamda2 = lamda+dl
N = lamda/(dl*m)

a_plus_b = w/N

#Results
print "The minimum no. of lines a grating must have is",N
print "The grating element is",round(a_plus_b/1e-3,2),"*10^-3 cm"

The minimum no. of lines a grating must have is 490
The grating element is 6.12 *10^-3 cm


## Example 2.6.6, Page number 2-34¶

In :
#Varaible declaration
N = 40000   #no. of lines per cm
m = 2       #for 2nd order

#Calculations
RP = m*N

#Result
print "Maximum value of resolving power =",RP

Maximum value of resolving power = 80000