.Modelica.Math.Polynomials.fitting

Information

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];

Interface

function fitting
  extends Modelica.Icons.Function;
  input Real u[:] "Abscissa data values";
  input Real y[size(u, 1)] "Ordinate data values";
  input Integer n(min = 1) "Order of desired polynomial that fits the data points (u,y)";
  output Real p[n + 1] "Polynomial coefficients of polynomial that fits the date points";
end fitting;

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f