#Variable declaration
# (b).Number of moles of each constituents
nCH4=2; # Number of moles of CH4
#Calculation
E=3-nCH4; # Amount of reaction from (a) and refer example 15.1 (a)
nH2O=1-E;# Number of moles of H2O
nCO=1+E;# Number of moles of CO
nH2=4+3*E;# Number of moles of H2
#Results
print "(b).Number of moles of each constituents","\nNumber of moles of H2O = ",nH2O
print "Number of moles of CO = ",nCO,"\nNumber of moles of H2 = ",nH2
import math
#Variable declaration
T0=298; # Given temperature in kelvin
R_1=8.314; # Universal gas constant in kJ/kg mol K
# (a).CO+1/2 O2 = CO2
# From table of properties of combustion
del_hfco2=-393509;# Enthalpy of heat
del_hfco=-110525;# Enthalpy of heat
s_co2=213.795;# Entropy of heat
s_co=197.652;# Entropy of heat
s_o2=205.142;# Entropy of heat
#Calculation for (a)
del_Ga=(del_hfco2-del_hfco-T0*(s_co2-s_co-(1/2*s_o2)));
Ka=math.exp (abs (del_Ga)/(R_1*1000*T0));
#Result for (a)
print "(a).CO+1/2 O2 = CO2"
print (" The equilibrium constant at 298 K = %0.3f (Error in textbook) ")%Ka
#Calculation for (b)
# (b).2CO + O2 = 2CO2
Kb=math.exp (2*abs (del_Ga)/(R_1*1000*T0));
#Result for (b)
print "\n(b).2CO + O2 = 2CO2"
print ("The equilibrium constant at 298 K = %0.3f (Error in textbook)")%Kb
import math
from __future__ import division
#Variable declaration
T0=298; # Temperature of surroundings in kelvin
R_1=8.314; # Universal gas constant in kJ/kg mol K
T=2800; # Given Temperature in kelvin
#Calculation
# From table of properties of combustion
del_hfco2=-393509; # Enthalpy of heat
del_hfco=-110525; # Enthalpy of heat
del_H=del_hfco2-del_hfco; # Standard enthalpy of reaction
Ka=1.202*10**45; # The equilibrium constant From the example 15.2
K1=math.log (Ka);
K=math.exp(-(del_H/R_1)*((1/T)-(1/T0))+K1);
#Result
print"K =",round(K,3)," (roundoff error)"
import math
#Variable declaration
T=2800; # Temperature of combustion in kelvin
p=1; # Pressure of combustion in atm
# For this reverse reaction at 2800K and 1atm, from Table 15.1
K=44.168; # K=e^3.788;
#Calculation
K=math.sqrt (K); # For stoichiometric equation CO+1/2 O2 = CO2 which is halved
# From equation 15.24a and by the iteration process we get the following
a=0.198;
b=(1+a)/2;
c=1-a;
#Results
print "The balance for the actual reaction equation CO + O2 → aCO + bO2 + cCO2 is given by "
print "a =",a,"\nb =",b,"\nc =",c
import math
from __future__ import division
#Variable declaration
# By driving the equation for equilibrium constant as shown in example 15.6 we get 6.646(6)^(1/6)=((1-a)/a)((3+a)/(1+a))^1/2
# by simple iteration process we get
a=0.095;
#Calculations
b=(1+a)/2;
c=1-a;
#Results
print "The equilibrium composition of CO = ",a,"mol (roundoff error)"
print "The equilibrium composition of O2 = ",b,"mol (roundoff error)"
print "The equilibrium composition of CO2 = ",c,"mol (roundoff error)"
import math
#Variable declaration
T=2800; # Temperature of combustion in kelvin
p=1; # Pressure of combustion in atm
# For this reverse reaction at 2800K and 1atm, from Table 15.1
K=44.168; # K=e^3.788;
#Calculations
K=math.sqrt (K); # For stoichiometric equation CO+1/2 O2 = CO2 which is halved
# From equation 15.24a and by the iteration process we get the following
a=0.302;
b=(1+a)/2;
c=1-a;
#Results
print "The balance for the actual reaction equation CO + 1/2O2 + 1.88N2 ↔ aCO + bO2 + cCO2 +3.76N2 is given by "
print "a =",a,"\nb =",b,"\nc =",c
import math
#Variable declaration
T=3000; # Temperature of combustion in kelvin
p=1; # Pressure of combustion in atm
T0=298; # Temperature of surroundings in kelvin
R_1=8.314; # Universal gas constant in kJ/kg mol K
# Gibbs functions at 298K from Table 14.1
del_gNO=86550; # In kJ/kmol
del_gNO2=51310; # In kJ/kmol
# From table of properties of combustion
del_hfNO=90250; # Enthalpy of heat
del_hfNO2=33180; # Enthalpy of heat
#Calculations
K1=math.exp (-(del_hfNO/R_1)*((1/T)-(1/T0))-((del_gNO)/(R_1*T0)));
K2=math.exp (-(del_hfNO2/R_1)*((1/T)-(1/T0))-((del_gNO2)/(R_1*T0)));
# By solving equilibrium equations by iteration method
E1=0.228; E2=0.0007;
yNO=E1/4.76; # Mole fraction of NO in exhaust gas
yNO2=E2/4.76; # Mole fraction of NO2 in exhaust gas
#Results
print "Percentage of NOx present in the exhaust gas ","\nMole fraction of NO in exhaust gas = ",round(yNO*100,2),"%"
print "Mole fraction of NO2 in exhaust gas = ",round(yNO2*100,4),"%"