Buildings.Utilities.Controls

Library with models to control the execution

Package Content

NameDescription
Buildings.Utilities.Controls.AssertEquality AssertEquality Assert when condition is violated
Buildings.Utilities.Controls.AssertInequality AssertInequality Assert when condition is violated
Buildings.Utilities.Controls.BaseClasses BaseClasses Library with base classes to control the execution


Buildings.Utilities.Controls.AssertEquality Buildings.Utilities.Controls.AssertEquality

Assert when condition is violated

Buildings.Utilities.Controls.AssertEquality

Information


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


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.Controls.AssertInequality Buildings.Utilities.Controls.AssertInequality

Assert when condition is violated

Buildings.Utilities.Controls.AssertInequality

Information


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


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 Tue Sep 30 14:24:47 2008.