#Varaible declaration
c = 3*10**8 #velocity of air(m/s)
m = 1.67*10**-27 #mass of proton(kg)
h = 6.626*10**-34 #Planck's constant(J x sec)
#Calculation
v = c/10. #velocity of proton(m/s)
lamda = h/(m*v)
#Result
print "The de Brogile wavelength is",round((lamda/1E-14),3),"*10^-14 m"
import math
#Varaible declaration
V = 400 #potential(V)
#Calculation
lamda = 12.26/math.sqrt(V)
#Result
print "The de Brogile wavelength is",lamda,"A"
import math
#Varaible declaration
E = 0.025 #kinetic energy of neutron(eV)
m = 1.674*10**-27 #mass of neutron(kg)
h = 6.626*10**-34 #Planck's constant(J x sec)
#Calculations
E_j = E*1.6*10**-19 #converting eV to joules
lamda = h/math.sqrt(2*m*E_j)
#Result
print "The de Brogile wavelength is",round((lamda/1E-11),3),"*10^-11 m"
import math
#Varaible declaration
V = 1600 #potential(V)
#Calculation
lamda = 12.26/math.sqrt(V)
#Result
print "The de Brogile wavelength is",lamda,"A"
#Varaible declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
L = 0.1*10**-9 #length of each side of box(m)
#For lowest energy level,
nx = 1
ny = 1
nz = 1
#Calculations
E1 = (((h**2)*(nx**2+ny**2+nz**2))/(8*m*L**2))/(1.6*10**-19)
#Result
print "The lowest energy of electron is",round(E1,2),"eV"
#Variable declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
L = 0.1*10**-9 #length of each side of box(m)
#For level next to lowest energy level,
nx = 1
ny = 1
nz = 2
#Calculations
E1 = (((h**2)*(nx**2+ny**2+nz**2))/(8*m*L**2))/(1.6*10**-19)
#Result
print "The lowest energy of electron is",round(E1,2),"eV"
#Variable declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
E = 2000. #energy of electron(eV)
#Calculations
Ej = E*1.6*10**-19 #converting eV to joules
lamda = h/math.sqrt(2*m*Ej)
#Result
print "The de Brogile wavelength is",round((lamda/1E-9),4),"nm"
#Variable declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
L = 4*10**-10 #length of each side of box(m)
#For minimum energy
n = 1
#Calculations
E1 = ((h**2)*(n**2))/(8*m*L**2)
#Result
print "Minimum energy =",round((E1/1E-18),3),"*10^-18 J"
#Variable declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
L = 1*10**-10 #length of each side of box(m)
n1 = 10 #For energy in ground state
n2 = 2 #For energy in first excited state
n3 = 3 #For energy in second excited state
#Calculations
E1 = ((h**2)*(n1**2))/(8*m*L**2)
E2 = ((h**2)*(n2**2))/(8*m*L**2)
E3 = ((h**2)*(n3**2))/(8*m*L**2)
#Results
print "Energy in ground state =",round((E1/1E-17),4),"*10^17 J (Calculation mistake in textbook)"
print "Energy in first excited state =",round((E2/1E-17),4),"*10^17 J"
print "Energy in second excited state =",round((E3/1E-17),4),"*10^17 J"
#Variable declaration
h = 6.626*10**-34 #Planck's constant(J x sec)
m = 9.1*10**-31 #mass of electron(kg)
lamda = 1.66*10**-10 #wavelength(m)
#Calculations
v = h/(m*lamda)
KE = (m*v**2)/(2*1.6*10**-19) #in joules
#Result
print "Velocity of electron =",round((v/1E+7),4),"*10^7 m"
print "Kinetic energy of electron =",round(KE,2),"eV"
import math
#Varaible declaration
V = 15*10**3 #potential(V)
#Calculation
lamda = 12.26/math.sqrt(V)
#Result
print "The de Brogile wavelength is",round(lamda,2),"A"
import math
#Varaible declaration
V = 344 #potential(V)
theta = 60 #glancing angle(degrees)
#Calculation
lamda = 12.26/math.sqrt(V)
#For first reflection
n = 1
d = (n*lamda)/(2*math.sin(math.radians(theta)))
#Result
print "The interatomic spacing of the crystal is",round(d,4),"A"