Prob-4 5
Prob-4 5
Prob-4 5
445
Concepts Demonstrated
Problem Definition
Ethane reacts with steam to form hydrogen over a cracking catalyst at a temperature of T = 1000 K and pressure of P = 1 atm. The feed contains 4 moles of H2O
per mole of CH4. Balzisher et al.1 suggest that only the compounds shown in
Table 410 are present in the equilibrium mixture (assuming that no carbon is
deposited). The Gibbs energies of formation of the various compounds at the temperature of the reaction (1000K) are also given in Table 410. The equilibrium
composition of the effluent mixture is to be calculated using these data.
Table 410 Compounds Present in Effluent of Steam Cracking Reactor1
No.
1
2
3
4
5
6
7
8
9
Component
CH4
C2H4
C2H2
CO2
CO
O2
H2
H2O
C2H6
Gibbs Energy
kcal/gm-mol
4.61
28.249
40.604
-94.61
-47.942
0
0
-46.03
26.13
Feed
gm-mol
4
1
Effluent
Initial Estimate
0.001
0.001
0.001
0.993
1
0.0001a
5.992
1
0.001
aThis initial estimate is more realistic and useful than the original
446
CHAPTER 4
(a) Formulate the problem as a constrained minimization problem. Introduce the constraints into the objective function using Lagrange multipliers and differentiate this function to obtain a system of nonlinear
algebraic equations.
(b) Use the POLYMATH Constrained solution algorithm to find the
solution to this system of nonlinear equations. Start the iterations
from the initial estimates shown in Table 410.
(c) Use Excel's Solver to solve the problem as a constrained minimization problem without the use of Lagrange multipliers and without differentiation of the objective functions. Compare the results with those
obtained in (b).
4.5.5
Solution
G
-------RT
G0
i
i + ln ---------
ni ------RTn
i
i=1
(4-49)
where ni is the number of moles of 0component i, c is the total number of compounds, R is the gas constant and Gi is the Gibbs energy of pure component i at
temperature T. The minimization of Equation (4-49) must be carried out subject
to atomic balance constraints
Oxygen Balance
g1
= 2 n4 + n 5 + 2 n6 + n7 4 = 0
(4-50)
Hydrogen Balance
g2
= 4 n 1 + 4 n 2 + 2 n 3 + 2 n 7 + 2 n 8 + 6 n 9 14 = 0
(4-51)
Carbon Balance
g3
n1 + 2 n 2 + 2 n3 + n4 + n 5 + 2 n9 2
= 0
(4-52)
ni 3
G0i
+ ln ---------- +
n ------RT
n i
i=1
j=1
j gj
(4-53)
The condition for minimum of this function at a particular point is that all the
partial derivatives of F with respect to ni and j vanish at this point. The partial
derivative of F with respect to n1, for example, is
F
=
n1
G0
n
ni
1
1
+ ln ---------- + 4 2 + 3
-------RT
= 0
(4-54)
447
n1 n i exp --------1 + 4 2 + 3
RT
= 0
(4-55)
The partial derivatives of F with respect to 1, 2 and 3 are g1, g2 and g3 respectively.
The complete set of nonlinear equations, as entered into the POLYMATH Nonlinear Algebraic Equation Solver, is shown in Table 411. There are
12 implicit equations associated with the 12 unknowns. In the POLYMATH
input, the amount (moles) of a compound (ni) is represented by the formula of the
compound, for clarity. The equations associated with O2 and C2H2 are written in
the form of Equation (4-55) as preliminary tests have shown difficulty in convergence of the solution algorithm when the equations that contain logarithms of
the amount of those compounds are used.
(b)
Table 411 Equation Input to the POLYMATH Nonlinear Equation Solver Program - File P4-05B1.POL
No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Equation, # Comment
R = 1.9872
sum = H2 + O2 + H2O + CO + CO2 + CH4 + C2H6 + C2H4 + C2H2
f(lamda1) = 2 * CO2 + CO + 2 * O2 + H2O - 4 # Oxygen balance
f(lamda2) = 4 * CH4 + 4 * C2H4 + 2 * C2H2 + 2 * H2 + 2 * H2O + 6 * C2H6 - 14 # Hydrogen balance
f(lamda3) = CH4 + 2 * C2H4 + 2 * C2H2 + CO2 + CO + 2 * C2H6 - 2 # Carbon balance
f(H2) = ln(H2 / sum) + 2 * lamda2
f(H2O) = -46.03 / R + ln(H2O / sum) + lamda1 + 2 * lamda2
f(CO) = -47.942 / R + ln(CO / sum) + lamda1 + lamda3
f(CO2) = -94.61 / R + ln(CO2 / sum) + 2 * lamda1 + lamda3
f(CH4) = 4.61 / R + ln(CH4 / sum) + 4 * lamda2 + lamda3
f(C2H6) = 26.13 / R + ln(C2H6 / sum) + 6 * lamda2 + 2 * lamda3
f(C2H4) = 28.249 / R + ln(C2H4 / sum) + 4 * lamda2 + 2 * lamda3
f(C2H2) = C2H2 - exp(-(40.604 / R + 2 * lamda2 + 2 * lamda3)) * sum
f(O2) = O2 - exp(-2 * lamda1) * sum
H2(0) = 5.992
O2(0) = 0.0001 > 0
H2O(0) = 1
CO(0) = 1
CH4(0) = 0.001 > 0
C2H4(0) = 0.001 > 0
C2H2(0) = 0.001 > 0
CO2(0) = 0.993
C2H6(0) = 0.001 > 0
lamda1(0) = 10
lamda2(0) = 10
lamda3(0) = 10
448
CHAPTER 4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Variable
C2H2
C2H4
C2H6
CH4
CO
CO2
H2
H2O
lamda1
lamda2
lamda3
O2
R
sum
Value
3.157E-10
9.541E-08
1.671E-07
0.0665638
1.388517
0.5449182
5.345225
1.521646
24.41966
0.2530591
1.559832
5.459E-21
1.9872
8.866871
f(x)
7.238E-25
-2.58E-13
-1.688E-13
0
2.442E-15
-1.11E-15
1.11E-16
-1.665E-15
0
0
0
-5.687E-27
Initial Guess
0.001
0.001
0.001
0.001
1.
0.993
5.992
1.
10.
10.
10.
0.0001
significant amounts of H2 (5.345 moles per mole of C2H6 feed), H2O, CO, CO2
and CH4 and contains only trace amounts of C2H6, C2H4, C2H2 and O2. All the
function values are smaller by several orders of magnitude than the respective
variable values, indicating that the solution is correct. The same values were
obtained also by Balzisher et al.1, who used a dedicated FORTRAN program to
solve the same problem.
449
The value of the objective function at this point may be added to the POLYMATH problem by including Equation (4-49). The additional equations comprising Equation (4-49) are summarized in Table 413. The objective function value
at the solution is -104.34, and this can be used to compare the POLYMATH solution with the Excel solution in part (c).
Table 413 Equations for Calculation of the Gibbs Energy Function - File P4-05B2.POL
Line
1
2
3
4
5
6
7
8
9
10
Equation
G_O2 = O2 * ln(abs(O2 / sum))
G_H2 = H2 * ln(H2 / sum)
G_H2O = H2O * (-46.03 / R + ln(H2O / sum))
G_CO = CO * (-47.942 / R + ln(CO / sum))
G_CO2 = CO2 * (-94.61 / R + ln(CO2 / sum))
G_CH4 = CH4 * (4.61 / R + ln(abs(CH4 / sum)))
G_C2H6 = C2H6 * (26.13 / R + ln(abs(C2H6 / sum)))
G_C2H4 = C2H4 * (28.249 / R + ln(abs(C2H4 / sum)))
G_C2H2 = C2H2 * (40.604 / R + ln(abs(C2H2 / sum)))
ObjFun = G_H2 + G_H2O + G_CO + G_O2 + G_CO2 + G_CH4 + G_C2H6 + G_C2H4 + G_C2H2
The use of the Excel Add-In Solver* to solve this problem requires only
the Gibbs Energy objective function of Equation (4-49) as presented in Table 4
13 and the atomic material balance constraints given by Equations (4-50), (4-51)
and (4-52). It is convenient to enter these needed equations into Excel via POLYMATH. The resulting equations from POLYMATH as exported to Excel are given
in Table 414. Note that the Gibbs Energy objective function is in line 4, and the
atomic constraints are in lines 5, 6 and 7. The equations in line 4 and lines 9
through 18 are components of the objective function (Equation (4-49). Lines 19
through 27 provide the initial estimates for the nine problem variables.
(c)
Table 414 Gibbs Energy Minimization with Atom Balance Constraints as Exported from POLYMATH to
Excel - Files P4-05C.POL and P4-05C.XLS
A
B
C
D
E
1 POLYMATH NLE Migration Document
2
Variable Value
Polymath Equation
3 Explicit Eqs R
1.9872
R=1.9872
4
sum
8.996
sum=H2 + H2O + CO + O2 + CO2 + CH4 + C2H6 + C2H4 +
C2H2
5
OxBal
-4.441E-16
OxBal=2 * CO2 + CO + 2 * O2 + H2O - 4
6
HydBal 0
HydBal=4 * CH4 + 4 * C2H4 + 2 * C2H2 + 2 * H2 + 2 * H2O +
6 * C2H6 - 14
7
CarBal 0
CarBal=CH4 + 2 * C2H4 + 2 * C2H2 + CO2 + CO + 2 * C2H6 2
8
eps
1E-21
eps=0.1e-20
9
G_O2
-0.0501104
G_O2=O2 * ln(abs((O2 + eps) / sum))
* The Excel Add-In Solver may require special installation from Microsoft Excel or the
Microsoft Office. If this Add-In is not available from the drop-down Tools/Add-Ins menu in
Excel, please consult the Microsoft instructions to install this software.
450
CHAPTER 4
Table 414 Gibbs Energy Minimization with Atom Balance Constraints as Exported from POLYMATH to
Excel - Files P4-05C.POL and P4-05C.XLS
10
11
12
13
14
15
16
17
18
B
G_H2
G_H2O
G_CO
G_CO2
G_CH4
G_C2H6
G_C2H4
G_C2H2
ObjFun
19
20
21
22
23
24
25
26
27
O2
H2
H2O
CO
CH4
C2H4
C2H2
CO2
C2H6
C
D
E
-2.4348779
G_H2=H2 * ln(H2 / sum)
-25.360025
G_H2O=H2O * (-46.03 / R + ln(H2O / sum))
-26.322183
G_CO=CO * (-47.942 / R + ln(CO / sum))
-49.464812
G_CO2=CO2 * (-94.61 / R + ln(CO2 / sum))
-0.0067847
G_CH4=CH4 * (4.61 / R + ln(CH4 / sum))
0.00404462
G_C2H6=C2H6 * (26.13 / R + ln(abs((C2H6 + eps) / sum))
0.00511094
G_C2H4=C2H4 * (28.249 / R + ln(abs((C2H4 + eps) / sum))
0.01132823
G_C2H2=C2H2 * (40.604 / R + ln(abs((C2H2 + eps) / sum))
-103.61831
ObjFun=G_H2 + G_H2O + G_CO + G_O2 + G_CO2 + G_CH4
+ G_C2H6 + G_C2H4 + G_C2H2
0.007
O2=0.007
5.992
H2=5.992
1
H2O=1
1
CO=1
0.001
CH4=0.001
0.001
C2H4=0.001
0.001
C2H2=0.001
0.993
CO2=0.993
0.001
C2H6=0.001
It should be noted that the Solver Add-In cannot find the minimum when
Equation (4-49) is entered in its original form. Excel execution stops with error
messages indicating that there is an attempt to calculate logarithm of a negative
number. In order to prevent calculation of logarithm of a negative number or logarithm of zero, the expressions for calculating the partial Gibbs energy of some of
the compounds have been changed according to
Gi
-------RT
G 0i
n -------- + ln
RT
n i +
abs --------------
ni
(4-56)
where is a very small number ( = 1 1021 ). This equation is used only for the
compounds which present in trace amounts in the effluent: O2, C2H2, C2H4 and
C2H6.
The use of the Excel Solver Add-In for the solution of this minimization
problem is best explained with reference to Figures 451, 452 and 453. After
the Solver interface is requested within the Excel Tools drop-down menu as
shown in Figure 451, the Target Cell to be minimized should be entered as cell
C18 which contains the formula for the objective function (see Table 414). Next
the Equal to: option should be set to Min. The cells to be changed are the cells
which contain the numbers of moles of the various compounds which is indicated
in Excel by $C$19:$C$27. The three constraint equations from the atomic material balance constraints given by Equations (4-50), (4-51) and (4-52) are entered
by reference to the Excel cell containing each equation as shown in Figure 451.
These balances should all be equal to zero at the solution. Addition of the first
451
CHAPTER 4
Figure 451
Figure 452
The constraints regarding the positive value of the compounds can be specified in the Options communication box shown in Figure 453. Two default
options must be changed with the Options button to obtain a solution. First,
Assume Non-Negative must be selected; otherwise the Solver converges to a
solution where some of the mole numbers are negative. Second, Use Automatic
Scaling must also be selected in order to obtain a feasible solution. The Excel
Solver solution is partially shown in Figure 454.
Figure 453
452
CHAPTER 4
Figure 454
Component
CH4
C2H4
C2H2
CO2
CO
O2
H2
H2O
C2H6
Gibbs
Energy
Initial Estimate
0.001
0.001
0.001
0.993
1
0.007
5.992
1
0.001
-103.61831
POLYMATH
0.066564
9.54E-08
3.16E-10
0.544918
1.388517
5.46E-21
5.345225
1.521646
1.67E-07
-104.34
Excel Solver
0.00149444
1.0112E-06
2.9847E-07
0.53441967
1.46396259
0
5.52962977
1.46719804
6.0332E-05
-104.27612
The problem solution files are found in directory CHAPTER 4 and designated
,
,
, and
.
P4-05B1.POL P4-05B2.POL P4-05C.POL
P4-05C.XLS