y = Polynomial.evaluate(p, x);
Evaluate a polynomial p
at a given
Real abszissa value x
.
For this function, functions for the first and second derivatives are provided, so that the function can be seamlessly used e.g. in mechanical models.
import Modelica_LinearSystems2.Math.Polynomial; x = Polynomial.x(); p1 = -6*x^2 + 4*x -3; Polynomial.evaluate(p1, 1); // = -5.0
Polynomial.derivativeValue, Polynomial.integralValue, Polynomial.evaluateComplex.
encapsulated function evaluate import Modelica_LinearSystems2.Math.Polynomial; input Polynomial p "Polynomial to be evaluated"; input Real x "Abszissa value"; output Real y "Value of polynomial at x"; end evaluate;