# Stoichiometric Analysis

## Preliminaries

A network of m chemical species and n reactions can be described by the m by n stochiometry matrix \mathbf{N}. \mathbf{N}_{i,j} is the net number of species i produced or consumed in reaction j. The dynamics of the network are described by

\frac{d}{dt}\mathbf{s}(t) = \mathbf{N} \mathbf{v}(\mathbf{s}(t),\mathbf{p},t),

where \mathbf{s} is the vector of species concentrations, \mathbf{p} is a vector of time independent parameters, and t is time.

Each structural conservation, or interchangably, conserved sum (e.g. conserved moiety) in the network coresponds to a lineraly dependent row in the stoichiometry matrix \mathbf{N}.

If there are conserved sums, then the row rank, r of N is < m, and the stochiometry matrix N may first be re-ordered such that the first r are linearly independent, and the remaining m-r rows are linear combinations of the first r rows. The reduced stochiometry matrix \mathbf{N_R} is then formed from the first r rows of N. Finally, N may be expressed as a product of the m \times r link matrix \mathbf{L} and the r \times n \mathbf{N_R} matrix:

\mathbf{N} = \mathbf{L}\mathbf{N_R}.

The link matrix \mathbf{L} has the form

\mathbf{L} = \left[ \begin{array}{c} \mathbf{I}_{r} \\ \mathbf{L}_0 \end{array} \right],

where \mathbf{I}_{r} is the r \times r identity matrix and \mathbf{L}_0 is a (m-r) \times r matrix.

## Full vs. Extended Stoichiometry Matrix

The “full” stoichiometric matrix includes any conserved quantities (as opposed to the reduced stoichiometric matrix, which does not). The extended stoichiometric matrix is equal to the full stoichiometric matrix plus additional rows representing boundary species and sources / sinks. For example, consider the following reaction system:

reaction1:  => C
reaction2: C =>
reaction3: C =>
reaction4: MI => M
reaction5: M => MI
reaction6: XI => X
reaction7: X => XI


The extended stoichiometry matrix for this system is:

>>>  rr.getExtendedStoichiometryMatrix()
reaction1, reaction2, reaction3, reaction4, reaction5, reaction6, reaction7
C                [[         1,        -1,        -1,         0,         0,         0,         0],
M                 [         0,         0,         0,         1,        -1,         0,         0],
X                 [         0,         0,         0,         0,         0,         1,        -1],
MI                [         0,         0,         0,        -1,         1,         0,         0],
XI                [         0,         0,         0,         0,         0,        -1,         1],
reaction1_source  [        -1,         0,         0,         0,         0,         0,         0],
reaction2_sink    [         0,         1,         0,         0,         0,         0,         0],
reaction3_sink    [         0,         0,         1,         0,         0,         0,         0]]


## Methods for Stoichiometric Analysis

The following methods are related to the analysis of the stoichiometric matrix.

RoadRunner::getLinkMatrix RoadRunner::getNrMatrix RoadRunner::getKMatrix RoadRunner::getConservationMatrix RoadRunner::getL0Matrix RoadRunner::getFullStoichiometryMatrix RoadRunner::getExtendedStoichiometryMatrix RoadRunner::getReducedStoichiometryMatrix ExecutableModel::getNumConservedMoieties ExecutableModel::getConservedMoietyIds ExecutableModel::getConservedMoietyValues ExecutableModel::setConservedMoietyValues