next | previous | forward | backward | up | top | index | toc | Macaulay2 website
ReactionNetworks :: steadyStateEquations

steadyStateEquations -- creates steady-state equations of a reaction network

Description

Obtain the steady-state equations for a given network. Before any equations can be created, you must invoke the createRing function, which creates the reaction network ring. If you do not create the ring, you will receive an error message.

i1 : N = reactionNetwork "A <--> 2B, A + C <--> D, B + E --> A + C, D --> B+E"

o1 = A-->2B
     2B-->A
     A+C-->D
     D-->A+C
     D-->B+E
     B+E-->A+C

o1 : ReactionNetwork
i2 : R = createRing(N, QQ)

o2 = R

o2 : PolynomialRing
i3 : steadyStateEquations N

o3 = | xx_B^2kk_{1, 0}-xx_Axx_Ckk_{2, 3}+xx_Bxx_Ekk_{4, 2}-xx_Akk_{0, 1}+xx_
     | -2xx_B^2kk_{1, 0}-xx_Bxx_Ekk_{4, 2}+2xx_Akk_{0, 1}+xx_Dkk_{3, 4}     
     | -xx_Axx_Ckk_{2, 3}+xx_Bxx_Ekk_{4, 2}+xx_Dkk_{3, 2}                   
     | xx_Axx_Ckk_{2, 3}-xx_Dkk_{3, 2}-xx_Dkk_{3, 4}                        
     | -xx_Bxx_Ekk_{4, 2}+xx_Dkk_{3, 4}                                     
     ------------------------------------------------------------------------
     Dkk_{3, 2} |
                |
                |
                |
                |

             5       1
o3 : Matrix R  <--- R

Obtain the steady-state equations for a motif and display equations.

i4 : N = modificationOfTwoSubstratesI()

o4 = S_0+E-->X_1
     X_1-->S_0+E
     X_1-->E+S_1
     S_1+F-->Y_1
     Y_1-->S_1+F
     Y_1-->S_0+F
     E+P_0-->X_2
     X_2-->E+P_0
     X_2-->E+P_1
     F+P_1-->Y_2
     Y_2-->F+P_1
     Y_2-->F+P_0

o4 : ReactionNetwork
i5 : R = createRing(N, QQ)

o5 = R

o5 : PolynomialRing
i6 : steadyStateEquations N

o6 = | -xx_S_0xx_Ekk_{0, 1}+xx_X_1kk_{1, 0}+xx_Y_1kk_{4, 5}                  
     | -xx_S_0xx_Ekk_{0, 1}-xx_Exx_P_0kk_{6, 7}+xx_X_1kk_{1, 0}+xx_X_1kk_{1, 
     | xx_S_0xx_Ekk_{0, 1}-xx_X_1kk_{1, 0}-xx_X_1kk_{1, 2}                   
     | -xx_S_1xx_Fkk_{3, 4}+xx_X_1kk_{1, 2}+xx_Y_1kk_{4, 3}                  
     | -xx_S_1xx_Fkk_{3, 4}-xx_Fxx_P_1kk_{9, 10}+xx_Y_1kk_{4, 3}+xx_Y_1kk_{4,
     | xx_S_1xx_Fkk_{3, 4}-xx_Y_1kk_{4, 3}-xx_Y_1kk_{4, 5}                   
     | -xx_Exx_P_0kk_{6, 7}+xx_X_2kk_{7, 6}+xx_Y_2kk_{10, 11}                
     | xx_Exx_P_0kk_{6, 7}-xx_X_2kk_{7, 6}-xx_X_2kk_{7, 8}                   
     | -xx_Fxx_P_1kk_{9, 10}+xx_X_2kk_{7, 8}+xx_Y_2kk_{10, 9}                
     | xx_Fxx_P_1kk_{9, 10}-xx_Y_2kk_{10, 9}-xx_Y_2kk_{10, 11}               
     ------------------------------------------------------------------------
                                            |
     2}+xx_X_2kk_{7, 6}+xx_X_2kk_{7, 8}     |
                                            |
                                            |
      5}+xx_Y_2kk_{10, 9}+xx_Y_2kk_{10, 11} |
                                            |
                                            |
                                            |
                                            |
                                            |

             10       1
o6 : Matrix R   <--- R

Generate the steady-state equations in a specific ring.

i7 : N = twoLayerCascadeL()

o7 = S_0+E-->X_1
     X_1-->S_0+E
     X_1-->E+S_1
     S_1+P_0-->X_2
     X_2-->S_1+P_0
     X_2-->S_1+P_1
     E+P_0-->X_3
     X_3-->E+P_0
     X_3-->E+P_1
     S_1+F_1-->Y_1
     Y_1-->S_1+F_1
     Y_1-->S_0+F_1
     P_1+F_2-->Y_2
     Y_2-->P_1+F_2
     Y_2-->P_0+F_2

o7 : ReactionNetwork
i8 : R = createRing(N, ZZ/2)

o8 = R

o8 : PolynomialRing
i9 : F = steadyStateEquations(N, ZZ/2)

o9 = | xx_S_0xx_Ekk_{0, 1}+xx_X_1kk_{1, 0}+xx_Y_1kk_{10, 11}                
     | xx_S_0xx_Ekk_{0, 1}+xx_Exx_P_0kk_{6, 7}+xx_X_1kk_{1, 0}+xx_X_1kk_{1, 
     | xx_S_0xx_Ekk_{0, 1}+xx_X_1kk_{1, 0}+xx_X_1kk_{1, 2}                  
     | xx_S_1xx_P_0kk_{3, 4}+xx_S_1xx_F_1kk_{9, 10}+xx_X_1kk_{1, 2}+xx_X_2kk
     | xx_S_1xx_P_0kk_{3, 4}+xx_Exx_P_0kk_{6, 7}+xx_X_2kk_{4, 3}+xx_X_3kk_{7
     | xx_S_1xx_P_0kk_{3, 4}+xx_X_2kk_{4, 3}+xx_X_2kk_{4, 5}                
     | xx_P_1xx_F_2kk_{12, 13}+xx_X_2kk_{4, 5}+xx_X_3kk_{7, 8}+xx_Y_2kk_{13,
     | xx_Exx_P_0kk_{6, 7}+xx_X_3kk_{7, 6}+xx_X_3kk_{7, 8}                  
     | xx_S_1xx_F_1kk_{9, 10}+xx_Y_1kk_{10, 9}+xx_Y_1kk_{10, 11}            
     | xx_S_1xx_F_1kk_{9, 10}+xx_Y_1kk_{10, 9}+xx_Y_1kk_{10, 11}            
     | xx_P_1xx_F_2kk_{12, 13}+xx_Y_2kk_{13, 12}+xx_Y_2kk_{13, 14}          
     | xx_P_1xx_F_2kk_{12, 13}+xx_Y_2kk_{13, 12}+xx_Y_2kk_{13, 14}          
     ------------------------------------------------------------------------
                                              |
     2}+xx_X_3kk_{7, 6}+xx_X_3kk_{7, 8}       |
                                              |
     _{4, 3}+xx_X_2kk_{4, 5}+xx_Y_1kk_{10, 9} |
     , 6}+xx_Y_2kk_{13, 14}                   |
                                              |
      12}                                     |
                                              |
                                              |
                                              |
                                              |
                                              |

             12       1
o9 : Matrix R   <--- R

Substitute ReactionRates

The example below demonstrates how to substitute randomly generated values, for the reaction rates, directly into the steady state equations. For specific user-input values create a list with the corresponding values for each reaction rate; to view the order: N.ReactionRates, where N is the name of the reaction network.

i10 : M = reactionNetwork "A <--> 2B, A+C <--> D, D --> B+E, B+E --> A+C"

o10 = A-->2B
      2B-->A
      A+C-->D
      D-->A+C
      D-->B+E
      B+E-->A+C

o10 : ReactionNetwork
i11 : R = createRing M

o11 = R

o11 : PolynomialRing
i12 : K = toList(apply(0..length M.ReactionRates-1, i-> random(QQ)))

       9  1  9  1     3
o12 = {-, -, -, -, 1, -}
       2  2  4  2     4

o12 : List
i13 : Rr = toList(apply(0..length M.ReactionRates-1, i-> value(M.ReactionRates#i)))

o13 = {kk      , kk      , kk      , kk      , kk      , kk      }
         {0, 1}    {1, 0}    {2, 3}    {3, 2}    {3, 4}    {4, 2}

o13 : List
i14 : P = toList(apply(0..length Rr-1, i-> Rr#i=>sub(K#i,R)))

                   9              1              9              1          
o14 = {kk       => -, kk       => -, kk       => -, kk       => -, kk      
         {0, 1}    2    {1, 0}    2    {2, 3}    4    {3, 2}    2    {3, 4}
      -----------------------------------------------------------------------
                        3
      => 1, kk       => -}
              {4, 2}    4

o14 : List
i15 : SSE = flatten entries steadyStateEquations M

         2                                                                   
o15 = {xx kk       - xx xx kk       + xx xx kk       - xx kk       + xx kk   
         B  {1, 0}     A  C  {2, 3}     B  E  {4, 2}     A  {0, 1}     D  {3,
      -----------------------------------------------------------------------
               2
        , - 2xx kk       - xx xx kk       + 2xx kk       + xx kk      , -
      2}       B  {1, 0}     B  E  {4, 2}      A  {0, 1}     D  {3, 4}   
      -----------------------------------------------------------------------
      xx xx kk       + xx xx kk       + xx kk      , xx xx kk       -
        A  C  {2, 3}     B  E  {4, 2}     D  {3, 2}    A  C  {2, 3}  
      -----------------------------------------------------------------------
      xx kk       - xx kk      , - xx xx kk       + xx kk      }
        D  {3, 2}     D  {3, 4}      B  E  {4, 2}     D  {3, 4}

o15 : List
i16 : toList apply(0..length SSE-1, i-> sub(SSE#i,P))

       1  2   9         3         9      1         2   3                    
o16 = {-xx  - -xx xx  + -xx xx  - -xx  + -xx , - xx  - -xx xx  + 9xx  + xx ,
       2  B   4  A  C   4  B  E   2  A   2  D      B   4  B  E      A     D 
      -----------------------------------------------------------------------
        9         3         1     9         3       3
      - -xx xx  + -xx xx  + -xx , -xx xx  - -xx , - -xx xx  + xx }
        4  A  C   4  B  E   2  D  4  A  C   2  D    4  B  E     D

o16 : List

See also

Ways to use steadyStateEquations :

For the programmer

The object steadyStateEquations is a method function.