Export ODEs to PottersWheel (pysb.export.potterswheel
)¶
Module containing a class for converting a PySB model to an equivalent set of ordinary differential equations for integration or analysis in PottersWheel.
For information on how to use the model exporters, see the documentation
for pysb.export
.
Output for the Robertson example model¶
The PottersWheel code produced will follow the form as given below for
pysb.examples.robertson
:
% A simple three-species chemical kinetics system known as "Robertson's
% example", as presented in:
%
% H. H. Robertson, The solution of a set of reaction rate equations, in Numerical
% Analysis: An Introduction, J. Walsh, ed., Academic Press, 1966, pp. 178-182.
%
% PottersWheel model definition file
% save as robertson.m
function m = robertson()
m = pwGetEmptyModel();
% meta information
m.ID = 'robertson';
m.name = 'robertson';
m.description = '';
m.authors = {''};
m.dates = {''};
m.type = 'PW-1-5';
% dynamic variables
m = pwAddX(m, 's0', 1.000000e+00);
m = pwAddX(m, 's1', 0.000000e+00);
m = pwAddX(m, 's2', 0.000000e+00);
% dynamic parameters
m = pwAddK(m, 'k1', 4.000000e-02);
m = pwAddK(m, 'k2', 3.000000e+07);
m = pwAddK(m, 'k3', 1.000000e+04);
m = pwAddK(m, 'A_0', 1.000000e+00);
m = pwAddK(m, 'B_0', 0.000000e+00);
m = pwAddK(m, 'C_0', 0.000000e+00);
% ODEs
m = pwAddODE(m, 's0', '-k1*s0 + k3*s1*s2');
m = pwAddODE(m, 's1', 'k1*s0 - k2*power(s1, 2) - k3*s1*s2');
m = pwAddODE(m, 's2', 'k2*power(s1, 2)');
% observables
m = pwAddY(m, 'A_total', '1.000000 * s0');
m = pwAddY(m, 'B_total', '1.000000 * s1');
m = pwAddY(m, 'C_total', '1.000000 * s2');
% end of PottersWheel model robertson
- class pysb.export.potterswheel.PottersWheelExporter(model, docstring=None)[source]¶
A class for returning the PottersWheel equivalent for a given PySB model.
Inherits from
pysb.export.Exporter
, which implements basic functionality for all exporters.