Page 212 - Physical Chemistry
P. 212
lev38627_ch06.qxd 3/3/08 10:07 AM Page 193
193
To get the initial setup of the spreadsheet, enter data, labels, and formulas as Section 6.5
shown in Fig. 6.9b. The spreadsheet will appear as shown in Fig. 6.9a. Cells B10, C10, Simultaneous Equilibria
and D10 contain the initial moles of the elements. Cells F11 and G11 contain the equi-
librium constants calculated from the current values of the equilibrium mole numbers
and P/n P° using the equations in (6.48). Cells B12, C12, and D12 contain the frac-
tot
tional errors in the mole numbers of each element and cells F12 and G12 contain the
fractional errors in the calculated equilibrium constants. Make sure you understand all
the formulas in Fig. 6.9b. To solve the problem, we need to make cells B12, C12, D12,
F12, and G12 differ negligibly from zero.
We shall use the Solver (Sec. 6.4) in Excel to do this. (Mathcad has what is called
a solve block to solve a system of simultaneous equations subject to specified con-
straints. Maple V has the function fsolve that will solve simultaneous equations for
roots that lie in specified ranges; Mathematica has the function FindRoot.)
After setting up the Excel spreadsheet as in Figs. 6.9a and 6.9b, choose Solver on
the Tools menu (or from the Data tab in Excel 2007). In the Solver Parameters dialog
box that opens, enter F12 in the Set Target Cell box, click Value of after Equal To and
enter 0 after Equal To. In the By Changing Cells box enter B6:F6 to tell Excel that
the numbers in these five cells (the equilibrium mole numbers) are to be varied. To
enter the remaining conditions to be satisfied, click Add below Subject to the
Constraints. In the Add Constraint box that opens, enter G12 under Cell Reference,
choose in the drop-down list in the middle, and enter 0 at the right. Click Add. Then
enter B12:D12 under Cell Reference, choose , and enter 0 at the right. We have
now specified the five conditions to be satisfied, but it is also desirable to give Excel
some guidance on the unknown mole numbers. These numbers cannot be negative or
zero, so we shall require them to each be larger than some very small number, say,
10 14 . Therefore enter B6:F6 under Cell Reference in the Add Constraint box,
choose , and enter 1E-14 at the right. Then click OK to close the Add Constraint
box. In the Solver Parameters box, you will see the constraints listed. (The $ signs can
be ignored.)
Now click on Solve in the Solver Parameters box. When Excel displays the Solver
Results box telling you that it has found a solution, click OK. The spreadsheet now
looks like Fig. 6.10. The desired solution is shown in cells B6 to F6. The fractional
6
errors in F12 and G12 are less than 10 , which is the default value of the Precision
parameter in Excel.
To save the results, select cells B6 to G6 by dragging over them with the mouse,
choose Copy from the Edit menu, click on cell B15, and choose Paste from the Edit
menu to paste the results into cells B15 to G15. Also, enter the pressure value 0.01 in
A15 and in row 14 put labels for the data. (In Excel 2007, choose Copy and Paste from
the Home tab.)
A B C D E F G
1 CH4+H2O=CO+3H2 K1= 1.3 T/K= 900
2 CH4+2H2O=CO2+4H2 K2= 2.99 P/bar= 0.01
3
4 CH4 H2O CO2 H2 CO
5 initial mol 1 1 1 1 2 ntot
6 eq mol 0.0006101 0.3248051 0.675805 3.6739747 3.3235849 7.9987798
7 (P/bar)/ntot
8 0.0012502
9 carbon hydrogen oxygen Figure 6.10
10 initial 4 8 5 K1calc K2calc The spreadsheet of Fig. 6.9 after
11 equilib 4 8 5 1.2999999 2.9899998 running the Solver to make the
12 fractnl erro 0 0 0 fractnl error -1.06E-07 -7.62E-08 fractional errors close to zero.