Chapter12 - Chemical reaction equillibria

Example: 12.1 Page: 471

In [1]:
print "Example: 12.1 - Page: 471\n\n"

# This problem involves proving a relation in which no mathematics and no calculations are involved.
# For prove refer to this example 12.1 on page number 471 of the book.

print " This problem involves proving a relation in which no mathematics and no calculations are involved.\n\n"
print " For prove refer to this example 12.1 on page 471 of the book."
Example: 12.1 - Page: 471


 This problem involves proving a relation in which no mathematics and no calculations are involved.


 For prove refer to this example 12.1 on page 471 of the book.

Example: 12.2 Page: 473

In [2]:
print "Example: 12.2 - Page: 473\n\n"

# This problem involves proving a relation in which no mathematics and no calculations are involved.
# For prove refer to this example 12.2 on page number 473 of the book.

print " This problem involves proving a relation in which no mathematics and no calculations are involved.\n\n"
print " For prove refer to this example 12.2 on page 473 of the book."
Example: 12.2 - Page: 473


 This problem involves proving a relation in which no mathematics and no calculations are involved.


 For prove refer to this example 12.2 on page 473 of the book.

Example: 12.3 Page: 479

In [3]:
from math import exp
from __future__ import division
print "Example: 12.3 - Page: 479\n\n"

# Solution

#*****Data******#
# Reaction: C2H5OH(g) + (1/2)O2(g) = CH3CHO(g) + H2O(g)
Temp = 298## [K]
G_CH3CHO = -133.978## [kJ]
G_H2O = -228.60## [kJ]
G_C2H5OH = -174.883## [kJ]
R = 8.314## [J/mol K]
#***************#

G_O2 = 0## [kJ]
G_rkn = G_CH3CHO + G_H2O -(G_C2H5OH + G_O2)## [kJ]
G_rkn = G_rkn*1000## [J]
if G_rkn < 0 :
    print "Reaction is feasible\n"
    K = exp(-(G_rkn/(R*Temp)))#
    print "Equilibium Constant is %.3e"%(K)#
else:
    print "Reaction is not feasible\n"
Example: 12.3 - Page: 479


Reaction is feasible

Equilibium Constant is 7.964e+32

Example: 12.4 Page: 479

In [1]:
print "Example: 12.4 - Page: 479\n\n"

# Solution

#*****Data******#
# H2O(l) = H2O(g)
deltaH = 9710## [cal]
deltaS = 26## [e.u.]
Temp = 27 + 273## [K]
P = 1## [atm]
#**************#

deltaG = deltaH - Temp*deltaS## [cal]
if deltaG > 0:
    print "Vaporisation of liquid water is not spontaneous\n"
else:
    print "Vaporisation of liquid water is spontaneous"
Example: 12.4 - Page: 479


Vaporisation of liquid water is not spontaneous

Example: 12.5 Page: 481

In [3]:
from math import exp
from __future__ import division
print "Example: 12.5 - Page: 481\n\n"

# Solution

#*****Data******#
# Reaction: N2(g) + 3H2(g) = 2NH3(g)
Temp = 298## [K]
G_NH3 = -16.750## [kJ/mol]
R = 8.314## [J/mol K]
#***************#

G_N2 = 0## [kJ/mol]
G_H2 = 0## [kJ/mol]
G_rkn = 2*G_NH3 - G_N2 - 3*G_H2## [kJ/mol]
print "Standard Gibbs free energy change is %.1f kJ/mol\n"%(G_rkn)#
G_rkn = G_rkn*1000## [J/mol]#
K = exp(-(G_rkn/(R*Temp)))#
print "Equilibrium constant is %.2e"%(K)#
Example: 12.5 - Page: 481


Standard Gibbs free energy change is -33.5 kJ/mol

Equilibrium constant is 7.45e+05

Example: 12.6 Page: 481

In [7]:
from math import exp
from __future__ import division
print "Example: 12.6 - Page: 481\n\n"

# Solution

#*****Data******#
# Reaction: CO(g) + H2O(g) = CO2(g) + H2(g)
G_CO = -32.8## [kcal]
G_H2O = -54.64## [kcal]
G_CO2 = -94.26## [kcal]
Temp = 273 + 25## [K]
R = 1.987## [cal/mol.K]
#***************#

G_H2 = 0## [kcal]
G_rkn = G_CO2 + G_H2 - (G_CO + G_H2O)## [kcal]
G_rkn = G_rkn*1000## [cal]
K = exp(-(G_rkn/(R*Temp)))#
print "Equilibrium Constant is %.3e"%(K)#
Example: 12.6 - Page: 481


Equilibrium Constant is 1.005e+05

Example: 12.7 Page: 485

In [8]:
from math import exp
from __future__ import division
print "Example: 12.7 - Page: 485\n\n"

# Solution

#*****Data******#
# Reaction: CO(g) + H2O(g) = CO2(g) + H2(g)
T1 = 298## [K]
T2 = 1000## [K]
P = 1## [bar]
K1 = 1.1582*10**5#
H_CO = -110.532## [kJ]
H_H2O = -241.997## [kJ]
H_CO2 = -393.978## [kJ]
R = 8.314## [J/mol.K]
#***************#

H_H2 = 0## [kJ]
H_rkn = H_CO2 + H_H2 - (H_CO + H_H2O)## [kJ]
H_rkn = H_rkn*1000## [J]
# From Van't Hoff Equation,
K2 = K1*exp((H_rkn/R)*((1/T1) - (1/T2)))#
print "Equilibrium constant at 1000 K is %.4f"%(K2)#
Example: 12.7 - Page: 485


Equilibrium constant at 1000 K is 0.9190

Example: 12.8 Page: 485

In [9]:
from math import exp
from __future__ import division
print "Example: 12.8 - Page: 485\n\n"

# Solution

#*****Data******#
# Reaction: N2(g) + 3H2(g) = 2NH3(g)
T1 = 298## [K]
T2 = 700## [K]
H_NH3 = -46.1## [kJ]
G_NH3 = -16.747## [kJ]
R = 8.314## [J/mol.K]
#**************#

H_N2 = 0## [kJ]
H_H2 = 0## [kJ]
G_N2 = 0## [kJ]
G_H2 = 0## [kJ]
H_rkn = 2*H_NH3 - (H_N2 + 3*H_H2)## [kJ]
G_rkn = 2*G_NH3 - (G_N2 + 3*G_H2)## [kJ]
H_rkn = H_rkn*1000## [J]
G_rkn = G_rkn*1000## [J]
K1 = exp(-(G_rkn/(R*T1)))#
K2 = K1*exp((H_rkn/R)*((1/T1) - (1/T2)))#
print "Equilibrium constant at 700 K is %.4e"%(K2)#
Example: 12.8 - Page: 485


Equilibrium constant at 700 K is 3.8878e-04

Example: 12.9 Page: 486

In [4]:
from math import exp,log
from __future__ import division

print "Example: 12.9 - Page: 486\n\n"

# Solution

#*****Data******#
# Reaction: CO(g) + H2O(g) ----> CO2(g) + H2(g)
T1 = 298## [K]
T2 = 1000## [K]
deltaH_298 = -41450## [J/mol]
deltaGf_298 = -28888## [J/mol]
alpha_CO2 = 45.369## [kJ/kmol K]
alpha_H2 = 27.012## [kJ/kmol K]
alpha_CO = 28.068## [kJ/kmol K]
alpha_H2O = 28.850## [kJ/kmol K]
beeta_CO2 = 8.688*10**(-3)## [kJ/kmol square K]
beeta_H2 = 3.509*10**(-3)## [kJ/kmol square K]
beeta_CO = 4.631*10**(-3)## [kJ/kmol square K]
beeta_H2O = 12.055*10**(-3)## [kJ/kmol square K]
R = 8.314## [J/mol K]
#*************#

delta_alpha = alpha_CO2 + alpha_H2 - (alpha_CO + alpha_H2O)#
delta_beeta = beeta_CO2 + beeta_H2 - (beeta_CO + beeta_H2O)#
# To obtain the standard heat of reaction:
deltaH_0 = deltaH_298 - (delta_alpha*T1 + (delta_beeta*T1**2)/2)## [kJ/mol]
# From Eqn. 12.52:
IR = (deltaH_0 - delta_alpha*T1*log(T1) - (delta_beeta*T1**2)/2 - deltaGf_298)/T1## [kJ/mol K]
# Substituting T = T2 and IR in Eqn. 12.51:
deltaG_1000 = deltaH_0 - delta_alpha*T2*log(T2) - (delta_beeta*T2**2)/2 - IR*T2## [kJ/mol]
print "Standard Gibbs free energy at 1000 K %.3f kJ\n"%(deltaG_1000/1000)#

# Standard Equilibrium Constant at 1000 K
K_1000 = exp(-(deltaG_1000)/(R*T2))#
print "Standard Equilibrium Constant is %.1f"%(K_1000)#
Example: 12.9 - Page: 486


Standard Gibbs free energy at 1000 K -6.055 kJ

Standard Equilibrium Constant is 2.1

Example: 12.10 Page: 489

In [1]:
from scipy.optimize import fsolve
print "Example: 12.10 - Page: 489\n\n"

# Solution

#*****Data******#
# Reaction: CO(g) + H2O(g) ------> CO2(g) + H2(g)
P = 10## [bar]
T = 1000## [K]
K_1000 = 1.5#
#***********#

# Moles in feed:
nCO_feed = 1#
nH20_feed = 1#
# Let e be the degree of completion at equilibrium.
# Moles at Equilibrium:
# nCO_eqb = 1 - e#
# nH20_eqb = 1 - e#
# nCO2_eqb = e#
# nH2_eqb = e#
# Total moles at equilibrium = 1 - e + 1 - e + e + e = 2
# Mole Fractions at Equilibrium:
# yCO_eqb = (1 - e)/2#
# yH20_eqb = (1 - e)/2#
# yCO2_eqb = e/2#
# yH2_eqb = e/2#
# Sum of stoichometric coeffecient:
v = 1 + 1 - 1 - 1#
K = K_1000*P**v#
#deff('[y] = f(e)','y = K - (e/2)*(e/2)/(((1 - e)/2)*(1 - e)/2)')#
def f(e):
    y = K - (e/2)*(e/2)/(((1 - e)/2)*(1 - e)/2)
    return y
e = fsolve(f, 0.5)#
print "Composition of the gas leaving the mixture\n"
print "yCO = yH20 = %.4f\n"%((1 - e)/2)#
print "yCO2 = yH2 = %.4f\n"%(e/2)#
Example: 12.10 - Page: 489


Composition of the gas leaving the mixture

yCO = yH20 = 0.2247

yCO2 = yH2 = 0.2753

Example: 12.11 Page: 489

In [2]:
from scipy.optimize import fsolve
print "Example: 12.11 - Page: 489\n\n"

# Solution

#*****Data******#
# Reaction: N2(g) + 3H2(g) --------> 2NH3
nN2_feed = 1#
nH2_feed = 5#
T = 800## [K]
P = 250## [bar]
K = 1.106*10**(-5)#
#**************#

# Let e be the degree of completion at equilibrium.
# Moles at Equilibrium:
# nN2_eqb = 1 - e#
# nH2_eqb = 5 - 3*e#
# nNH3_eqb = 2*e#
# Total moles at equilibrium = 1 - e + 5 - 3*e + 2*e = 2*(3 - e)
# Mole Fractions at Equilibrium:
# yN2_eqb = (1 - e)/(2*(3 - e))#
# yH2_eqb = (5 - 3*e)/(2*(3 - e))#
# yNH3_eqb = 2*e/(2*(3 - e))#
# Sum of stoichometric coeffecient:
v = 2 - 3 - 1#
Ky = K*P**(-v)#
def f(e):
    y = Ky - ((2*e/(2*(3 - e)))**2)/(((1-e)/((2*(3 - e))))*((5 - 3*e)/(2*(3 - e)))**3)
    return y
e = fsolve(f, 0.5)#
print "Molar Composition of the gases\n"
print "yN2 = %.4f\n"%((1 - e)/(2*(3 - e)))#
print "yH2 = %.4f\n"%((5 - 3*e)/(2*(3 - e)))#
print "yNH3 = %.4f\n"%((2*e)/(2*(3 - e)))#
Example: 12.11 - Page: 489


Molar Composition of the gases

yN2 = 0.1103

yH2 = 0.7207

yNH3 = 0.1690

Example: 12.12 Page: 490

In [3]:
from scipy.optimize import fsolve
print "Example: 12.12 - Page: 490\n\n"

# Solution

#*****Data******#
# Reaction: SO2(g) + (1/2)O2 ------> SO3(g)
P = 1## [bar]
T = 750## [K]
K = 74#
#************#

# Moles in Feed:
nSO2 = 1#
nO2 = 0.5#
# Let e be the degree of completion at equilibrium.
# Moles at Equilibrium:
# nSO2_eqb = 10 - e#
# nO2_eqb = 8 - 0.5*e#
# nSO3_eqb = e#
# Total no. of moles = 10 - e + 8 - 0.5*e + e = 18 -0.5*e#
# Mole fraction at Equilibrium:
# ySO2_eqb = (10 - e)/(18 - 0.5*e)#
# yO2_eqb = (8 - 0.5*e)/(18 - 0.5*e)#
# ySO3_eqb = e/(18 - 0.8*e)#
# Sum of stoichometric coeffecient:
v = 1 - 1 -0.5#
Ky = K*P**(-v)#
def f(e):
    y = Ky - (e*(18 - (0.5*e)))/((10 - e)*(8 - 0.5*e))
    return y
e = fsolve(f, 7)#
print "Molar Composition of the gases\n"
print "nSO2 = %.2f\n"%((10 - e))#
print "nO2 = %.2f\n"%((8 - 0.5*e))#
print "nSO3 = %.2f\n"%(e)#
Example: 12.12 - Page: 490


Molar Composition of the gases

nSO2 = 0.52

nO2 = 3.26

nSO3 = 9.48

Example: 12.13 Page: 492

In [4]:
from scipy.optimize import fsolve
print "Example: 12.13 - Page: 492\n\n"

# Solution

#*****Data******#
# Reaction: PCl5 = PCl3 + Cl2
T = 250## [OC]
Kp = 1.8#
e = 0.5#
#**************#

# Basis: 1 mol of PCl5
# At Equilibrium:
n_PCl5 = 1 - e#
n_PCl3 = e#
n_Cl2 = e#
n_total = n_PCl5 + n_PCl3 + n_Cl2#
# Patrial Pressures:
# P_PCl5 = (n_PCl5/n_total)*P
# P_PCl3 = (n_PCl3/n_total)*P
# P_Cl2 = (n_Cl2/n_total)*P
def f(P):
    y = Kp - ((n_PCl3/n_total)*P)*((n_Cl2/n_total)*P)/((n_PCl5/n_total)*P)
    return y
P = fsolve(f, 7)## [atm]
print "Total Pressure Required for 50 %% conversion of PCl5 is %.1f atm"%(P)#
Example: 12.13 - Page: 492


Total Pressure Required for 50 % conversion of PCl5 is 5.4 atm

Example: 12.14 Page: 494

In [5]:
from scipy.optimize import fsolve
print "Example: 12.14 - Page: 494\n\n"

# Solution

#*****Data******#
# Reaction: SO2(g) + (1/2)O2(g) -------> SO3(g)
# Moles in Feed:
nSO2_feed = 1#
nO2_feed = 0.5#
nAr_feed = 2#
P = 30## [bar]
T = 900## [K]
K = 6#
#*************#

# Let e be the degree of completion at equilibrium.
# nSO2_eqb = 1 - e#
# nO2_eqb = 0.5*(1 - e)#
# nSO3_eqb = e#
# nAr_eqb = 2#
# Total moles at equilibrium = 1 - e + 0.5*(1 - e) + e + 2 = (7 - e)/2
# Mole fractions:
# ySO2_eqb = 2*(1 - e)/(7 - e)
# yO2_eqb = (1 - e)/(7 - e)
# ySO3_eqb = 2*e/(7 - e)
# yAr_eqb = 4/(7 - e)
# Sum of Stoichiometric Coeffecient:
v = 1 - 1 - 1/2#
Ky = K*P**(-v)#
e = 0.8#
err = 1#
while err > 0.2:
    Ky_new = (2*e/(7 - e))/(((2*(1 - e))/(7 - e))*(((1 - e)/(7 - e))**0.5))#
    err = abs(Ky - Ky_new)#
    Ky = Ky_new#
    e = e + 0.001#
print "Degree of Conversion is %.3f\n"%(e)#
ySO2_eqb = 2*(1 - e)/(7 - e)#
yO2_eqb = (1 - e)/(7 - e)#
ySO3_eqb = 2*e/(7 - e)#
yAr_eqb = 4/(7 - e)#
print "Equilibrium Composition of the reaction Mixture\n"
print "ySO2 = %.4f\n"%(ySO2_eqb)#
print "yO2 = %.4f\n"%(yO2_eqb)#
print "ySO3 = %.4f\n"%(ySO3_eqb)#
print "yAr = %.4f\n"%(yAr_eqb)
Example: 12.14 - Page: 494


Degree of Conversion is 0.802

Equilibrium Composition of the reaction Mixture

ySO2 = 0.0639

yO2 = 0.0319

ySO3 = 0.2588

yAr = 0.6454

Example: 12.15 Page: 498

In [7]:
from math import exp
print "Example: 12.15 - Page: 498\n\n"

# Solution

#*****Data******#
# Reaction: CH3COOH(l) + C2H5OH(l) --------> CH3COOC2H5(l) + H2O(l)
T = 373.15## [K]
nCH3COOH_feed = 1#
nC2H5OH_feed = 1#
deltaHf_CH3COOH = -484.5## [kJ]
deltaHf_C2H5OH = -277.69## [kJ]
deltaHf_CH3COOC2H5 = -480## [kJ]
deltaHf_H2O = -285.83## [kJ]
deltaGf_CH3COOH = -389.9## [kJ]
deltaGf_C2H5OH = -174.78## [kJ]
deltaGf_CH3COOC2H5 = -332.2## [kJ]
deltaGf_H2O = -237.13## [kJ]
R = 8.314## [J/mol K]
#******************#

deltaH_298 = deltaHf_CH3COOC2H5 + deltaHf_H2O - deltaHf_CH3COOH - deltaHf_C2H5OH## [kJ]
deltaG_298 = deltaGf_CH3COOC2H5 + deltaGf_H2O - deltaGf_CH3COOH - deltaGf_C2H5OH## [kJ]
T0 = 298## [K]
K_298 = exp(-(deltaG_298*1000/(R*T0)))#
K_373 = K_298*exp((deltaH_298*1000/R)*((1/T0) - (1/T)))#
# Let e be the degree of completion at equilibrium.
# nCH3COOH_eqb = 1 - e#
# nC2H5OH_eqb = 1 - e#
# nCH3COOC2H5_eqb = e#
# nH2O_eqb = e#
# Total moles at equilibrium = 1 - e + 1 - e + e + e = 2
# Mole fractions:
# ySO2_eqb = (1 - e)/2
# yO2_eqb = (1 - e)/2
# ySO3_eqb = e/2
# yAr_eqb = e/2
# Sum of Stoichiometric Coeffecient:
v = 1 + 1 - 1 - 1#
def f(e):
    y = K_373 - ((e/2)*(e/2))/(((1 - e)/2)*((1 - e)/2))
    return y
e = fsolve(f, 0.5)#
print "Mole fraction of ethyl acetate is %.3f"%(e/2)#
Example: 12.15 - Page: 498


Mole fraction of ethyl acetate is 0.639

Example: 12.16 Page: 501

In [9]:
from math import exp
from __future__ import division
print "Example: 12.16 - Page: 501\n\n"

# Solution

#*****Data******#
# Reaction: CaCO3(s) = CaO(s) + CO2(g)
T = 1000## [K]
deltaH_1000 = 1.7533*10**5## [J]
deltaS_1000 = 150.3## [J/mol K]
R = 8.314## [J/mol K]
#****************#

deltaG_1000 = deltaH_1000 - T*deltaS_1000## [J]
K_1000 = exp(-(deltaG_1000/(R*T)))## [bar]
P = K_1000#
print "The decomposition pressure of limestone is %.4f bar at 1000 K"%(P)#
Example: 12.16 - Page: 501


The decomposition pressure of limestone is 0.0493 bar at 1000 K

Example: 12.17 Page: 501

In [11]:
from math import exp,log
from __future__ import division

print "Example: 12.17 - Page: 501\n\n"

# Solution

#*****Data******#
# Reaction: A(s) ---------> B(s) + C(g)
def f1(T):
    deltaG = 85000 - 213.73*T + 6.71*T*log(T) - 0.00028*T**2
    return deltaG
T1 = 400## [K]
T2 = 700## [K]
Pc = 1## [bar]
R = 8.314## [J/mol K]
#**************#

deltaG_400 = f1(400)## [J]
deltaG_700 = f1(700)## [J]
K_400 = exp(-(deltaG_400/(R*T1)))## [bar]
K_700 = exp(-(deltaG_700/(R*T2)))## [bar]
print "The decomposition pressure is %.4f bar at 400 K\n"%(K_400)#
print "The decomposition pressure is %.2f bar at 700 K\n"%(K_700)#

# Equilibrium constant for solid - gas reaction is:
# K = aB*aC/aA = aC = fC = Pc
def f2(T):
    y = Pc - exp(-f1(T)/(R*T))
    return y
T = fsolve(f2,900)## [K]
print "The decomposition temperature is %.3f K"%(T)#
Example: 12.17 - Page: 501


The decomposition pressure is 0.0093 bar at 400 K

The decomposition pressure is 343.20 bar at 700 K

The decomposition temperature is 493.450 K

Example: 12.18 Page: 502

In [26]:
print "Example: 12.18 - Page: 502\n\n"

# Solution

#*****Data******#
T = 875## [K]
K = 0.514#
P = 1## [bar]
#*************#

# Reaction: Fe(s) + H2O(g) --------->FeO(s) + H2(g)
# K = a_FeO*a_H2/(a_Fe*a_H2O)
# Since the activities of the solid components Fe & FeO at equilibrium may be taken as unity.
# a_Fe = a_FeO = 1
# Ka = a_H2/a_H2O#
# Feed:
nH2O_feed = 1#
nH2feed = 0#
# Let e be the degree of completion at equilibrium.
# Moles at Equilibrium:
# nH2O_eqb = 1 - e#
# nH2_eqb = e#
# Total moles at equilibrium = 1 - e + e = 1
# Mole Fractions at Equilibrium:
# yH20_eqb = 1 - e#
# yH2_eqb = e#
# Sum of stoichometric coeffecient:
v = 1 - 1#
Ky = K*P**(-v)#
# Ky = e/(1 - e)
e = Ky/(Ky + 1)#
yH2_eqb = e#
yH2O_eqb = 1 - e#
print "Equilibrium Composition\n"
print "yH2 = %.2f\n"%(yH2_eqb)#
print "y_H2O = %.2f\n"%(yH2O_eqb)#
Example: 12.18 - Page: 502


Equilibrium Composition

yH2 = 0.34

y_H2O = 0.66

Example: 12.19 Page: 503

In [27]:
print "Example: 12.19 - Page: 503\n\n"

# Mathematics is involved in proving but just that no numerical computations are involved.
# For prove refer to this example 12.19 on page number 503 of the book.

print " Mathematics is involved in proving but just that no numerical computations are involved.\n\n"
print " For prove refer to this example 12.19 on page 503 of the book."
Example: 12.19 - Page: 503


 Mathematics is involved in proving but just that no numerical computations are involved.


 For prove refer to this example 12.19 on page 503 of the book.

Example: 12.20 Page: 505

In [28]:
print "Example: 12.20 - Page: 505\n\n"

# Solution

#Reactions:
# CO + (1/2)O2 ------------> CO2 ......................................(1)
# C + O2 ------------------> CO2 ......................................(2)
# H2 + (1/2)O2 ------------> H2O ......................................(3)
# C + 2H2 -----------------> CH4 ......................................(4)

# Elimination of C:
# Combining Eqn. (2) with (1):
# CO + (1/2)O2 ------------> CO2 ......................................(5)
# Combining Eqn. (2) with (4):
# CH4 + O2 ----------------> 2H2 + CO2 ................................(6)

# Elimination of O2:
# Combining Eqn. (3) with (4):
# CO2 + H2 ----------------> CO + H2O .................................(7)
# Combining Eqn. (3) with (6):
# CH4 + 2H2O -------------> CO2 + 4H2 .................................(8)

# Equations 7 & 8 are independent sets. Hence
r = 2## [No. of independent rkn.]
C = 5## [No. of component]
P = 1## [No. of phases]
s = 0## [No special constraint]
# Applying Eqn. 12.81
F = C - P + 2 - r - s## [Degree of freedom]
print "No. of independent reaction that occur is %d\n"%(r)#
print "No. of Degree of freedom is %d"%(F)#
Example: 12.20 - Page: 505


No. of independent reaction that occur is 2

No. of Degree of freedom is 4

Example: 12.21 Page: 506

In [29]:
print "Example: 12.21 - Page: 506\n\n"

# Solution

# Reaction: CaCO3 -----------> CaO + CO2
r = 1## [No. of independent rkn.]
C = 3## [No. of component]
P = 3## [No. of phases, solid CaO, solid CaCO3, gaseous CO2]
s = 0## [No special constraint]
# Applying Eqn. 12.81
F = C - P + 2 - r - s## [Degree of freedom]
print "No. of Degree of freedom is %d"%(F)#
Example: 12.21 - Page: 506


No. of Degree of freedom is 1

Example: 12.22 Page: 508

In [12]:
from scipy.optimize import fsolve
print "Example: 12.22 - Page: 508\n\n"

# Solution

#*********Data*********#
# Reaction: 
# C4H10 -----------> C2H4 + C2H6 ....................................(A)
# C4H10 -----------> C3H6 + CH4 .................................... (B)
T = 750## [K]
P = 1.2## [bar]
Ka = 3.856#
Kb = 268.4#
#************************#

# Let
# ea = Degree of conversion of C4H10 in reaction (A)
# eb = Degree of conversion of C4H10 in reaction (B)

# Moles in Feed:
nC4H10_feed = 1#
nC2H4_feed = 0#
nC2H6_feed = 0#
nC3H6_feed = 0#
nCH4_feed = 0#

# Moles at Equilibrium:
# nC4H10_eqb = 1 - ea - eb
# nC2H4_eqb = ea
# nC2H6_eqb = ea
# nC3H6_eqb = eb
# nCH4_eqb = eb

# Total moles at equilibrium = 1 - ea - eb + ea + eb + eb = 1 + ea + eb

# Mole Fraction:
# yC4H10_eqb = (1 - ea - eb)/(1 + ea + eb)
# yC2H4_eqb = ea/(1 + ea + eb)
# yC2H6_eqb = ea/(1 + ea + eb)
# yC3H6_eqb = eb/(1 + ea + eb)
# yCH4_eqb = eb/(1 + ea + eb)

# Sum of the stoichometric coeffecient:
va = 1 + 1 - 1#
vb = 1 + 1 - 1#

# e = [ea eb]
# Solution of simultaneous equation
def F(e):
    f1 = (((e[0]/(1 + e[0] + e[1]))*(e[0]/(1 + e[0] + e[1])))/((1 - e[0] - e[1])/(1 + e[0] + e[1])))*P**va - Ka#
    f2 = (((e[1]/(1 + e[0] + e[1]))*(e[1]/(1 + e[0] + e[1])))/((1 - e[0] - e[1])/(1 + e[0] + e[1])))*P**vb - Kb#
    return [f1, f2]

# Initial guess:
e = [0.1, 0.8]#
y = fsolve(F, e)#
ea = y[0]#
eb = y[1]#
yC4H10_eqb = (1 - ea - eb)/(1 + ea + eb)#
yC2H4_eqb = ea/(1 + ea + eb)#
yC2H6_eqb = ea/(1 + ea + eb)#
yC3H6_eqb = eb/(1 + ea + eb)#
yCH4_eqb = eb/(1 + ea + eb)#

print "At Equilibrium\n"
print "yC4H10 = %.4f\n"%(yC4H10_eqb)#
print "yC2H4 = %.4f\n"%(yC2H4_eqb)#
print "yC2H6 = %.4f\n"%(yC2H6_eqb)#
print "yC3H6 = %.4f\n"%(yC3H6_eqb)#
print "yCH4 = %.4f\n"%(yCH4_eqb)#
Example: 12.22 - Page: 508


At Equilibrium

yC4H10 = 0.0009

yC2H4 = 0.0535

yC2H6 = 0.0535

yC3H6 = 0.4461

yCH4 = 0.4461