Main Content

addreaction

Create reaction object and add to model

Description

rxnObj = addreaction(modelObj,rxnEquation) creates and returns a SimBiology.Reaction object rxnObj. The function also assigns

  • rxnEquation to the Reaction property of rxnObj.

  • Reactant species to the Reactants property of rxnObj.

  • Product species to the Products property of rxnObj.

  • modelObj to the Parent property of rxnObj.

  • rxnObj to the Reactions property of modelObj.

Note

example

rxnObj = addreaction(modelObj,reactantNames,productNames) specifies the reactant species and product species. By default, the stoichiometric values are set to 1.

rxnObj = addreaction(modelObj,reactantNames,RStoichCoefficients,productNames,PStoichCoefficients) also specifies the stoichiometric coefficients for reactants and products and sets the Stoichiometry property of rxnObj.

rxnObj = addreaction(___,Name=Value) also sets the properties of rxnObj using one or more name-value arguments. Name is the property name and Value is the corresponding value.

Examples

collapse all

Create a model.

modelObj = sbiomodel("m1");

Add a reaction.

rxnObj = addreaction(modelObj, 'a -> c + d');

Create a kinetic law object for the reaction object, of the type 'Henri-Michaelis-Menten'.

kineticlawObj = addkineticlaw(rxnObj, 'Henri-Michaelis-Menten');

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.

kineticlawObj.ParameterVariableNames = ["Vm_d","Km_d"];
kineticlawObj.SpeciesVariableNames = "a";

Verify that the reaction rate is expressed correctly in the reaction object ReactionRate property.

rxnObj.ReactionRate
ans = 
'Vm_d*a/(Km_d+a)'

Input Arguments

collapse all

SimBiology model, specified as a Model object.

Reaction equation, specified as a character vector or string scalar.

A hyphen preceded by a space and followed by a right angle bracket (->) indicates reactants going forward to products. A hyphen with left and right angle brackets (<->) indicates a reversible reaction. Coefficients before reactant or product names must be followed by a space.

Examples are 'A -> B', 'A + B -> C', '2 A + B -> 2 C', and 'A <-> B'. Enter reactions with spaces between the species.

If there are multiple compartments, or to specify the compartment name, use compartmentName.speciesName to qualify the species name.

Examples are 'cytoplasm.A -> cytoplasm.B', 'cytoplasm.A -> nucleus.A', and 'cytoplasm.A + cytoplasm.B -> nucleus.AB'.

Data Types: char | string

Names of reactant species, specified as a character vector, string scalar, string vector, or cell array of character vectors. Qualify with compartment names if there are multiple compartments.

Data Types: char | string | cell

Names of product species, specified as a character vector, string scalar, string vector, or cell array of character vectors. Qualify with compartment names if there are multiple compartments.

Data Types: char | string | cell

Stoichiometry coefficients of reactants, specified as a positive numeric scalar or positive numeric vector. If it is a vector, it must have the same length as reactantNames.

Data Types: double

Stoichiometry coefficients of products, specified as a positive numeric scalar or positive numeric vector. If it is a vector, it must have the same length as productNames.

Data Types: double

More About

collapse all

Version History

Introduced in R2006a

expand all