Você está na página 1de 4

Chemical Stoichiometry UsingMATLAB

P. K. Andersen and G.Bjedov


Department of Freshman Engineering
Purdue University
West Lafayette, IN 47907

There is a fourth method, which is arguably more general


Abstract and powerful than the other three:
In beginning chemistry courses, students are • Algebraic Method. The unbalanced chemical
taught a variety of techniques for balancing chemical equation is used to define a system of linear
equations. The determination of the stoichiometric equations, which can then be solved to yield the
coefficients in a chemical equation is mathematically stoichiometric coefficients [4, 5].
equivalent to solving a system of linear algebraic
equations, a problem for which MATLAB is ideally The algebraic method has traditionally been less popular
suited. Using MATLAB, it is possible to balance than the alternatives, probably because of the
equations describing all kinds of chemical inconveniences related to solving systems of equations.
transformations, including acid-base reactions, redox However, modern mathematics software handle such
reactions, electrochemical half-reactions, combustion systems with ease, making the algebraic method much
reactions, and synthetic reactions. MATLAB is especially more attractive.
convenient for balancing chemical equations that are
difficult to treat by traditional methods.
A Simple Example
Introduction The algebraic method is perhaps best grasped by
way of an example. The combustion of methane in
A number of different techniques have oxygen can be represented by the chemical equation
traditionally been taught in beginning chemistry courses
for balancing chemical reactions. Three methods are x 1CH 4 + x 2O2 → x3CO 2 + x4 H2O
commonly found in introductory textbooks [1–3]:
Our task is to determine the unknown coefficients x1, x2,
• Inspection. In its simplest form, this method may be
little more than intelligent guessing. For this reason, x3, and x4. There are three elements involved in this
it is sometimes called the trial-and-error method. reaction: carbon (C), hydrogen (H), and oxygen (O). A
Students may be taught various rules of thumb that balance equation can be written for each of these
make the method more efficient. (e.g., “start with an elements:
element that appears in just one species on each side
of the equation.”) Carbon (C): 1⋅ x1 + 0⋅ x2 = 1⋅x 3 + 0⋅x 4
Hydrogen (H): 4⋅ x1 + 0⋅ x2 = 0⋅x 3 + 2⋅x 4
• Half-Equation Method. This approach, also called Oxygen (O): 0⋅x 1 + 2⋅ x2 = 2⋅ x3 + 1⋅x 4
the ion-electron method, is used for balancing
oxidation-reduction (redox) reactions. The reaction We write these as homogeneous equations, each having
is divided into two half reactions, one for oxidation, zero on its right hand side:
the other for reduction. These half reactions are
balanced separately, then combined to form a x1 – x3 = 0
balanced redox reaction.
4x 1 – 2x 4 = 0
• Oxidation Number Method. This is another 2x 2 – 2x 3 – x 4 = 0
approach for balancing redox reactions. The first
step is to assign oxidation numbers to the elements At this point, we have three equations in four unknowns.
involved in the reaction. The oxidation numbers are To complete the system, we define an auxiliary equation
balanced, after which the anions, cations, and by arbitrarily choosing a value for one of the coefficients:
remaining elements are balanced by inspection.
x4 = 1
» x = x/0.5
The complete system of equations can be written in
matrix form as Ax = b, where x =

1
1 0 –1 0 x1 0 2
A = 4 0 0 –2 , x = xx 2 , b = 0 1
0 2 –2 –1 3 0
0 0 0 1 x4 1 2

Next we consider how this system can be solved using Thus, the balanced equation is
MATLAB.
CH 4 + 2O 2 → CO 2 + 2H 2O
The MATLAB Solution
Conservation of Mass and Charge
MATLAB is a general-purpose mathematics
program that was originally designed to solve problems The reaction shown in the first example could
involving matrices. (The name MATLAB is a easily be balanced by inspection. Not so with the
contraction of Matrix Laboratory.) This program is following equation:
ideally suited for solving matrix equations of the form Ax
= b. 2– 2+
x 1Cr2O 7 + x2Fe + x3H
+

→ x4Cr 3+ + x 5Fe 3+ + x 6H 2O
After starting MATLAB, we enter the matrix A
and the column vector b. (In what follows, » is the
MATLAB prompt.) At first glance, it might appear that this equation cannot
be balanced algebraically because there are six unknown
» A = [ stoichiometric coefficients but only four elements to
1 0 -1 0 conserve (Cr, O, Fe, and H). However, charge must be
4 0 0 -2 conserved as well, giving rise to another balance
0 2 -2 -1 equation. That, plus an auxiliary equation setting the
0 0 0 1]; value of one coefficient, yields six equations in six
unknowns:
» b = [
0 Chromium (Cr): 2x 1 – x 4 = 0
0
0 Oxygen (O): 7x 1 – x6 = 0
1]; Iron (Fe): x 2 – x 5 = 0
Hydrogen (H): x 3 – 2x 6 = 0
Next we compute x = A–1b, in which A–1 is the inverse Charge (+): –2x 1 + 2x2 + x3 – 3x4 – 3x 5 = 0
of A. The function inv() computes matrix inverses:
(*): x6 = 1
» x = inv(A)*b
From these equations we obtain
x =
2 0 0 –1 0 0 0
0.5000 7 0 0 0 0 –1 0
1.0000 A = 0 1 0 0 –1 0 , b = 0
0 0 1 0 0 –2 0
0.5000 –2 2 1 –3 –3 0 0
1.0000 0 0 0 0 0 1 1

Finally, we note that the stoichiometric coefficients are Using MATLAB, the unknown stoichiometric
usually chosen to be integers. Divide the vector x by its coefficients are quickly determined. First we enter A and
smallest value: b:
» A = [
2 0 0 -1 0 0 x 1P2I 4 + x 2P4+ x3H 2O → x 4PH4I + x5 H3PO 4
7 0 0 0 0 -1
0 1 0 0 -1 0
0 0 1 0 0 -2 What makes this reaction difficult is that phosphorus
-2 2 1 -3 -3 0 appears in four different oxidation states. Nevertheless,
0 0 0 0 0 1]; we can easily balance this reaction using MATLAB:

» b = [ » A = [
0 2 4 0 -1 -1
0 4 0 0 -1 0
0 0 0 2 -4 -3
0 0 0 1 0 -4
0 0 0 0 0 1
1]; ];

Next we solve the system, this time using the left division » b = [
operator (\) instead of the inv() function. The left division 0
0
operator uses LU factorization rather than matrix
0
inversion, and is the preferred method of solution: 0
1];
» x = A\b
» x = A\b
x =
x =
0.1429
0.8571 0.3125
2.0000 0.4062
0.2857 4.0000
0.8571 1.2500
1.0000 1.0000
We divide by the smallest value of x to obtain integral We divide by the first element of x to obtain integral
coefficients. In the this case, the smallest value is found coefficients:
in the first element, designated by x(1):
» x = x/x(1)
» x = x/x(1)
x =
x =
1.0000
1.0000 1.3000
6.0000 12.8000
14.0000 4.0000
2.0000 3.2000
6.0000
7.0000 This does not yield integral coefficients, but multiplying
by 10 will do the trick:
Thus we obtain
» x = x * 10
Cr2O 7 + 6Fe + 14H → 2Cr + 6Fe + 7H 2O
2– 2+ + 3+ 3+

x =

A Difficult Redox Reaction 10


13
128
The oxidation number and half-reaction methods are 40
normally recommended for balancing redox reactions. 32
However, neither method works well on the following
reaction [6]:
The balanced equation is
6. Solve the system Ax = b for x using either the inv()
10 P 2I4 + 13 P4 + 128 H 2O → 40 PH 4I + 32 H 3PO 4 function or the left division operator (\).
7. If necessary, scalex to obtain integral coefficients.
Underdetermined Systems
Some reactions cannot be balanced by the algebraic References
method as presented here. One such reaction is the
oxidation of hydrogen peroxide by permanganate ion in 1. Chang, Raymond. Chemistry, 5th ed. McGraw-Hill.
acid solutions: (1994).
2. Masterton, William L., and Cecile N. Hurley.

x 1MnO + x 2H2O 2 + x3H
+ Chemistry: Principles and Reactions, 2d ed.
4
Saunders College Publishing (1993).
→ x4Mn 2+ + x5O 2 + x 6H 2O 3. Bodner, George M., and Harry L. Pardue.
Chemistry: An Experimental Science. Wiley (1989).
This equation contains six unknowns. We can write four 4. Porges, Arthur. “A Question of Balancing,” Journal
independent balances and an auxiliary equation, giving a of Chemical Education, Vol. 22, pp. 266–267
total of five equations. Thus the system is (1945).
underdetermined, having infinitely many solutions [6, 7]: 5. Kolb, Doris. “The Chemical Equation, Part II:
Oxidation-Reduction Reactions,” Journal of
2 MnO 4 + 3 H 2O 2 + 6 H → 2 Mn + 4 O2 + 6 H 2O
– + 2+
Chemical Education, Vol. 55, No. 5, pp. 326–331
– + 2+
2 MnO 4 + 5 H 2O 2 + 6 H → 2 Mn + 5 O2 + 8 H 2O (1978).
– + 2+
2 MnO 4 + 7 H 2O 2 + 6 H → 2 Mn + 6 O2 + 10 H 2O 6. Kolb, Doris. “More on Balancing Redox Reactions,”
Journal of Chemical Education, Vol. 56, No. 3, pp.
– +
181–184 (1979).
2 MnO 4 + (5 + 2n) H 2O 2 + 3H 7. Dickerson, Richard E., Harry B. Gray, and Gilbert P.
→ 2 Mn2+ + (5 + n) O 2 + (8 + 2n) H 2O Haight. Chemical Principles. W. A. Benjamin
(1970).
The problem here is that there are really two chemical 8. Standin, Anthony. “Some Simple Balancing,”
reactions occurring independently. One reaction is the Journal of Chemical Education, Vol. 22, pp. 461–
reduction of permanganate ion, the other is the 462 (1945).
disproportionation of hydrogen peroxide [7, 8]:

2 MnO 4 + 5 H 2O 2 + 6 H → 2 Mn + 5 O 2 + 8 H2O
– + 2+

2 H2O 2 → O 2 + 2 H 2O

Summary
The procedure for balancing a chemical
equation with MATLAB may be summarized as follows:

1. Write the chemical equation showing the n unknown


coefficients x1, x2, . . . , xn.

2. Write a balance equation for each of (n – 1)


conserved quantities (elements and charge).

3. Write an auxiliary equation setting the value of one


of the unknowns.

4. Express the system in the formAx = b.

5. Start MATLAB and enter the matrix A and column


vector b.

Você também pode gostar