reacteqn.tst 877 B

1234567891011121314151617181920212223242526272829303132333435
  1. % Examples for the conversion of reaction equations to ordinary
  2. % differential equations.
  3. % Example taken from Feinberg (Chemical Engineering):
  4. species := {A1,A2,A3,A4,A5};
  5. reac2ode { A1 + A4 <> 2A1, rho, beta,
  6. A1 + A2 <> A3, gamma, epsilon,
  7. A3 <> A2 + A5, theta, mue};
  8. inputmat;
  9. outputmat;
  10. % Computation of the classical reaction matrix as difference
  11. % of output and input matrix:
  12. reactmat := outputmat-inputmat;
  13. % Example with automatic generation of rate constants and automatic
  14. % extraction of species.
  15. species := {};
  16. reac2ode { A1 + A4 <> 2A1,
  17. A1 + A2 <> A3,
  18. A3 <> A2 + A5};
  19. on rounded;
  20. species := {};
  21. reac2ode { A1 + A4 <> 2A1, 17.3* 22.4**1.5,
  22. 0.04* 22.4**1.5 };
  23. end;