21. Arithmetical Expressions#

21.1. Introduction#

NaxToView includes an arithmetic expression engine that allows defining custom formulas to derive new results from finite element model data. This engine is used in four different contexts:

Context

Purpose

Derived Load Cases

Combine results from different load cases and increments, including envelopes for structural sizing.

Derived Components

Create new result components from existing ones (vector magnitudes, equivalent stresses, failure criteria, etc.).

Derived Attributes

Generate data fields on the mesh computed from geometric or intrinsic properties of the model.

Tags

Display model values, file information, and expression results directly in the 3D viewer.

All contexts share the same base set of operators and functions, but each has its own variable syntax and some exclusive functions.

21.2 General Concepts#

This section defines the fundamental data types, operators, precedence rules, and mathematical functions used by the NaxToView expression engine. These rules apply to all contexts: Derived Load Cases, Derived Components, Derived Attributes, and Tags.

21.2.1 Data Types#

The engine works with three fundamental data types:

Type

Description

Notation

Scalar

A single numerical value. Supports signs, decimals, and scientific notation. The special value NaN represents an undefined result.

3.14-21.5E-3NaN

Array

An ordered list of scalars enclosed in brackets, separated by the regional list separator.

[1.0;2.5;-0.3]

Variable

A named reference to a dataset in the model. Internally an array of double, with one value per node or element.

<LC1:FR1>

Operational rules between types#

All operations involving arrays or variables are applied element‑wise:

Operand A

Operand B

Result

Behavior

Scalar

Scalar

Scalar

result = a op b

Array/Variable [n]

Scalar

Array/Variable [n]

result[i] = A[i] op b

Scalar

Array/Variable [n]

Array/Variable [n]

result[i] = a op B[i]

Array/Variable [n]

Array/Variable [n]

Array/Variable [n]

result[i] = A[i] op B[i]

Note

When operating on two arrays or variables, they must have the same length. If dimensions do not match, the result is NaN.

21.2.2 Arithmetic Operators#

Operator

Operation

Example

+

Addition

<LC1:FR1>+<LC2:FR1>

-

Subtraction

<LC1:FR1>-<LC2:FR1>

*

Multiplication

<LC1:FR1>*1.5

/

Division

<LC1:FR1>/<LC2:FR1>

^

Power

<CMPT_STRESSES:XX>^2

( )

Parentheses

(<LC1:FR1>+<LC2:FR1>)*1.5

No spaces allowed: Expressions cannot contain whitespace. Incorrect: <LC1:FR1> + <LC2:FR1>
Correct: <LC1:FR1>+<LC2:FR1>

Division by zero: Produces NaN for the affected position but does not stop evaluation; other elements continue normally.

21.2.3 Evaluation Order (Precedence)#

The engine evaluates expressions using this strict priority order:

Priority

Category

Detail

1

Expressions inside arrays

Expressions inside []

2

Logarithmic functions

log(), ln()

3

Trigonometric functions

sin(), cos(), tan(), sec(), cosec(), cot(), asin(), acos(), atan(), sinh(), cosh(), tanh()

4

Square root

sqrt()

5

Envelope functions

envmax(), envmin(), envrange(), envextrememax(), envextrememin()

6

Min/Max functions

min(), max(), extrememin(), extrememax()

7

Parentheses

( )

8

Power

^

9

Multiplication

*

10

Division

/

11

Addition

+

12

Subtraction

-

Tip

Use parentheses to enforce a specific evaluation order and improve readability, e.g., (<LC1:FR1>+<LC2:FR1>)*1.5.

21.2.4 Mathematical Functions#

All functions accept a scalar, array, variable, or composite expression inside parentheses, and operate element‑wise.

Logarithms and Square Root#

Function

Description

Valid Domain

log(x)

Base‑10 logarithm

x > 0 (outside domain → NaN)

ln(x)

Natural logarithm

x > 0

sqrt(x)

Square root

x ≥ 0

Direct Trigonometric Functions#

Function

Definition

sin(x)

Sine

cos(x)

Cosine

tan(x)

Tangent

sec(x)

Secant = 1/cos(x)

cosec(x)

Cosecant = 1/sin(x)

cot(x)

Cotangent = 1/tan(x)

Inverse Trigonometric Functions#

Function

Description

Input Domain

Output Range

asin(x)

Arcsine

−1 ≤ x ≤ 1

[−π/2, π/2]

acos(x)

Arccosine

−1 ≤ x ≤ 1

[0, π]

atan(x)

Arctangent

All real values

(−π/2, π/2)

Hyperbolic Functions#

Function

Definition

sinh(x)

(eˣ − e⁻ˣ) / 2

cosh(x)

(eˣ + e⁻ˣ) / 2

tanh(x)

sinh(x) / cosh(x)

Note

If the argument is outside the valid domain or the result is infinite, that position becomes NaN. The rest of the array continues to evaluate normally.

21.2.5 Aggregation Functions (Min / Max)#

These functions accept multiple arguments, separated by comma or semicolon depending on regional settings.

Function

Behavior (per position i)

max(a,b,...)

Returns the maximum value

min(a,b,...)

Returns the minimum value

extrememax(a,b,...)

Returns the value with the largest absolute value (sign preserved)

extrememin(a,b,...)

Returns the value with the smallest absolute value (sign preserved)

Note

Single‑array case: If max() or min() receives a single array, it returns the global extreme value as a scalar. Useful for normalization: <CONTOUR>/max(<CONTOUR>).

21.2.6 Automatic Sign Simplification#

The engine automatically simplifies consecutive sign sequences:

Original

Simplified

Rule

a++b

a+b

Double positive = positive

a--b

a+b

Double negative = positive

a+-b

a-b

Positive–negative = negative

a-+b

a-b

Negative–positive = negative

This also applies after *, /, ^, opening parentheses, and commas.

21.2.7 Regional Configuration#

The engine respects the OS regional settings for separators:

Region

Decimal

List

Array Example

English (US/UK)

.

,

[1.5,2.3,0.8]

Spanish / French / German

,

;

[1,5;2,3;0,8]

Warning

The list separator also applies to function arguments like max(), min(), and envelope functions. In Spanish settings: max(<LC1:FR1>;<LC2:FR1>).

21.3. Derived Load Cases#

Derived load cases allow you to combine results from different load cases and increments using arithmetic expressions. Each referenced variable represents a full array containing one value per node or per element in the model. This is the main tool for load combinations, envelopes, and multilinear post‑processing.

21.3.1 Variable Syntax#

Variables are enclosed between angle brackets < >:

Format

Description

Example

<LCid:FRincrement_id>

Load case with ID id, increment with ID increment_id. The number after FR is the increment ID, not its sequential position.

<LC1:FR1> <LC12:FR3>

<LCDid:FRincrement_id>

Derived load case with ID –id. The prefix LCD replaces the negative sign.

<LCD5:FR1> (equivalent to ID −5)

Supported operations: All arithmetic operators, parentheses, all mathematical functions, min/max, and envelope functions (exclusive to this context).

Warning

No spaces allowed: Write expressions continuously: 1.5*<LC1:FR1>+1.35*<LC2:FR1>.

21.3.2 Envelope Functions#

Envelope functions are exclusive to Derived Load Cases and essential for structural sizing. For each node/element, they evaluate the extreme value among multiple load cases and can also identify which load case or increment yields that extreme.

Function

Behavior per position i

envmax(...)

Returns the maximum value among all load cases.

envmin(...)

Returns the minimum value.

envextrememax(...)

Returns the value with the largest absolute magnitude, preserving its sign.

envextrememin(...)

Returns the value with the smallest absolute magnitude, preserving its sign.

envrange(...)

Computes amplitude: max[i] min[i] for each node/element.

Warning

Restriction: Arguments of envelope functions must be only load‑case variables <LC…:FR…>. Scalars, literal arrays, and composite expressions are not allowed as direct arguments.

21.3.3 Envelope Result Modifiers#

Internally, each envelope function generates three arrays simultaneously. The modifier (suffix) selects which one is used:

Suffix

Displayed Result

(no suffix)

Actual contour value (stress, displacement, etc.).

:bylcid

Load case ID that provides the extreme at each node/element.

:byicid

Increment ID where the extreme occurs (useful in nonlinear analysis).

21.3.4 Practical Examples#

Linear load combination

1.5*<LC1:FR1>+1.35*<LC2:FR1>+1.5*<LC3:FR1>

Each variable references increment ID 1 of its corresponding load case.

Combination using different increments

<LC1:FR1>+<LC2:FR3>+<LC3:FR1>

Combines increment 1 of LC1, increment 3 of LC2, and increment 1 of LC3. The number following FR is the increment ID as shown in the results tree.

Ultimate load from a limit‑state derived case

<LCD1:FR1>*1.5

Multiplies a derived load case (the previously defined limit combination, with derived ID 1) by the ultimate safety factor of 1.5.

Difference Between Increments (thermal delta)

<LC3:FR5>-<LC3:FR1>

Computes the result increment between increment ID 5 and increment ID 1 of the same thermal load case.

RSS Combination (Root Sum of Squares)

sqrt(<LC1:FR1>^2+<LC2:FR1>^2+<LC3:FR1>^2)

Quadratic combination of three independent load cases.

Maximum envelope for sizing

envmax(<LC1:FR1>,<LC2:FR1>,<LC3:FR1>,<LC4:FR1>)

For each node/element, retrieves the maximum stress (or displacement, etc.) among the four load cases.

Absolute‑value envelope with critical case identification

envextrememax(<LC1:FR1>,<LC2:FR1>,<LC3:FR1>):bylcid

Identifies, for each node/element, which load case produces the largest result magnitude. The contour displays the load case IDs, allowing visualization of regions dominated by each condition.

Envelope range (fatigue amplitude)

envrange(<LC1:FR1>,<LC2:FR1>,<LC3:FR1>,<LC4:FR1>)

Computes max − min at each point.

Margin of Safety Between Derived Load Cases

<LCD2:FR1>/<LCD1:FR1>-1

Calculates the margin of safety MS = (allowable load / applied load) − 1 using two previously defined derived cases.

Logarithmic transformation

log(<LC1:FR1>/<LC2:FR1>)

Base-10 logarithm of the ratio between two responses. Useful for representing amplitude ratios in decibels.

Envelope with increment identification

envmax(<LC1:FR1>,<LC1:FR2>,<LC1:FR3>,<LC1:FR4>):byicid

Maximum envelope among four increments of the same nonlinear load case. The modifier :byicid indicates at which load step the maximum is reached at each point.

21.4. Derived Components#

Derived components allow you to create new result components by combining existing ones for the same load case and increment. Each variable represents an array of data with one value per node or element.

21.4.1 Variable Syntax#

Format

Description

Example

<CMPT_{result}:{component}>

Component of an existing result group. result = name of the result group exactly as it appears in the loaded model. component = name of the component within that group.

<CMPT_DISPLACEMENTS:X> <CMPT_STRESSES:XX>

<CMPTD:{name}>

Previously created derived component.

<CMPTD:VonMises>

Note

Name source: Both the result group name and the component names come directly from the solver’s result file. For example, in a Nastran model, the stress group is typically STRESSES (not STRESS) with components XX, YY, XY, etc. Always verify exact names in the NaxToView results tree.

Supported operations: All operators, parentheses, mathematical functions, and min/max.

Note

Not available: Envelope functions (envmax, envmin, envrange, envextrememax, envextrememin) and modifiers :bylcid / :byicid are not available for derived components.

21.4.2 Practical Examples#

Displacement Vector Magnitude

sqrt(<CMPT_DISPLACEMENTS:X>^2+<CMPT_DISPLACEMENTS:Y>+<CMPT_DISPLACEMENTS:Z>^2)

Computes the total displacement magnitude from its three Cartesian components.

Von Mises stress (2D, shell)

sqrt(<CMPT_STRESSES:XX>^2+<CMPT_STRESSES:YY>^2-<CMPT_STRESSES:XX>*<CMPT_STRESSES:YY>+3*<CMPT_STRESSES:XY>^2)

Von Mises criterion for plane stress state (shell elements).

Von Mises stress (3D, full tensor)

sqrt(0.5*((<CMPT_STRESSES:XX>-<CMPT_STRESSES:YY>)^2+( <CMPT_STRESSES:YY>-<CMPT_STRESSES:ZZ>)^2+( <CMPT_STRESSES:ZZ>-<CMPT_STRESSES:XX>)^+6*(<CMPT_STRESSES:XY>^2+<CMPT_STRESSES:YZ>^2+<CMPT_STRESSES:XZ>^2)))

Von Mises criterion computed from the full 3D stress tensor. Use the component names corresponding to your model.

Maximum shear stress (simplified Tresca)

max(<CMPT_STRESSES:XX>,<CMPT_STRESSES:YY>,<CMPT_STRESSES:ZZ>)
 - min(<CMPT_STRESSES:XX>,<CMPT_STRESSES:YY>,<CMPT_STRESSES:ZZ>)

Difference between the maximum and minimum normal stresses at each point. Approximation of Tresca stress using direct stresses.

Stress component in the XY plane

sqrt(<CMPT_STRESSES:XX>^2
    +<CMPT_STRESSES:YY>^2
    +2*<CMPT_STRESSES:XY>^2)

Equivalent stress in the XY plane for shell-type elements.

Reserve Factor (RF)

<CMPTD:Allowable>/<CMPTD:VonMises>

Reserve factor: ratio between allowable stress (previously defined as a derived component) and Von Mises stress. Values > 1 indicate positive margin.

Unit conversion

<CMPT_STRESSES:XX>*0.145038

Converts stresses from MPa to ksi (kilo-pounds per square inch).

Displacement in the XY Plane (Excluding Z Component)

sqrt(<CMPT_DISPLACEMENTS:X>^2
    +<CMPT_DISPLACEMENTS:Y>^2)

Displacement projected onto the XY plane, useful for evaluating in-plane deformation without considering out-of-plane buckling.

Principal Stress Direction Angle

0.5*atan(2*<CMPT_STRESSES:XY>
        /(<CMPT_STRESSES:XX>-<CMPT_STRESSES:YY>))

Angle of the principal stress direction in the plane (in radians). Applicable to shells and 2D elements.

Largest Absolute Component (Critical Stress)

extrememax(<CMPT_STRESSES:XX>,
           <CMPT_STRESSES:YY>,
           <CMPT_STRESSES:ZZ>)

Selects the normal stress with the greatest magnitude (tension or compression), preserving its sign. Useful for identifying the critical stress component at each point in the model.

21.5. Derived Attributes#

Derived attributes allow you to create data fields on the mesh computed from the model’s intrinsic properties and other existing attributes. Each variable is an array with one value per node or per element across the full model.

21.5.1 Available Variables#

Element Fields#

Available when the attribute item type is ELEMENTS:

Variable

Description

Value Type

<ID>

Element ID (solver pedigree ID)

Integer

<GLOBAL_ID>

Internal global ID (VTK index)

Integer

<CONTOUR>

Current contour value being plotted

Decimal

<PROPERTY>

Structural property ID assigned to the element

Integer

<MATERIAL>

Material ID assigned

Integer

<TYPE_ELEMENT>

Element type according to the solver

Integer

<PART>

Group/part ID

Integer

<COORD_X>

X coordinate of the element centroid

Decimal

<COORD_Y>

Y coordinate of the element centroid

Decimal

<COORD_Z>

Z coordinate of the element centroid

Decimal

<NORMAL>

Element normal vector as array [nx, ny, nz]

Array [3]

Node Fields#

Available when the attribute item type is NODES:

Variable

Description

Value Type

<ID>

Node ID (solver pedigree ID)

Integer

<GLOBAL_ID>

Internal global ID (VTK index)

Integer

<CONTOUR>

Current contour value

Decimal

<PART>

Group/part ID

Integer

<COORD_X>

Node X coordinate

Decimal

<COORD_Y>

Node Y coordinate

Decimal

<COORD_Z>

Node Z coordinate

Decimal

Supported operations: All operators, parentheses, math functions, and min/max.
Not available: Envelope functions cannot be used in Derived Attributes.

21.5.2 Referencing Other Attributes#

Any existing attribute (derived, imported, or contour) may be referenced by name:

<AttributeName>

The attribute must exist and have its data computed beforehand. Its array of values is injected directly into the formula.

21.5.3 Practical Examples#

Radial distance to Z-axis (cylindrical radius)

sqrt(<COORD_X>^2 + <COORD_Y>^2)

Computes the radius in cylindrical coordinates. Useful for fuselages, cylindrical tanks, or bodies of revolution.

Distance from the origin (spherical radius)

sqrt(<COORD_X>^2 + <COORD_Y>^2 + <COORD_Z>^2)

Radius in spherical coordinates measured from the origin of the global reference system.

Azimuth angle in the XY plane

atan(<COORD_Y> / <COORD_X>)  Returns NaN where `<COORD_X> = 0`.

Angle in radians measured from the positive X-axis. Returns NaN where COORD_X = 0. Useful for parameterizing circular sections.

Relative Height with Respect to a Section

<COORD_Z> - 1250.0

Vertical distance of each node/element relative to section Z = 1250 mm (e.g., a reference frame).

Contour normalization with respect to global maximum

<CONTOUR> / max(<CONTOUR>)

Scales contour values to the range [0, 1] by dividing each value by the global maximum. Useful for comparing distributions of different magnitudes.

Ratio between custom attribute and Coordinate

<Espesor> / sqrt(<COORD_X>^2 + <COORD_Y>^2)

Thickness-to-radius ratio for an imported thickness attribute. Useful for verifying thickness/radius ratios in pressure vessels.

21.6. Tags#

Tags allow you to display numerical values, model information, and results of arithmetic expressions directly in the 3D viewer, associated with selected nodes or elements.

Processing follows two sequential phases:

  1. Phase 1 — Variable Substitution: References FIELD::CRITERION are replaced by their numerical values (scalars or arrays).

  2. Phase 2 — Arithmetic Evaluation: Expressions ={...} are evaluated by the formula engine. Values extracted in Phase 1 can participate as operands in Phase 2.

21.6.1 Domain Variables (Phase 1)#

Syntax:

FIELD::CRITERION

Available Fields#

Field

Available In

Description

ID

Elements, Nodes

ID of the node or element

GLOBAL_ID

Elements, Nodes

Internal global ID

CONTOUR

Elements, Nodes

Value of the active contour. May return an array in element‑nodal mode.

PROPERTY

Elements

Structural property name

MATERIAL

Elements

Material name. May have multiple values.

TYPE_ELEMENT

Elements

Element type name

PART

Elements, Nodes

Group/part name

COORD_X

Elements, Nodes

X coordinate (centroid for elements)

COORD_Y

Elements, Nodes

Y coordinate

COORD_Z

Elements, Nodes

Z coordinate

NORMAL

Elements

Normal vector [nx, ny, nz] as a 3‑component array

{attribute}

Elements, Nodes

Value of an existing custom attribute

Selection Criteria#

Criterion

Description

ENTITY

Value at the specific entity where the tag is placed. If the result is element‑nodal, returns an array with one value per element node.

MAX

Maximum value among all entities selected in the tag.

MIN

Minimum value among all entities selected.

EXTREME_MAX

Value with the largest absolute magnitude, sign preserved.

EXTREME_MIN

Value with the smallest absolute magnitude, sign preserved.

Note

PROPERTY, MATERIAL, TYPE_ELEMENT, and PART resolve to textual names (not numeric IDs), hence they cannot be used inside arithmetic expressions ={...}.

21.6.2 Global Variables#

Provide general model information, independent of the selected entity:

Variable

Returned Value

MODEL_NAME::ENTITY

Model file name (text)

MODEL_FILE::ENTITY

Full file path (text)

SOLVER::ENTITY

Solver name (text)

LOAD_CASE::ENTITY

ID and name of the active load case (text)

INCREMENT::ENTITY

Active increment value (text)

Note

Global variables return text, not numbers. They are inserted directly in the tag text and cannot be used inside ={...} expressions.

21.6.3 Arithmetic Expressions (Phase 2)#

Expressions are written between ={ and } and are evaluated after domain variables have been substituted.

Format

Description

={expression}

Evaluates and displays with maximum precision (up to 20 significant digits)

={expression,%.{n}f}

Evaluates and formats to n fixed decimals

={expression,%.{n}e}

Evaluates and formats to n decimals in scientific notation

Note

No spaces inside the expression:
Incorrect: ={CONTOUR::MAX / 1000,%.3f}
Correct: ={CONTOUR::MAX/1000,%.3f}

21.6.4 Output Formatting#

Specifier

Description

Example

%.0f

Integer (no decimals)

={CONTOUR::MAX,%.0f}

%.2f

2 fixed decimals

={CONTOUR::MAX,%.2f}

%.4f

4 fixed decimals

={CONTOUR::MAX,%.4f}

%.3e

Scientific notation, 3 decimals

={CONTOUR::ENTITY,%.3e}

(no format)

Full precision

={CONTOUR::MAX}

21.6.5 Arrays in Tags#

When a domain variable returns multiple values, it is inserted as an array [v1,v2,...,vn]. If this array appears inside ={...}, the engine processes it element‑wise.

Situations that produce arrays#

Situation

Resulting Array

CONTOUR::ENTITY on an element with element‑nodal results

Array with the value at each element node (e.g., 4 for QUAD4, 3 for TRIA3)

NORMAL::ENTITY on an element

[nx,ny,nz]

CONTOUR::ENTITY on a node with an unstitched mesh

Array with discontinuous values from adjacent elements

MATERIAL::ENTITY on a multi‑material element

Array with material IDs

Tip

Tip: You can operate on these arrays. For example, if CONTOUR::ENTITY produces [150.3,148.7,155.1,152.0] (the four nodes of a QUAD4), then ={CONTOUR::ENTITY/1000,%.4f} yields [0.1503,0.1487,0.1551,0.1520].

21.6.6 Practical Examples#

Complete Model Information Card

Model: MODEL_NAME::ENTITY
Load Case: LOAD_CASE::ENTITY
Increment: INCREMENT::ENTITY
Solver: SOLVER::ENTITY

Four lines of general model information, without arithmetic operations. Global variables are directly substituted as text.

Contour value with units and formatting

Stress: ={CONTOUR::MAX,%.2f} MPa

Displays the maximum contour stress among selected elements, formatted to two decimal places and followed by the unit.

Unit conversion Within the Tag Itself

Stress: ={CONTOUR::MAX/1000,%.3f} GPa

Stress: ={CONTOUR::MAX/1000,%.3f} GPa First, CONTOUR::MAX is replaced by the numeric value (e.g., 245730), then ={245730/1000,%.3f} is evaluated → 245.730 GPa.

Range of Values (Max - Min) Within a Selection

Range: ={CONTOUR::MAX-CONTOUR::MIN,%.2f} MPa

Both variables are first resolved to their scalar values, and then the subtraction is evaluated.

Margin of Safety in the Tag

MS = ={480/CONTOUR::EXTREME_MAX-1,%.3f}

Computes the margin of safety MS = (allowable stress / applied stress) − 1 directly within the label, using 480 MPa as allowable and the maximum magnitude contour value.

Scientific Notation Value

Strain: ={CONTOUR::ENTITY,%.4e}

Displays strain with four decimals in scientific notation (e.g., 1.2345E-03). Ideal for very small or very large magnitudes.

Element‑Nodal Values with Operation

Nodal stress (ksi): ={CONTOUR::ENTITY*0.145038,%.1f}

If the contour is element-nodal and the element is a QUAD4, CONTOUR::ENTITY resolves as [s1,s2,s3,s4] and is multiplied by the conversion factor to ksi at each node.

Selected Point Coordinates

Position: X={COORD_X::ENTITY,%.1f} Y={COORD_Y::ENTITY,%.1f} Z={COORD_Z::ENTITY,%.1f}

Displays the three coordinates of the node/centroid with one decimal each.

Element normal vector

Normal: NORMAL::ENTITY

Displays the normal vector as [nx, ny, nz]. Does not require ={} unless operations are to be performed on it.

21.7. General Compatibility Table#

Functionality

Load Case

Component

Attribute

Tag

+ - * / ^

Yes

Yes

Yes

Yes

Parentheses ( )

Yes

Yes

Yes

Yes

log() ln()

Yes

Yes

Yes

Yes

sqrt()

Yes

Yes

Yes

Yes

sin() cos() tan()

Yes

Yes

Yes

Yes

sec() cosec() cot()

Yes

Yes

Yes

Yes

asin() acos() atan()

Yes

Yes

Yes

Yes

sinh() cosh() tanh()

Yes

Yes

Yes

Yes

min() max()

Yes

Yes

Yes

Yes

extrememin() extrememax()

Yes

Yes

Yes

Yes

envmax() envmin()

Yes

No

No

No

envextrememax() envextrememin()

Yes

No

No

No

envrange()

Yes

No

No

No

Modifiers :bylcid :byicid

Yes

No

No

No

Variable ↔ Variable

Yes

Yes

Yes

Yes*

Variable ↔ Scalar

Yes

Yes

Yes

Yes*

Scalar ↔ Scalar

Yes

Yes

Yes

Yes

Array ↔ Array

Yes

Yes

Yes

Yes*

Array ↔ Scalar

Yes

Yes

Yes

Yes*

Format %.nf and %.ne

No

No

No

Yes

Note

In tags, arrays come from Phase‑1 domain‑variable substitution (e.g., CONTOUR::ENTITY in element‑nodal mode, NORMAL::ENTITY, nodes in unstitched meshes, etc.).

21.8. Validation of Formulas and Errors#

21.8.1 Validation Process#

NaxToView automatically validates every formula before creating or editing a derived entity:

  1. Reference parsing: All <...> references in the formula are parsed.

  2. Entity existence checks:

    • Load cases: Verifies that the referenced load case and increment exist.

    • Components: Verifies that the referenced component exists in the active result.

    • Attributes: Validation is more flexible (accepts any valid attribute reference).

  3. Test evaluation: The formula is evaluated with test data to verify that the syntax yields a valid result.

21.8.2 Error Codes#

Code

Description

OK

Valid formula; it can be evaluated successfully.

ERROR_FORMULA_SYNTAX

Incorrect syntax: misplaced operators, unclosed parentheses, wrong function name, etc.

ERROR_FORMULA_LOAD_CASE

A referenced load case does not exist in the model.

ERROR_FORMULA_COMPONENT

A referenced component does not exist in the active result.

ERROR_FORMULA_INCREMENT

A referenced increment does not exist in the indicated load case.

21.8.3 Common Errors and Solutions#

Problem

Likely Cause

Solution

Result NaN across the whole model

Widespread division by zero, square root of negative values, logarithm of zero.

Check input data: ensure values are within the valid domain of the functions used.

NaN in localized regions

Some nodes/elements produce invalid operations (e.g., division by zero result).

Normal in real models. Nodes/elements with NaN are not plotted.

Syntax error on creation

Unclosed parentheses, double operator (**), misspelled function name, or whitespace in the formula.

Ensure all parentheses are paired, function names are exact (sqrt, not sqr), and remove spaces.

Variable not found

The referenced load case, component, or attribute does not exist or is misspelled.

Verify exact names in the NaxToView results tree.

Increment not found

The increment ID after FR does not exist in the given load case.

Verify available increment IDs in the results tree. The number after FR must match the increment ID.

Unexpected result from arrays of different sizes

Two variables with different number of items are combined (e.g., nodal vs. elemental results).

Ensure all variables in the formula share the same mapping/type.

List separator not working

OS regional settings use a different list separator.

In Spain/France use ; as list separator. In US/UK use ,.

envmax does not work in a component

Envelope functions are available only in Derived Load Cases.

Use max() for derived components, or create a derived load case.

Tag shows the formula unevaluated

Missing ={...} wrapper.

Wrap the expression inside ={ and }.

Tag shows too many decimals

No decimal‑format specifier used.

Add ={expression,%.2f} (or desired format).