Expression block

The Expression block represents one variable, whose value is set by a text expression entered in the Contents tab. Note that this can only be an expression; no statements, such as assignments (using the “=” sign), or PML code can be included. An expression is any combination of numbers, identifiers, and operators representing a single value. It includes no “=” sign representing assignment.

Expressionblockoptions.png 

An expression represents a single numerical quantity in algebraic terms. It does not contain an assignment, or “=”.

An expression may include any combination of the following:

Numbers
Optional decimal point:    999 9.99 .999 999. 0.999 
Followed by optional exponent:    1e999    99e-999 
Limits: IEEE double precision (about 13 decimal places)

Identifiers (variable names, function names)
Identifiers used within expressions must be valid model variables or function names.

Unary minus (negative sign)
Syntax: -expression 
Example: -exp(-ETA1), where ETA1 is a variable in the model

Factors
Syntax: expression*expression 
      or expression/expression 

Sums
Syntax: expression+expression 
      or expression-expression 

Exponential terms
Syntax: expression^expression 
   or expression**expression 
Example: Emax*C^gamma/(EC50^gamma+C^gamma) 
where Emax, C, EC50 and gamma are variables in the model.

Numeric Comparisons
The value of an expression using a comparison is one if the comparison is true, zero if false. Comparison operators allowed within expressions are:
- greater than or equal to: >=
- less than or equal to: <=
- not equal to: !=
- is equal to: ==
- greater than: >
- less than: <
Syntax: expression1 == expression2 
Example: probability_pain_relief >= chance 

Choice operator
Syntax: expression1 ? expression2:expression3 
Example (conditional expression): bodyweight < 300 ? 0:1 
If bodyweight is less than 300, the value is zero; else the value is one.

Logical operators 
For example: &&, ||, !

These have a lesser level of precedence than arithmetic operators. So, for example, “a+b>c” means “(a+b)>c”.

Example expression using a discrete covariate:

The values of a covariate baseline_pain are low, moderate, and severe, in that order. They are rep­resented internally by the Phoenix as 0, 1, and 2.

An Expression block called “pain_effect” might contain a conditional expression as follows:

Baseline_pain > 0 ? -1:0

This expression reads, “if baseline pain is greater than zero (the index for the first discrete value, low), the expression value is negative one; else, zero.”

The equality operator (==) can also be used to build expressions from discrete covariates or model variables such as:

CL=tvCL+(renal_necrosis==1)*renNC

For available logical operators and functions that can be used in expressions, see “Supported Opera­tors”, “Supported Math Functions”, and “Supported Special Functions”.

To specify Expression block options


Last modified date:7/9/20
Certara USA, Inc.
Legal Notice | Contact Certara
© 2020 Certara USA, Inc. All rights reserved.