blockAssertInequality

Assert when condition is violated

Extends from BaseClasses.PartialInputCheck (Assert when condition is violated).

Information

Model that triggers an assert if u1 > u2 - threShold and t > t0.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.TimestartTime (from PartialInputCheck)0Start time for activating the assert
RealthreShold (from PartialInputCheck)1E-2Threshold for equality comparison
Stringmessage (from PartialInputCheck)"Inputs differ by more than threShold"

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputu1 (from PartialInputCheck)Value to check
Modelica.Blocks.Interfaces.RealInputu2 (from PartialInputCheck)Value to check

Revisions

  • October 10, 2013, by Michael Wetter:
    Reformulated model to avoid an event iteration.
  • September 10, 2013, by Michael Wetter:
    Added time in print statement as OpenModelica, in its error message, does not output the time when the assert is triggered.
  • January 23, 2013, by Michael Wetter:
    Replaced when test with if test as equations within a when section are only evaluated when the condition becomes true. This fixes issue 72.
  • April 17, 2008, by Michael Wetter:
    First implementation.