Matice
Reaktanty | Produkty | ||||||
KMnO4 | H2C2O4 | H2SO4 | MnSO4 | CO2 | K2SO4 | H2O | |
a | b | c | p | q | r | s | |
K | 1 | 2 | |||||
Mn | 1 | 1 | |||||
O | 4 | 4 | 4 | 4 | 2 | 4 | 1 |
H | 2 | 2 | 2 | ||||
C | 2 | 1 | |||||
S | 1 | 1 | 1 | ||||
náboj |
Bilance prvků
|
+ 1·a | = | + 2·r |
|
+ 1·a | = | + 1·p |
|
+ 4·a + 4·b + 4·c | = | + 4·p + 2·q + 4·r + 1·s |
|
+ 2·b + 2·c | = | + 2·s |
|
+ 2·b | = | + 1·q |
|
+ 1·c | = | + 1·p + 1·r |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 1*a== + 2*r, + 1*a== + 1*p, + 4*a + 4*b + 4*c== + 4*p + 2*q + 4*r + 1*s, + 2*b + 2*c== + 2*s, + 2*b== + 1*q, + 1*c== + 1*p + 1*r, +0*a +0*b +0*c== +0*p +0*q +0*r +0*s} Solve[eqns]
Neznámých koeficientů je: 7, počet nezávislých rovnic je: 6. Počet stupňů volnosti je tedy: 7 - 6 = 1. Jedno z možných řešení je:
a = 2; b = 5; c = 3; p = 2; q = 10; r = 1; s = 8Zadání (program Octave/Matlab) reaction_id-5-7.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,0,0,1,1,4,0; 0,2,2,0,0,4,0; 0,0,2,0,0,4,1; 0,0,0,0,1,4,1; 0,1,0,0,0,2,0; 0,0,0,2,0,4,1; 0,0,2,0,0,1,0] hodnost = rank(a) % hodnost matice = pocet nezavislych rovnic b = a' % transpozice matice c = null(b) % nalezeni baze nuloveho prostoru matice b reseni = rref(c') % upravy na "row reduced echelon form"
Řešení (program Octave/Matlab)
a = 0 0 0 1 1 4 0 0 2 2 0 0 4 0 0 0 2 0 0 4 1 0 0 0 0 1 4 1 0 1 0 0 0 2 0 0 0 0 2 0 4 1 0 0 2 0 0 1 0 hodnost = 6 b = 0 0 0 0 0 0 0 0 2 0 0 1 0 0 0 2 2 0 0 0 2 1 0 0 0 0 2 0 1 0 0 1 0 0 0 4 4 4 4 2 4 1 0 0 1 1 0 1 0 c = -0.139010 -0.347524 -0.208514 0.139010 0.695048 0.069505 0.556038 reseni = 1.00000 2.50000 1.50000 -1.00000 -5.00000 -0.50000 -4.00000
Zadání (program Mathematica)
m = { {0,0,0,1,1,4,0}, {0,2,2,0,0,4,0}, {0,0,2,0,0,4,1}, {0,0,0,0,1,4,1}, {0,1,0,0,0,2,0}, {0,0,0,2,0,4,1}, {0,0,2,0,0,1,0}} NullSpace[Transpose[m]]