Equation vs. Rule vs. Function
‘What is the difference between an
All three are algebraic expressions, however:
Equationis an equality relation the simulator is expected to keep throughout simulation time. Thus whenever dependent symbols change the referred symbol (
symbol-ref) is recalculated.
Ruleis a recurrance relation rule available in
System, i.e. the expression may depend on the output symbol. All rules in a system are executed synchronously. The time-step of the system controls the frequency of the execution of the rule.
Functionis a parametric function definition that is calclulated whenever used (using
symbol()notation). For convenience, parameter-free functions are also accessible in plain
||Evaluated whenever input symbols change and assigned to the referred symbol (e.g.
||Evaluated with the
||Evaluated when symbol / function is used.|