Professional Documents
Culture Documents
Introduction
A Simple Example
x1 x3 = 0
4x 1 2x 4 = 0
2x 2 2x 3 x 4 = 0
x4 = 1
x = x/0.5
0
0
2
0
1 0
0 2 ,
2 1
0 1
x1
x = xx 2 ,
3
x4
0
b = 0
0
1
x =
1
2
1
2
1
4
0
0
A
0
0
2
0
= [
-1 0
0 -2
-2 -1
0 1];
b = [
0
0
0
1];
x =
0.5000
1.0000
0.5000
1.0000
2
7
A = 0
0
2
0
0
0
1
0
2
0
0 1 0 0
0 0 0 1
0 0 1 0 ,
1 0 0 2
1 3 3 0
0 0 0 1
0
0
b = 0
0
0
1
A = [
2 0 0 -1 0 0
7 0 0 0 0 -1
0 1 0 0 -1 0
0 0 1 0 0 -2
-2 2 1 -3 -3 0
0 0 0 0 0 1];
b = [
0
0
0
0
0
1];
A
2 4
4 0
0 0
0 0
0 0
];
Next we solve the system, this time using the left division
operator (\) instead of the inv() function. The left division
operator uses LU factorization rather than matrix
inversion, and is the preferred method of solution:
b = [
0
0
0
0
1];
x = A\b
=
0
0
2
1
0
[
-1 -1
-1 0
-4 -3
0 -4
0 1
x = A\b
x =
x =
0.1429
0.8571
2.0000
0.2857
0.8571
1.0000
0.3125
0.4062
4.0000
1.2500
1.0000
x = x/x(1)
x =
x =
1.0000
1.3000
12.8000
4.0000
3.2000
1.0000
6.0000
14.0000
2.0000
6.0000
7.0000
Thus we obtain
Cr2O 7 + 6Fe + 14H 2Cr + 6Fe + 7H 2O
2
2+
3+
3+
x = x * 10
x =
10
13
128
40
32
7.
Underdetermined Systems
Some reactions cannot be balanced by the algebraic
method as presented here. One such reaction is the
oxidation of hydrogen peroxide by permanganate ion in
acid solutions:
References
1.
2.
3.
4.
5.
2 MnO 4 + 3 H 2O 2 + 6 H 2 Mn + 4 O2 + 6 H 2O
2+
2+
2 MnO 4 + 5 H 2O 2 + 6 H 2 Mn + 5 O2 + 8 H 2O
+
2+
2 MnO 4 + 7 H 2O 2 + 6 H 2 Mn + 6 O2 + 10 H 2O
+
2 MnO 4 + (5 + 2n) H 2O 2 + 3H
2 Mn2+ + (5 + n) O 2 + (8 + 2n) H 2O
2+
Summary
The procedure for balancing a chemical
equation with MATLAB may be summarized as follows:
1.
2.
3.
4.
5.
6.
7.
8.