ExtendedLaurentPolynomials.PolynomialType
Polynomial{T}(coeffs, exponent; variable)

Creates a Polynomial with coeffs of type T. Supports Rational exponents and substitution.

#Examples

julia> Polynomial(8)
8

julia> Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2]; variable=:x)
x^-2 + 2*x^-1 + 3 + 4*x + 5*x^2

julia> Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2]; ϵ=10^(-3))
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2
ExtendedLaurentPolynomials.PolynomialMethod
(p::Polynomial)(x::Number)
(→)(x::Number, p::Polynomial)

Evaluates p of x.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> p(2.3)
39.7086011342155

julia> 2.3 → p
39.7086011342155
ExtendedLaurentPolynomials.:→Method
substitute(p::Polynomial, expr::Expr)
(→)(p::Polynomial, expr::Expr)

Substitutes expr for p.variable. expr can be only √x, a*x^b or √(a*x^b).

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> substitute(p, :(√x))
x^-1 + 2*x^⁻¹/₂ + 3 + 4*x^¹/₂ + 5*x

julia> :(√x) → p
x^-1 + 2*x^⁻¹/₂ + 3 + 4*x^¹/₂ + 5*x
ExtendedLaurentPolynomials.InvZMethod
InvZ(p::Polynomial)

Performs inverse z-transform on polynomial p that has only integer exponents.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> InvZ(p)
5-element Vector{Int64}:
1
2
3
4
5
ExtendedLaurentPolynomials.LaurentDownMethod
LaurentDown(p::Polynomial)

Downscales p.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> LaurentDown(p)
z^-1 + 3.0 + 5.0*z
ExtendedLaurentPolynomials.LaurentLeftMethod
LaurentLeft(p::Polynomial)

Shifts polynomial p to the left.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> LaurentLeft(p)
z^-1 + 2 + 3*z + 4*z^2 + 5*z^3 
ExtendedLaurentPolynomials.LaurentRightMethod
LaurentRight(p::Polynomial)

Shifts polynomial p to the right.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> LaurentRight(p)
z^-3 + 2*z^-2 + 3*z^-1 + 4 + 5*z
ExtendedLaurentPolynomials.LaurentUpMethod
LaurentUp(p::Polynomial)

Upscales p.

Examples

julia> p = Polynomial([1, 2, 3, 4, 5], [-2, -1, 0, 1, 2])
z^-2 + 2*z^-1 + 3 + 4*z + 5*z^2

julia> LaurentUp(p)
z^-4 + 2*z^-2 + 3 + 4*z^2 + 5*z^4