COPASI provides a comprehensive library of commonly used kinetic functions
that you can choose from when building your model. You can view the complete
list of these predefined functions by navigating to the Functions branch
of the object tree in the COPASI interface.
![]() |
| Function Table with predefined Functions |
Sometimes you may need to define a custom kinetic function to address a specific modeling requirement. COPASI allows you to create your own functions by either double-clicking an empty row in the functions table or clicking the New button at the bottom of the screen. In the function definition dialog, enter a unique name for your new function in the Function Name field. Then, specify the formula that describes the reaction rate in the Formula field.
The allowable syntax allowed for functions is specified in the Available Operators and Functions section below.
Note that this formula should only represent the right-hand side of the rate equation.
![]() |
| Function Definition Dialog |
For example, if you want to define the Michaelis-Menten equation, which can be
written as v = V * (S / (Km + S)), you would enter only the right-hand side
(V * (S / (Km + S))) into the Formula field. As you type, COPASI immediately
attempts to interpret the formula and automatically identifies any parameters
used. These parameters are then listed in the Parameters table below the formula
entry area.
![]() |
| Function Definition Dialog with graphical Display of the Function |
In COPASI, parameter names can be chosen freely, but there are a few important rules to keep in mind:
\" or \\).By default, any variable identified in your function formula will be assigned the type Parameter. However, you should specify the correct type for each variable by selecting from the “Description” dropdown list. Valid options are:
The types you assign to variables will affect where the function can be used. For example, if you define a function using two substrates and a modifier, that function can only be applied to reactions which actually have two substrates and a modifier.
You can also see how restrictions apply in the “Application Restrictions” table,
which appears below the Parameters table in the function dialog. For example,
if you define a function as A*B and set A and B to be substrates, the
Application Restrictions table will indicate that this function is applicable
only to reactions with exactly two substrates. After defining such a function,
it can be used for any chemical reaction containing exactly two substrates.
Before committing your function, you must also specify whether it is valid for reversible reactions, irreversible reactions, or both. This is controlled using the Reversible, Irreversible, or General radio buttons.
You can also call other functions from within your user-defined function. Keep these four important rules in mind when calling a function from another function:
Henry-Michaelis-Menten (irreversible), the first argument must be a
Substrate and the other two must be Parameters.Quoting function names: COPASI’s built-in function names may include spaces or special characters (such as hyphens). To call one of these functions, put its name in double quotes. For instance, you would call it like this:
"Henry-Michaelis-Menten (irreversible)"(S, Km, V)
Once you have created and committed your user-defined function, it becomes available for use in reaction definitions just like any other kinetic rate law.
The operators and functions that COPASI knows and therefore can be used to create user defined functions are the
following:
| Operator/Function | Description |
|---|---|
| + | plus operator |
| - | minus operator |
| / | division operator |
| * | multiplication operator |
| % | modulus operator |
| ^ | power operator |
| Operator/Function | Description |
|---|---|
| abs / ABS | absolute value |
| floor / FLOOR | floor value |
| ceil / CEIL | next highest integer |
| factorial / FACTORIAL | factorial function |
| log / LOG | natural logarithm |
| log10 / LOG10 | logarithm for base 10 |
| exp / EXP | exponent function |
| Operator/Function | Description |
|---|---|
| sin / SIN | sine function |
| cos / COS | cosine function |
| tan / TAN | tangent function |
| sec / SEC | secand function |
| csc / CSC | cosecand function |
| cot / COT | cotangent function |
| sinh / SINH | hyperbolic sine function |
| cosh / COSH | hyperbolic cosine function |
| tanh / TANH | hyperbolic tangent function |
| sech / SECH | hyperbolic secand function |
| csch / CSCH | hyperbolic cosecand function |
| coth / COTH | hyperbolic cotangent function |
| asin / ASIN | arcsine function |
| acos / ACOS | arccosine function |
| atan / ATAN | arctangent function |
| arcsec / ARCSEC | arcsecand function |
| arccsc / ARCCSC | arccosecand function |
| arccot / ARCCOT | arccotangent function |
| arcsinh / ARCSINH | hyperbolic arcsine function |
| arccosh / ARCCOSH | hyperbolic arccosine function |
| arctanh / ARCTANH | hyperbolic arctangent function |
| arcsech / ARCSECH | hyperbolic arcsecand function |
| arccsch / ARCCSCH | hyperbolic arccosecand function |
| arccoth / ARCCOTH | hyperbolic arccotangent function |
| Operator/Function | Description |
|---|---|
| uniform/UNIFORM | This functions takes 2 arguments min and max. It returns a normally distributed value in the open interval (min, max). |
| normal/NORMAL | This function takes 2 arguments mean and standard deviation. It returns a uniform distributed value with the given mean and standard deviation. |
| gamma/GAMMA | This function takes 2 arguments shape and scale deviation. It returns a gamma distributed value with the given values. |
| poisson/POISSON | This function takes 1 argument mu. It returns a poisson distributed value with the given expected rate of occurrences. |
The logical operators and comparisons are evaluated in the order they are listed in the table.
| Operator/Function | Description |
|---|---|
| le / LE / <= | smaller or equal (≤) |
| lt / LT / < | smaller (<) |
| ge / GE / >= | greater or equal (≥) |
| gt / GT / > | greater (>) |
| ne / NE / != | not equal (!=) |
| eq / EQ / == | equal (=) |
| and / AND / && | logical and (&) |
| or / OR / || | logical or (|) |
| xor / XOR | logical xor |
| not / NOT / ! | logical negation |
In addition to defining "normal" functions, COPASI allows the definition of piecewise defined functions.
Piecewise defined functions are constructed with the IF statement.
| Operator/Function | Description |
|---|---|
| if() / IF() | if statement for the construction of piecewise defined functions etc. |
The function name for the if statement must be written entirely in lowercase
(if) or entirely in uppercase (IF). Mixing uppercase and lowercase letters in
the name (e.g., “If” or “iF”) is not allowed and will result in an error.
The if function takes three arguments, separated by commas:
true — used if the Boolean expression is true.false — used if the Boolean expression is false.To clarify its usage, here’s an example showing how to define the Heaviside step function in COPASI:
if(x lt 0.0, 0.0, if(x gt 0.0, 1.0, 0.5))
In this example, the result is:
0.0 if x < 0.0,1.0 if x > 0.0, and0.5 if x == 0.0.| Operator/Function | Description |
|---|---|
| () | parenthesis for grouping of elements |
In addition to the function and operators above, COPASI knows some predefined constant names:
| Operator/Function | Description |
|---|---|
| pi / PI | Quotient of a circles circumference and its diameter ( 3.14159...) |
| exponentiale / EXPONENTIALE | Euler's number ( 2.7183... ) |
| true / TRUE | Boolean true value for conditional expressions |
| false / FALSE | Boolean false value for conditional expressions |
| infinity / INFINITY | Positive infinity |
Note: Built-in constant names must be written using either all lowercase or all uppercase letters. Mixing uppercase and lowercase letters is not allowed and will result in errors.