functionfromZeros

Generate a Polynomial data record from given zeros

Information

This function constructs a polynomial from given zeros (also called roots). The zeros are defined as a vector of Complex numbers. Since only polynomials with real coefficients are supported, complex zeros must be defined as conjugate complex pairs. It is required that complex conjugate pairs must directly follow each other. An error occurs if this is not the case.

Example:

The polynomial

y = (s - 1) * ( s - (2+3j) ) * (s - (2-3j))

with j=sqrt(-1), is defined as

import Modelica_LinearSystems2.Math.Polynomial
Polynomial( {Complex(1),
             Complex(2,  3),
             Complex(2, -3)} );
// x^3 - 5*x^2 + 17*x - 13

Inputs

TypeNameDefaultDescription
Complex[:]rootsZeros of polynomial (must be real or conjugate complex pairs)

Outputs

TypeNameDefaultDescription
PolynomialpPolynomial that corresponds to the zeros