Buildings.Fluid.Movers.BaseClasses.Characteristics.Examples

Examples to test implemenation of derivative function

Information

Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).

Package Content

NameDescription
LinearFlowDerivativeCheck Model to check implementation of derivative function
QuadraticFlowDerivativeCheck Model to check implementation of derivative function


Buildings.Fluid.Movers.BaseClasses.Characteristics.Examples.LinearFlowDerivativeCheck

Model to check implementation of derivative function

Information


This example checks whether the function derivative is implemented correctly. If the derivative implementation is not correct, the model will stop with an assert statement.

Modelica definition

model LinearFlowDerivativeCheck 
  "Model to check implementation of derivative function"

  Real x;
  Real y;
initial equation 
   y=x;
equation 
  x=Buildings.Fluid.Movers.BaseClasses.Characteristics.linearFlow(
     V_flow=time-2,
     V_flow_nominal={1, 0},
     dp_nominal=  {0, 3000});
  der(y)=der(x);
  assert(abs(x-y) < 1E-2, "Model has an error");
end LinearFlowDerivativeCheck;

Buildings.Fluid.Movers.BaseClasses.Characteristics.Examples.QuadraticFlowDerivativeCheck

Model to check implementation of derivative function

Information


This example checks whether the function derivative is implemented correctly. If the derivative implementation is not correct, the model will stop with an assert statement.

Modelica definition

model QuadraticFlowDerivativeCheck 
  "Model to check implementation of derivative function"

  Real x;
  Real y;
initial equation 
   y=x;
equation 
  x=Buildings.Fluid.Movers.BaseClasses.Characteristics.quadraticFlow(
     V_flow=time,
     V_flow_nominal={0, 1.8, 3},
     dp_nominal=  {1000, 600, 0});
  der(y)=der(x);
  assert(abs(x-y) < 1E-2, "Model has an error");
end QuadraticFlowDerivativeCheck;

HTML-documentation generated by Dymola Sat Feb 6 17:36:13 2010.