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.

Insert an Expression block by selecting Insert > Expression from the right-click menu.

Expressionblockoptions

With the Expression block selected, type a name for the expression, in the Name field, or use the default.

The Expression block is labeled Expr1, Expr2, and so forth depending on how many Expression blocks are added to the model. The output node is labeled based on the name given to the parameter.

In the Contents sub-tab, type the expression.

In the Structural Parameters tab, click Add to add a structural parameter to the Expression block.

In the parameter field, type a name for the parameter.

An input node is added to the Expression block for each new parameter that is added.

Click the (X) button to remove a structural parameter.

Entering expressions

An expression represents a single numerical quantity in algebraic terms. It does not contain an assignment, or “=”, but 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 represented 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 Operators”, “Supported Math Functions”, and “Pharmacometrics Modeling Language” sections in the PML documentation.


Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.