Matice
Reaktanty | Produkty | ||||||
AuCl3 | SO2 | Na2CO3 | Au | Na2SO4 | CO2 | NaCl | |
a | b | c | p | q | r | s | |
Au | 1 | 1 | |||||
Cl | 3 | 1 | |||||
S | 1 | 1 | |||||
O | 2 | 3 | 4 | 2 | |||
Na | 2 | 2 | 1 | ||||
C | 1 | 1 | |||||
náboj |
Bilance prvků
|
+ 1·a | = | + 1·p |
|
+ 3·a | = | + 1·s |
|
+ 1·b | = | + 1·q |
|
+ 2·b + 3·c | = | + 4·q + 2·r |
|
+ 2·c | = | + 2·q + 1·s |
|
+ 1·c | = | + 1·r |
Bilance elektronů (náboje)
Zadání pro program Mathematica
eqns = { + 1*a== + 1*p, + 3*a== + 1*s, + 1*b== + 1*q, + 2*b + 3*c== + 4*q + 2*r, + 2*c== + 2*q + 1*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 = 3; c = 6; p = 2; q = 3; r = 6; s = 6Zadání (program Octave/Matlab) reaction_id-4-7.m
% % Jiri Jirat % Prague Institute of Chemical Technology % % % matice - 1. sloupec naboj, dalsi sloupce prvky % a = [ 0,1,0,3,0,0,0; 0,0,0,0,0,2,1; 0,0,1,0,2,3,0; 0,1,0,0,0,0,0; 0,0,0,0,2,4,1; 0,0,1,0,0,2,0; 0,0,0,1,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 1 0 3 0 0 0 0 0 0 0 0 2 1 0 0 1 0 2 3 0 0 1 0 0 0 0 0 0 0 0 0 2 4 1 0 0 1 0 0 2 0 0 0 0 1 1 0 0 hodnost = 6 b = 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 3 0 0 0 0 0 1 0 0 2 0 2 0 1 0 2 3 0 4 2 0 0 1 0 0 1 0 0 c = -0.17277 -0.25916 -0.51832 0.17277 0.25916 0.51832 0.51832 reseni = 1.0000 1.5000 3.0000 -1.0000 -1.5000 -3.0000 -3.0000
Zadání (program Mathematica)
m = { {0,1,0,3,0,0,0}, {0,0,0,0,0,2,1}, {0,0,1,0,2,3,0}, {0,1,0,0,0,0,0}, {0,0,0,0,2,4,1}, {0,0,1,0,0,2,0}, {0,0,0,1,1,0,0}} NullSpace[Transpose[m]]