pwAddODE
m = pwAddODE(m, lhs, rhs)
Adds one ordinary differential equation to the model.
lhs Left hand side. Must be the ID of a species, e.g. 'R'.
The initial value of the species and other
properties must be specified using pwAddX.
rhs Right hand side. The differential equation for the given species,
e.g. '- R_act*R*L + R_deact*pR'
Note
PottersWheel must be able to determine the class of each token of the
right hand side, e.g. dynamic variable x, dynamic parameter k,
driving input u, or algebraic expression a. Since the right hand side
is specified as a string, all elements must be specified explicitely
using pwAddX, pwAddK, pwAddU, or pwAddA.
Piecewise definition
PottersWheel supports the function
piecewise(value1, condition1, value2, condition2, ..., defaultValue)
with an arbitrary number of value/condition pairs and one required default value.
The conditions should be specified using the functions
| less than | lt(value1, value2) |
| greater than | gt(value1, value2) |
| equals | eq(value1, value2) |
| greater or equal | ge(value1, value2) |
| less or equal | le(value1, value2) |
| and | and(bool1, bool2) |
| or | or(bool1, bool2) |
Examples:
Returning a value of 1 for a > 5, else 0:
piecewise(1, gt(a, 5), 0)
Returning b for c < d, e for f >= g, else h:
piecewise(b, lt(c, d), e, ge(f, g), h)
It is recommended to reduce the maximum integration step size,
in order to accurately detect the event, when a different branch
of the piecewise function should be evaluated.
Please note that model integration and parameter calibration may be hampered
when using piecewise functions, due to the non-analytic properties at
the switches. Also, the Jacobian matrices for integration and calibration
can not be determined, effecting e.g. the results of the profile likelihood
estimation.
Examples
m = pwAddODE(m, 'R', '- R_act*R*L + R_deact*pR'); % recommended syntax
or
m = pwAddODE(m, 'd(R)/dt = - R_act*R*L + R_deact*pR'); % supported old syntax
See also