Nullspace

echelonNullspace(S, side, tol)[source]

Returns the Echelon form of the: left nullspace, \(L S = [-L0\ I] P S = 0\) or right nullspace \(S L = S ([-L0\ I] P)^T = 0\).

Usage

[L0, I, P, L, p] = echelonNullspace(S, side, tol)

Input

  • Sm x n stoichiometric matrix

Optional inputs

  • side – {‘left’, ‘right’} left or right nullspace, left by default.
  • tol – upper bound on tolerance of linear independence default no greater than 1e-12

Outputs

  • if side == left
  • L0(m-r) x r matrix which forms the non-trivial part of the left nullspace in echelon form i.e. \([-L0\ I] P S = 0\).
  • Pm x m row (permutation matrix
  • I(m-r) x (m-r) identity matrix
  • p – row permutation which leaves first 1:rankA rows independent and last rows dependent
  • if side == right
  • L0(n-r) x r matrix which forms the non-trivial part of the right nullspace in echelon form i.e. \(S ([-L0\ I] P)^T = 0\).
  • Pn x n column permutaion matrix
  • I(n-r) x (n-r) identity matrix
  • p – column permutation which leaves first 1:rankA columns independent and last columns dependent

See: Conservation analysis of large biochemical networks Ravishankar Rao Vallabhajosyula , Vijay Chickarmane and Herbert M. Sauro

getNullSpace(S, printLevel)[source]

Calculates the nullspace of S for full(S) or \(rank(S) == m\). If full row rank i.e. rank(S) = m, it’s much faster to work with a sparse LU.

Usage

[Z, rankS] = getNullSpace(S, printLevel)

Input

  • Sm x n stoichiometric matrix

Optional input

  • printLevel – {0, (1)}, 0 means quiet

Outputs

  • Z – (right) null space of S (when \(m \leq n\), otherwise [])
  • rankS – scalar giving rank of S
nullSpaceOperator(S, scale, printLevel)[source]

Uses LUSOL to compute a nullspace operator nullS We assume S is m x n with \(m < n\) with rank r. First nullS = nullSpaceOperator(S) computes a structure nullS from an m x n sparse matrix S (\(m < n\)). Second, if V is an (n-r) x k sparse matrix \((k \geq 1)\), W = nullSpaceOperatorApply(nullS, V); computes an n x k sparse matrix W from V such that \(S W = 0\).

This is an operator form of finding an n x (n-r) matrix Z such that \(S Z = 0\) and then computing \(W = Z V\). The aim is to obtain W without forming Z explicitly.

nullS.rank returns the rank of S \((r \leq m)\). It doesn’t matter if \(rank < m\).

Usage

nullS = nullSpaceOperator(S, scale, printLevel)

Inputs

  • Sm x n matrix
  • scale – {(1), 0} geometric mean scaling of S
  • printLevel – {(1), 0}

Output

  • nullS – nullspace operator to be used with nullSpaceOperatorApply.m
    • nullS.rank - rank of S

Note

Requires Nick Henderson’s 64 bit LUSOL interface to be intalled and added to the matlab path. See https://github.com/nwh/lusol see also https://web.stanford.edu/group/SOL/software/lusol/

nullSpaceOperatorApply(nullS, V)[source]

Computes a sparse matrix W from V such that \(S W = 0\). First, nullS = nullSpaceOperator(S) computes a structure nullS from an m x n sparse matrix S \((m < n)\), with rank r.

Second, if V is an (n-r) x k sparse matrix \((k \geq 1)\), W = nullSpaceOperatorApply(nullS, V); computes an n x k sparse matrix W from V such that \(S W = 0\).

This is an operator form of finding an n x (n-r) matrix Z such that \(S Z = 0\) and then computing \(W = Z V\). The aim is to obtain W without forming Z explicitly.

nullspaceLUSOLapply2Modes(mode, m, n, V, nullS)[source]

Computes the matrix vector product with the operator nullspace function handle of the form y = pdMat(mode, m, n, x)

Usage

W = nullspaceLUSOLapply2Modes(mode, m, n, V, nullS)

Inputs

  • mode\(mode = 1\) returns \(W = Z V\), mode = 2 returns \(W = Z^T V\)
  • m – first dimension of the matrix
  • n – second dimension of the matrix
  • V – one of the components of the multiplication
  • nullS – structure nullS from the function nullspaceLUSOLform(S); where m x n sparse matrix S (\(m < n\)).

Output

  • W – Matrix vector product