MATLAB: How to create time-dependent rate equations in SimBiolgy 2.1.1 (R2007a)

SimBiology

I would like to create reactions which involve time. For instance, the reaction rate is specified by a different equation for times (t<t1), and (t> t1) && (t< t2). These involve rather complicated differential equations, with parameters that are time-dependent.

Best Answer

This enhancement has been incorporated in SimBiology 2.4 (R2008b). For previous product releases, read below for any possible workarounds:
It is possible to change rate parameters via rules, by defining them with "global" scope and setting the "constant" property to false (on the Parameters tab, select the parameter and uncheck "ConstantValue"). The type of the rule can be "rate" or "algebraic". It is possible to incorporate M functions - but they must be differentiable (see the attached "inStep" function). The current time step is everywhere accessible with "time".
Attached is an example. To run it, copy both files in a local directory, cd to this directory in MATLAB and open the project in SBIODESKTOP.