Buildings.Fluid.CHPs.BaseClasses.Functions

Information

This package contains functions for used in the blocks. The functions are used in the blocks Buildings.Fluid.CHPs.BaseClasses.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.CHPs.BaseClasses.Functions.polynomialtrivariate polynomialtrivariate Polynominal function used for efficiency calculation

Buildings.Fluid.CHPs.BaseClasses.Functions.polynomialtrivariate Buildings.Fluid.CHPs.BaseClasses.Functions.polynomialtrivariate

Polynominal function used for efficiency calculation

Information

This function computes a trivariate fifth order polynomial. The polynomial has the form

y = a1 + a2 x12 + a3 x1 + a4 x22 + a5 x2 + a6 x32 + a7 x3 + a8 x12 x22 + a9 x1 x2
+ a10 x1 x22 + a11 x12 x2 + a12 x12 x32 + a13 x1 x3 + a14 x1 x32 + a15 x12 x3 + a16 x22 x32 + a17 x2 x3 + a18 x2 x32
+ a19 x22 x3 + a20 x12 x22 x32 + a21 x12 x22 x3 + a22 x12 x2 x32 + a23 x1 x22 x32 + a24 x12 x2 x3 + a25 x1 x22 x3 + a26 x1 x2 x32 + a27 x1 x2 x3

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

Inputs

TypeNameDefaultDescription
Realx1 Independent variable
Realx2 Independent variable
Realx3 Independent variable
Reala[27] Coefficients

Outputs

TypeNameDescription
RealyResult

Modelica definition

function polynomialtrivariate "Polynominal function used for efficiency calculation" extends Modelica.Icons.Function; input Real x1 "Independent variable"; input Real x2 "Independent variable"; input Real x3 "Independent variable"; input Real a[27] "Coefficients"; output Real y "Result"; protected Real x1Sq = x1^2; Real x2Sq = x2^2; Real x3Sq = x3^2; algorithm y := a[1] + a[2]*x1Sq + a[3]*x1 + a[4]*x2Sq + a[5]*x2 + a[6]*x3Sq + a[7]*x3 + a[8]*x1Sq*x2Sq + a[9]*x1*x2 + a[10]*x1*x2Sq + a[11]*x1Sq*x2 + a[12]*x1Sq*x3Sq + a[13]*x1*x3 + a[14]*x1*x3Sq + a[15]*x1Sq*x3 + a[16]*x2Sq*x3Sq + a[17]*x2*x3 + a[18]*x2*x3Sq + a[19]*x2Sq*x3 + a[20]*x1Sq*x2Sq*x3Sq + a[21]*x1Sq*x2Sq*x3 + a[22]*x1Sq*x2*x3Sq + a[23]*x1*x2Sq*x3Sq + a[24]*x1Sq*x2*x3 + a[25]*x1*x2Sq*x3 + a[26]*x1*x2*x3Sq + a[27]*x1*x2*x3; end polynomialtrivariate;