Documentation Center

  • Trial Software
  • Product Updates

Create a Rate Rule for a Constant Rate of Change

You can increase or decrease the amount or concentration of a species by a constant value using a zero-order rate rule. For example, suppose species x increases by a constant rate k. The rate of change is . Set the initial amount of species x to 2, and the value of parameter k to 1. Use the following commands to set up a SimBiology model accordingly and simulate it.

m = sbiomodel('m');
c = addcompartment(m,'comp');
s = addspecies(m,'x','InitialAmount',2);
p = addparameter(m,'k','Value',1);
r = addrule(m,'x = k','RuleType','rate');
simdata = sbiosimulate(m);
sbioplot(simdata);

Alternatively, you could model a constant increase in a species using the Mass Action reaction null -> x with the forward rate constant k.

clear
m = sbiomodel('m');
c = addcompartment(m,'comp');
s = addspecies(m,'x','InitialAmount',2);
r = addreaction(m,'null -> x');
kl = addkineticlaw(r,'MassAction');
p = addparameter(kl,'k','Value',1);
set(kl,'ParameterVariableNames','k');
simdata = sbiosimulate(m);
sbioplot(simdata);

Was this topic helpful?