This package contains components models for run-time diagnostics. The models in this package can be used to stop a simulation if a test is violated.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).Name | Description |
---|---|
AssertEquality | Assert when condition is violated |
AssertInequality | Assert when condition is violated |
BaseClasses | Package with base classes for Buildings.Utilities.Diagnostics |
Model that triggers an assert if |u1-u2| > threShold and t > t0.
Extends from BaseClasses.PartialInputCheck (Assert when condition is violated).
Type | Name | Default | Description |
---|---|---|---|
Time | startTime | 0 | Start time for activating the assert [s] |
Real | threShold | 1E-2 | Threshold for equality comparison |
String | message | "Inputs differ by more than ... |
Type | Name | Description |
---|---|---|
input RealInput | u1 | Value to check |
input RealInput | u2 | Value to check |
block AssertEquality "Assert when condition is violated" extends BaseClasses.PartialInputCheck(message = "Inputs differ by more than threShold"); equation if noEvent(time > t0) then assert(noEvent(abs(u1 - u2) < threShold), message + "\n" + " time = " + String(time) + "\n" + " u1 = " + String(u1) + "\n" + " u2 = " + String(u2) + "\n" + " abs(u1-u2) = " + String(abs(u1-u2)) + "\n" + " threShold = " + String(threShold)); end if;end AssertEquality;
Model that triggers an assert if u1 > u2 - threShold and t > t0.
Extends from BaseClasses.PartialInputCheck (Assert when condition is violated).
Type | Name | Default | Description |
---|---|---|---|
Time | startTime | 0 | Start time for activating the assert [s] |
Real | threShold | 0 | Threshold for equality comparison |
String | message | "Inputs differ by more than ... |
Type | Name | Description |
---|---|---|
input RealInput | u1 | Value to check |
input RealInput | u2 | Value to check |
block AssertInequality "Assert when condition is violated" extends BaseClasses.PartialInputCheck(message = "Inputs differ by more than threShold", threShold = 0); equation if noEvent(time > t0) then assert(noEvent(u1 > u2 - threShold), message + "\n" + " time = " + String(time) + "\n" + " u1 = " + String(u1) + "\n" + " u2 = " + String(u2) + "\n" + " abs(u1-u2) = " + String(abs(u1-u2)) + "\n" + " threShold = " + String(threShold)); end if;end AssertInequality;