Buildings.Fluid.Actuators.BaseClasses.Examples

Collection of models that illustrate model use and test models

Information


This package contains examples for the use of models
that can be found in 
Buildings.Fluid.Actuators.BaseClasses.

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

Package Content

NameDescription
EqualPercentageDerivativeCheck  
ExponentialDerivativeCheck  


Buildings.Fluid.Actuators.BaseClasses.Examples.EqualPercentageDerivativeCheck

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
RealR50Rangeability
Realdelta0.01Value where transition occurs
Reall0.001Leakage

Modelica definition

model EqualPercentageDerivativeCheck


 parameter Real R = 50 "Rangeability";
 parameter Real delta = 0.01 "Value where transition occurs";
 parameter Real l = 0.001 "Leakage";
  Real x;
  Real y;
initial equation 
   y=x;
equation 
  x=Buildings.Fluid.Actuators.BaseClasses.equalPercentage(time, R, l, delta);
  der(y)=der(x);
  assert(abs(x-y) < 1E-2, "Model has an error");

end EqualPercentageDerivativeCheck;

Buildings.Fluid.Actuators.BaseClasses.Examples.ExponentialDerivativeCheck

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
Reala-1.51Coefficient a for damper characteristics
Realb0.105*90Coefficient b for damper characteristics
RealyL15/90Lower value for damper curve
RealyU55/90Upper value for damper curve
Realk01E6Flow coefficient for y=0, k0 = pressure drop divided by dynamic pressure
Realk10.45Flow coefficient for y=1, k1 = pressure drop divided by dynamic pressure
RealcL[3] Polynomial coefficients for curve fit for y < yL
RealcU[3] Polynomial coefficients for curve fit for y > yU

Modelica definition

model ExponentialDerivativeCheck


  parameter Real a(unit="")=-1.51 "Coefficient a for damper characteristics";
  parameter Real b(unit="")=0.105*90 "Coefficient b for damper characteristics";
  parameter Real yL = 15/90 "Lower value for damper curve";
  parameter Real yU = 55/90 "Upper value for damper curve";
  parameter Real k0(min=0) = 1E6 
    "Flow coefficient for y=0, k0 = pressure drop divided by dynamic pressure";
  parameter Real k1(min=0) = 0.45 
    "Flow coefficient for y=1, k1 = pressure drop divided by dynamic pressure";
  parameter Real[3] cL(fixed=false) 
    "Polynomial coefficients for curve fit for y < yL";
  parameter Real[3] cU(fixed=false) 
    "Polynomial coefficients for curve fit for y > yU";

  Real x;
  Real y;
initial equation 
 cL[1] = (ln(k0) - b - a)/yL^2;
 cL[2] = (-b*yL - 2*ln(k0) + 2*b + 2*a)/yL;
 cL[3] = ln(k0);

 cU[1] = (ln(k1) - a)/(yU^2 - 2*yU + 1);
 cU[2] = (-b*yU^2 - 2*ln(k1)*yU - (-2*b - 2*a)*yU - b)/(yU^2 - 2*yU + 1);
 cU[3] = (ln(k1)*yU^2 + b*yU^2 + (-2*b - 2*a)*yU + b + a)/(yU^2 - 2*yU + 1);

   y=x;
equation 
  x=Buildings.Fluid.Actuators.BaseClasses.exponentialDamper(y=time,a=a,b=b,cL=cL,cU=cU,yL=yL,yU=yU);
  der(y)=der(x);
  assert(abs(x-y) < 1E-2, "Model has an error");
end ExponentialDerivativeCheck;

HTML-documentation generated by Dymola Sat Feb 6 17:25:35 2010.