MathSBML Home Page | MathSBML Site Map |

## Model Builder: |
## SBMLStoichiometryMatrix |

SBMLStoichiometryMatrix→True/False is an input option for the return option of SBMLRead. If the value is True (the default value is False), then the return value of SBMLRead will inlude the stoichiometry matrix as the value of the returned option of the same name, eg as SBMLStoichiometryMatrix→{{M11,M12,...},...}

SBMLMassBalanceEquations→True/False will calculate the mass balance equations based on the stoichiometry matrix. (Scroll down for mathematical definition and an example.)

SBMLMassActionEquations→True/False will calcluate the mass action ODE's based on the stoichiometry matrix, regardless of the kineticLaws supplied in the reactions. This allows one to calculate differential equations for a model even if it does not contain any kinetic laws. (Scroll down for mathematical definition and an example.)

SBMLConservationMatrix→True/False is an input option for the return option of SBMLRead. If the value is True (the default value is False), then the return value of SBMLRead will inlude the conservation matrix as the value of the returned option of the same name, eg as SBMLConservationMatrix→{{M11,M12,...},...}

See also conservationMatrix.

New in MathSBML version 2.4.2. SBMLConservationMatrix added in version 2.5.6.__Related Options__

SBMLMassBalanceRateVector - the name of the mathematica variable that will represent the mass balance rates (for the mass balance equations) or the rate constants (for the mass action equations)

verboseStoichiometry→True/False - to print the stoichiometry matrix; requires verbose→True and SBMLStoichiometrymatrix→True. Also a valid option for SBMLWrite, format→HTML.

verboseMassBalanceEquations→True/False - to print the mass balance equations; requires verbose→True and SBMLMassBalanceEquations→True. Also a valid option for SBMLWrite, format→HTML.

verboseMassActionEquations→True/False - to print the mass action equations; requires verbose→True and SBMLMassActionEquations→True. Also a valid option for SBMLWrite, format→HTML.

The stoichiometry matrix is calculated from the stoichiometry values of the reactants and products in a model's reactions. Every species and every reaction in the model is represented in the matrix. The columns represent the reactions, in the order in which they are defined in the model, and the rows represent the species, in order, as they are defined in the model. Verbose listings will identify the species by name in the output.

The mass balance equations are calculated as

where

The mass action equations are calculated from the stoichiometry matrix using the standard definition of the law of mass action, and ignore the kinetic laws actually specified in the reaction. The name of the array of rate constants is taken to be the name specified as SBMLMassBalanceRateVector.

The conservation matrix is calculated using the function conservationMatrix.

**In the current version it is assumed that all species are in the same compartment!!!!**

The following four reaction system:

5S

S

S

has the following stoichiometry matrix:

The five rows represent the five species, and the four columns represent the four reactions.

Let **v**=[
*v*_{1},
*v*_{2},
*v*_{3},
*v*_{4}]^{T} be a column vector of kinetic rates; then
the mass balance equations are

Using **v** instead as a vector of
rate constants, the mass action equations become

We can create this model as stoic.xmlwith the following model builder commands:

newModel["stoichiometry_matrix_example"]; addCompartment[C]; addSpecies[{S1, S2, S3, S4, S5}, initialAmount→1]; addReaction[S1→S2, reversible→False]; addReaction[5S3 + S2→4 S3 + 2S2, reversible→False]; addReaction[S3→S4, reversible→False]; addReaction[S4→S5, reversible→False]; createModel["stoic.xml"];

Click here to see the file stoic.xml |

To create an interpretive listing in HTML including all the relevant verbose options, enter

SBMLWrite[inputfile→"stoic.xml", outputfile→"stoic.html", context →None, SBMLMassBalanceRateVector→v, format→"HTML", verboseStoichiometry→True, verboseMassBalanceEquations→True, verboseMassActionEquations→True]

Click here to see the translated file stoic.html |

Now read the model back in:

m = SBMLRead["stoic.xml", context→None , SBMLMassBalanceRateVector→v]

The following output is produced (observe the values of
SBMLStoichiometryMatrix, SBMLMassBalanceEquations, SBMLMassActionEquations):

Click to see the verbose listing as A Mathematica Notebook |

Click to see the verbose listing as an HTML display of a Mathematica Notebook |