#importing modules
import math
from __future__ import division
#Variable declaration
m=1 #first minimum
lamda=6000*10**-10 #waveleght
theta=math.radians(35) #angle in radians
#Calculations
a=(m*lamda)/math.sin(theta)/10**-6
#Result
print"width of the slit a= %1.2f micro-m" %a
#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
#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
#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
#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)
#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)
#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)
#importing modules
import math
from __future__ import division
#Variable declaration
N=5000 #number of lines for diffraction grating
n=2 #second order
theta2=math.radians(30) #angle in radians
#Calculations
lamda=math.sin(theta2)/(n*N)/10**-5*10**3
#Result
print"wavelength lamda= %1.0f Armstrong" %lamda
#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
#importing modules
import math
from __future__ import division
#Variable declaration
lamda=6.5*10**-7 #wavelenght
n=1 #first order
theta=math.radians(15) #angle in radians
#Calculations
d=(n*lamda)/math.sin(theta)/10**-6
#Result
print"Grating element= %1.3f*10**-6 m" %d
#importing modules
import math
from __future__ import division
#Variable declaration
lamda2=4992 #wavelenght
#Calculations
lamda=(4*lamda2)/3
#Result
print"lamda= %i Armstrong" %lamda
#importing modules
import math
from __future__ import division
#Variable declaration
theta=math.radians(30) #angle in radians
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