.ModelicaReference.Operators.'noEvent()'

Information

Turn off event triggering

Syntax

noEvent(expr)

Description

Real elementary relations within expr are taken literally, i.e., no state or time event is triggered.

smooth vs. noEvent

The noEvent operator implies that real elementary expressions are taken literally instead of generating crossing functions. The smooth operator should be used instead of noEvent, in order to avoid events for efficiency reasons. A tool is free to not generate events for expressions inside smooth. However, smooth does not guarantee that no events will be generated, and thus it can be necessary to use noEvent inside smooth. [Note that smooth does not guarantee a smooth output if any of the occurring variables change discontinuously.]

[Example:

  Real x, y, z;
equation
  x = if time<1 then 2 else time-2;
  z = smooth(0, if time<0 then 0 else time);
  y = smooth(1, noEvent(if x<0 then 0 else sqrt(x)*x));
  // noEvent is necessary.

]

Examples

der(h)=if noEvent(h>0) then -c*sqrt(h) else 0;

Generated at 2024-11-14T19:25:47Z by OpenModelicaOpenModelica 1.24.0 using GenerateDoc.mos