Matice
Reaktanty | Produkty | |||||
N2H6SO4 | KIO3 | N2 | KI | H2SO4 | H2O | |
a | b | p | q | r | s | |
N | 2 | 2 | ||||
H | 6 | 2 | 2 | |||
S | 1 | 1 | ||||
O | 4 | 3 | 4 | 1 | ||
K | 1 | 1 | ||||
I | 1 | 1 | ||||
náboj |
Bilance prvků
|
+ 2·a | = | + 2·p |
|
+ 6·a | = | + 2·r + 2·s |
|
+ 1·a | = | + 1·r |
|
+ 4·a + 3·b | = | + 4·r + 1·s |
|
+ 1·b | = | + 1·q |
|
+ 1·b | = | + 1·q |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 2*a== + 2*p, + 6*a== + 2*r + 2*s, + 1*a== + 1*r, + 4*a + 3*b== + 4*r + 1*s, + 1*b== + 1*q, + 1*b== + 1*q, +0*a +0*b== +0*p +0*q +0*r +0*s} Solve[eqns]
Neznámých koeficientů je: 6, počet nezávislých rovnic je: 5. Počet stupňů volnosti je tedy: 6 - 5 = 1. Jedno z možných řešení je:
a = 3; b = 2; p = 3; q = 2; r = 3; s = 6Zadání (program Octave/Matlab) reaction_id-5-13.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,6,0,0,2,4,1; 0,0,1,1,0,3,0; 0,0,0,0,2,0,0; 0,0,1,1,0,0,0; 0,2,0,0,0,4,1; 0,2,0,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 6 0 0 2 4 1 0 0 1 1 0 3 0 0 0 0 0 2 0 0 0 0 1 1 0 0 0 0 2 0 0 0 4 1 0 2 0 0 0 1 0 hodnost = 5 b = 0 0 0 0 0 0 6 0 0 0 2 2 0 1 0 1 0 0 0 1 0 1 0 0 2 0 2 0 0 0 4 3 0 0 4 1 1 0 0 0 1 0 c = -0.35603 -0.23736 0.35603 0.23736 0.35603 0.71207 reseni = 1.00000 0.66667 -1.00000 -0.66667 -1.00000 -2.00000
Zadání (program Mathematica)
m = { {0,6,0,0,2,4,1}, {0,0,1,1,0,3,0}, {0,0,0,0,2,0,0}, {0,0,1,1,0,0,0}, {0,2,0,0,0,4,1}, {0,2,0,0,0,1,0}} NullSpace[Transpose[m]]