.ModelicaReference.Operators.'change()'

Information

Indicate discrete variable changing

Syntax

change(v)

Description

Is expanded into "(v<>pre(v))". The same restrictions as for the pre() operator apply.

Examples

model BothEdges
  Boolean u;
  Integer i;
equation
  u = Modelica.Math.sin(time) > 0.5;
  when change(u) then
    i = pre(i) + 1;
  end when;
end BothEdges;
Simulation result

Generated at 2024-12-21T19:25:56Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos