# lmlib.polynomial.poly.Poly#

class lmlib.polynomial.poly.Poly(coef, expo)#

Bases: lmlib.polynomial.poly._PolyBase

Univariate polyonimial in vector exponent notation: $$\alpha^\mathsf{T} x^q$$

Polynomial class for uni-variate polynomials in vector exponent notation, [Wildhaber2019], see Chapter 6.

Such a polynomial p(x) in x is defined as

$\begin{split}p(x) &= \alpha^\mathsf{T}x^q = \begin{bmatrix}a_0& a_1& \cdots& a_{Q-1}\end{bmatrix} \begin{bmatrix}x^{q_0}\\ x^{q_1}\\ \vdots\\ x^{q_{Q-1}}\end{bmatrix}\\ &= a_0 x^{q_0} + a_1 x^{q_1}+ \dots + a_{Q-1} x^{q_{Q-1}} \ ,\end{split}$

with coefficient vector $$\alpha \in \mathbb{R}^Q$$, exponent vector $$q \in \mathbb{Z}_{\geq 0}^Q$$, and function variable $$x \in \mathbb{R}$$.

Parameters
• coef (array_like, shape=(Q)) – Coefficient vector

• expo (array_like, shape=(Q)) – Exponent vector

|def_Q|

Examples

>>> import lmlib as lm
>>> p = Poly([0, 0.2, 3], [0, 1, 2])
>>> print(p)


Methods

 __init__(coef, expo) Constructor method eval(variable) Evaluates the polynomial

Attributes

 Q Number of elements in exponent vector $$Q$$ coef Coefficient vector $$\alpha$$ coefs Coefficient vector (i.e., not factorized) coefs_fac Factorized coefficient vectors expo Exponent vector $$q$$ expos Exponent vectors variable_count Number of dependent variables
property Q#

Number of elements in exponent vector $$Q$$

Type

int

property coef#

Coefficient vector $$\alpha$$

Type

ndarray

property coefs#

Coefficient vector (i.e., not factorized)

Type

tuple of ndarray

property coefs_fac#

Factorized coefficient vectors

Type

ndarray, None

eval(variable)#

Evaluates the polynomial

Parameters

variable (array_like, scalar) – Dependent variables of a polynomial.

Returns

out – Output of evaluated polynomial. Shape is identical as a dependent variable

Return type

ndarray

property expo#

Exponent vector $$q$$

Type

ndarray

property expos#

Exponent vectors

Type

tuple of ndarray

property variable_count#

Number of dependent variables

Type

int