COCO - CAPE-OPEN to CAPE-OPEN simulation environment
 Help

Formula syntax

Reaction rates, equilibrium constants and heats of reaction can be specified in formulas. The following operands can be used in the formulas. The operators are in order of precedence. Use brackets to make order of operations explicit.

operandsamplemeaning
-a - bsubstraction
+a + baddition
*a * bmultiplication
/a / bdivision
-- anegation (unary minus)
^a ^ bpower (a to the power of b)

The following values can be used:

valuedescription
PI3.1415926535897932384626433832795
Runiversal gas constant, 8.314 J/mol/K
numberany numeric value
Pcurrent pressure, Pa
Tcurrent temperature, K
A(compound)activity of compound with ID compound, Pa
F(compound)fugacity of compound with ID compound, Pa
C(compound)concentration (molality) of compound with ID compound, mol / m3
X(compound)mole fraction of compound with ID compound
MWT(compound)molar weight of compound with ID compound, g / mol

The following functions can be used:

functionsampledescription
SQRTSQRT(a)square root
SINSIN(a)sine
COSCOS(a)cosine
TANTAN(a)tangent
SINHSINH(a)hyperbolic sine
COSHCOSH(a)hyperbolic cosine
TANHTANH(a)hyperbolic tangent
ASINASIN(a)arc sine
ACOSACOS(a)arc cosine
ATANATAN(a)arc tangent
FLOORFLOOR(a)nearest lower integer
CEILCEIL(a)nearest higher integer
ROUNDROUND(a)nearest integer
EXPEXP(a)natural exponent
LOGLOG(a)natural logarithm
LOG10LOG10(a)10 based logarithm
MINMIN(a,b)minimum of two values
MAXMAX(a,b)maximum of two values
MODMOD(a,b)modulus

All formulas are case-insensitive. In the above, a and b are arbitrary expressions.

String values (compound names) should be quoted with double quotes if the string contains non-alpha-numeric characters or white spaces, e.g. use X("Diethyl Ether") rather than X(Diethyl Ether).