Matice
Reaktanty | Produkty | ||||||
I2 | NH2OH | NaHCO3 | NaI | N2O | CO2 | H2O | |
a | b | c | p | q | r | s | |
I | 2 | 1 | |||||
N | 1 | 2 | |||||
H | 3 | 1 | 2 | ||||
O | 1 | 3 | 1 | 2 | 1 | ||
Na | 1 | 1 | |||||
C | 1 | 1 | |||||
náboj |
Bilance prvků
|
+ 2·a | = | + 1·p |
|
+ 1·b | = | + 2·q |
|
+ 2·b + 1·b + 1·c | = | + 2·s |
|
+ 1·b + 3·c | = | + 1·q + 2·r + 1·s |
|
+ 1·c | = | + 1·p |
|
+ 1·c | = | + 1·r |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 2*a== + 1*p, + 1*b== + 2*q, + 2*b + 1*b + 1*c== + 2*s, + 1*b + 3*c== + 1*q + 2*r + 1*s, + 1*c== + 1*p, + 1*c== + 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 = 2; c = 4; p = 4; q = 1; r = 4; s = 5Zadání (program Octave/Matlab) reaction_id-8-14.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,0,0,2,0,0,0; 0,0,3,0,1,0,1; 0,1,1,0,0,1,3; 0,0,0,1,0,1,0; 0,0,0,0,2,0,1; 0,1,0,0,0,0,2; 0,0,2,0,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 0 0 2 0 0 0 0 0 3 0 1 0 1 0 1 1 0 0 1 3 0 0 0 1 0 1 0 0 0 0 0 2 0 1 0 1 0 0 0 0 2 0 0 2 0 0 0 1 hodnost = 6 b = 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 3 1 0 0 0 2 2 0 0 1 0 0 0 0 1 0 0 2 0 0 0 0 1 1 0 0 0 0 1 3 0 1 2 1 c = 0.22086 0.22086 0.44173 -0.44173 -0.11043 -0.44173 -0.55216 reseni = 1.00000 1.00000 2.00000 -2.00000 -0.50000 -2.00000 -2.50000
Zadání (program Mathematica)
m = { {0,0,0,2,0,0,0}, {0,0,3,0,1,0,1}, {0,1,1,0,0,1,3}, {0,0,0,1,0,1,0}, {0,0,0,0,2,0,1}, {0,1,0,0,0,0,2}, {0,0,2,0,0,0,1}} NullSpace[Transpose[m]]