#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"
#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"
#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"
#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"
#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)
#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
#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"
#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"
#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"
#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"
#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"