.BusinessSimulation.Functions.polynomialFunction

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The function returns the value of the n-th degree polynomial given the real input x and the real vector of coefficients a[:] = {a_0, a_1, ..., a_n} where the degree of the polynomial is n = size(a,1) - 1.

Syntax

Functions.polynomialFunction(x,a);

Examples


Functions.polynomialFunction( 2, { 0,0,1}); // 4.0
Functions.polynomialFunction( 2, {-6,1,1}); // 0.0

See also

PolynomialFunction

Interface

function polynomialFunction
  extends BusinessSimulation.Icons.Function;
  input Real x "Independent variable";
  input Real a[:] "Vector of coefficients";
  output Real y "Value of the polynomial equation";
end polynomialFunction;

Generated at 2024-04-28T18:16:21Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos