blockVerifyDifferenceThreePeriods

Assert when condition is violated

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

Information

Block that outputs satisfied = false if abs(u1-u2) > threShold within the prescribed time intervals, or satisfied = true otherwise.

Implementation

The test uses a hysteresis of plus/minus 1% in order to avoid chattering if abs(u1-u2) is near threShold.

The difference abs(u1-u2) is filtered with a first order filter with time constant tau. This guards against rounding errors in event handling by upstream signal-generating blocks.

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"
Modelica.Units.SI.TimeendTime0Start time for deactivating the assert (period one)
Modelica.Units.SI.TimestartTime20Start time for activating the assert (period two)
Modelica.Units.SI.TimeendTime20Start time for deactivating the assert (period two)
Modelica.Units.SI.TimestartTime30Start time for activating the assert (period three)
Modelica.Units.SI.TimeendTime30Start time for deactivating the assert (period three)
Modelica.Units.SI.Timetau60Time constant for filtering signal

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputu1 (from PartialInputCheck)Value to check
Modelica.Blocks.Interfaces.RealInputu2 (from PartialInputCheck)Value to check
Modelica.Blocks.Interfaces.BooleanOutputsatisfied
Modelica.Blocks.Interfaces.RealOutputdiffDifference abs(u1-u2) after filtering

Revisions

  • November 4, 2021, by Michael Wetter:
    Added filtering to guard against rounding errors in events of upstream signal generating blocks.
    This is for Buildings, #2713.
  • September 7, 2018, by Michael Wetter:
    Rewrote inequality to turn a state into a time event for Dymola 2019FD01.
  • December 16, 2016, by Michael Wetter:
    Reformulated model for https://github.com/ibpsa/modelica-ibpsa/issues/623.
  • October 10, 2013, by Michael Wetter:
    Reformulated model to allow scheduling of time events as opposed to state events, and removed noEvent operator which is not needed as these are only time events.
  • June 29, 2016, by Moritz Lauster:
    First implementation.