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.
operand | sample | meaning |
---|---|---|
- | a - b | substraction |
+ | a + b | addition |
* | a * b | multiplication |
/ | a / b | division |
- | - a | negation (unary minus) |
^ | a ^ b | power (a to the power of b) |
The following values can be used:
value | description |
---|---|
PI | 3.1415926535897932384626433832795 |
R | universal gas constant, 8.314 J/mol/K |
number | any numeric value |
P | current pressure, Pa |
T | current 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:
function | sample | description |
---|---|---|
SQRT | SQRT(a) | square root |
SIN | SIN(a) | sine |
COS | COS(a) | cosine |
TAN | TAN(a) | tangent |
SINH | SINH(a) | hyperbolic sine |
COSH | COSH(a) | hyperbolic cosine |
TANH | TANH(a) | hyperbolic tangent |
ASIN | ASIN(a) | arc sine |
ACOS | ACOS(a) | arc cosine |
ATAN | ATAN(a) | arc tangent |
FLOOR | FLOOR(a) | nearest lower integer |
CEIL | CEIL(a) | nearest higher integer |
ROUND | ROUND(a) | nearest integer |
EXP | EXP(a) | natural exponent |
LOG | LOG(a) | natural logarithm |
LOG10 | LOG10(a) | 10 based logarithm |
MIN | MIN(a,b) | minimum of two values |
MAX | MAX(a,b) | maximum of two values |
MOD | MOD(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).