from math import *
# Given
E = 1000 # energy of electron in eV
delta_x = 1e-10 # error in position in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
p = sqrt(2 * m * E * e)
delta_p = h / (4 * pi * delta_x)
P = (delta_p / p) * 100
#Result
print "Percentage of uncertainty in momentum is %.1f%%"%P
from math import *
# Given
E = 500 # energy of electron in eV
delta_x = 2e-10 # error in position in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
p = sqrt(2 * m * E * e)
delta_p = h / (4 * pi * delta_x)
P = (delta_p / p) * 100
#Result
print "Percentage of uncertainty in momentum is %.2f%%"%P
from math import *
# Given
delta_lambda = 1e-6 # accuracy in wavelength of its one part
lamda = 1e-10 # wavelength of x-ray in m
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_x = lamda / (4 * pi * delta_lambda)
#Result
print "Uncertainty in position is %.2f micrometer"%(delta_x*10**6)
from math import *
# Given
delta_x = 1e-10 # error in position in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_p = h / (4 * pi * delta_x)
#Result
print "Uncertainty in momentum is %.2e kg m/sec"%delta_p
from math import *
# Given
M = 5.4e-26 # momentum of electron in kg-m/sec
p = 0.05 # percentage accuracy in momentum
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_m = p * M / 100
delta_x = h / (4 * pi * delta_m)
#Result
print "Uncertainty in position is %.3f micrometer"%(delta_x * 10**6)
from math import *
# Given
r = 0.53e-10 # radius of hydrogen atom in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_M = h / (4 * pi * r)
delta_k = delta_M**2 / (2 * m)
#Result
print "Minimum energy of electron is %.3e J"%delta_k
from math import *
# Given
v = 5e3 # speed of electron in m/sec
a = 0.003 # percentage accuracy in measurement of speed
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_v = v * a / 100
delta_p = m * delta_v
delta_x = h / (4 * pi * delta_p)
#Result
print "Uncertainty in determining the position of electron is %.3e m"%delta_x
from math import *
# Given
v = 6.6e4 # speed of electron in m/sec
a = 0.01 # percentage accuracy in measurement of speed
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.6e-34 # Planck constant in J-sec
#Calculations
delta_v = v * a / 100
delta_p = m * delta_v
delta_x = h / (4 * pi * delta_p)
#Result
print "Uncertainty in determining the position is %.2e m"%delta_x
from math import *
# Given
v = 3e7 # speed of electron in m/sec
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
h = 6.62e-34 # Planck constant in J-sec
c = 3e8 # speed of light in m/sec
#Calculations
delta_p = m * v / sqrt(1 - (v/c)**2)
delta_x = h / (4 * pi * delta_p)
#Result
print "Uncertainty in determining the position is %.2e m"%delta_x
from math import pi
# Given
t = 2.5e-14 # life time of hydrogen atom in exited state in sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_E = h / (4 * pi * t)
#Result
print "Minimum error in measurement of the energy is %.2e J"%delta_E
from math import *
# Given
t = 10**-8 # life time of atom in exited state in sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_f = 1 / (4 * pi * t)
#Result
print "Minimum uncertainty in frequency is %.2e sec"%delta_f
from math import pi
# Given
delta_x = 20e-10 # uncertainty in position in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
m_ = 1.67e-27 # mass of proton in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
delta_v1 = h / (4 * pi * m * delta_x)
delta_v2 = h / (4 * pi * m_ * delta_x)
r = delta_v2 / delta_v1
#Result
print "Ratio of uncertainty in velocity of a proton and an electron is %.2e"%r
# Given
delta_x = 1e-10 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
n = 1 # for n=1
#Calculations
E = (n**2 * h**2) / (8 * m * delta_x**2)
n = 2 # for n=2
E_ = (n**2 * h**2) / (8 * m * delta_x**2)
#Result
print "Energy of electron - \nFor (n=1) energy is %.2e J\nFor (n=2) energy is %.2e J"%(E,E_)
# Given
l = 1e-10 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
n = 1 # for n=1
#Calculations
E = (n**2 * h**2) / (8 * m * l**2)
n = 2 # for n=2
E_ = (n**2 * h**2) / (8 * m * l**2)
d = E_ - E
#Result
print "Energy difference is %.2e J"%d
# Given
l = 3e-10 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
n = 1 # For n=1
#Calculations
E = (n**2 * h**2) / (8 * m * l**2)
n = 2 # For n=2
E_ = (n**2 * h**2) / (8 * m * l**2)
n = 3 # For n=3
E__ = (n**2 * h**2) / (8 * m * l**2)
#Result
print "Energy of electron -\nFor (n=1) is %.1e J\nFor (n=2) is %.2e J\nFor (n=3) is %.2e J"%(E,E_,E__)
# Given
l = 2.5e-10 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
n = 1 # for n=1
E = (n**2 * h**2) / (8 * m * l**2)
n = 2 # for n=2
E_ = (n**2 * h**2) / (8 * m * l**2)
#Result
print "Energy of electron -\nFor (n=1) is %.2e J\nFor (n=2) is %.3e J"%(E,E_)
# Given
l = 1e-14 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 1.67e-27 # mass of neutron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
n = 1 # for n=1
E = (h**2) / (8 * m * l**2)
#Result
print "Lowest energy of neutron confined in the nucleus is %.2e J"%E
# Given
l = 1e-10 # width of box in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.63e-34 # Planck constant in J-sec
#Calculations
n = 1 # for n=1
p1 = (n * h) / (2 * l)
E = (n**2 * h**2) / (8 * m * l**2)
n = 2 # for n=2
p2 = (n * h) / (2 * l)
E_ = (n**2 * h**2) / (8 * m * l**2)
#Result
print "Energy of electron -\nFor (n=1) is %.2e J\nFor (n=2) is %.2e J"%(E,E_)
print "\nMomentum of electron -\nFor (n=1) is %.3e kg-m/sec\nFor (n=2) is %.2e kg-m/sec"%(p1,p2)
# Given
l = 1e-10 # length of box in m
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
n = 1 # for n=1
E1 = (n**2 * h**2) / (8 * m * l**2)
lambda1 =2*l
n = 2 # for n=2
E2 = (n**2 * h**2) / (8 * m * l**2)
lambda2 =2*l/2
n = 3 # for n=3
E3 = (n**2 * h**2) / (8 * m * l**2)
lambda3 =2*l/3
#Results
print "Energy Eigen value of electron -\nFor (n=1) is %.2e J\nFor (n=2) is %.2e J\nFor (n=3) is %.2e J"%(E1,E2,E3)
print "\nde-Broglie wavelength of electron -\nFor (n=1) is %.f A\nFor (n=2) is %.f A \nFor (n=3) is %.3f A"%(lambda1*1e10,lambda2*1e10,lambda3*1e10)
# Given
E1 = 3.2e-18 # minimum energy possible for a particle entrapped in a one dimensional box in J
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
E1 = E1 / e # in eV
n = 2 # for n=2
E2 = n**2 * E1
n = 3 # for n=3
E3 = n**2 * E1
n = 4 # for n=4
E4 = n**2 * E1
#Result
print "Energy Eigen values -\nFor (n=2) for %.f eV\nFor (n=3) is %.f eV\nFor (n=4) is %.f eV"%(E2,E3,E4)
from math import *
# Given
l = 4e-10 # width of box in m
E = 9.664e-17 # energy of electron in J
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
n = 1 # for n=1
E1 = (n**2 * h**2) / (8 * m * l**2)
N = sqrt(E / E1)
p = ((N) * h) / (2 * l)
#Result
print "Order of exited state is %d\nMomentum of electron is %.2e kg-m/sec"%(N,p)
# Given
l = 10e-10 # width of box containing electron in m
E = 9.664e-17 # energy of electron in J
M = 0.001 # mass of glass marble in kg
l_ = 0.2 # width of box containing marble in m
e = 1.6e-19 # charge on an electron in C
m = 9.1e-31 # mass of electron in kg
c = 3e8 # speed of light in m/sec
h = 6.62e-34 # Planck constant in J-sec
#Calculations
# For electron
n = 1 # for n=1
E1 = (n**2 * h**2) / (8 * m * l**2)
E2 = 2**2* E1
E3 = 3**2 * E1
# For glass marble
E1_ = h**2/(8*M*l_**2)
E2_ = 2**2 * E1_
E3_ = 3**2 *E1_
#Result
print "\nEnergy levels of electron- \nFor (n=1) is %.2e J\nFor (n=2) is %.2e J\n For (n=3) is %.2e J"%(E1,E2,E3)
print "\nEnergy levels of marble- \nFor (n=1) is %.2e J\nFor (n=2) is %.2e J\nFor (n=3) is %.2e J"%(E1_,E2_,E3_)