Matice
Reaktanty | Produkty | |||||
Al2O3 | HF | Na2CO3 | Na3[AlF6] | CO2 | H2O | |
a | b | c | p | q | r | |
Al | 2 | 1 | ||||
O | 3 | 3 | 2 | 1 | ||
H | 1 | 2 | ||||
F | 1 | 6 | ||||
Na | 2 | 3 | ||||
C | 1 | 1 | ||||
náboj |
Bilance prvků
|
+ 2·a | = | + 1·p |
|
+ 3·a + 3·c | = | + 2·q + 1·r |
|
+ 1·b | = | + 2·r |
|
+ 1·b | = | + 6·p |
|
+ 2·c | = | + 3·p |
|
+ 1·c | = | + 1·q |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 2*a== + 1*p, + 3*a + 3*c== + 2*q + 1*r, + 1*b== + 2*r, + 1*b== + 6*p, + 2*c== + 3*p, + 1*c== + 1*q, +0*a +0*b +0*c== +0*p +0*q +0*r} 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 = 1; b = 12; c = 3; p = 2; q = 3; r = 6Zadání (program Octave/Matlab) reaction_id-3-7.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,0,0; 0,0,1,0,0,2,3; 0,1,0,6,0,3,0; 0,0,1,0,0,0,2; 0,0,0,0,2,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 0 0 0 0 3 0 0 0 1 1 0 0 0 0 1 0 0 2 3 0 1 0 6 0 3 0 0 0 1 0 0 0 2 0 0 0 0 2 0 1 hodnost = 5 b = 0 0 0 0 0 0 2 0 0 1 0 0 0 0 1 0 1 0 0 1 0 6 0 0 0 1 0 0 0 2 0 0 2 3 0 0 3 0 3 0 2 1 c = 0.070186 0.842235 0.210559 -0.140372 -0.210559 -0.421117 reseni = 1.0000 12.0000 3.0000 -2.0000 -3.0000 -6.0000
Zadání (program Mathematica)
m = { {0,2,0,0,0,0,3}, {0,0,0,1,1,0,0}, {0,0,1,0,0,2,3}, {0,1,0,6,0,3,0}, {0,0,1,0,0,0,2}, {0,0,0,0,2,0,1}} NullSpace[Transpose[m]]