Appendix D

Example 2

In [1]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 16.2
'''Determine the value of G0 for the reaction 2H2O  2H2 + O2 at 25◦C and at 2000 K,
with the water in the gaseous phase.'''

#Keys:
#1-H2
#2-O2
#3-H2O

#Variable Declaration: 
def dG(T1,Hf1,Hf2,Hf3,Sf1,Sf2,sf3):
	dH = 2*Hf1+Hf2-2*Hf3	#Change in enthalpy in kJ
	dS = 2*Sf1+Sf2-2*sf3 	#Change in entropy in J/K
	dG = dH-T1*dS/1000	#change n gibbs free energy in kJ
	return dG

#Results:
print 'Change in gibbs free energy at 298K :',round(dG(298,0, 0, -241.826, 130.678,205.148,188.834),3),"KJ"
print 'Change in gibbs free energy at 298K :',round(dG(2000,52.942, 59.176, -241.826+72.788,188.419,268.748,264.769),3),"KJ"
Change in gibbs free energy at 298K : 457.179 KJ
Change in gibbs free energy at 298K : 271.04 KJ

Example 3

In [2]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 16.3
'''Determine the equilibrium constant K, expressed as ln K, for the reaction 2H2O <--->
2H2 + O2 at 25◦C and at 2000 K.'''

#Variable Declaration: 
dG1 = -457.166			#change in gibbs free energy at temp 298 K from example2 in kJ
dG2 = -271.040			#change in gibbs free energy at temp 2000 K from example2 n kJ
T1 = 298				#K
T2 = 2000				#K
R = 8.3145				#gas constant

#Calculations:
K1 = dG1*1000/(R*T1)
K2 = dG2*1000/(R*T2)

#Results:
print 'Equilibrium constant at 298K: ',round(K1,2)
print 'Equilibrium constant at 2000K: ',round(K2,3)
Equilibrium constant at 298K:  -184.51
Equilibrium constant at 2000K:  -16.299