| MathSBML Home Page | MathSBML Site Map |
Model Builder: |
SBMLStoichiometryMatrix |
SBMLStoichiometryMatrix→True is an input option for SBMLRead. If the value is True (as it is by default), 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 will calculate the mass balance equations based on the stoichiometry matrix. (Scroll down for mathematical definition and an example.)
SBMLMassActionEquations→True 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→False is an input option for SBMLRead. If the value is True (as it is by default), 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→False - to print the stoichiometry matrix; requires verbose→True and SBMLStoichiometrymatrix→True. Also a valid option for SBMLWrite, format→HTML.
verboseMassBalanceEquations→False - to print the mass balance equations; requires verbose→True and SBMLMassBalanceEquations→True. Also a valid option for SBMLWrite, format→HTML.
verboseMassActionEquations→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

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:
has the following stoichiometry matrix:

Let v=[ v1, v2, v3, v4]T be a column vector of kinetic rates; then the mass balance equations are
S2'=v1+v2
S3'=-v2-v3
S4'=v3-v4
S5'=v4
Using v instead as a vector of rate constants, the mass action equations become
S2'=S1v1+S2S35v2
S3'=-S2S35v2-S3v3
S4'=S3v3-S4v4
S5'=S4v4
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 |