Chapter 7:Statistical Thermodynamics

Example 7.1,Page number:193

In [3]:
N=20 				#no, of particles
N1=4 				#no. of particles in E1 energy level
N2=4 				#no. of particles in E2 energy level
N3=6 				#no. of particles in E3 energy level
N4=3 				#no. of particles in E4 energy level
N5=3 				#no. of particles in E5 energy level
import math
	
Nf=math.factorial(N) 
N1f=math.factorial(N1) 
N2f=math.factorial(N2) 
N3f=math.factorial(N3) 
N4f=math.factorial(N4) 
N5f=math.factorial(N5) 
n=N1f*N2f*N3f*N4f*N5f 
W=Nf/n 			#no. of ways of distributing
print"The no. of ways of distributing the particles is",W
The no. of ways of distributing the particles is 162954792000

Example 7.2,Page number:194

In [4]:
T=298.0 			#Temperature [K]
v=6.5*10**13 		#Frequency in [sec-1]
	#Consider zero point energy = 0.
h=6.627*10**-34 	#planck's constant[J.s]
k=1.381*10**-23 	#Boltzmann constant 
N=1.0 			#Since N=summation(gj*exp(-Ej/kT))

E1=h*v 			#for energy level 1[J]
E2=2*h*v 		#for energy level 2[J]
x=k*T 
g1=1.0 
g2=1.0 
import math
N1=(g1*math.exp(-E1/x)) #molecules present in energy level 1
N2=(g2*math.exp(-E2/x)) #molecules present in energy level 2
n1=N1/N 		#fraction of molecules present in energy level 1
n2=N2/N 		#fraction of molecules present in energy level 2
print"The fraction of molecule  s present in energy level 1 is",'{0:.7f}'.format(round(n1,7)) 


print"The fraction of molecules present in energy level 2 is",round(n2,10)   
The fraction of molecule  s present in energy level 1 is 0.0000285
The fraction of molecules present in energy level 2 is 8e-10

Example 7.3,Page number:194

In [5]:
dE=4.3*10**-20 			#difference in energy levels[J]
T1=0.000001 			#Initial Temperature[K](approximately zero , needed for 				execution)
T2=300 				#Final Temperature[K]
k=1.381*10**-23 		#Boltzmann constant [J/K]
import math
	
x1=k*T1 
r1=math.exp(-dE/x1) 
x2=k*T2 
r2=math.exp(-dE/x2) 
print"The ratio of no. of particles per state at 0K is",r1 
print"The ratio of no. of particles per state at 300K is",round(r2,6) 
The ratio of no. of particles per state at 0K is 0.0
The ratio of no. of particles per state at 300K is 3.1e-05

Example 7.4,Page number:195

In [6]:
T1=273.0 				#[K]
T2=14273.0 			#[K]
E1=-13.6 			#Energy of ground state [eV]
k=8.617*10.0**-5.0 			#Boltzmann constant[eV/K]
g2=8.0 				#total no. of states with energy E2
g1=2.0 				#total no. of states with energy E1
import math
	
E2=E1/(2.0**2) 		#Energy for n=2 (i.e.E2=E1/n2)
x1=k*T1 
r1=(g2/g1)*math.exp(-(E2-E1)/x1) 
x2=k*T2 
r2=(g2/g1)*math.exp(-(E2-E1)/x2) 
print"The fraction of atoms present in level n=2 at 273K is", round(r1,190)   
print"Therefore total 3*10**25 atoms we say   that all are present at ground state" 
print"\n\nThe fraction of atoms present in level n=2 at 14273 is",round(r2,3) 
x=r2*3.0*10**25.0 
print"Therefore no. of atoms in level n=2 is",x  
The fraction of atoms present in level n=2 at 273K is 1.97e-188
Therefore total 3*10**25 atoms we say   that all are present at ground state


The fraction of atoms present in level n=2 at 14273 is 0.001
Therefore no. of atoms in level n=2 is 3.0021673634e+22

Example 7.5,Page number:195

In [7]:
r1=0.001 			#the population of the states at a higher energy to that at a 				lower energy 
dE=8*10**-20 			#The difference in energy[J]
k=1.381*10**-23 			#Boltzmann constant [J/K]


x=k*math.log(r1) 
T=-dE/x #[K]
print"The Temperature at this condition is",round(T,1),"K"
The Temperature at this condition is 838.6 K

Example 7.6,Page number:196

In [8]:
w=1 			#no. of ways of distributing the molecules
k=1.381*10**-23 	#Boltzmann constant[J/K]
import math
	
S1=k*math.log(w) 		#Entropy of system at 0K
print"The Entropy of System at 0K and non-degenerate eng level is",S1,"J/K/mol"

n=2 
R=8.314 #Universal gas constant[J/K/mol]

S2=R*math.log(n) #Entropy of the system[J/K/mol]
print"\nThe Entropy of system at 0K and degenerete eng level is",round(S2,2),"J/K/mol"
The Entropy of System at 0K and non-degenerate eng level is 0.0 J/K/mol

The Entropy of system at 0K and degenerete eng level is 5.76 J/K/mol

Example 7.9,Page number:202

In [9]:
V=0.001 			#Volume of vessel[m3]
T=300 				#Temperature [K]
k=1.381*10**-23 		#Boltzmann constant[J/K]
mol_wt=32 			#molecular mass of oxygen molecule
h=6.626*10**-34 		#planck's constant[J.s}


	
m=32*1.66*(10**-27) 		#mass of oxygen molecule[Kg]
x=((2*3.14*m*k*T)**(3.0/2.0))*V 
y=h**3 
zt=x/y 				#Transitional partition function of an oxygen molecule
print"The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is",zt
print"Wrongly calculated in book as 5.328*10^33"
The Transitional partition function of an oxygen molecule confined in a 1-litre vessel at 300K is 1.76621948031e+29
Wrongly calculated in book as 5.328*10^33

Example 7.12,Page number:204

In [10]:
R=1.99 			#Universal gas constant [cal/K]
e=2.718 
V=22414 		#volume[cm3]
L=6.023*10**23 
h=6.626*10**-27 	#Planck's constant [erg.sec]
m=6.63*10**-23 		#mass[gm]
k=1.381*10**-16 	#Boltzmann constant[erg/K]
T=273.2 		#Temperature[K]
import math
	
x=V*(e**2.5) 
y=L*(h**3) 
z=(2*3.14*m*k*T)**1.5 
S=R*math.log(x*z/y) #Entropy [cal/degree/mol]
print"The Entropy of argon at 273K and 1 atm is",round(S,1),"cal/degree/mol"
The Entropy of argon at 273K and 1 atm is 36.6 cal/degree/mol

Example 7.14,Page number:207

In [11]:
T=298 				#Temperature[K]
I=1.9373*10**-46 		#moment of inertia of O2 gas [Kg/m2]
h=6.626*10**-34 			#Planck's constant[J.s]
k=1.381*10**-23 			#Boltzmann constant[J/K]
R=8.314 			#Universal gas constant[J/K/mol]
u=2 				#Homonuclear diatomic molecule
import math
	
Sr=R+R*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[J/K/mol]
Gr=-R*0.001*T*math.log(8*3.14*3.14*I*k*T/(u*h*h)) #[KJ/mol]
print"The rotational entropy for O2 gas is",round(Sr,3),"J/K/mol"
print"The rotational free energy for O2 gas is",round(Gr,3),"KJ/mol"
The rotational entropy for O2 gas is 43.826 J/K/mol
The rotational free energy for O2 gas is -10.583 KJ/mol

Example 7.15,Page number:208

In [12]:
T=298 				#Temperature[K]
v=892.1*3*10**10 		#frequency[sec-1]
h=6.626*10**-27 		#Planck's constant [J.s]
k=1.381*10**-16 		#Boltzmann constant[erg/K]
e=2.718 
R=1.998 			#Universal gas constant[cal/K]
	
import math
x=h*v/(k*T) 
a=R*x*e**-x/(1-e**-x) 		#a=E-Eo/T
b=R*math.log(1-e**-x) 		#b=G-Eo/T
S=a-b 				#[cal/deg]
print"The vibrational contribution to the entropy of F2 is",round(S,4),"cal/deg APPROX"
The vibrational contribution to the entropy of F2 is 0.1445 cal/deg APPROX

Example 7.16,Page number:211

In [13]:
T=1273 				#Temperature[K]
h=6.26*10**-27 			#Planck's constant[J.s]
k=1.381*10**-16 			#Boltzmann constant[erg/K]
T=1000 				#Temperature[degrees]
m=3.82*10**-23 			#mass of Na [gm]
I=(1.91*10**-23)*(3.078*10**-8)**2 	#moment of inertia[gm.cm2]
dE=0.73*1.602*10**-12 			#[erg]
v=159.23*(3*10**10)	 		#frequency [s-1]
R=82 					#universal gas constant[cm3.atm/deg]
u=2 					#symmetry number
L=6.023*10**23 				#avogadro's number
import math
	
p=((3.14*m*k*T)**1.5)/h/h/h 
s=R*u*h*h/L/8/3.14/3.14/I/k 
q=1-(math.exp(-h*v/k/T)) 
r=math.exp(-dE/k/T) 
Kp=p*s*q*r 				#Equilibrium constant 
print"The equilibrium constant is",round(Kp,3) 
The equilibrium constant is 0.608

Example 7.17,Page number:212

In [14]:
T=298.0 #Temperature[K]
m1=32.0 
m2=36.0 
m3=34.0 
u1=8.0 
u2=9.0 
u3=16.0*18.0/34.0 
z1=0.99924 
z2=0.99951 
z3=0.99940 
h=6.26*10**-27 #Planck's constant[J.s]
c=3.0*10**10 #Speed of light[m/s]
k=1.38*10**-16 #Boltzman's constant[erg/K]
vo1=1535.8 #vibration frequency of 16O18O [cm-1]
vo2=1580.4 #vibration frequency of 16O2 [cm-1]
vo3=1490.0 #vibration frequency of 18O2 [cm-1]
dE=0.5*h*c*(2*vo1-vo2-vo3) #[erg]
r=dE/k/T 
import math

a=m3**3/m2**1.5/m1**1.5 
b=(u3**2)*4/u2/u1 
c=z3**2/z2/z1 
Kp=a*b*c*math.exp(-r) 
print"The value of equilibrium constant for isotopic exchange reaction is",round(Kp,3) 
The value of equilibrium constant for isotopic exchange reaction is 3.996