Temporary Functions operating on polynomials (including polynomial fitting); only to be used in Modelica.Media.Incompressible.TableBased
This package contains functions to operate on polynomials, in particular to determine the derivative and the integral of a polynomial and to use a polynomial to fit a given set of data points.
Copyright © 2004-2016, Modelica Association and DLR.
This package is free software. It can be redistributed and/or modified under the terms of the Modelica license, see the license conditions and the accompanying disclaimer in the documentation of package Modelica in file "Modelica/package.mo".
Extends from Modelica.Icons.Package (Icon for standard packages).
| Name | Description |
|---|---|
| Evaluate polynomial at a given abscissa value | |
| Evaluate polynomial at a given abscissa value with linear extrapolation outside of the defined range | |
| Derivative of polynomial | |
| Value of derivative of polynomial at abscissa value u | |
| Value of 2nd derivative of polynomial at abscissa value u | |
| Indefinite integral of polynomial p(u) | |
| Integral of polynomial p(u) from u_low to u_high | |
| Computes the coefficients of a polynomial that fits a set of data points in a least-squares sense | |
| Evaluate derivative of polynomial at a given abscissa value | |
| Evaluate derivative of polynomial at a given abscissa value with extrapolation outside of the defined range | |
| Time derivative of integral of polynomial p(u) from u_low to u_high, assuming only u_high as time-dependent (Leibniz rule) | |
| Time derivative of derivative of polynomial |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.evaluateEvaluate polynomial at a given abscissa value
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| u | Abscissa value |
| Name | Description |
|---|---|
| y | Value of polynomial at u |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.evaluateWithRangeEvaluate polynomial at a given abscissa value with linear extrapolation outside of the defined range
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| uMin | Polynomial valid in the range uMin .. uMax |
| uMax | Polynomial valid in the range uMin .. uMax |
| u | Abscissa value |
| Name | Description |
|---|---|
| y | Value of polynomial at u. Outside of uMin,uMax, linear extrapolation is used |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.derivativeDerivative of polynomial
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p1[:] | Polynomial coefficients (p1[1] is coefficient of highest power) |
| Name | Description |
|---|---|
| p2[size(p1, 1) - 1] | Derivative of polynomial p1 |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.derivativeValueValue of derivative of polynomial at abscissa value u
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| u | Abscissa value |
| Name | Description |
|---|---|
| y | Value of derivative of polynomial at u |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.secondDerivativeValueValue of 2nd derivative of polynomial at abscissa value u
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| u | Abscissa value |
| Name | Description |
|---|---|
| y | Value of 2nd derivative of polynomial at u |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.integralIndefinite integral of polynomial p(u)
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p1[:] | Polynomial coefficients (p1[1] is coefficient of highest power) |
| Name | Description |
|---|---|
| p2[size(p1, 1) + 1] | Polynomial coefficients of indefinite integral of polynomial p1 (polynomial p2 + C is the indefinite integral of p1, where C is an arbitrary constant) |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.integralValueIntegral of polynomial p(u) from u_low to u_high
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients |
| u_high | High integrand value |
| u_low | Low integrand value, default 0 |
| Name | Description |
|---|---|
| integral | Integral of polynomial p from u_low to u_high |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.fittingComputes the coefficients of a polynomial that fits a set of data points in a least-squares sense
Polynomials.fitting(u,y,n) computes the coefficients of a polynomial p(u) of degree "n" that fits the data "p(u[i]) - y[i]" in a least squares sense. The polynomial is returned as a vector p[n+1] that has the following definition:
p(u) = p[1]*u^n + p[2]*u^(n-1) + ... + p[n]*u + p[n+1];
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| u[:] | Abscissa data values |
| y[size(u, 1)] | Ordinate data values |
| n | Order of desired polynomial that fits the data points (u,y) |
| Name | Description |
|---|---|
| p[n + 1] | Polynomial coefficients of polynomial that fits the date points |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.evaluate_derEvaluate derivative of polynomial at a given abscissa value
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| u | Abscissa value |
| du | Delta of abscissa value |
| Name | Description |
|---|---|
| dy | Value of derivative of polynomial at u |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.evaluateWithRange_derEvaluate derivative of polynomial at a given abscissa value with extrapolation outside of the defined range
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| uMin | Polynomial valid in the range uMin .. uMax |
| uMax | Polynomial valid in the range uMin .. uMax |
| u | Abscissa value |
| du | Delta of abscissa value |
| Name | Description |
|---|---|
| dy | Value of derivative of polynomial at u |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.integralValue_derTime derivative of integral of polynomial p(u) from u_low to u_high, assuming only u_high as time-dependent (Leibniz rule)
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients |
| u_high | High integrand value |
| u_low | Low integrand value, default 0 |
| du_high | High integrand value |
| du_low | Low integrand value, default 0 |
| Name | Description |
|---|---|
| dintegral | Integral of polynomial p from u_low to u_high |
Modelica.Media.Incompressible.TableBased.Polynomials_Temp.derivativeValue_derTime derivative of derivative of polynomial
Extends from Modelica.Icons.Function (Icon for functions).
| Name | Description |
|---|---|
| p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
| u | Abscissa value |
| du | Delta of abscissa value |
| Name | Description |
|---|---|
| dy | Time-derivative of derivative of polynomial w.r.t. input variable at u |