Matice
Reaktanty | Produkty | ||||||
CuFeS2 | HNO3 | Cu(NO3)2 | Fe(NO3)3 | NO | H2SO4 | H2O | |
a | b | p | q | r | s | t | |
Cu | 1 | 1 | |||||
Fe | 1 | 1 | |||||
S | 2 | 1 | |||||
H | 1 | 2 | 2 | ||||
N | 1 | 2 | 3 | 1 | |||
O | 3 | 6 | 9 | 1 | 4 | 1 | |
náboj |
Bilance prvků
|
+ 1·a | = | + 1·p |
|
+ 1·a | = | + 1·q |
|
+ 2·a | = | + 1·s |
|
+ 1·b | = | + 2·s + 2·t |
|
+ 1·b | = | + 2·p + 3·q + 1·r |
|
+ 3·b | = | + 6·p + 9·q + 1·r + 4·s + 1·t |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 1*a== + 1*p, + 1*a== + 1*q, + 2*a== + 1*s, + 1*b== + 2*s + 2*t, + 1*b== + 2*p + 3*q + 1*r, + 3*b== + 6*p + 9*q + 1*r + 4*s + 1*t, +0*a +0*b== +0*p +0*q +0*r +0*s +0*t} 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 = 3; b = 32; p = 3; q = 3; r = 17; s = 6; t = 10Zadání (program Octave/Matlab) reaction_id-8-15.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,1,1,0,0,0,2; 0,0,0,1,1,3,0; 0,1,0,0,2,6,0; 0,0,1,0,3,9,0; 0,0,0,0,1,1,0; 0,0,0,2,0,4,1; 0,0,0,2,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 1 1 0 0 0 2 0 0 0 1 1 3 0 0 1 0 0 2 6 0 0 0 1 0 3 9 0 0 0 0 0 1 1 0 0 0 0 2 0 4 1 0 0 0 2 0 1 0 hodnost = 6 b = 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 2 2 0 1 2 3 1 0 0 0 3 6 9 1 4 1 2 0 0 0 0 1 0 c = 0.078087 0.832927 -0.078087 -0.078087 -0.442492 -0.156174 -0.260290 reseni = 1.00000 10.66667 -1.00000 -1.00000 -5.66667 -2.00000 -3.33333
Zadání (program Mathematica)
m = { {0,1,1,0,0,0,2}, {0,0,0,1,1,3,0}, {0,1,0,0,2,6,0}, {0,0,1,0,3,9,0}, {0,0,0,0,1,1,0}, {0,0,0,2,0,4,1}, {0,0,0,2,0,1,0}} NullSpace[Transpose[m]]