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-2013, 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 | Evaluate polynomial at a given abscissa value |
evaluateWithRange | Evaluate polynomial at a given abscissa value with linear extrapolation outside of the defined range |
derivative | Derivative of polynomial |
derivativeValue | Value of derivative of polynomial at abscissa value u |
secondDerivativeValue | Value of 2nd derivative of polynomial at abscissa value u |
integral | Indefinite integral of polynomial p(u) |
integralValue | Integral of polynomial p(u) from u_low to u_high |
fitting | Computes the coefficients of a polynomial that fits a set of data points in a least-squares sense |
evaluate_der | Evaluate derivative of polynomial at a given abscissa value |
evaluateWithRange_der | Evaluate derivative of polynomial at a given abscissa value with extrapolation outside of the defined range |
integralValue_der | Time derivative of integral of polynomial p(u) from u_low to u_high, assuming only u_high as time-dependent (Leibnitz rule) |
derivativeValue_der | Time derivative of derivative of polynomial |
Name | Description |
---|---|
p[:] | Polynomial coefficients (p[1] is coefficient of highest power) |
u | Abscissa value |
Name | Description |
---|---|
y | Value of polynomial at u |
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 |
Name | Description |
---|---|
p1[:] | Polynomial coefficients (p1[1] is coefficient of highest power) |
Name | Description |
---|---|
p2[size(p1, 1) - 1] | Derivative of polynomial p1 |
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 |
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 |
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) |
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 |
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 |
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 |
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 |
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 |
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 |