# Chapter 13 - Thermodynamic changes accompanying chemical reaction¶

## Example 1 - pg 320¶

In [1]:
#calculate the dHp value
#Initialization of variables
n1=10 #mol
n2=12 #mol
#calculations
dn=n1-n2
#results
print '%s %d %s' %("dHp = dEv-",dn,"*RT")

dHp = dEv- -2 *RT


## Example 2 - pg 322¶

In [3]:
#calculate the Enthalpy
#Initialization of variables
Ht1=-22063 #cal
T=298.15 #K
#calculations
H=Ht1 +0.5293*T + 0.3398*10**-3 *T**2 - 2.039*10**-7 *T**3
#results
print '%s %d %s' %("Enthalpy =",H,"cal")

Enthalpy = -21880 cal


## Example 3 - pg 326¶

In [4]:
#calculate the Entropy
#Initialization of variables
Cp=0.797 #cal/deg/mol
#calculations
S=Cp/3.
#results
print '%s %.3f %s' %("Entropy =",S," eu/mol")

Entropy = 0.266  eu/mol


## Example 4 - pg 328¶

In [5]:
#calculate the Change in entropy
#Initialization of variables
T1=77.32 #K
P=1 #atm
T2=126 #K
Pc=33.5 #atm
#calculations
dS=27/32. *1.987*P/Pc *(T2/T1)**3
#results
print '%s %.2f %s' %("Change in entropy =",dS,"eu/mol")

Change in entropy = 0.22 eu/mol


## Example 5 - pg 330¶

In [6]:
#calculate the Change in entropy, enthalpy and free energy
#Initialization of variables
S1=57.47
S2=50.34
S3=49
H1=8.09
H2=21.06
H3=0
F1=12.39
F2=20.72
F3=0
#calculations
dS=S1-S2-0.5*S3
dH=H1-H2-0.5*H3
dF=F1-F2-0.5*F3
#results
print '%s %.2f %s' %("Change in entropy =",dS," eu")
print '%s %.2f %s' %("\n Change in enthalpy =",dH," kcal")
print '%s %.2f %s' %("\n Change in free energy =",dF,"kcal")

Change in entropy = -17.37  eu

Change in enthalpy = -12.97  kcal

Change in free energy = -8.33 kcal


## Example 6 - pg 334¶

In [7]:
#calculate the change in free energy
#Initialization of variables
import math
P1=0.01
P2=0.1
P3=0.01
dF0=-54640 #cal
T=298.15 #K
R=1.987 #cal/deg
#calculations
Qp=P1/(P2*P3**0.5)
dF=dF0+R*T*math.log(Qp)
#results
print '%s %d %s' %("change in free energy =",dF,"cal")

change in free energy = -54640 cal


## Example 7 - pg 335¶

In [8]:
#calculate the Equilibrium constant
#Initialization of variables
print "From table 13.4 "
logKfwater=40.04724
logKfH2=0
logKfO2=0
#calculations
logK=logKfwater-logKfH2-0.5*logKfO2
K=10**logK
#results
print '%s %.4e' %("Equilibrium constant = ",K)

From table 13.4
Equilibrium constant =  1.1149e+40


## Example 8 - pg 339¶

In [1]:
#calculate the value of Kc
#Initialization of variables
Kp=1.1*10**40 #atm**-0.5
dn=-0.5
R=0.08206 #lt atm/deg mol
T=298.15 #K
#calculations
Kc=Kp*(R*T)**(-dn)
#results
print '%s %.1e %s' %("Kc =",Kc," (mol/lt)^-0.5")

Kc = 5.4e+40  (mol/lt)^-0.5


## Example 9 - pg 339¶

In [11]:
#calculate the Density of equilibrium mixture
#Initialization of variables
import numpy
Kp=0.141 #atm
P=1 #atm
nu=2
R=0.08206 #lt atm/deg mol
T=298.15 #K
M=92.02 #g/mol
#calculations
p=([Kp+ 4*P,0, -Kp])
z=numpy.roots(p)
alpha=z[0]
wbyV=P*M/(R*T*(1+(nu-1)*alpha))
#results
print '%s %.2f %s' %("Density of the equilibrium mixture =",wbyV," g/lt")

Density of the equilibrium mixture = 3.18  g/lt


## Example 10 - pg 340¶

In [12]:
#calculate the Final pressure after equilibrium
#Initialization of variables
x=0.5
P=0.468 #atm
#calculations
P1=x*P
P2=x*P
Kp=P1*P2
#results
print '%s %.4f %s' %("Final pressure after equilibrium =",Kp," atm^2")

Final pressure after equilibrium = 0.0548  atm^2