# 4: Elements of Statistical Mechanics and Principles of Quantum Mechanics¶

## Example number 1, Page number 4-41¶

In [6]:
#importing modules
import math
from __future__ import division

#Variable declaration
new=5.6*10**12;    #frequency(Hz)
h=6.625*10**-34;   #plank constant
kB=1.38*10**-23;   #boltzmann constant
T=330;             #temperature(K)

#Calculation
x=h*new/(kB*T);
E=h*new/(math.exp(x)-1);     #average energy of oscillator(joule)

#Result
print "average energy of oscillator is",round(E*10**21,3),"*10**-21 joule"
print "answer given in the book varies due to rounding off errors"

average energy of oscillator is 2.948 *10**-21 joule
answer given in the book varies due to rounding off errors


## Example number 2, Page number 4-41¶

In [8]:
#importing modules
import math
from __future__ import division

#Variable declaration
h=6.63*10**-34;   #plank constant
kB=1.38*10**-23;  #boltzmann constant
T=1500;           #temperature(K)
c=3*10**8;        #velocity of light(m/sec)
lamda=6000*10**-10;   #wavelength(m)

#Calculation
new=c/lamda;
x=h*new/(kB*T);
y=math.exp(x)-1;     #average energy of oscillator(joule)
Ulamda=8*math.pi*h*new/(y*lamda**4);    #energy density per unit wavelength(Jm-4)

#Result
print "energy density per unit wavelength is",round(Ulamda,2),"Jm-4"
print "answer given in the book is wrong"

energy density per unit wavelength is 7.13 Jm-4
answer given in the book is wrong


## Example number 3, Page number 4-41¶

In [9]:
#importing modules
import math
from __future__ import division

#Variable declaration
e=1.6*10**-19;    #charge(c)
m=9.1*10**-31;    #mass(kg)
h=6.63*10**-34;   #plank constant
E=2000;            #energy(eV)

#Calculation
lamda=h/math.sqrt(2*m*E*e);    #wavelength(m)

#Result
print "wavelength is",round(lamda*10**9,4),"nm"

wavelength is 0.0275 nm


## Example number 4, Page number 4-42¶

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
lamda=1.66*10**-10;    #wavelength(m)
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E=h**2/(2*m*e*lamda**2);   #kinetic energy(eV)
v=h/(m*lamda);      #velocity(m/s)

#Result
print "velocity is",round(v*10**-4,1),"*10**4 m/s"
print "kinetic energy is",round(E,2),"eV"
print "answer for energy given in the book is wrong"

velocity is 438.9 *10**4 m/s
kinetic energy is 54.78 eV
answer for energy given in the book is wrong


## Example number 5, Page number 4-42¶

In [18]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=1*10**-10;    #length(m)
n2=2;
n3=3;
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #ground state energy(eV)
E2=n2**2*E1;      #energy of 1st excited state(eV)
E3=n3**2*E1;      #energy of 2nd excited state(eV)

#Result
print "ground state energy is",round(E1,4),"eV"
print "energy of 1st excited state is",round(E2,2),"eV"
print "energy of 2nd excited state is",round(E3,4),"eV"

ground state energy is 37.7377 eV
energy of 1st excited state is 150.95 eV
energy of 2nd excited state is 339.6395 eV


## Example number 6, Page number 4-43¶

In [19]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=4*10**-10;    #length(m)
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #minimum energy(eV)

#Result
print "minimum energy is",round(E1,4),"eV"

minimum energy is 2.3586 eV


## Example number 7, Page number 4-43¶

In [21]:
#importing modules
import math
from __future__ import division

#Variable declaration
V=15*10**3;    #accelerated voltage(V)

#Calculation
lamda=1.227/math.sqrt(V);    #wavelength of electron waves(nm)

#Result
print "wavelength of electron waves is",round(lamda,2),"nm"

wavelength of electron waves is 0.01 nm


## Example number 8, Page number 4-43¶

In [24]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=0.05*10**-9;    #length(m)
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #minimum energy(eV)

#Result
print "minimum energy is",round(E1,2),"eV"

minimum energy is 150.95 eV


## Example number 9, Page number 4-44¶

In [35]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=3*10**-10;    #length(m)
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #minimum energy(eV)

#Result
print "minimum energy is",round(E1,1),"eV"

minimum energy is 4.2 eV


## Example number 10, Page number 4-44¶

In [30]:
#importing modules
import math
from __future__ import division

#Variable declaration
me=9.1*10**-31;    #mass(kg)
h=6.63*10**-34;   #plank constant
mn=1.676*10**-27;    #mass(kg)

#Calculation
lamdan=h*10**9/math.sqrt(4*mn*me);     #de broglie wavelength(nm)

#Result
print "de broglie wavelength is",int(lamdan),"nm"

de broglie wavelength is 8488 nm


## Example number 11, Page number 4-44¶

In [42]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=2*10**-10;    #length(m)
n2=2;
n4=4;
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #minimum energy(eV)
E2=n2**2*E1;      #energy of 1st excited state(eV)
E4=n4**2*E1;      #energy of 2nd excited state(eV)

#Result
print "ground state energy is",round(E1,2),"eV"
print "energy of 1st excited state is",round(E2,3),"eV"
print "energy of 2nd excited state is",round(E4,2),"eV"
print "answers for energy of 1st and 2nd states given in the book are wrong"

ground state energy is 9.43 eV
energy of 1st excited state is 37.738 eV
energy of 2nd excited state is 150.95 eV
answers for energy of 1st and 2nd states given in the book are wrong


## Example number 12, Page number 4-45¶

In [44]:
#importing modules
import math
from __future__ import division

#Variable declaration
n=1;
e=1.6*10**-19;    #charge(c)
m=9.1*10**-31;    #mass(kg)
h=6.63*10**-34;   #plank constant
V=344;            #energy(eV)

#Calculation
d=h*10**10/(2*math.sin(theta)*math.sqrt(2*m*V*e));    #spacing of crystal(angstrom)

#Result
print "spacing of crystal is",round(d,3),"angstrom"

spacing of crystal is 0.382 angstrom


## Example number 13, Page number 4-45¶

In [47]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=1*10**-10;    #length(m)
n3=3;
m=9.11*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #ground state energy(eV)
E3=n3**2*E1;      #energy of 2nd excited state(eV)
E=E3-E1;          #energy required to pump an electron(eV)

#Result
print "ground state energy is",round(E1,3),"eV"
print "energy of 2nd excited state is",round(E3,2),"eV"
print "energy required to pump an electron is",round(E,2),"eV"
print "answer given in the book is wrong"

ground state energy is 37.696 eV
energy of 2nd excited state is 339.27 eV
energy required to pump an electron is 301.57 eV
answer given in the book is wrong


## Example number 14, Page number 4-46¶

In [48]:
#importing modules
import math
from __future__ import division

#Variable declaration
L=2*10**-10;    #length(m)
m=9.1*10**-31;    #mass(kg)
e=1.6*10**-19;    #charge(c)
h=6.63*10**-34;   #plank constant

#Calculation
E1=h**2/(8*m*e*L**2);    #minimum energy(eV)

#Result
print "minimum energy is",round(E1,2),"eV"

minimum energy is 9.43 eV


## Example number 15, Page number 4-46¶

In [52]:
#importing modules
import math
from __future__ import division

#Variable declaration
V=1600;    #accelerated voltage(V)

#Calculation
lamda=1.227*10/math.sqrt(V);    #wavelength of electron waves(angstrom)

#Result
print "wavelength of electron waves is",round(lamda,2),"angstrom"

wavelength of electron waves is 0.31 angstrom