Create reaction object and add to model object
reactionObj
=
addreaction(modelObj
,'ReactionValue
')
reactionObj
=
addreaction(modelObj
, 'ReactantsValue
', 'ProductsValue'
)
reactionObj = addreaction(modelObj
,
'ReactantsValue
', RStoichCoefficients
,
'ProductsValue
', PStoichCoefficients
)
reactionObj
=
addreaction(...'PropertyName
', PropertyValue
...)
| SimBiology® model object . |
| Specify the reaction equation. Enter a character vector.
A hyphen preceded by a space and followed by a right angle bracket
( Examples are If there
are multiple compartments, or to specify the compartment name, use Examples
are |
| Character vector defining the species name, a cell array of character vectors, a species object, or an array of species objects. If using names, qualify with compartment names if there are multiple compartments. |
| Character vector defining the species name, a cell array of character vectors, a species object, or an array of species objects. If using names, qualify with compartment names if there are multiple compartments. |
| Stoichiometric coefficients for reactants, length of array
equal to length of . |
| Stoichiometric coefficients for products, length of array equal
to length of . |
creates
a reaction object, assigns a value (reactionObj
=
addreaction(modelObj
,'ReactionValue
')
)
to the property ReactionValue
Reaction
, assigns reactant species
object(s) to the property Reactants
, assigns the
product species object(s) to the property Products
,
and assigns the model object
to
the property Parent
. In the Model object (modelObj
),
this method assigns the reaction object to the property Reactions
,
and returns the reaction object (reactionObj
).
reactionObj = addreaction(modelObj, 'a -> b')
When you define a reaction with a new species:
If no compartment objects exist in the model, the
method creates a compartment object (called '
)
in the model and adds the newly created species to that compartment.unnamed
'
If only one compartment object (compObj
)
exists in the model, the method creates a species object in that compartment.
If there is more than one compartment object (compObj
)
in the model, you must qualify the species name with the compartment
name.
For example, cell.glucose
denotes that you
want to put the species named glucose
into a compartment
named cell
. Additionally, if the compartment named cell
does
not exist, the process of adding the reaction creates the compartment
and names it cell
.
You can manually add a species to a compartment object with
the method addspecies
.
You can add species to a reaction object using the methods addreactant
or addproduct
.
You can remove species from a reaction object with the methods
or rmreactant
rmproduct
. The property Reaction
is
modified by adding or removing species from the reaction equation.
You can copy a SimBiology reaction object to a model object
with the function copyobj
.
You can remove the SimBiology reaction object from a SimBiology model
object with the function delete
.
You can view additional reaction object properties with the get
command.
For example, the reaction equation of reactionObj
can
be viewed with the command get(
. You can modify additional reaction object properties
with the command reactionObj
,
'Reaction')set
.
creates
a reaction object, assigns a value to the property reactionObj
=
addreaction(modelObj
, 'ReactantsValue
', 'ProductsValue'
)Reaction
using
the reactant (
)
and product (ReactantsValue
)
names, assigns the species objects to the properties ProductsValue
Reactants
and Products
,
and assigns the model object to the property Parent
.
In the model object (modelObj
), this method assigns
the reaction object to the property Reactions
,
and returns the reaction object (reactionObj
).
The stoichiometric values are assumed to be 1
.
reactionObj = addreaction(
adds
stoichiometric coefficients (modelObj
,
'ReactantsValue
', RStoichCoefficients
,
'ProductsValue
', PStoichCoefficients
)
)
for reactant species, and stoichiometric coefficients (RStoichCoefficients
PStoichCoefficients
)
for product species to the property Stoichiometry
. The length of Reactants
and RCoefficients
must
be equal, and the length of Products
and PCoefficients
must
be equal.
defines
optional properties. The property name/property value pairs can be
in any format supported by the function reactionObj
=
addreaction(...'PropertyName
', PropertyValue
...)set
.
If you use the addreaction
method to create
a reaction rate expression that is not continuous and differentiable,
see Using Events to Address Discontinuities in Rule and Reaction Rate Expressions before
simulating your model.
Methods for reaction objects
addkineticlaw (reaction) | Create kinetic law object and add to reaction object |
addproduct (reaction) | Add product species object to reaction object |
addreactant (reaction) | Add species object as reactant to reaction object |
copyobj (any object) | Copy SimBiology object and its children |
delete (any object) | Delete SimBiology object |
display (any object) | Display summary of SimBiology object |
get (any object) | Get object properties |
getadjacencymatrix (model) | Get adjacency matrix from model object |
getstoichmatrix (model) | Get stoichiometry matrix from model object |
rename (any object) | Rename object and update expressions |
rmproduct (reaction) | Remove species object from reaction object products |
rmreactant (reaction) | Remove species object from reaction object reactants |
set (any object) | Set object properties |
Properties for reaction objects
Active | Indicate object in use during simulation |
KineticLaw | Show kinetic law used for ReactionRate |
Name | Specify name of object |
Notes | HTML text describing SimBiology object |
Parent | Indicate parent object |
Products | Array of reaction products |
Reactants | Array of reaction reactants |
Reaction | Reaction object reaction |
ReactionRate | Reaction rate equation in reaction object |
Reversible | Specify whether reaction is reversible or irreversible |
Stoichiometry | Species coefficients in reaction |
Tag | Specify label for SimBiology object |
Type | Display SimBiology object type |
UserData | Specify data to associate with object |
Create a model, add a reaction object, and assign the expression for the reaction rate equation.
Create a model object, and then add a reaction object.
modelObj = sbiomodel('my_model'); reactionObj = addreaction(modelObj, 'a -> c + d');
Create a kinetic law object for the reaction object,
of the type 'Henri-Michaelis-Menten'
.
kineticlawObj = addkineticlaw(reactionObj, 'Henri-Michaelis-Menten');
reactionObj
KineticLaw
property
is configured to kineticlawObj
.
The 'Henri-Michaelis-Menten'
kinetic
law has two parameter variables (Vm
and Km
)
and one species variable (S
) that should to be
set. To set these variables, first create the parameter variables
as parameter objects (parameterObj1, parameterObj2
)
with names Vm_d
, and Km_d
, and
assign the objects Parent
property value to the kineticlawObj
.
parameterObj1 = addparameter(kineticlawObj, 'Vm_d'); parameterObj2 = addparameter(kineticlawObj, 'Km_d');
Set the variable names for the kinetic law object.
set(kineticlawObj,'ParameterVariableNames', {'Vm_d' 'Km_d'}); set(kineticlawObj,'SpeciesVariableNames', {'a'});
Verify that the reaction rate is expressed correctly
in the reaction object ReactionRate
property.
get (reactionObj, 'ReactionRate')
MATLAB returns:
ans = Vm_d*a/(Km_d+a)
model object
, addkineticlaw
, addproduct
, addreactant
, rmproduct
, rmreactant