Specify type of rule for rule object
RuleType property indicates the type
of rule defined by the rule object. A
defines how certain species, parameters, and compartments should interact
with one another. For example, a rule could state that the total number
of species A and species B must be some value.
a MATLAB® expression that defines the change in the species object
quantity or a parameter object
Value when the rule is evaluated.
The types of rules in SimBiology® are as follows:
initialAssignment — Lets
you specify the initial value of a parameter, species, or compartment
capacity, as a function of other model component values in the model.
repeatedAssignment — Lets
you specify a value that holds at all times during simulation, and
is a function of other model component values in the model.
algebraic — Lets you specify
mathematical constraints on one or more parameters, species, or compartments
that must hold during a simulation.
rate — Lets you specify
the time derivative of a parameter value, species amount, or compartment
If the model has a species defined in concentration, being varied
rate rule, and it is in a compartment with
varying volume, you can only use
to vary the compartment volume.
Conversely, if you are varying a compartment's volume using
then you cannot vary a species (defined in concentration) within that
compartment, with a
The reason for these constraints is that, if a species is defined in concentration and it is in a compartment with varying volume, the time derivative of that species is a function of the compartment's rate of change. For compartments varied by rate rules, the solver has that information.
Note that if you specify the species in amounts there are no constraints.
|Applies to||Object: rule|
|Data type||Character vector|
Create a model object, and then add a reaction object.
modelObj = sbiomodel ('my_model'); reactionObj = addreaction (modelObj, 'a -> b');
Add a rule that specifies the quantity of a species
In the rule expression,
k is the rate constant
a -> b.
ruleObj = addrule(modelObj, 'c = k*(a+b)')
RuleType from the default
'rate' and verify it
set(ruleObj, 'RuleType', 'rate'); get(ruleObj)
MATLAB returns all the properties for the rule object.
Active: 1 Annotation: '' Name: '' Notes: '' Parent: [1x1 SimBiology.Model] Rule: 'c = k*(a+b)' RuleType: 'rate' Tag: '' Type: 'rule' UserData: