Buildings.Fluids.Utilities.Examples

Collection of models that illustrate model use and test models

Package Content

NameDescription
ExtendedPolynomialDerivativeCheck  


Buildings.Fluids.Utilities.Examples.ExtendedPolynomialDerivativeCheck

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.


Parameters

TypeNameDefaultDescription
Realc[:]{0.1162,1.5404,-1.4825,0.766...Polynomial coefficients
RealxMin1Minimum x value for polynomial
RealxMax2Maximum x value for polynomial

Modelica definition

model ExtendedPolynomialDerivativeCheck 
  
  
  parameter Real[:] c={0.1162,1.5404,-1.4825,0.7664,-0.1971} 
    "Polynomial coefficients";
  parameter Real xMin=1 "Minimum x value for polynomial";
  parameter Real xMax=2 "Maximum x value for polynomial";
  
  Real x;
  Real y;
initial equation 
   y=x;
equation 
  x=Buildings.Fluids.Utilities.extendedPolynomial(c, time, xMin, xMax);
  der(y)=der(x);
  assert(abs(x-y) < 1E-2, "Model has an error");
  
end ExtendedPolynomialDerivativeCheck;

HTML-documentation generated by Dymola Fri Jun 20 09:58:33 2008.