#initiation of variable
from math import sin,pi
w=0.250; theta=26.3;n=1 # n=1 for hydrogen atom and rest all are given values
#calculation
d=n*w/(2*sin(theta*pi/180)); # bragg's law
#result
print "Hence the atomic spacing in nm is",round(d,3);
#initiation of variable
from math import pi,sin
I=120.0;r=0.1*10**-9;Eev=2.3 #I-intensity in W/m^2 r in m & E in electron volt
A=pi*r**2;K=1.6*10**-19; # A=area and K is conversion factor from ev to joules
#calculation
t= Eev*K/(I*A); #time interval
#result
print "The value of time interval was found out to be in sec is",round(t,3);
#initiation of variable
from math import pi,sin
w=650.0*10**-9;h=6.63*10**-34;c=3*10**8; #given values and constant taken in comfortable units
#calculation
E=h*c/w;
E1=E/(1.6*10**-19);
#result
print "The Energy of the electron in J ",E,"which is equivalent to in eV is ", round(E1,3);
print "The momentum of electron is p=E/c i.e is ", round(E1,3);
#part b
E2=2.40; #given energy of photon.
#calculation
w2=h*c*10**9/(E2*1.6*10**9); #converting the energy in to eV and nm
#result
print "The wavelength of the photon in m is",round(w2*10**28,0)
#initiation of variable
hc=1240.0; phi=4.52 #both the values are in eV
#calcualtion
w1=hc/phi;
#result
print "The cutoff wavelength of the tungsten metal in nm is ",round(w1,3);
#part b
w2=198.0; #given value of wavelength
#calculation
Kmax=(hc/w2)-phi;
#result
print 'The max value of kinetic energy in eV is',round(Kmax,3);
#part c
Vs=Kmax;
#result
print "The numerical value of the max kinetic energy is same as stopping potential in volts.Hence in V is",round(Vs,3);
#initiation of variable
T1=293.0; Kw=2.898*10**-3;
#calculation
w1=Kw/T1;
#result
print "The wavelength at which emits maximum radiation in um. is",round(w1*10**6,3);
#part b
w2=650.0*10**-9;
T2=Kw/w2;
#result
print 'The temperature of the object must be raised to in K. is',round(T2,3);
#part c
x=(T2/T1)**4;
#result
print "Thus the thermal radiation at higher temperature in times the room (lower) tempertaure. is",round(x,3);
#initiation of variable
#part a
from math import cos, sin, pi,atan
w1=0.24;wc=0.00243;theta=60.0; #given values w=wavelength(lambeda)
#calculation
w2=w1+(wc*(1-cos(theta*pi/180)));
#result
print "The wavelength of x-rays after scattering in nm is",round(w2,5);
#part b;
hc=1240;
E2=hc/w2;E1=hc/w1;
#result
print "The energy of scattered x-rays in eV is",round(E2,3);
#part c
K= E1-E2; #The kinetic energy is the difference in the energy before and after the collision;
print "The kinetic energy of the x-rays in eV is",round(K,3);
#part d
phi2=atan(E2*sin(theta*pi/180)/(E1-E2*cos(theta*pi/180)))
#result
print "The direction of the scattered eletron in degrees is",round(phi2*180/pi,3);