reacteqn.log 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. Codemist Standard Lisp 3.54 for DEC Alpha: May 23 1994
  2. Dump file created: Mon May 23 10:39:11 1994
  3. REDUCE 3.5, 15-Oct-93 ...
  4. Memory allocation: 6023424 bytes
  5. +++ About to read file tstlib.red
  6. % Examples for the conversion of reaction equations to ordinary
  7. % differential equations.
  8. % Example taken from Feinberg (Chemical Engineering):
  9. species := {A1,A2,A3,A4,A5};
  10. species := {a1,
  11. a2,
  12. a3,
  13. a4,
  14. a5}
  15. reac2ode { A1 + A4 <> 2A1, rho, beta,
  16. A1 + A2 <> A3, gamma, epsilon,
  17. A3 <> A2 + A5, theta, mue};
  18. 2
  19. {df(a1,t)=rho*a1*a4 - beta*a1 - gamma*a1*a2 + epsilon*a3,
  20. df(a2,t)= - gamma*a1*a2 + epsilon*a3 + theta*a3 - mue*a2*a5,
  21. df(a3,t)=gamma*a1*a2 - epsilon*a3 - theta*a3 + mue*a2*a5,
  22. 2
  23. df(a4,t)= - rho*a1*a4 + beta*a1 ,
  24. df(a5,t)=theta*a3 - mue*a2*a5}
  25. inputmat;
  26. [1 0 0 1 0]
  27. [ ]
  28. [1 1 0 0 0]
  29. [ ]
  30. [0 0 1 0 0]
  31. outputmat;
  32. [2 0 0 0 0]
  33. [ ]
  34. [0 0 1 0 0]
  35. [ ]
  36. [0 1 0 0 1]
  37. % Computation of the classical reaction matrix as difference
  38. % of output and input matrix:
  39. reactmat := outputmat-inputmat;
  40. [1 0 0 -1 0]
  41. [ ]
  42. reactmat := [-1 -1 1 0 0]
  43. [ ]
  44. [0 1 -1 0 1]
  45. % Example with automatic generation of rate constants and automatic
  46. % extraction of species.
  47. species := {};
  48. species := {}
  49. reac2ode { A1 + A4 <> 2A1,
  50. A1 + A2 <> A3,
  51. A3 <> A2 + A5};
  52. new species: a1
  53. new species: a4
  54. new species: a2
  55. new species: a3
  56. new species: a5
  57. 2
  58. {df(a1,t)= - a1 *rate(2) + a1*a4*rate(1) - a1*a2*rate(3) + a3*rate(4)
  59. ,
  60. 2
  61. df(a4,t)=a1 *rate(2) - a1*a4*rate(1),
  62. df(a2,t)= - a1*a2*rate(3) - a2*a5*rate(6) + a3*rate(5) + a3*rate(4),
  63. df(a3,t)=a1*a2*rate(3) + a2*a5*rate(6) - a3*rate(5) - a3*rate(4),
  64. df(a5,t)= - a2*a5*rate(6) + a3*rate(5)}
  65. on rounded;
  66. species := {};
  67. species := {}
  68. reac2ode { A1 + A4 <> 2A1, 17.3* 22.4**1.5,
  69. 0.04* 22.4**1.5 };
  70. new species: a1
  71. new species: a4
  72. 2
  73. {df(a1,t)= - 4.24064598853*a1 + 1834.07939004*a1*a4,
  74. 2
  75. df(a4,t)=4.24064598853*a1 - 1834.07939004*a1*a4}
  76. end;
  77. (reacteqn 283 33)
  78. End of Lisp run after 0.31+0.69 seconds