blockVerifyDifferenceThreePeriods
Assert when condition is violated
Extends from Buildings.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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Time | startTime (from PartialInputCheck) | 0 | Start time for activating the assert |
| Real | threShold (from PartialInputCheck) | 1E-2 | Threshold for equality comparison |
| String | message (from PartialInputCheck) | "Inputs differ by more than threShold" | |
| Modelica.Units.SI.Time | endTime | 0 | Start time for deactivating the assert (period one) |
| Modelica.Units.SI.Time | startTime2 | 0 | Start time for activating the assert (period two) |
| Modelica.Units.SI.Time | endTime2 | 0 | Start time for deactivating the assert (period two) |
| Modelica.Units.SI.Time | startTime3 | 0 | Start time for activating the assert (period three) |
| Modelica.Units.SI.Time | endTime3 | 0 | Start time for deactivating the assert (period three) |
| Modelica.Units.SI.Time | tau | 60 | Time constant for filtering signal |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | u1 (from PartialInputCheck) | Value to check | |
| Modelica.Blocks.Interfaces.RealInput | u2 (from PartialInputCheck) | Value to check | |
| Modelica.Blocks.Interfaces.BooleanOutput | satisfied | ||
| Modelica.Blocks.Interfaces.RealOutput | diff | Difference 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 removednoEventoperator which is not needed as these are only time events. -
June 29, 2016, by Moritz Lauster:
First implementation.