# Chapter 2 : Diffraction¶

## Example number 1 , Page number 46¶

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

#Variable declaration
m=1                      #first minimum
lamda=6000*10**-10       #waveleght

#Calculations
a=(m*lamda)/math.sin(theta)/10**-6

#Result
print"width of the slit a= %1.2f micro-m" %a

width of the slit a= 1.05 micro-m


## Example number 2 , Page number 46¶

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

#Variable declaration
m=1                      #first minimum
lamda=6500*10**-10       #waveleght
a=2*10**-6               #slit width

#Calculations
theta=math.degrees(math.asin((m*lamda)/a))

#Result
print"Angle of first minimum theta= %2.2f degrees" %theta

Angle of first minimum theta= 18.97 degrees


## Example number 3 , Page number 46¶

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

#Variable declaration
m=1                      #first minimum
a=90*10**-16             #slit width
y=6*10**-3               #distance from central maximum
D=0.98                   #Screen distance

#Calculations
lamda=(y*a)/D/10**-17*10**3

#Result
print"Wavelength of incident light lamda= %i Armstrong" %lamda

Wavelength of incident light lamda= 5510 Armstrong


## Example number 4 , Page number 46¶

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

#Variable declaration
a=2*10**-4               #slit width
lamda=6*10**-7           #waveleght

#Calculations
theta=math.asin(lamda/a)
TLW=4*theta/10**-2
theta1=math.asin(lamda/a)/10**-3

#Result
print"Total linear width= %1.1f cm" %TLW
print"angular position of the minima= %i*10**-3 radian" %theta1

Total linear width= 1.2 cm
angular position of the minima= 3*10**-3 radian


## Example number 5 , Page number 47¶

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

#Variable declaration
n1=1
n2=2
lamda=6000*10**-8          #waveleght
N=6000                     #number of lines for diffraction grating

#Calculations
theta1=math.degrees(math.asin(n1*lamda*N))
theta2=math.degrees(math.asin(n2*lamda*N))

#Result
print"angle between 1st and 2nd order line is %2.2f degrees" %(theta2-theta1)

angle between 1st and 2nd order line is 24.95 degrees


## Example number 6 , Page number 47¶

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

#Variable declaration
lamda1=5890*10**-8         #waveleght
lamda2=5896*10**-8         #waveleght
N=6000                     #number of lines for diffraction grating

#Calculations
theta1=math.degrees(math.asin(2*lamda1*N))
theta2=math.degrees(math.asin(2*lamda2*N))

#Result
print"angular separation= %2.2f degrees" %(theta2-theta1)

angular separation= 0.06 degrees


## Example number 7 , Page number 48¶

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

#Variable declaration
lamda=5000*10**-8          #waveleght
N=4000                     #number of lines for diffraction grating
n=3                        #third order

#Calculations
theta=math.degrees(math.asin(n*lamda*N))

#Result
print"dispersive power in third order spectum= %2.2f degrees" %(theta)

dispersive power in third order spectum= 36.87 degrees


## Example number 8 , Page number 48¶

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

#Variable declaration
N=5000                     #number of lines for diffraction grating
n=2                        #second order

#Calculations
lamda=math.sin(theta2)/(n*N)/10**-5*10**3

#Result
print"wavelength lamda= %1.0f Armstrong" %lamda

wavelength lamda= 5000 Armstrong


## Example number 9 , Page number 48¶

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

#Variable declaration
lamda=5893*10**-8         #wavelenght
dlamda=6*10**-8
n=3                       #third order

#Calculations
N=lamda/(n*dlamda)

#Result
print"Number of grating lines= %0.1f" %N

Number of grating lines= 327.4


## Example number 10 , Page number 49¶

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

#Variable declaration
lamda=6.5*10**-7         #wavelenght
n=1                      #first order

#Calculations
d=(n*lamda)/math.sin(theta)/10**-6

#Result
print"Grating element= %1.3f*10**-6 m" %d

Grating element= 2.511*10**-6 m


## Example number 11 , Page number 49¶

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

#Variable declaration
lamda2=4992            #wavelenght

#Calculations
lamda=(4*lamda2)/3

#Result
print"lamda= %i Armstrong" %lamda

lamda= 6656 Armstrong


## Example number 12 , Page number 49¶

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

#Variable declaration
lamda1=5400*10**-10
n=3                     #third order

#Calculations
d=(n*lamda1)/math.sin(theta)*10**2/10**-4
N1=1/d/10**-1*10**3

#Result
print"Grating element= %1.2f*10**-4 cm" %d
print"Number of lines in 1 cm lenght of grating= %i" %N1

Grating element= 3.24*10**-4 cm
Number of lines in 1 cm lenght of grating= 3086