Differences between revisions 2 and 3
Revision 2 as of 2013-10-21 16:11:28
Size: 852
Editor: david
Comment: Starting some Kinetic documentation, based on Delhi pratical materials.
Revision 3 as of 2013-10-21 18:40:25
Size: 1863
Editor: david
Comment: Interin save, still in progress
Deletions are marked like this. Additions are marked like this.
Line 30: Line 30:
Line 37: Line 38:
There are two limitations on the model specification:
 1. The identifiers canot be quoted, and
 1. No c or C++ key words can be used as identifiers.

On the other hand, it is possible to compute the values to be assigned, as in this example of adjusting an equilibrium constant to its apparent value at the prevailing pH:
 {{{
pH = 7.5
k2eq = 17.84e8*10**(-pH)
}}}
Line 38: Line 49:
 {{{
m = ScrumPy.Model()
}}}

Once it has been loaded, values can be inspected, e.g.:
 {{{
>>> m[ " x_A " ] # parameter
1 . 0
>>> m[ "B" ] # concentration
0.4
>>> m[ "R1" ] # rate, evaluated with current variable values
3.3333333333333335
}}}

They can, of course, also be changed:
 {{{
>>> m[ " x_A " ] = 2 # parameter
>>> m[ "B" ] = 2 # concentration
}}}

However, note:
 {{{
>>> m["R1"]
3.3333333333333335
>>> m.FindSS()
>>> m["R1"]
2.814141152659996
}}}
That is, the computation of the rate is not updated until ''m.FindSS()'' is called to force a reevaluation of the rate.

Kinetic Modelling

The general form of the description of a kinetic model has been covered in the pages on the ScrumPy Model Description Language. Consider the following two enzyme system as an example:

  • # Two reactions with reversible Michaelis-Menten kinetics
    
    R1:
        x_A <> B
        
        Vmax1/K1A * (x_A - B/Keq1)/ (
            1 + x_A/K1A + B/K1B
                )
    
    R2:
        B <> x_C
        Vmax2/K2B * (B - x_C/Keq2)/ (
            1 + B/K2B + x_C/K2C
        )
    
    x_A = 1
    x_C = 1
    
    Vmax1 = 10
    K1A = 1
    K1B = 1
    Keq1 = 2
    
    Vmax2 = 10
    K2B = 1
    
    K2C = 1
    Keq2 = 2
    
    B=0.4

Note that this file contains two reaction definitions with their kinetic equations, followed by initial assignments of the parameters and the variable (B).

There are two limitations on the model specification:

  1. The identifiers canot be quoted, and
  2. No c or C++ key words can be used as identifiers.

On the other hand, it is possible to compute the values to be assigned, as in this example of adjusting an equilibrium constant to its apparent value at the prevailing pH:

  • pH = 7.5
    k2eq = 17.84e8*10**(-pH)

If this model had already been saved as a spy file, then it can be loaded into ScrumPy as follows:

  • m = ScrumPy.Model()

Once it has been loaded, values can be inspected, e.g.:

  • >>> m[ " x_A " ]    # parameter
    1 . 0
    >>> m[ "B" ]        # concentration
    0.4
    >>> m[ "R1" ]       # rate, evaluated with current variable values
    3.3333333333333335

They can, of course, also be changed:

  • >>> m[ " x_A " ] = 2   # parameter
    >>> m[ "B" ] = 2       # concentration

However, note:

  • >>> m["R1"]
    3.3333333333333335
    >>> m.FindSS()
    >>> m["R1"]
    2.814141152659996

That is, the computation of the rate is not updated until m.FindSS() is called to force a reevaluation of the rate.

None: ScrumPy/Doc/KinMod (last edited 2015-09-27 12:29:44 by david)