Matice
Reaktanty | Produkty | ||||||
FeCr2O4 | KNO3 | KOH | K2CrO4 | K2FeO4 | KNO2 | H2O | |
a | b | c | p | q | r | s | |
Fe | 1 | 1 | |||||
Cr | 2 | 1 | |||||
O | 4 | 3 | 1 | 4 | 4 | 2 | 1 |
K | 1 | 1 | 2 | 2 | 1 | ||
N | 1 | 1 | |||||
H | 1 | 2 | |||||
náboj |
Bilance prvků
|
+ 1·a | = | + 1·q |
|
+ 2·a | = | + 1·p |
|
+ 4·a + 3·b + 1·c | = | + 4·p + 4·q + 2·r + 1·s |
|
+ 1·b + 1·c | = | + 2·p + 2·q + 1·r |
|
+ 1·b | = | + 1·r |
|
+ 1·c | = | + 2·s |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 1*a== + 1*q, + 2*a== + 1*p, + 4*a + 3*b + 1*c== + 4*p + 4*q + 2*r + 1*s, + 1*b + 1*c== + 2*p + 2*q + 1*r, + 1*b== + 1*r, + 1*c== + 2*s, +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 = 1; b = 5; c = 6; p = 2; q = 1; r = 5; s = 3Zadání (program Octave/Matlab) reaction_id-8-18.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,2,1,0,0,0,4; 0,0,0,0,1,1,3; 0,0,0,1,1,0,1; 0,1,0,0,2,0,4; 0,0,1,0,2,0,4; 0,0,0,0,1,1,2; 0,0,0,2,0,0,1] 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 2 1 0 0 0 4 0 0 0 0 1 1 3 0 0 0 1 1 0 1 0 1 0 0 2 0 4 0 0 1 0 2 0 4 0 0 0 0 1 1 2 0 0 0 2 0 0 1 hodnost = 6 b = 0 0 0 0 0 0 0 2 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 2 0 1 1 2 2 1 0 0 1 0 0 0 1 0 4 3 1 4 4 2 1 c = -0.099504 -0.497519 -0.597022 0.199007 0.099504 0.497519 0.298511 reseni = 1.00000 5.00000 6.00000 -2.00000 -1.00000 -5.00000 -3.00000
Zadání (program Mathematica)
m = { {0,2,1,0,0,0,4}, {0,0,0,0,1,1,3}, {0,0,0,1,1,0,1}, {0,1,0,0,2,0,4}, {0,0,1,0,2,0,4}, {0,0,0,0,1,1,2}, {0,0,0,2,0,0,1}} NullSpace[Transpose[m]]