pwAddF


 m = pwAddF(m, ID, rhs, numberOfArguments)

 PottersWheel supports user defined functions, which can be used within
 the differential equations or the reaction rate signatures.

 

Arguments for pwAddF

 ID                 ID          function name
 rhs                string      body of the function
 numberOfArguments  integer     number of arguments (default 1)

 

Description

 The right hand side (rhs) may contain expressions 'arg1', 'arg2', etc.
 to use the first, second, etc. argument. In addition, all dynamic
 variables (x), dynamic paramters (k), rules (a), or inputs (u)
 may be used.

 Allowed mathematical functions within the right hand side
 are all functions supported by math.h of the C language, e.g.
 sin, cos, exp, log, and sqrt.

 x^y will be replaced by pow(x, y).
 x^2 will be replaced by x*x, etc.

 

Example

 % Sum of two values
 m = pwAddF(m, 'sum', 'arg1 + arg2', 2);
 % Could be used within the reaction kinetics as
 'r1 * sum(r2, r3)'

See also

pwAddR