Computes the chemical kinetics
of a reaction by integrating its kinetic equations, from given initial
reactant concentrations. The reaction is A → B → C,
with kinetic mechanism:
a'(t) = −k1a,
b'(t) = −k2b +
k1a,
c'(t) = k2b
([Winkel, 2011]). Integration is through Python 'scipy' module
solver solve_ivp.
Files involved:
P-kinetSet.php (this one),
KinetSet.php,
kinetSet.py.
Draws plots of the kinetics (compositions vs.
time).
Python file (download): kinetSet.py
Computation structure — A PHP file
(this page: 'P-kinetSet.php') calls (via
'action=...') an intermediate PHP file ('KinetSet.php'), which
(through $_POST) sends the problem data as command line arguments to
a Python script. This last does the computing, and makes
'system' call(s) to 'gnuplot', for the final (temporary) webpage.
Keywords: PHP, command line arguments,
Python script, gnuplot. |