Matice
Reaktanty | Produkty | ||||||
Ag3AsO4 | Zn | H2SO4 | AsH3 | Ag | ZnSO4 | H2O | |
a | b | c | p | q | r | s | |
Ag | 3 | 1 | |||||
As | 1 | 1 | |||||
O | 4 | 4 | 4 | 1 | |||
Zn | 1 | 1 | |||||
H | 2 | 3 | 2 | ||||
S | 1 | 1 | |||||
náboj |
Bilance prvků
|
+ 3·a | = | + 1·q |
|
+ 1·a | = | + 1·p |
|
+ 4·a + 4·c | = | + 4·r + 1·s |
|
+ 1·b | = | + 1·r |
|
+ 2·c | = | + 3·p + 2·s |
|
+ 1·c | = | + 1·r |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 3*a== + 1*q, + 1*a== + 1*p, + 4*a + 4*c== + 4*r + 1*s, + 1*b== + 1*r, + 2*c== + 3*p + 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 = 2; b = 11; c = 11; p = 2; q = 6; r = 11; s = 8Zadání (program Octave/Matlab) reaction_id-7-11.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,3,1,0,4,0,0; 0,0,0,0,0,0,1; 0,0,0,2,4,1,0; 0,0,1,3,0,0,0; 0,1,0,0,0,0,0; 0,0,0,0,4,1,1; 0,0,0,2,1,0,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 3 1 0 4 0 0 0 0 0 0 0 0 1 0 0 0 2 4 1 0 0 0 1 3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 4 1 1 0 0 0 2 1 0 0 hodnost = 6 b = 0 0 0 0 0 0 0 3 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 2 3 0 0 2 4 0 4 0 0 4 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 c = 0.092155 0.506853 0.506853 -0.092155 -0.276465 -0.506853 -0.368621 reseni = 1.00000 5.50000 5.50000 -1.00000 -3.00000 -5.50000 -4.00000
Zadání (program Mathematica)
m = { {0,3,1,0,4,0,0}, {0,0,0,0,0,0,1}, {0,0,0,2,4,1,0}, {0,0,1,3,0,0,0}, {0,1,0,0,0,0,0}, {0,0,0,0,4,1,1}, {0,0,0,2,1,0,0}} NullSpace[Transpose[m]]