#importing modules
import math
from __future__ import division
#Variable declaration
theta=6*10**-3 #Angular Width
D=1 #Distance of Screen
#Calculations
Totalangularwidth=2*theta
tlw=Totalangularwidth*D*10**2
#Result
print"The Total Linear Width of central maxima is",tlw,"cm"
#importing modules
import math
from __future__ import division
#Variable declaration
e=0.14 #width of the slit
y=1.6 #Distance of center of dark band from middle of central bright band
n=2 #no. of dark band
D=2 #Distance from the slit
#Calculations
lambdaa=((e*y)/(D*n))*10**5
#Result
print"The Wavelength is %i"%lambdaa,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-8 #Wavelength
theta=30 #Angular Width
#Calculations
thetarad=math.radians(theta)
sinetheta=math.sin(thetarad)
e=(lambdaa)/(sinetheta)
#Result
print"The Width of the slit is ",e,"cm"
#importing modules
import math
from __future__ import division
#Variable declaration
y=5*10**-3 #First Minima
D=2 #Distance of screen
e=0.2*10**-3 #Slit width
#Calculations
lambdaa=((e*y)/D)*10**10
#Result
print"The Wavelength is %i"%lambdaa,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
y=0.005 #First Minima
D=1 #Distance of screen
e=0.5*10**-2 #Slit width
#Calculations
yd=(y/D)
sinyd=(math.sin(yd))
lambdaa1=((e*sinyd)/4)*10**9
lambdaa2=((e*sinyd)/5)*10**9
#Result
print"The Wavelengths are %4.0f" %lambdaa1,"Angstrom & %4.0f"%lambdaa2,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
n=2 #order of spectral line
theta=30 #Angular Width
invde=5000 #Inverse of diffraction element
#Calculations
thetarad=math.radians(theta)
sinetheta=math.sin(thetarad)
lambdaa=((sinetheta)/(n*invde))*10**8
#Result
print"The Wavelength is %i"%lambdaa,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-8 #Wavelength
invde=6000 #Diffraction element inverse
#Calculations
sinetheta1=lambdaa*invde
sinetheta3=lambdaa*invde*3
theta1=math.degrees(math.asin(sinetheta1))
theta3=math.degrees(math.asin(sinetheta3))
deltheta=theta3-theta1
#Result
print"The Angular Difference is %2.1f"%deltheta,"Degrees"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-8 #Wavelength
invde=(2620/2.54) #Diffraction element inverse
#Calculations
n=(1/(lambdaa*invde))
#Result
print"The orders visible would be %i"%n
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa1=4000*10**-8 #Wavelength1
lambdaa2=7000*10**-8 #Wavelength2
invde=4000 #Diffraction element inverse
#Calculations
n1=(1/(lambdaa1*invde))
n2=(1/(lambdaa2*invde))
#Result
print"The orders visible will be from %i"%n2,"to %i"%n1,"order Spectrum"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-8 #Wavelength
theta=30 #Angular Width
#Calculations
thetarad=(math.radians(theta))
invde=((2*lambdaa)/(math.sin(thetarad)))**-1
#Result
print" The number of line cm in grating is",invde
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=6000*10**-8 #Wavelength
sinetheta=(3/4) #Angular Width
n=4
#Calculations
gratingele=((n*lambdaa)/sinetheta)
#Result
print" The grating element is",gratingele,"cm"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=6000*10**-8 #Wavelength
n=3
invde=200 #inverse of diffraction element
#Calculations
sinetheta=(n*lambdaa*invde)
thetarad=math.asin(sinetheta)
theta=math.degrees(thetarad)
#Result
print" The Angle of Diffraction is %1.2f"%theta,"degrees"
#Note:The second part of problem is theoretical and hence is not solved
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-10 #Wavelength
theta=30 #Angular Width
dtheta=0.01
#Calculations
thetarad=(math.radians(theta))
dlambda=((lambdaa*math.cos(thetarad))/(math.sin(thetarad)))*10**8
#Result
print" The difference between the two wavelengths is %2.1f"%dlambda,"Angstrom"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5000*10**-8 #Wavelength
N=40000 #Grating lines
de=12.5*10**-5 #Diffraction element
#Calculations
RPmax=((de*N)/lambdaa)
#Result
print" The Maximum resolving power is %i"%RPmax,"or 10**5"
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5890 #Wavelength
dlambdaa=6 #Difference in wavelengths
n=2 #order
#Calculations
N=((lambdaa)/(n*dlambdaa))
#Result
print" The Minimum number of lines in the grating are %3.0f"%N
#importing modules
import math
from __future__ import division
#Variable declaration
lambdaa=5896 #Wavelength
N=60000 #Total Number of lines in 10 cm
n1=2 #order
n2=3 #order
#Calculations
RP=n1*N
dlambda=((lambdaa)/(n2*N))
#Result
print" (a)The resolving power in second order is",RP
print" (b) The smallest wavelength that can be resolved in the 3rd order in 5896 Angstrom wavelength region is %0.4f"%dlambda,"Angstrom"