Chapter 9 : Chemical Reaction Equilibria

Example 9.6

In [20]:
import math
#Given:
Go_reac = 97540.; 			#standard free energy of formation of reactant (J/mol)
Go_pdt = 51310.; 			#standard free energy of formation of product (J/mol)
R = 8.314; 			#ideal gas constant
T = 298.; 			#temperature (K)
#Reaction: N2O4(g) --> 2NO2(g)

# Calculations
#To calculate equilibrium constant
#Using eq. 9.50 (Page no.413)
Go = 2*Go_pdt - Go_reac;
#Using eq. 9.31 (Page no. 406)
K = math.e**(-Go/(R*T))

# Results
print 'The equilbrium constant %f'%K
The equilbrium constant 0.128684

Example 9.7

In [21]:
# Variables
T1 = 298.; 			#temperature in K
Hf = -46100.; 			#standard heat of formation (J/mol)
Go = -16500.; 			#standard free energy change (J/mol)
R = 8.314; 			#ideal gas constant
T = 500.; 
#Reaction: N2(g) + 3H2(g) --> 2NH3(g)
#To calculate the equilibrium constant at 500 K
#Using eq. 9.50 (Page no. 413)

# Calculations
del_Go = 2*Go;
import math
#Using eq. 9.31 (Page no. 406)
K1 = math.e**(-del_Go/(R*T1)) 			#equilibrium const at 298 K
Ho = 2*Hf; 			#standard heat of reaction

#Using eq. 9.37 (Page no. 411)
K = K1*(math.e**((-Ho/R)*(1/T - 1/T1)))

# Results
print 'The equilibrium constant at 500 K is %f'%K
The equilibrium constant at 500 K is 0.179981

Example 9.8

In [22]:
# Variablesa
R = 8.314; 			#ideal gas constant
T2 = 317.; 			#temperature in K
T1 = 391.; 			#(K)
x2 = 0.31; 			#mol fraction of n-butane at 317 K
x1 = 0.43; 			#mol fraction of iso-butane at 391 K

# Calculations
#To calculate standard free energy change and heat of reaction
#At 317 K
K2 = (1-x2)/x2; 			#equilibrium constant at 317 K
K1 = (1-x1)/x1; 			#equilibrium constant at 391 K
import math
#Using eq. 9.31 (Page no. 406)
#Standard free energy change
G2 = -R*T2*math.log(K2 )			#at 317 K (J/mol)
G1 = -R*T1*math.log(K1 )			#at 391 K (J/mol)

#Using eq. 9.37 (Page no. 411)
Ho = -math.log(K2/K1)*R/(1/T2 - 1/T1)

# Calculations
print 'Standard free energy change of the reaction'
print ' At 317 K is %f J/mol'%G2
print ' At 391 K is %f J/mol'%G1
print ' Average value of heat of reaction is %f J/mol'%Ho
Standard free energy change of the reaction
 At 317 K is -2108.744820 J/mol
 At 391 K is -916.234397 J/mol
 Average value of heat of reaction is -7217.201631 J/mol

Example 9.9

In [23]:
# Variables
To = 298.; 			#temperature in K
T = 700.; 			#(K)
R = 8.314; 			#ideal gas constant
Hf = -46100.; 			#standard heat of formation (J/mol)
Gf = -16500.; 			#standard free energy of formtion of ammonia (J/mol)

# Calculations
Ho = 2*Hf;
Go = 2*Gf;
alpha = 2*29.75 - 27.27 - 3*27.01;
betta = (2*25.11 - 4.93 - 3*3.51)*10**-3;
import math
#Using eq. 9.46 (Page no. 412)
del_H = Ho - alpha*To - (betta/2)*To**2;
#Using eq. 9.48 (Page no. 413)
A = -(Go - del_H + alpha*To*math.log(To) + (betta/2)*To**2)/(R*To)

#Using eq. 9.47 and 9.48 (Page no. 412)
K = math.e**((-del_H/(R*T)) + (alpha/R)*math.log(T) + (betta/(2*R))*T + A)
G = del_H - alpha*T*math.log(T) -(betta/2)*T**2 - A*R*T;

# Results
print 'At 700 K'
print ' Equilibrium constant is %3.2e'%K
print ' Standard free energy change is %f J/mol'%G
At 700 K
 Equilibrium constant is 9.99e-05
 Standard free energy change is 53606.315911 J/mol

Example 9.10

In [24]:
# Variables
T = 600.; 			#temperature in K
R = 8.314; 			#ideal gas constant

#Gibbs free energy at 600 K (J/mol K)
Gc = -203.81; 			#for CO
Gh = -136.39; 			#for hydrogen
Gm = -249.83; 			#for methanol

#Heats of formation at 298 K (J/mol)
Hc = -110500.; 			#for CO
Hm = -200700.; 			#for methanol
import math

# Calculations
#To calculate equilibrium constant at 600 K
Go = T*((Gm-Gc-(2*Gh)) + (1/T)*(Hm-Hc))
			#Using eq. 9.31 (Page no. 406)
K = math.e**(-Go/(R*T))

# Results
print 'Equilibrium constant is %4.3e'%K
Equilibrium constant is 1.018e-04

Example 9.11

In [25]:
# Variables
T = 500.; 			#temperature in K
R = 8.314; 			#ideal gas constant

#Free energy at 500 K (J/mol K)
Fn = -177.5; 			#for nitrogen
Fh = -116.9; 			#for hydrogen
Fa = -176.9; 			#for ammonia

#The function (Ho at 298 K - Ho at 0 K) [J/mol]
Hn = 8669.; 			#for nitrogen
Hh = 8468.; 			#for hydrogen
Ha = 9920.; 			#for methanol

#Free energy of formation at 298 K (J/mol)
Hf = -46100.;
import math
#To calculate equilibrium constant at 500 K

# Calculations
#Using eq. 9.53 (Page no. 414)
sum_F = (2*Fa - Fn - 3*Fh) - (2*Ha - Hn - 3*Hh)/T; 			#(J/mol K)
#Using eq. 9.57 (Page no.415)
Go = T*(sum_F + 2*Hf/T)
K = math.e**(-Go/(R*T))

# Results
print 'Equilibrium constant is %f'%K
Equilibrium constant is 0.108493

Example 9.12

In [26]:
# Variables
P1 = 1.; 			#pressure (bar)
P2 = 2.; 			#(bar)
x1 = 0.15; 			#mol fraction of polymer at 1 bar
x2 = 0.367; 			#mol fraction of polymer at 2 bar

# Calculations
import math
n = round((math.log(x2/x1)+math.log(2))/(math.log(2)-math.log((1-x1)/(1-x2))))

# Results
print 'The value of n is %i'%n
The value of n is 4

Example 9.13

In [27]:
from scipy.optimize import root

# Variables
#Reaction: N2 + 3H2 --> 2NH3
K = 2*10**-4; 			#equilibrium constant of reaction
P = 20; 			#(bar)

# Calculations and Results
#e(4-2e)/(1-e)**2 = 0.73485
#e = poly(0,'e')
def f(e):
    return 2.73845*e**2 - 5.4697*e + 0.73485;
x = root(f,0)

print '(a) Percentage conversion is %f percent'%(x.x[0]*100)

#(b)
P = 200; 			#(bar)

#e(4-2e)/(1-e)**2 = 7.3485

def f2(e):
    return  9.3485*e**2 - 18.697*e + 7.3485;
x = root(f2,0)
print ' (b) Percentage conversion is %f percent'%(x.x[0]*100)
(a) Percentage conversion is 14.485445 percent
 (b) Percentage conversion is 53.746561 percent

Example 9.14

In [28]:
# Variables
K = 1; 			#equilibrium constant for reaction

# Calculations and Results
e = 1./2;
print '(a) Fractional dissociation of steam is %i percent'%(e*100)

#On solving we get
e = 1./2;
print ' (b) After dilution fractional distillation of steam is %i percent'%(e*100)
(a) Fractional dissociation of steam is 50 percent
 (b) After dilution fractional distillation of steam is 50 percent

Example 9.15

In [29]:
from scipy.optimize import root

# Variables
K = 2.*10**-4; 			#equilibrium constant of reaction
P = 20.; 			#pressure in bar



def f(e):
    return 1.3674*e**2 - 3.7348*e + 0.3674;
x = root(f,0)

# Results
print 'Percentage coversion in presence of argon is %f percent'%(x.x[0]*100)
print ' while in absence of argon is 14.48 percent' 			#From example 9.13
Percentage coversion in presence of argon is 10.219587 percent
 while in absence of argon is 14.48 percent

Example 9.16

In [30]:
# Variables
P = 1.; 			#pressure in bar
K = 1.; 			#equilibrium constant of reaction

e)(2-e)] = K = 1% so

e = 2./3;
print '(a). The conversion of steam is %f percent'%(e*100)

#(b). CO supplied is only 50% of the theoretical requirement
#Mole fraction of components
#CO: (0.5-e)/1.5
#H20: (1-e)/1.5
#CO2: e/1.5
#H2: e/1.5

#e**2/[(0.5-e)(1-e)] = K = 1
#1.5e-0.5 = 1
e = 0.5/1.5;
print ' (b). Percentage conversion of steam is %f percent'%(e*100)
(a). The conversion of steam is 66.666667 percent
 (b). Percentage conversion of steam is 33.333333 percent

Example 9.17

In [31]:
# Variables
K = 1.; 			#equilibrium constant of reaction

# Calculations
e = 1./3;

# Results
print 'Percentage conversion of steam is %f percent'%(e*100)
Percentage conversion of steam is 33.333333 percent

Example 9.18

In [32]:
# Variables
#Reaction: CO(g) + 2H2(g) --> CH3OH(g)
Kf = 4.9*10**-5;
Kfi = 0.35;
P = 300.; 			#pressure in bar
n_CO = 25.;
n_H2 = 55.;
n_inert = 20.;
v = -1-2+1; 			#change in number of moles in reaction

# Calculations
#Mole fractions in the equilibrium mixture
#CO = (25-e)/(100-2e)
#H2 = (55-2e)/(100-2e)
#CH3OH = e/(100-2e)

Ky = (Kf/Kfi)*P**(-v)
			#[e/(100-2e)]/[(25-e)/(100-2e)][(55-2e)/(100-2e)]**2 = Ky% so

def f(e):
    return  (4+4*Ky)*e**3 - (400+320*Ky)*e**2 + (10000+8525*Ky)*e - 75625*Ky

x = root(f,0)
conv = x.x[0]/n_CO; 			#first two roots are complex

# Results
print 'Percentage conversion of CO is %f percent'%(conv*100)
Percentage conversion of CO is 61.015734 percent

Example 9.19

In [33]:
# Variables
#Reaction: 1/2N2 + 3/2H2 --> NH3
Kp = 1.25*10**-2 ;			#equilibrium constant
P = 50; 			#pressure in bar
v = 1-(3./2)-(1./2) 			#change in number of moles in reaction

#Initial composition of gas mixture
n_h = 60.;
n_n = 20.;
n_inert = 100-n_h-n_n;

# Calculations

Ky = Kp*(P**-v)
#e/(100-e)/[(20-(e/2)]**1/2[{60-(3e/2)}/(100-e)]**3/2 = Ky
#e = poly(0%'e'

def f(e):
    return (1.6875*Ky**2-1)*e**4 - (270*Ky**2+200)*e**3 + (16200*Ky**2-10000)*e**2 - (334800*Ky**2)*e + 4320000*Ky**2;
x = root(f,0)
e = x.x[0]

#x(4) being the only positive root is the percentage conversion
#Mole fractions in equilibrium mixture
x_n = (20-(e/2))/(100-e)
x_h = (60-3*(e/2))/(100-e)
x_a = e/(100-e)
x_inert = 1 - x_n - x_h - x_a;

# Results
print 'Composition of gas leaving the reactor is'
print ' Nitrogen  : %f percent'%(x_n*100)
print ' Hydrogen  : %f percent'%(x_h*100)
print ' Ammonia   : %f percent'%(x_a*100)
print ' Inert gas : %f percent'%(x_inert*100)
Composition of gas leaving the reactor is
 Nitrogen  : 17.048802 percent
 Hydrogen  : 51.146406 percent
 Ammonia   : 9.837327 percent
 Inert gas : 21.967465 percent

Example 9.20

In [34]:
# Variables
P = 85.; 			#pressure in bar
n_e = 0.015; 			#mol percent of ethanol
n_w = 0.95; 			#mole percent of water
n_a = 0.48; 			#mol percent of ethylene in vapour phase
M = 18.; 			#molecular mass of water
fc = 0.9; 			#fugacity coeffecient for ethylene

#To evaluate the equilibrium constant
#K = a_c/(a_a*a_b)
# Calculations
m_e = n_e/(n_w*M*10**-3) 			#mol/kg water
a_c = m_e;
fa = fc*n_a*P; 			#bar
a_a = fa;

#Since mol fraction of water is close to unity% so fugacity coeffecient of water is assumed to be 1
a_b = n_w;
K = a_c/(a_a*a_b)

# Results
print 'The equilibrium constant is %5.4e (mol C2H4)/(kg water bar)'%K
The equilibrium constant is 2.5146e-02 (mol C2H4)/(kg water bar)

Example 9.21

In [35]:
# Variables
T = 1000.; 			#temperature of reaction in K
P = 1.; 			#pressure in bar
R = 8.314; 			#ideal gas constant
import math

#Function for standard free energy of the reaction
def G(T):
    y = 1.8856*10**5 - 243.42*T + 11.8478*T*math.log(T) - 3.1045*10**-3*T**2 + 1.7271*10**-6*T**3 - (4.1784*10**5)/T
    return y

# Calculations and Results
K = math.e**(-Go/(R*T))
#Using eq. 9.75 (Page no. 432)
p_CO2 = K; 			#decomposition pressure
print 'Decomposition pressure of limestone at 1000 K s %f bar'%p_CO2

#At pressure = 1 bar
K = 1.;
Go = 0.; 			#since K = 1

T = 1160.; 			#assumed temperature (K)
flag = 1.;
while(flag==1):
    res = round(G(T))
    if(res<=0):
        flag = 0;
    else:
        T = T+1;

print 'Decomposition temperature at 1 bar is %i K'%T
Decomposition pressure of limestone at 1000 K s 0.048344 bar
Decomposition temperature at 1 bar is 1169 K

Example 9.22

In [36]:
# Variables
K = 0.403; 			#equilibrium constant of reaction
T = 1200.; 			#temperature of reaction (K)
To = 273.; 			#standard temperature (K)
Vo = 22.4*10**-3; 			#molar volume at STP 
M = 55.8; 			#molecular mass of iron
n = 100.; 			#moles of gas entering
n_C = 20.; 			#moles of carbon mono oxide
n_N = 80.; 			#moles of nitrogen


# Calculations
#Let e be the extent of reaction
#Mole fractions in equilibrium mixture
#CO = (20-e)/100
#CO2 = e/100
#e/(20-e) = K
e = (20*K)/(1+K)
n_CO2 = e; 			#moles of CO2 at equilibrium
n_Fe = n_CO2; 			#by stoichiometry
V = (n*Vo*T)/To; 			#volume of 100 mol of gas at 1200 K and 1 bar

#Let m be iron produced per 100 m**3 gas
m = (n_Fe*100*M)/V;

# Results
print 'Iron produced per 100 cubic m of gas is %f kg'%(m/1000)
Iron produced per 100 cubic m of gas is 3.255704 kg

Example 9.23

In [37]:
from scipy.optimize import fsolve

# Variables
P = 1.; 			#pressure in bar
K1 = 0.574; 			#equilibrium constant for eq. 9.88 (Page no. 437)
K2 = 2.21; 			#equilibrium constant for eq. 9.89 (Page no. 437)

v1 = 1+3-1-1;
v2 = 1+1-1-1;
Ky1 = K1*P**-v1;
Ky2 = K2*P**-v2;

# Calculations
#mole fractions in equilibrium mixture are:
#CH4: (1-e1)/(6+2e1)
#H2O: (5-e1-e2)/(6+2e1)
#CO: (e1-e2)/(6+2e1)
#H2: (3e1+e2)/(6+2e1)
#CO2: e2/(6+2e1)

#For 1st reaction:
#Ky1 = [(e1-e2)(3e1+e2)**3]/[(1-e1)(5-e1-e2)(6+2e1)**2]
#For 2nd reaction:
#Ky2 = [e2(3e1+e2)]/[(e1-e2)(5-e1-e2)]
#on solving% we get:

def f2(e):
    f_1 = ((e[0]-e[1])*(3*e[0]+e[1])**3)/((1-e[0])*(5-e[0]-e[1])*(6+2*e[0])**2)-Ky1
    f_2 = (e[1]*(3*e[0]+e[1]))/((e[0]-e[1])*(5-e[0]-e[1]))-Ky2
    y = [f_1,f_2]
    return y
eo = [0.9,0.6]; 			#initial guesses
e = fsolve(f2,eo)

			#Mole fraction of components:
n_m = (1-e[0])/(6+2*e[0])
n_w = (5-e[0]-e[1])/(6+2*e[0])
n_CO = (e[0]-e[1])/(6+2*e[0])
n_h = (3*e[0]+e[1])/(6+2*e[0])
n_c = e[1]/(6+2*e[0])

# Results
print 'Mole fraction of the components are:'
print ' Methane = %f'%n_m
print ' Water = %f'%n_w
print ' Carbon monoxide = %f'% n_CO
print ' Hydrogen = %f'%n_h
print ' Carbon dioxide = %f'%n_c
Mole fraction of the components are:
 Methane = 0.011240
 Water = 0.441597
 Carbon monoxide = 0.035687
 Hydrogen = 0.430593
 Carbon dioxide = 0.080883

Example 9.24

In [38]:
# Variables
#A system consisting of CO% CO2% H2% H2O% CH4


r = 2.;
C = 5.; 			#no. of components
pi = 1.; 			#no. of phases

# Calculations
#From eq. 9.90 (Page no. 438)
F = C-pi-r+2;

# Results
print 'The number of degrees of freedom are %i'%F
The number of degrees of freedom are 4
In [ ]: