SearchLatest VersionsLogin |
COPASI already defines a large set of commonly used kinetic functions to choose from. The list of defined functions is located at the last branch in the object tree.
![]() Function table
Nevertheless sometimes you need to define your own kinetic function to solve a specific problem. COPASI enables you to add a new function either by double clicking on an empty table row or by clicking on the button on the bottom of the screen. In the function definition dialog, you give your function a name in the Function Name field. This name has to be unique within the list of defined functions. Next, you have to specify a formula that defines the reaction rate of your kinetic function in the Formula field. The function string only covers the right side of the rate function.
![]() Function definition dialog
So for Michaelis-Menten which is defined as
![]() Function definition dialog with graphical display of the function
In COPASI parameters can have arbitrary names, there are only a few rules that one has to be aware of. If a parameter starts with a letter or underscore character and contains only letters, digits and underscore characters all is well, if however the parameter name contains other characters, the whole parameter name has to be enclosed in double quotes. If the parameter name contains double quotes or backslashes those have to be escaped by a backslash. As all variables found are defined, per default, as Parameters, you should specify their correct types by selecting one from the drop down list Description. However, the specific type of variables will affect to the type of reactions the function can be used for. E.g, if you define the function to contain two substrates and a modifier, you can later only use it for reactions that really do have two substrates. NoteThe restrictions on the number of modifiers is not strict since substrates and reactants could act as modifiers. So the above mentioned rate law could be used on reactions that do not explicitly specify a modifier. You can also see this in the
Application restrictions table below the
Parameters table. Let's say you define the
function
After you commit the function, you can use it for the definition of reactions. The operators and functions that COPASI knows and therefore can be used to create user defined functions are the following: Table 1.4. Standard Operators
Table 1.5. Miscellaneous Functions
Table 1.6. Trigonometric Functions
Table 1.7. Logical Functions
Table 1.8. Miscellaneous
The functions name can be written with either all lowercase letters or all letters uppercase. Mixing of upper and lowercase letters is not allowed and will lead to errors. CautionAlthough COPASI allows the usage of discontinuous functions (ceil, floor, factorial, etc) all integration is done by LSODA which officially can not handle discontinuous functions. Nevertheless in most cases this will lead to correct results, however you should be aware of the fact that the usage of discontinuous functions in COPASI can lead to errors. Later versions of COPASI will use different integration methods that will be able to deal with discontinuous functions. In addition to the function above, COPASI knows some predefined constant names: Table 1.9. Built-in Constants
Again, built-in constant names can be written with either all lowercase letters or all letters uppercase. Mixing of upper and lowercase letters is not allowed and will lead to errors. In addition to defining "normal" functions, COPASI allows the definition of piecewise defined functions. Piecewise defined functions are constructed with the IF statement. The IF statement in COPASI is used like a function with three arguments. The first argument is a conditional expression that evaluates to either TRUE or FALSE, the second argument is an expression that is evaluated if the condition evaluates to TRUE otherwise the third argument, which can also be an expression, determines the value of the function. The second and third argument to the IF statement must evaluate to a double value, that means it can not be a conditional expression like the first argument. On the other hand, the second and third arguments themselves can be IF statements. So in order to make this a little more clear, we will look at how one would implement the Heaviside step function in COPASI:
|