CHW Example 6.2
(Contains examples 1-5 in Craciun-Tang-Feinberg '06, Table 1, p. 8699.  NOTE: In the examples with no anomalous signs, we are using a slightly different form of the Craciun-Feinberg determinant with the identity matrix multiplied by an extra parameter e, which accomodates the case of arbitrarily small outflows)

Loads the chemJac command file, which contains all commands used below

\(\(\(
\)\( (*\ \ SetDirectory["C:\CHEMmma"]\ \ \ *) \)\(\ \)\( (*\ 
      Put\ in\ path\ to\ chemJac . 
          m\ *) \)\(\ \ \)\(
\)\(\(<<\)\("chemJac.m"\)\(\ \)\)\)\)

CTF Example 1

Clear[S, vars, monomials,  j, det, core]

Inputting the stoichiometric matrix S

S = 
      Transpose[{{-1, -1, 1, 0}, {1, 1, -1, 0}, {0, 1, -1, 
            1}}]; S // MatrixForm

Making the mass-action flux vector 'monomials' and the list of species concentrations 'vars' automatically from S

monomials  =  makeMonomial[S]

vars = svars[S]

'S.monomials' is the right hand side of the ODE

S . monomials

The Jacobian of the RHS of the ODE, and its Craciun-Feinberg determinant

j = jac[S . monomials,  vars];
j // MatrixForm

det=Det[
        j - e*IdentityMatrix[Length[j]]]

coeffs[det]

Core Determinant of the Jacobian of the RHS of the ODE

core = coreDet[j, S]

coeffs[core]

CTF Example 2

Clear[S, vars, monomials,  j, det, core]

Inputting the stoichiometric matrix S

S = 
      Transpose[{{-1, -1, 1, 0, 0, 0}, {1, 1, -1, 0, 0, 0}, {0, 
            1, -1, 1, 0, 0}, {0, 1, 0, 0, 1, -1}, {0, -1, 0, 
            0, -1, 1}}];  S // MatrixForm

Making the mass-action flux vector 'monomials' and the list of species concentrations 'vars' automatically from S

monomials  =  makeMonomial[S]

vars = svars[S]

'S.monomials' is the right hand side of the ODE

S . monomials

The Jacobian of the RHS of the ODE, and its Craciun-Feinberg determinant

j = jac[S . monomials,  vars];
j // MatrixForm

det = Det[j - e*IdentityMatrix[Length[j]]]

coeffs[det]

Core Determinant of the Jacobian of the RHS of the ODE

core = coreDet[j, S]

coeffs[core]

CTF Example 3

Clear[S, vars, monomials,  j, det, core]

Inputting the stoichiometric matrix S

S = 
      Transpose[{{-1, -1, 1, 0, 0, 0}, {1, 1, -1, 0, 0, 0}, {0, 
            1, -1, 1, 0, 0}, {0, 0, 1, 0, 1, -1}, {0, 0, -1, 
            0, -1, 1}}];  S // MatrixForm

Making the mass-action flux vector 'monomials' and the list of species concentrations 'vars' automatically from S

monomials  =  makeMonomial[S]

vars = svars[S]

'S.monomials' is the right hand side of the ODE

S . monomials

The Jacobian of the RHS of the ODE, and its Craciun-Feinberg determinant

j = jac[S . monomials,  vars];
j // MatrixForm

det = Det[j - e*IdentityMatrix[Length[j]]];

coeffs[det]

Core Determinant of the Jacobian of the RHS of the ODE

core = coreDet[j, S]

coeffs[core]

CTF Example 4

Clear[S, vars, monomials,  j, det, core]

Inputting the stoichiometric matrix S

S = Transpose[{{-1, -1, 1, 0, 0, 0, 0}, {1, 
            1, -1, 0, 0, 0, 0}, {0, 1, -1, 1, 0, 0, 0}, {0, 0, 1, 0, 
            1, -1, 0}, {0, 0, -1, 0, -1, 1, 0}, {0, 1, 0, 0, 1, 
            0, -1}, {0, -1, 0, 0, -1, 0, 1}, {1, 0, 0, 0, 
            0, -1, 1}, {-1, 0, 0, 0, 0, 1, -1}}]; 
    S // MatrixForm

Making the mass-action flux vector 'monomials' and the list of species concentrations 'vars' automatically from S

monomials  =  makeMonomial[S]

vars = svars[S]

'S.monomials' is the right hand side of the ODE

S . monomials

The Jacobian of the RHS of the ODE, and its Craciun-Feinberg determinant

j = jac[S . monomials,  vars];
j // MatrixForm

det = cfDet[j];

coeffs[det]

Core Determinant of the Jacobian of the RHS of the ODE

core = coreDet[j, S]

coeffs[core]

CTF Example 5

Clear[S, vars, monomials,  j, det, core]

Inputting the stoichiometric matrix S

S = Transpose[{{1, 1, 0, -1, 0, 0}, {-1, -1, 0, 
            1, 0, 0}, {0, 0, 1, 1, -1, 0}, {0, 0, -1, -1, 1, 
            0}, {1, 0, 0, 0, -1, 1}}]; S // MatrixForm

Making the mass-action flux vector 'monomials' and the list of species concentrations 'vars' automatically from S

monomials  =  makeMonomial[S]

vars = svars[S]

'S.monomials' is the right hand side of the ODE

S . monomials

The Jacobian of the RHS of the ODE, and its Craciun-Feinberg determinant

j = jac[S . monomials,  vars];
j // MatrixForm

det = Det[j - e*IdentityMatrix[Length[j]]]

coeffs[det]

Core Determinant of the Jacobian of the RHS of the ODE

core = coreDet[j, S]

coeffs[core]