module: polynomials

This module provides a calculus for uni- and multivariate polynomials using the vector exponent notation [Wildhaber2019], Chapter 6. This calculus simplifies to use polynomials in (squared error) cost functions, e.g., as localized signal models.

Polynomial Classes

Poly

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

MPoly

Multivariate polynomials \({\tilde{\alpha}}^\mathsf{T} (x^q \otimes y^r)\), or with factorized coefficient vector \((\alpha \otimes \beta )^\mathsf{T} (x^q \otimes y^r)\).

Polynomial Operators

Operators for Univariate Polynomials

Operators handling univariate polynomials. Return parameters are highlighted in \(\color{blue}{blue}\).

Sum of Polynomials \(\alpha^\mathsf{T} x^q + \beta^\mathsf{T} x^r\)

poly_sum(polys)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_sum_coef(polys)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_sum_coef_Ls(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = (\color{blue}{\Lambda_1} \alpha + \dots + \color{blue}{\Lambda_N}\beta)^\mathsf{T} x^{\tilde{q}}\)

poly_sum_expo(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

poly_sum_expo_Ms(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{M_1} q + \dots +\color{blue}{M_N} r}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>> p2 = lm.Poly([2, -1], [0, 1])
>>>
>>> p_sum = lm.poly_sum((p1, p2))
>>> print(p_sum)
[ 1.  3.  5.  2. -1.], [0. 1. 2. 0. 1.]

Product of Polynomials \(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r\)

poly_prod(polys)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_prod_coef(polys)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_prod_expo(expos)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

poly_prod_expo_Ms(expos)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{M_1} q + \color{blue}{M_2} r}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>> p2 = lm.Poly([2, -1], [0, 1])
>>>
>>> p_prod = lm.poly_prod((p1, p2))
>>> print(p_prod)
[ 2 -1  6 -3 10 -5], [0. 1. 1. 2. 2. 3.]

Square of a Polynomial \((\alpha^\mathsf{T} x^q)^2\)

poly_square(poly)

\((\alpha^\mathsf{T} x^q)^2 = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_square_coef(poly)

\(\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_square_expo(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

poly_square_expo_M(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{M} q}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>>
>>> p_square = lm.poly_square(p1)
>>> print(p_square)
[ 1  3  5  3  9 15  5 15 25], [0. 1. 2. 1. 2. 3. 2. 3. 4.]

Shift of a Polynomial \(\alpha^\mathsf{T} (x+ \gamma)^q\)

poly_shift(poly, gamma)

\(\alpha^\mathsf{T} (x+ \gamma)^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_shift_coef(poly, gamma)

\(\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_shift_coef_L(expo, gamma)

\(\color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

poly_shift_expo(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>> gamma = 2
>>> p_shift = lm.poly_shift(p1, gamma)
>>> print(p_shift)
[27. 23.  5.], [0 1 2]

Dilation of a Polynomial \(\alpha^\mathsf{T} (\eta x)^q\)

poly_dilation(poly, eta)

\(\alpha^\mathsf{T} (\eta x)^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^q}\)

poly_dilation_coef(poly, eta)

\(\alpha^\mathsf{T} (\eta x)^q =\color{blue}{\tilde{\alpha}}^\mathsf{T} x^q\)

poly_dilation_coef_L(expo, eta)

\(\alpha^\mathsf{T} (\eta x)^q =\color{blue}{\Lambda} \alpha^\mathsf{T} x^{q}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>> eta = -5
>>> p_dilation = lm.poly_dilation (p1, eta)
>>> print(p_dilation)
[  1 -15 125], [0 1 2]

Integral of a Polynomial \(\int (\alpha^\mathsf{T} x^q) dx\)

poly_int(poly)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_int_coef(poly)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_int_coef_L(expo)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

poly_int_expo(expo)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>>
>>> p_int = lm.poly_int(p1)
>>> print(p_int)
[1.         1.5        1.66666667], [1 2 3]

Derivative of a Polynomial \(\frac{d}{dx} (\alpha^\mathsf{T} x^q)\)

poly_diff(poly)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

poly_diff_coef(poly)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

poly_diff_coef_L(expo)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

poly_diff_expo(expo)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

>>> import lmlib as lm
>>>
>>> p1 = lm.Poly([1, 3, 5], [0, 1, 2])
>>>
>>> p_diff = lm.poly_diff(p1)
>>> print(p_diff)
[ 0  3 10], [0 0 1]

API (module: polynomial)

Classes

class 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

Q : number of elements in exponent vector

Examples

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

Attributes

Poly.coef

Coefficient vector \(\alpha\)

Poly.expo

Exponent vector \(q\)

Poly.Q

Number of elements in exponent vector \(Q\)

Poly.coefs

Coefficient vector (i.e., not factorized)

Poly.expos

Exponent vectors

Poly.variable_count

Number of dependent variables

Methods

eval(variable)

Evaluates the polynomial

eval(variable)

Evaluates the polynomial

Parameters

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

Returns

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

class MPoly(coefs, expos)

Bases: lmlib.polynomial.poly._PolyBase

Multivariate polynomials \({\tilde{\alpha}}^\mathsf{T} (x^q \otimes y^r)\), or with factorized coefficient vector \((\alpha \otimes \beta )^\mathsf{T} (x^q \otimes y^r)\).

This polynomial class is for multivariate polynomials in vector exponent notation, see [Wildhaber2019], Chapter 6.

Such a multivariate polynomial is in general given by

\[p(x) = \tilde{\alpha}^\mathsf{T}(x^q \otimes y^r) \ ,\]

where \(\tilde{\alpha} \in \mathbb{R}^{Q \times R}\) is the coefficient vectors, \(q \in \mathbb{Z}_{\geq 0}^Q\) and \(r \in \mathbb{Z}_{\geq 0}^R\) the exponent vectors, and \(x \in \mathbb{R}\) and \(y \in \mathbb{R}\) the independent variables.

As a special case, if the coefficient vector is in the form of a Kronecker product, i.e.,

\[p(x) = (\alpha \otimes \beta)^\mathsf{T}(x^q \otimes y^r) \ ,\]

where \(\alpha \in \mathbb{R}^Q\) and \(\beta \in \mathbb{R}^R\) are coefficient vectors, we denote a polynomial as factorized. This form often leads to algebraic simplifications (if it exists).

Examples

>>> # Bivariate (x,y) polynomial with factorized coefficients ([.2,.7],[-1.0,2.0,.1]) and terms x^1, x^2, y^1, y^2, y^3, and cross terms
>>> l= lm.MPoly(([.2,.7],[-1.0,2.0,.1]),([1,2],[1,2,3]))
>>> l.coefs # gets coefficients
(array([0.2, 0.7]), array([-1. ,  2. ,  0.1]))
>>> l.coef_fac # gets factorized coefficients (if available)
array([-0.2 ,  0.4 ,  0.02, -0.7 ,  1.4 ,  0.07])
>>> l.eval([.3,.7])  # evaluating polynomial for x=.3 and y=.7
array(0.0386589)
>>> # Bivariate (x,y) polynomial with non-factorized coefficients ([.2,.7,1.3,1.4,.2,-1.6]) and terms x^1, x^2, y^1, y^2, y^3, and cross terms
>>> l= lm.MPoly(([.2,.7,1.3,1.4,.2,-1.6],),([1,2],[1,2,3]))
>>> l.eval([.3,.7])  # evaluating polynomial for x=.3 and y=.7
array(0.326298)
Parameters
  • coefs (tuple of array_like) – Set of coefficient vector(s)

  • expos (tuple of array_like) – Set of exponent vector(s)

Attributes

MPoly.coefs

Coefficient vector (i.e., not factorized)

MPoly.expos

Exponent vectors

MPoly.variable_count

Number of dependent variables

MPoly.coefs_fac

Factorized coefficient vectors

Methods

eval(variables)

Evaluates the polynomial for given values (variables)

eval(variables)

Evaluates the polynomial for given values (variables)

Parameters

variables (tuple) – Dependent variables of a polynomial. Each element in variables has the same shape which is also the output shape.

Returns

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

Example

>>> # evaluate bivariate polynomial at multiple positions (x=.1 ... .4, y=.5)
>>> l = lm.MPoly(([.2, .7], [1.3, 1.4, -.9],), ([0, 1], [0, 1, 2]))
>>> l.eval(([.1, .2, .3, .4], [.5, .5, .5, .5]))
array([0.47925, 0.6035, 0.72775, 0.852])

Methods

poly_sum(polys)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Sum of univariate polynomials Poly(alpha,q),... , Poly(beta,r), all of common variable x

Parameters

polys (tuple of Poly) – (Poly(alpha,q),... , Poly(beta,r)), list of polynomials to be summed

Returns

out (Poly) – Poly(alpha_tilde, q_tilde)

References

[Wildhaber2019] (Eq. 6.4)

poly_sum_coef(polys)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector \(\tilde{q}\) to sum of univariate polynomials polys, all of common variable x

Parameters

polys (tuple of Poly) – (Poly(alpha,q),... , Poly(beta,r)), list of polynomials to be summed

Returns

coef (ndarray) – alpha_tilde - Coefficient vector \(\tilde{\alpha}\)

Note

To get \(\tilde{q}\), see poly_sum_expo().

References

[Wildhaber2019] (Eq. 6.4)

poly_sum_coef_Ls(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = (\color{blue}{\Lambda_1} \alpha + \dots + \color{blue}{\Lambda_N}\beta)^\mathsf{T} x^{\tilde{q}}\)

Exponent manipulation matrices \(\Lambda_1, ...., Lambda_N\) to sum univariate polynomials polys, all of common variable x

Parameters

expos (tuple of array_like) – (q, ..., r), list of exponent vectors of polynomials to be summed

Returns

Ls (list of ndarray) – (Lambda_1, ..., Lambda_N), Coefficient manipulation matrices, see also poly_sum()

Note

To get \(\tilde{q}\), see poly_sum_expo().

References

[Wildhaber2019] (Eq. 6.4)

poly_sum_expo(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{1}\) of sum of univariate polynomials with exponent vectors expos, all of common variable x

Parameters

expos (tuple of array_like) – (q, ..., r), list of exponent vectors of polynomials to be summed

Returns

expo ndarrayq_tilde, exponent vector \(\tilde{q}\)

Note

To get \(\tilde{\alpha}\), see poly_sum_coef().

References

[Wildhaber2019] (Eq. 6.4)

poly_sum_expo_Ms(expos)

\(\alpha^\mathsf{T} x^q + \dots + \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{M_1} q + \dots +\color{blue}{M_N} r}\)

Exponent manipulation matrices \(M_1, ... , M_N\) to sum univariate polynomials with exponent vectors expos, all of common variable x

Parameters

expos (tuple of array_like) – (q, ..., r), list of exponent vectors of polynomials to be summed

Returns

Ms (list of ndarray) – (M_1, ..., M_N), list of exponent manipulation matrices, see also poly_sum().

References

[Wildhaber2019] (Eq. 6.4)

poly_prod(polys)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Product of two univariate polynomials of common variable x

Parameters

polys (tuple of Poly) – (poly_1, poly_2), two polynomials to be multiplied

Returns

out (Poly) – poly_tilde, product as polynomial \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.14)

poly_prod_coef(polys)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector \(\tilde{\alpha}\) of product of two univariate polynomials of common variable x

Parameters

polys (tuple of Poly) – (poly_1, poly_2), two polynomials to be multiplied

Returns

coef ndarrayalpha_tilde, coefficient vector \(\tilde{\alpha}\) of product polynomial \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\), see poly_prod()

References

[Wildhaber2019] (Eq. 6.12)

poly_prod_expo(expos)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{q}\) of product of two univariate polynomials of common variable x

Parameters

expos (tuple of arraylike) – (q, r), exponent vectors of the two polynomials

Returns

coef ndarrayq_tilde, exponent vector \(\tilde{q}\) of product polynomial \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\), see poly_prod()

References

[Wildhaber2019] (Eq. 6.16)

poly_prod_expo_Ms(expos)

\(\alpha^\mathsf{T} x^q \cdot \beta^\mathsf{T} x^r = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{M_1} q + \color{blue}{M_2} r}\)

Exponent manipulation matrices \(M_1, M_2\) of product of two univariate polynomials of common variable x

Parameters

expos (tuple of arraylike) – (q, r), exponent vectors

Returns

Ms (list of ndarray) – (M_1, ..., M_N), list of exponent manipulation matrices for the two polynomial exponent vectors, i.e., the new exponent vector results from \(\tilde{q} = M_1 q + M_2 r\). See poly_prod().

References

[Wildhaber2019] (Eq. 6.16)

poly_square(poly)

\((\alpha^\mathsf{T} x^q)^2 = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Square of a univariate polynomial

Parameters

poly (Poly) – poly, polynomial to be squared

Returns

out (Poly) – squared polynomial

References

[Wildhaber2019] (Eq. 6.11)

poly_square_coef(poly)

\(\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector \(\tilde{\alpha}\) of squared polynomial, see poly_square()

Parameters

poly (Poly) – poly, polynomial to be squared

Returns

coef ndarray, – alpha_tilde Coefficient vector \(\tilde{\alpha}\)

References

[Wildhaber2019] (Eq. 6.12)

poly_square_expo(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{q}\) of squared polynomial, see poly_square().

Parameters

expo (array_like,) – q, exponent vector \(q\)

Returns

out ndarray, – q_tilde, exponent vector \(\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.12)

poly_square_expo_M(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{M} q}\)

Exponent manipulation matrix \(M\) of squared polynomial, see poly_square()

Parameters

expo (array_like,) – q, exponent vector \(q\)

Returns

M (ndarray,) – M, exponent manipulation matrix \(M\)

References

[Wildhaber2019] (Eq. 6.10, Eq. 6.13)

poly_shift(poly, gamma)

\(\alpha^\mathsf{T} (x+ \gamma)^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Shifting an univariate polynomial by constant value \(\gamma \in \mathbb{R}\)

Parameters
  • poly (Poly) – polynomial to be shifted

  • gamma (float) – gamma, shift parameter \(\gamma\)

Returns

out (Poly) – shifted polynomial, \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.28)

poly_shift_coef(poly, gamma)

\(\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector of shifted polynomial, see poly_shift()

Parameters
  • poly (Poly) – polynomial to be shifted

  • gamma (float) – gamma, shift parameter \(\gamma\)

Returns

coef (ndarray) – alpha_tilde Coefficient vector \(\tilde{\alpha}\)

References

[Wildhaber2019] (Eq. 6.29)

poly_shift_coef_L(expo, gamma)

\(\color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

Coefficient manipulation \(\Lambda}\) for shifted polynomial, see poly_shift()

Parameters
  • poly (Poly) – polynomial to be shifted

  • gamma (float) – gamma, shift parameter \(\gamma\)

Returns

L (ndarray) – L, coefficient manipulation matrices \(\Lambda\).

References

[Wildhaber2019] (Eq. 6.32)

poly_shift_expo(expo)

\(\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{q}\) for shifted polynomial, see poly_shift()

Parameters
  • poly (Poly) – polynomial to be shifted

  • gamma (float) – gamma, shift parameter \(\gamma\)

Returns

expo (ndarray) – q_tilde, exponent vector \(\tilde{q}\).

References

[Wildhaber2019] (Eq. 6.30)

poly_dilation(poly, eta)

\(\alpha^\mathsf{T} (\eta x)^q = \color{blue}{\tilde{\alpha}^\mathsf{T} x^q}\)

Dilation of a polynomial by scaling x by constant value \(\eta \in \mathbb{R}\)

Parameters
  • poly (Poly) – polynomial to be scaled

  • eta (float) – eta, dilation factor \(\eta\)

Returns

out (Poly) – dilated polynomial, \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.33)

poly_dilation_coef(poly, eta)

\(\alpha^\mathsf{T} (\eta x)^q =\color{blue}{\tilde{\alpha}}^\mathsf{T} x^q\)

Coefficient vector \(\tilde{\alpha}\) of dilated polynomial by scaling x by constant value \(\eta \in \mathbb{R}\), see poly_dilation().

Parameters
  • poly (Poly) – polynomial to be scaled

  • eta (float) – eta, dilation factor \(\eta\)

Returns

coef ndarray – Coefficient vector \(\tilde{\alpha}\)

References

[Wildhaber2019] (Eq. 6.34)

poly_dilation_coef_L(expo, eta)

\(\alpha^\mathsf{T} (\eta x)^q =\color{blue}{\Lambda} \alpha^\mathsf{T} x^{q}\)

Coefficient manipulation matrix \(\tilde{\Lambda}\) to dilated polynomial by scaling x by constant value \(\eta \in \mathbb{R}\), see poly_dilation().

Parameters
  • poly (Poly) – polynomial to be scaled

  • eta (float) – eta, dilation factor \(\eta\)

Returns

L (ndarray) – L, Coefficient Manipulation Matrices \(\Lambda\)

References

[Wildhaber2019] (Eq. 6.35)

poly_int(poly)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Indefinite integral of a polynomial

Parameters

poly (Poly) – polynomial to be integrated

Returns

out (Poly) – polynomial, \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.17)

poly_int_coef(poly)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector \(\tilde{\alpha}\) of indefinite integral of a polynomial, see poly_int()

Parameters

poly (Poly) – polynomial to be integrated

Returns

coef (ndarray,) – alpha_tilde, Coefficient vector \(\tilde{\alpha}\)

References

[Wildhaber2019] (Eq. 6.18)

poly_int_coef_L(expo)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

Coefficient manipulation matrix \(\Lambda\) of indefinite integral of a polynomial, see poly_int().

Parameters

expo (array_like) – q, Exponent vector \(q\)

Returns

L (ndarray) – L, coefficient Manipulation Matrices \(\Lambda\)

References

[Wildhaber2019] (Eq. 6.20-21)

poly_int_expo(expo)

\(\int \big(\alpha^{\mathsf{T}}x^q\big) dx = \tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{q}\) of indefinite integral of a polynomial, see poly_int().

Parameters

expo (array_like) – q, exponent vector \(q\)

Returns

expo (ndarray) – q_tilde, exponent vector \(\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.19)

poly_diff(poly)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) = \color{blue}{\tilde{\alpha}^\mathsf{T} x^\tilde{q}}\)

Derivation of a polynomial

Parameters

poly (Poly) – polynomial for derivation

Returns

out (Poly) – derivative \(\tilde{\alpha}^\mathsf{T} x^\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.24)

poly_diff_coef(poly)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\color{blue}{\tilde{\alpha}}^\mathsf{T} x^\tilde{q}\)

Coefficient vector \(\tilde{\alpha}\) of polynomial derivation, see poly_diff()

Parameters

poly (Poly) – polynomial for derivation

Returns

coef (ndarray) – alpha_tilde, coefficient vector \(\tilde{\alpha}\)

References

[Wildhaber2019] (Eq. 6.25)

poly_diff_coef_L(expo)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\color{blue}{\Lambda} \alpha^\mathsf{T} x^{\tilde{q}}\)

Coefficient manipulation matrix \(\Lambda\) of polynomial derivation, see poly_diff()

Parameters

expo (array_like) – Exponent vector \(q\)

Returns

L (ndarray) – L, coefficient manipulation matrices \(\Lambda\)

References

[Wildhaber2019] (Eq. 6.27)

poly_diff_expo(expo)

\(\frac{d}{dx} \big(\alpha^{\mathsf{T}}x^q\big) =\tilde{\alpha}^\mathsf{T} x^{\color{blue}{\tilde{q}}}\)

Exponent vector \(\tilde{q}\) of polynomial derivation, see poly_diff()

Parameters

expo (array_like) – Exponent vector \(q\)

Returns

expo (ndarray) – q_tilde, exponent vector \(\tilde{q}\)

References

[Wildhaber2019] (Eq. 6.26)