The SysML v2 Simulation plugin supports the evaluation of feature values defined by expressions. Expressions may calculate values using operators (for example, arithmetic or comparison operations) or derive values by referencing other features in the model. Expressions can be applied to attributes and references to define computed or derived values within a model.

During simulation, expressions are evaluated automatically. When a runtime value is changed, all dependent expressions are recalculated.

If you initiate the simulation from a model view, the results of expression evaluation are displayed on element shapes to provide immediate runtime feedback. Evaluated values of attributes and references are displayed in blue and are updated dynamically as the simulation progresses. For more information, see Simulation information in views.

Supported value types

Expressions operate on:

  • Primitive types (Integer, Real, Boolean, etc.)
  • Enumeration values
  • Feature references
  • Collections (arrays/lists)

Supported operators

TypeOperators
Arithmetic+
-
*
/
Comparison



>
<
>=
<=
Equality==
!=

Collections and aggregation functions

In the simulation context, expressions support collections (arrays/lists), which contain multiple values of a compatible type. Each element in a collection is evaluated individually. If any element in a collection is incompatible, the entire assignment is rejected. If values are converted during evaluation, those elements are also treated as incompatible.

You can use collections with the sum(<list>) function, which computes the total of all numeric elements in a collection and returns a single numeric value. This function can be used in any expression context that expects a numeric result.

Accessing nested features

Expressions support nested feature access using dot notation. This mechanism is available wherever feature values are used in simulation, including expressions, actions, event conditions, and message targets. It allows you to navigate structured model elements and access deeply nested values in complex systems.