#import modules
import math
from __future__ import division
#Variable declaration
V=20000; #applied voltage(V)
#Calculation
lamda=12.25/(math.sqrt(V)); #de broglie wavelength(angstrom)
#Result
print "de broglie wavelength is",round(lamda,3),"angstrom"
#import modules
import math
from __future__ import division
#Variable declaration
V=5000; #applied voltage(V)
e=1.602*10**-19; #the charge on electron(C)
m=9.12*10**-31; #mass of electron(kg)
d=2.04*10**-10; #distance(m)
n=1;
#Calculation
p=math.sqrt(2*m*e*V); #momentum(kg m/s)
lamda=12.25/math.sqrt(V); #de broglie wavelength(angstrom)
v=1/(lamda*10**-10); #wave number
theta=math.asin((n*lamda*10**-10)/(2*d)); #Bragg angle(radian)
theta=theta*180/math.pi; #Bragg angle(degrees)
#Result
print "momentum is",round(p/1e-23,2),"*10^-23 kg m/s"
print "de broglie wavelength is",round(lamda,3),"angstrom"
print "the wave number is",round(v/10**10,2),"*10^10"
print "the Bragg angle is",round(theta,2),"degrees"
print "answers given in the book varies due to rounding off errors"
#import modules
import math
from __future__ import division
#Variable declaration
V=54; #applied voltage(V)
e=1.602*10**-19; #the charge on electron(C)
m=9.12*10**-31; #mass of electron(kg)
h=6.625*10**-34; #Plank's constant
#Calculation
v=math.sqrt(2*e*V/m); #velocity of electron(m/s)
lamda=12.25/math.sqrt(V); #de broglie wavelength(angstrom)
u=h/(2*m*lamda*10**-10); #phase velocity(m/s)
#Result
print "velocity of electron is",round(v/1e+6,2),"*10^6 m/s"
print "de broglie wavelength is",round(lamda,2),"angstrom"
print "phase velocity is",round(u/1e+6,2),"*10^6 m/s"
#import modules
import math
from __future__ import division
#Variable declaration
e=1.6*10**-19; #the charge on electron(C)
m=9.12*10**-31; #mass of electron(kg)
c=3*10**8; #speed of light(m/s)
h=6.625*10**-34; #Plank's constant
#Calculation
E=m*c**2; #rest energy(J)
mp=1836*m; #mass of proton(kg)
#(0.5*m*v^2)=E
mv=math.sqrt(E*2*mp); #momentum(kg m/s)
lamda=h/mv; #de broglie wavelength(m)
#Result
print "de broglie wavelength is",round(lamda*10**10,4),"Angstrom"
#import modules
import math
from __future__ import division
#Variable declaration
e=1.6*10**-19; #the charge on electron(C)
m=1.676*10**-27; #mass of neutron(kg)
c=3*10**8; #speed of light(m/s)
h=6.625*10**-34; #Plank's constant
#Calculation
E=1; #in eV
E=1*e; #in V
mv=math.sqrt(2*E*m); #momentum(kg m/s)
lamda=h/mv; #de broglie wavelength(m)
#Result
print "de broglie wavelength is",round(lamda*10**10,3),"Angstrom"
#import modules
import math
from __future__ import division
#Variable declaration
lamda=0.09; #wavelength(Angstrom)
D=54; #scattering angle(degree)
h=6.625*10**-34; #Plank's constant
c=3*10**8; #speed of light(m/s)
e=1.6*10**-19; #the charge on electron(C)
#Calculation
dlamda=0.0243*(1-math.cos(D));
lamda1=lamda+dlamda; #Wavelength of scattered X-rays(Angstrom)
Ei=h*c/(lamda*10**-10); #Energy of incident photon(J)
Es=h*c/(lamda1*10**-10); #Energy of scattered photon(J)
#Result
print "wavelength of scattered X-rays is",round(lamda1,1),"Angstrom"
print "Energy of incident photon is",round(Ei/(e*10**6),3),"MeV"
print "Energy of scattered photon is",round(Es/(e*10**6),4),"MeV"
print "answer for energy of scattered photon given in the book varies due to rounding off errors"
#import modules
import math
from __future__ import division
#Variable declaration
h=6.625*10**-34; #Plank's constant
m=9.12*10**-31; #mass of electron(kg)
#Calculation
#for 1st quantum state
nx=1;
ny=1;
nz=1;
L=1;
E1=h**2*(nx**2+ny**2+nz**2)/(8*m*L**2); #energy in first quantum state(J)
#for 2nd quantum state (nx^2+ny^2+nz^2)=6
L=1;
E=h**2*6/(8*m*L**2); #energy in second quantum state(J)
#Result
print "energy in first quantum state is",round(E1/1e-37,3),"*10^-37 J"
print "energy in second quantum state is",round(E/1e-37,2),"*10^-37 J"
#import modules
import math
from __future__ import division
#Variable declaration
h=6.625*10**-34; #Plank's constant
m=9.12*10**-31; #mass of electron(kg)
L=2.5*10**-10; #width of square(m)
e=1.6*10**-19; #the charge on electron(C)
n1=1;
n2=2;
n3=3;
#Calculation
E1=n1**2*h**2/(8*m*L**2*e); #1st lowest quantum energy(eV)
E2=n2**2*E1; #2nd lowest quantum energy(eV)
E3=n3**2*E1; #3rd lowest quantum energy(eV)
#Result
print "the lowest 3 quantum energies are",int(E1),"eV,",int(E2),"eV and",int(E3),"eV"