Buildings.Utilities.Diagnostics

Library with models to diagnose model errors

Package Content

NameDescription
Buildings.Utilities.Diagnostics.AssertEquality AssertEquality Assert when condition is violated
Buildings.Utilities.Diagnostics.AssertInequality AssertInequality Assert when condition is violated
Buildings.Utilities.Diagnostics.BaseClasses BaseClasses Library with base classes to diagnose model errors


Buildings.Utilities.Diagnostics.AssertEquality Buildings.Utilities.Diagnostics.AssertEquality

Assert when condition is violated

Buildings.Utilities.Diagnostics.AssertEquality

Information


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

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

Parameters

TypeNameDefaultDescription
TimestartTime0Start time for activating the assert [s]
RealthreShold1E-2Threshold for equality comparison
Stringmessage"Inputs differ by more than ... 

Connectors

TypeNameDescription
input RealInputu1Value to check, equal to 0 if unconnected
input RealInputu2Value to check, equal to 0 if unconnected

Modelica definition

block AssertEquality "Assert when condition is violated"
  extends BaseClasses.PartialInputCheck(message = "Inputs differ by more than threShold");
equation 
  when (time > t0) then
    assert(abs(u1 - u2) < threShold, message + "\n"
      + "  u1         = " + realString(u1) + "\n"
      + "  u2         = " + realString(u2) + "\n"
      + "  abs(u1-u2) = " + realString(abs(u1-u2)) + "\n"
      + "  threShold  = " + realString(threShold));
  end when;
end AssertEquality;

Buildings.Utilities.Diagnostics.AssertInequality Buildings.Utilities.Diagnostics.AssertInequality

Assert when condition is violated

Buildings.Utilities.Diagnostics.AssertInequality

Information


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

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

Parameters

TypeNameDefaultDescription
TimestartTime0Start time for activating the assert [s]
RealthreShold0Threshold for equality comparison
Stringmessage"Inputs differ by more than ... 

Connectors

TypeNameDescription
input RealInputu1Value to check, equal to 0 if unconnected
input RealInputu2Value to check, equal to 0 if unconnected

Modelica definition

block AssertInequality "Assert when condition is violated"
  extends BaseClasses.PartialInputCheck(message = "Inputs differ by more than threShold",
     threShold = 0);
equation 
  when (time > t0) then
    assert(u1 > u2 - threShold, message + "\n"
      + "  u1         = " + realString(u1) + "\n"
      + "  u2         = " + realString(u2) + "\n"
      + "  abs(u1-u2) = " + realString(abs(u1-u2)) + "\n"
      + "  threShold  = " + realString(threShold));
  end when;
end AssertInequality;

HTML-documentation generated by Dymola Thu Mar 17 10:17:18 2011.