Chapter 5: Enthalpy and the Second and Third Laws of Thermodynamics

Example Problem 5.1, Page Number 84

In [1]:
#Variable Declaration
Th, Tc = 500.,200.     #Temeperatures IN Which reversible heat engine works, K
q = 1000.              #Heat absorbed by heat engine, J

#Calcualtions
eps = 1.-Tc/Th
w = eps*q

#Results
print 'Efficiency of heat engine is %4.3f'%eps
print 'Work done by heat engine is %4.1f J'%w
Efficiency of heat engine is 0.600
Work done by heat engine is 600.0 J

Example Problem 5.4, Page Number 87

In [2]:
from sympy import integrate, symbols
from math import log

#Variable Declaration
n = 1.0                #Number of moles of CO2
Ti, Tf = 320.,650.     #Initial and final state Temeperatures of CO2, K
vi, vf = 80.,120.      #Initial and final state volume of CO2, K
A, B, C, D = 31.08,-0.01452,3.1415e-5,-1.4973e-8
                       #Constants in constant volume Heat capacity equation in J, mol, K units
R = 8.314              #Ideal Gas Constant, J/(mol.K) 
#Calcualtions
T = symbols('T')
dS1 = n*integrate( (A + B*T + C*T**2 + D*T**3)/T, (T,Ti,Tf)) 
dS2 = n*R*log(vf/vi)
dS = dS1 + dS2
#Results
print 'Entropy change of process is %4.2f J/(mol.K)'%dS
Entropy change of process is 24.43 J/(mol.K)

Example Problem 5.5, Page Number 88

In [3]:
from sympy import integrate, symbols
from math import log

#Variable Declaration
n = 2.5                #Number of moles of CO2
Ti, Tf = 450.,800.     #Initial and final state Temeperatures of CO2, K
pi, pf = 1.35,3.45     #Initial and final state pressure of CO2, K
A, B, C, D = 18.86,7.937e-2,-6.7834e-5,2.4426e-8
                       #Constants in constant pressure Heat capacity equation in J, mol, K units
R = 8.314              #Ideal Gas Constant, J/(mol.K) 
#Calcualtions
T = symbols('T')
dS1 = n*integrate( (A + B*T + C*T**2 + D*T**3)/T, (T,Ti,Tf)) 
dS2 = n*R*log(pf/pi)
dS = dS1 - dS2
#Results
print 'Entropy change of process is %4.2f J/(mol.K)'%dS
Entropy change of process is 48.55 J/(mol.K)

Example Problem 5.6, Page Number 89

In [4]:
from math import log

#Variable Declaration
n = 3.0                #Number of moles of CO2
Ti, Tf = 300.,600.     #Initial and final state Temeperatures of CO2, K
pi, pf = 1.00,3.00     #Initial and final state pressure of CO2, K
cpm = 27.98            #Specific heat of mercury, J/(mol.K)
M = 200.59             #Molecualr wt of mercury, g/(mol)
beta = 1.81e-4         #per K
rho = 13.54            #Density of mercury, g/cm3
R = 8.314              #Ideal Gas Constant, J/(mol.K) 

#Calcualtions
dS1 = n*cpm*log(Tf/Ti)
dS2 = n*(M/(rho*1e6))*beta*(pf-pi)*1e5
dS = dS1 - dS2

#Results
print 'Entropy change of process is %4.1f J/(mol.K)'%dS
print 'Ratio of pressure to temperature dependent term %3.1e\nhence effect of pressure dependent term isvery less'%(dS2/dS1)
Entropy change of process is 58.2 J/(mol.K)
Ratio of pressure to temperature dependent term 2.8e-05
hence effect of pressure dependent term isvery less

Example Problem 5.7, Page Number 93

In [5]:
from math import log

#Variable Declaration
n = 1.0                #Number of moles of CO2
T = 300.0              #Temeperatures of Water bath, K
vi, vf = 25.0,10.0     #Initial and final state Volume of Ideal Gas, L
R = 8.314              #Ideal Gas Constant, J/(mol.K) 

#Calcualtions
qrev = n*R*T*log(vf/vi)
w = -qrev
dSsys = qrev/T
dSsur = -dSsys
dS = dSsys + dSsur

#Results
print 'Entropy change of surrounding is %4.1f J/(mol.K)'%dSsur
print 'Entropy change of system is %4.1f J/(mol.K)'%dSsys
print 'Total Entropy changeis %4.1f J/(mol.K)'%dS
Entropy change of surrounding is  7.6 J/(mol.K)
Entropy change of system is -7.6 J/(mol.K)
Total Entropy changeis  0.0 J/(mol.K)

Example Problem 5.8, Page Number 93

In [6]:
from math import log

#Variable Declaration
n = 1.0                #Number of moles of CO2
T = 300.0              #Temeperatures of Water bath, K
vi, vf = 25.0,10.0     #Initial and final state Volume of Ideal Gas, L
R = 8.314              #Ideal Gas Constant, J/(mol.K) 

#Calcualtions
pext = n*R*T/(vf/1e3)
pi = n*R*T/(vi/1e3)
q = pext*(vf-vi)/1e3
qrev = n*R*T*log(vf/vi)
w = -q
dSsur = -q/T
dSsys = qrev/T
dS = dSsys + dSsur

#Results
print 'Constant external pressure and initial pressure are %4.3e J,and %4.3e J respectively'%(pext,pi)
print 'Heat in reverssible and irreversible processes are %4.1f J,and %4.1f J respectively'%(qrev,q)
print 'Entropy change of system is %4.1f J/(mol.K)'%dSsys
print 'Entropy change of surrounding is %4.2f J/(mol.K)'%dSsur
print 'Total Entropy changeis %4.2f J/(mol.K)'%dS
Constant external pressure and initial pressure are 2.494e+05 J,and 9.977e+04 J respectively
Heat in reverssible and irreversible processes are -2285.4 J,and -3741.3 J respectively
Entropy change of system is -7.6 J/(mol.K)
Entropy change of surrounding is 12.47 J/(mol.K)
Total Entropy changeis 4.85 J/(mol.K)

Example Problem 5.9, Page Number 96

In [7]:
from sympy import integrate, symbols
from math import log

#Variable Declaration
n = 1.0                #Number of moles of CO2
pi, pf = 1.35,3.45     #Initial and final state pressure of CO2, K
D1 = 2.11e-3           #Constants in constant pressure Heat capacity equation for K<T<12.97K, in J, mol, K units
A2, B2, C2, D2 = -5.666,0.6927,-5.191e-3,9.943e-4
        #Constants in constant pressure Heat capacity equation for 12.97<T<23.66, J, mol, K units
A3, B3, C3, D3 = 31.70,-2.038,0.08384,-6.685e-4
        #Constants in constant pressure Heat capacity equation for 23.66<T<43.76, J, mol, K units
A4 = 46.094 #Constants in constant pressure Heat capacity equation for 43.76<T<54.39, J/(mol.K)
A5, B5, C5, D5 = 81.268,-1.1467,0.01516,-6.407e-5
        #Constants in constant pressure Heat capacity equation for 54.39<T<90.20K, J, mol, K units
A6, B6, C6, D6 = 32.71,-0.04093,1.545e-4,-1.819e-7
        #Constants in constant pressure Heat capacity equation for 90.20<T<298.15 KJ, mol, K units
R = 8.314         #Ideal Gas Constant, J/(mol.K) 
Ltrans1 = 93.80   #Entalpy of transition at 23.66K, J/mol
Ltrans2 = 743.0   #Entalpy of transition at 43.76K, J/mol
Ltrans3 = 445.0   #Entalpy of transition at 54.39K, J/mol
Ltrans4 = 6815.   #Entalpy of transition at 90.20K, J/mol
T1 = 12.97        #Maximum applicabliltiy temeprature for first heat capacity equation, K
T12 = 23.66       #Phase Change temperature from Solid III--II, K
T23 = 43.76       #Phase Change temperature from Solid II--I, K
T34 = 54.39       #Phase Change temperature from Solid I--liquid, K
T45 = 90.20       #Phase Change temperature from liquid--gas, K
Ts = 298.15       #Std. Temeprature, K
#Calcualtions
T = symbols('T')
dS1 = n*integrate( (D1*T**3)/T, (T,0,T1)) 
dS2 = n*integrate( (A2 + B2*T + C2*T**2 + D2*T**3)/T, (T,T1,T12)) 
dS21 = Ltrans1/T12
dS3 = n*integrate( (A3 + B3*T + C3*T**2 + D3*T**3)/T, (T,T12,T23)) 
dS31 = Ltrans2/T23
dS4 = n*integrate( (A4)/T, (T,T23,T34)) 
dS41 = Ltrans3/T34
dS5 = n*integrate( (A5 + B5*T + C5*T**2 + D5*T**3)/T, (T,T34,T45)) 
dS51 = Ltrans4/T45
dS6 = n*integrate( (A6 + B6*T + C6*T**2 + D6*T**3)/T, (T,T45,Ts))
#print dS1+dS2,dS21
#print dS3, dS31
#print dS4, dS41
#print dS5, dS51
#print dS6
dS = dS1+dS2+dS21+dS3+dS31+dS4+dS41+dS5+dS51+dS6

#Results
print 'Entropy change Sm0 for O2 is %4.1f J/(mol.K)'%dS
Entropy change Sm0 for O2 is 204.8 J/(mol.K)

Example Problem 5.10, Page Number 99

In [8]:
from sympy import integrate, symbols
from math import log

#Variable Declaration
n = 1.0                #Number of moles of CO2 formed, mol
p = 1.                 #Pressure of CO2, K

A1, B1, C1, D1 = 18.86,7.937e-2,-6.7834e-5,2.4426e-8
        #Constants in constant pressure Heat capacity equation for CO2, J/(mol.K)
A2, B2, C2, D2 = 30.81,-1.187e-2,2.3968e-5, 0.0
        #Constants in constant pressure Heat capacity equation for O2, J/(mol.K)
A3, B3, C3, D3 =  31.08,-1.452e-2,3.1415e-5 ,-1.4793e-8          
        #Constants in constant pressure Heat capacity equation for CO, J/(mol.K)
DSr298CO = 197.67   #Std. Entropy change for CO, J/(mol.K)
DSr298CO2 = 213.74  #Std. Entropy change for CO, J/(mol.K)
DSr298O2 = 205.138  #Std. Entropy change for CO, J/(mol.K)
Tr = 475.           #Reaction temperature, K
Ts = 298.15         #Std. temperature, K
#Calcualtions
T = symbols('T')
v1,v2,v3 = 1.,1./2,1.
DSr = DSr298CO2*v1 - DSr298CO*v1 - DSr298O2*v2
DA = v1*A1-v2*A2-v3*A3
DB = v1*B1-v2*B2-v3*B3
DC = v1*C1-v2*C2-v3*C3
DD = v1*D1-v2*D2-v3*D3
dS = DSr + n*integrate( (DA + DB*T + DC*T**2 + DD*T**3)/T, (T,Ts,Tr)) 

#Results
print 'Entropy change for reaction at %4d K is %4.2f J/(mol.K)'%(Tr,dS)
Entropy change for reaction at  475 K is -88.26 J/(mol.K)