import math
##Example 13.1
##calculation of rate of flow of photons
##given values
l=5893*10**-10;##wavelength of light in m
P=40.;##power of sodium lamp in W
d=10;##distance from the source in m
s=4*math.pi*d**2;##surface area of radius in m**2
c=3*10**8.;##velocity of light in m/s
h=6.626*10**-34;##Planck's constant in Js
##calculation
E=P*1.;##
print'%s %.2f %s'%('total energy emitted per second(in Joule)is',E,'');
n=E*l/(c*h);##total no of photons
R=n/s;
print'%s %.2e %s'%('rate of flow of photons per unit area (in /m^2) is',R,'')
import math
##Example 13.2
##calculation of threshold wavelength and stopping potential
##given values
l=2000.;##wavelength of light in armstrong
e=1.6*10**-19.;##charge of electron
W=4.2;##work function in eV
c=3*10**8.;##velocity of light in m/s
h=6.626*10**-34.;##Planck's constant in Js
##calculation
x=12400/(W);##h*c=12400 eV
print'%s %.2f %s'%('threshold wavelength(in Armstrong)is',x,'');
Vs=(12400/l-W);##
print'%s %.2f %s'%('stopping potential (in VOLTS) is',Vs,'')
import math
##Example 13.3
##calculation of momentum of X-ray photon undergoing scattering
##given values
alpha=60*math.pi/180.;##scattering angle in radian
e=1.6*10**-19;##charge ofelectrone
W=12273.;##work function in eV
c=3*10**8;##velocity of light in m/s
h=6.626*10**-34.;##Planck's constant in Js
hc=12400.;##in eV
m=9.1*10**-31##restmass of photon in kg
##calculation
x=hc/(W);##wavelength of photon undergoing modofied scattering in armstrong
y=x-(h/(m*c))*(1-math.cos(alpha));
p=h/y*10**10.;
print'%s %.3e %s'%('momentum of photon(in kg-m/s) is',p,'');
import math
##Example 13.4
##calculation of wavelength of scattered radiation and velocity of recoiled electron
##given values
alpha=30*math.pi/180.;##scattering angle in radian
e=1.6*10**-19.;##charge ofelectron
x=1.372*10**-10.;##wavelength of incident radiation in m
c=3*10**8;##velocity of light in m/s
h=6.626*10**-34;##Planck's constant in Js
m=9.1*10**-31##rest mass of photon in kg
hc=12400.;##in eV
##calculation
y=((x+(h/(m*c))*(1-math.cos(alpha))))*10**10;
print'%s %.2f %s'%('wavelength of scattered radiation(in armstrong)is',y,'');
x1=x*10**10;##converting incident wavelength into armstrong
KE=hc*e*((1/x1)-(1/y));##kinetic energy in Joule
print'%s %.3e %s'%('kinetic energy in joule is ',KE,'');
v=math.sqrt(2.*KE/m);
print'%s %.2f %s'%('velocity of recoiled electron (in m/s^2)is',v,'');
import math
##Example 13.5
##calculation of wavelength of light emitted
##given values
e=1.6*10**-19;##charge of electrone
c=3*10**8;##velocity of light
h=6.626*10**-34;##Planck's constant in Js
E1=5.36;##energy of first state in eV
E2=3.45;##energy of second state in eV
##1)calculation
l=h*c*10**10/((E1-E2)*e);
print'%s %.2f %s'%('wavelength of scattered light(in Armstrong)is',l,'');
import math
##Example 13.6
##calculation of de Broglie wavelength
##1)given values
e=1.6*10**-19.;
h=6.626*10**-34.;##Planck's constant in Js
V=182.;##potential difference in volts
m=9.1*10**-31;##mass of e in kg
##1)calculation
l=h/math.sqrt(2.*e*m*V);
print'%s %.3e %s'%('de Brogliewavelength (in m)is',l,'');
##2)given values
m1=1.;##mass of object in kg
v=1.;##velocity of object in m/s
l1=h/(m1*v);
print'%s %.3e %s'%('debrogie wavelength of object in m) is',l1,'');
import math
##Example 13.7
##calculation of uncertainty in position
##1)given values
h=6.626*10**-34;##Planck's constant in Js
v1=220;##velocity of e in m/s
m=9.1*10**-31;##mass of e in kg
A=0.065/100.;##accuracy
##1)calculation
v2=v1*A;##uncertainty in speed
x1=h/(2*math.pi*m*v2);##
print'%s %.4f %s'%('uncertainty in position of e (in m)is',x1,'');
##2)given values
m1=150/1000.;##mass of object in kg
x2=h/(2*math.pi*m1*v2);
print'%s %.3e %s'%('uncertainty in position of baseball(in m) is',x2,'');
import math
##Example 13.8
##calculation of energy states of an electron and grain of dust and comparing
##1)given values
L1=10*10**-10;##width of potential well in which e is confined
L2=.1*10**-3;##width of potential well in which grain of dust is confined
h=6.626*10**-34;##Planck's constant in Js
v1=10**6;##velocity of garin of dust in m/s
m1=9.1*10**-31;##mass of e in kg
m2=10**-9;##mass of grain in kg
##1)calculation
Ee1=1**2*h**2./(8.*m1*L1**2.);##first energy state of electron
print'%s %.3e %s'%('first energy state of e is ',Ee1,'');
Ee2=2**2*h**2/(8*m1*L1**2);##second energy state of electron
print'%s %.3e %s'%('second energy state of e is ',Ee2,'');
Ee3=3**2*h**2/(8*m1*L1**2);##third energy state of electron
print'%s %.3e %s'%('third energy state of e is ',Ee3,'');
print('Energy levels of an electron in an infinite potential well are quantised and the energy difference between the successive levels is quite large.Electron cannot jump from one level to other on strength of thermal energy.Hence quantization of energy plays a significant role in case of electron')
Eg1=1**2*h**2/(8.*m2*L2**2.);##first energy state of grain of dust
print'%s %.3e %s'%('first energy state of grain of dust is ',Eg1,'');
Eg2=2**2*h**2/(8.*m2*L2**2.);##second energy state of grain of dust
print'%s %.3e %s'%('second energy state of grain of dust is ',Eg2,'');
Eg3=3**2*h**2/(8.*m2*L2**2.);##third energy state of grain of dust
print'%s %.3e %s'%('third energy state of grain of dust is ',Eg3,'');
KE=m2*v1**2/2.;##kinetic energy of grain of dust;
print'%s %.2f %s'%('kinetic energy of grain of dust is',KE,'');
print('The energy levels of a grain of dust are so near to each other that they constitute a continuum.These energy levels are far smaller than the kinetic energy possessed by the grain of dust.It can move through all these energy levels without an external supply of energy.Thus quantization of energy levels is not at all significant in case of macroscopic bodies.')