The variability of an expression governs the degree of freedom with which the expression may vary during simulation. Variability is a specific property but has clear connections with the notion of data type. The example classes below illustrates the subtyping and variability rules for declaration equations and normal equations.
This is not allowed, since p1 + 2 is not a constant expression
Below the error message is shown, after trying to simulate the Constants model.
This is correct, since p1 + 2 has the same variability as p1.
The equation in TestEquations is not correct, since b is a discrete time and noEvent(x > 1) is a continuous time expression.
Below the error message is shown, after trying to simulate the TestEquations model.