Matice
Reaktanty | Produkty | |||||
Ag | O2 | KCN | H2O | K[Ag(CN)2] | KOH | |
a | b | c | d | p | q | |
Ag | 1 | 1 | ||||
O | 2 | 1 | 1 | |||
K | 1 | 1 | 1 | |||
C | 1 | 2 | ||||
N | 1 | 2 | ||||
H | 2 | 1 | ||||
náboj |
Bilance prvků
|
+ 1·a | = | + 1·p |
|
+ 2·b + 1·d | = | + 1·q |
|
+ 1·c | = | + 1·p + 1·q |
|
+ 1·c | = | + 2·p |
|
+ 1·c | = | + 2·p |
|
+ 2·d | = | + 1·q |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 1*a== + 1*p, + 2*b + 1*d== + 1*q, + 1*c== + 1*p + 1*q, + 1*c== + 2*p, + 1*c== + 2*p, + 2*d== + 1*q, +0*a +0*b +0*c +0*d== +0*p +0*q} 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 = 8; b = 2; c = 16; d = 4; p = 8; q = 8Zadání (program Octave/Matlab) reaction_id-4-3.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,1,0,0,0,0,0; 0,0,0,0,0,0,2; 0,0,1,0,1,1,0; 0,0,0,2,0,0,1; 0,1,2,0,1,2,0; 0,0,0,1,1,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 1 0 0 0 0 0 0 0 0 0 0 0 2 0 0 1 0 1 1 0 0 0 0 2 0 0 1 0 1 2 0 1 2 0 0 0 0 1 1 0 1 hodnost = 5 b = 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 2 0 0 0 0 2 0 1 0 0 1 0 1 1 0 0 1 0 2 0 0 2 0 1 0 1 c = -0.369800 -0.092450 -0.739600 -0.184900 0.369800 0.369800 reseni = 1.00000 0.25000 2.00000 0.50000 -1.00000 -1.00000
Zadání (program Mathematica)
m = { {0,1,0,0,0,0,0}, {0,0,0,0,0,0,2}, {0,0,1,0,1,1,0}, {0,0,0,2,0,0,1}, {0,1,2,0,1,2,0}, {0,0,0,1,1,0,1}} NullSpace[Transpose[m]]