Performs a chemical reaction
from given initial reactant concentrations, with randomness,
to compute product concentrations at final time, tf.
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.
* If only one 'cv' is given, all are made
equal. ** Caution: Trials > ~1.e+5 can lead to
time out failure.
Files involved:
P-randKinet.php (this one),
RandKinet.php,
randKinet.py.
Draws plots of: the kinetics (compositions vs. time);
and the random behavior of the resulting composition of the incumbent
component.
Python file (download): randKinet.py
Computation structure — A PHP file
(this page: 'P-ranKin.php') calls (via
'action=...') an intermediate PHP file ('RanKin.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. |