Matice
Reaktanty | Produkty | ||||||
As2S3 | NaNO3 | Na2CO3 | Na3AsO4 | Na2SO4 | CO2 | NaNO2 | |
a | b | c | p | q | r | s | |
As | 2 | 1 | |||||
S | 3 | 1 | |||||
Na | 1 | 2 | 3 | 2 | 1 | ||
N | 1 | 1 | |||||
O | 3 | 3 | 4 | 4 | 2 | 2 | |
C | 1 | 1 | |||||
náboj |
Bilance prvků
|
+ 2·a | = | + 1·p |
|
+ 3·a | = | + 1·q |
|
+ 1·b + 2·c | = | + 3·p + 2·q + 1·s |
|
+ 1·b | = | + 1·s |
|
+ 3·b + 3·c | = | + 4·p + 4·q + 2·r + 2·s |
|
+ 1·c | = | + 1·r |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 2*a== + 1*p, + 3*a== + 1*q, + 1*b + 2*c== + 3*p + 2*q + 1*s, + 1*b== + 1*s, + 3*b + 3*c== + 4*p + 4*q + 2*r + 2*s, + 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 = 1; b = 14; c = 6; p = 2; q = 3; r = 6; s = 14Zadání (program Octave/Matlab) reaction_id-1-5.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,2,0,0,0,0,3; 0,0,0,1,1,3,0; 0,0,1,0,2,3,0; 0,1,0,0,3,4,0; 0,0,0,0,2,4,1; 0,0,1,0,0,2,0; 0,0,0,1,1,2,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 2 0 0 0 0 3 0 0 0 1 1 3 0 0 0 1 0 2 3 0 0 1 0 0 3 4 0 0 0 0 0 2 4 1 0 0 1 0 0 2 0 0 0 0 1 1 2 0 hodnost = 6 b = 0 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 0 1 0 1 2 3 2 0 1 0 3 3 4 4 2 2 3 0 0 0 1 0 0 c = 0.045739 0.640345 0.274434 -0.091478 -0.137217 -0.274434 -0.640345 reseni = 1.0000 14.0000 6.0000 -2.0000 -3.0000 -6.0000 -14.0000
Zadání (program Mathematica)
m = { {0,2,0,0,0,0,3}, {0,0,0,1,1,3,0}, {0,0,1,0,2,3,0}, {0,1,0,0,3,4,0}, {0,0,0,0,2,4,1}, {0,0,1,0,0,2,0}, {0,0,0,1,1,2,0}} NullSpace[Transpose[m]]