LBL logo

Buildings.Fluid.Utilities.BaseClasses

Package with base classes for Buildings.Fluid.Utilities

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.Utilities.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

NameDescription
Buildings.Fluid.Utilities.BaseClasses.der_extendedPolynomial der_extendedPolynomial Polynomial that is linearly extended at user specified values


Buildings.Fluid.Utilities.BaseClasses.der_extendedPolynomial Buildings.Fluid.Utilities.BaseClasses.der_extendedPolynomial

Polynomial that is linearly extended at user specified values

Information

This function is the derivative of extendedPolynomial with respect to x.

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
Realx x value
Realc[:] Polynomial coefficients
RealxMin Minimum x value for polynomial
RealxMax Maximum x value for polynomial
Realder_x  

Outputs

TypeNameDescription
Realder_yDerivative dy/dx

Modelica definition

function der_extendedPolynomial 
  "Polynomial that is linearly extended at user specified values"
  extends Modelica.Icons.Function;
  input Real x "x value";
  input Real[:] c "Polynomial coefficients";
  input Real xMin "Minimum x value for polynomial";
  input Real xMax "Maximum x value for polynomial";
  input Real der_x;
  output Real der_y "Derivative dy/dx";
protected 
 Integer N = size(c,1) "Number of coefficients";
algorithm 
if x < xMin then
   der_y := 0;
   for i in 2:N loop
     der_y := der_y + (i - 1)*xMin^(i - 2)*c[i];
   end for;
  elseif x < xMax then
   der_y := 0;
   for i in 2:N loop
     der_y := der_y + (i - 1)*x^(i - 2)*c[i];
  end for;
  else
     der_y := 0;
     for i in 2:N loop
       der_y := der_y + (i - 1)*xMax^(i - 2)*c[i];
    end for;
  end if;
end der_extendedPolynomial;

Automatically generated Wed Feb 22 15:22:55 2012.