Trigger is a property of an
Trigger is a condition that must become
true for an event to execute. You can use a combination of relational
and logical operators to build a trigger expression.
be a character vector, an expression, or a function handle that when
evaluated returns a value of
Trigger can access species, parameters, and compartments.
A trigger can contain the keyword
relational operators to trigger an event that occurs at a specific
time during the simulation. For example,
time >= x.
In this example trigger, note that:
The units associated with the keyword
the units for the
TimeUnits property for the
associated with the simulation.
x is an expression containing
compartments, species, or parameters, then any units associated with
the expression must have the same dimensions as the keyword
x is a raw number, then its
dimensions (and units, if unit conversion is on) are assumed to be
the same as the keyword
on and your model has any event, follow the recommendation below.
Non-dimensionalize any parameters used in the event
trigger if they are not already dimensionless.
For example, suppose you have a trigger
x > 1,
where x is the species concentration in mole/liter.
Non-dimensionalize x by scaling (dividing) it with
a constant such as
x/x0 > 1, where x0 is
a parameter defined as 1.0 mole/liter. Note that x does
not have to have the same unit as the constant x0,
but must be dimensionally consistent with it. For example, the unit
of x can be picomole/liter instead of mole/liter.
|Applies to||Object: |
|SimBiology type||Character vector, function handle|
Specify a MATLAB® expression as a character vector.
Create a model object, and then add an event object.
modelObj = sbmlimport('oscillator'); eventObj = addevent(modelObj, 'time>= 5', 'OpC = 200');
Trigger property of the
set(eventObj, 'Trigger', '(time >=5) && (speciesA<1000)');