Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultivariatePolynomial interface #132

Open
dpsanders opened this issue Nov 1, 2017 · 3 comments
Open

MultivariatePolynomial interface #132

dpsanders opened this issue Nov 1, 2017 · 3 comments

Comments

@dpsanders
Copy link
Contributor

A general interface for multivariate polynomials is being developed:

https://github.com/JuliaAlgebra/MultivariatePolynomials.jl

TaylorSeries.jl should probably implement this interface, and in particular be a subtype of the corresponding abstract type.

Related to #130

@lbenet
Copy link
Member

lbenet commented Nov 1, 2017

A-priori I am in favor; what do we need to do?

@mforets
Copy link
Contributor

mforets commented Feb 4, 2019

Related to JuliaIntervals/TaylorModels.jl#19.

@baggepinnen
Copy link

I tried converting a TaylorN{Float64} to a DynamicPolynomial.Polynomial by calling the TaylorN object as a function, but this resulted in a stack overflow. Is there a way to perform such conversion?

julia> dx[3]
 1.9620000000000002 xu₂ + 1.0 xu₅ - 1.7004000000000001 xu₂³ - 0.2 xu₂² xu₅ + 0.1 xu₂ xu₄² + 0.73248 xu₂⁵ + 0.10666666666666667 xu₂⁴ xu₅ - 0.036666666666666674 xu₂³ xu₄² + 𝒪(‖x‖⁶)

julia> typetree(dx[3])
   TaylorN{Float64} <: 
   AbstractSeries{Float64} <: 
   Number <: 
Any

julia> dx[3]
 1.9620000000000002 xu₂ + 1.0 xu₅ - 1.7004000000000001 xu₂³ - 0.2 xu₂² xu₅ + 0.1 xu₂ xu₄² + 0.73248 xu₂⁵ + 0.10666666666666667 xu₂⁴ xu₅ - 0.036666666666666674 xu₂³ xu₄² + 𝒪(‖x‖⁶)

julia> typeof(dx[3])
TaylorN{Float64}

julia> @polyvar x[1:4] u[1:1];

julia> xu = [x; u]
5-element Vector{PolyVar{true}}:
 x₁
 x₂
 x₃
 x₄
 u₁

julia> dx[3](xu)
ERROR: StackOverflowError:
Stacktrace:
 [1] evaluate(a::HomogeneousPolynomial{Float64}, v::Vector{PolyVar{true}}) (repeats 43253 times)
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:191
 [2] evaluate
   @ ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:191 [inlined]
 [3] evaluate(a::HomogeneousPolynomial{Float64}, v::NTuple{5, PolyVar{true}})
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:191
 [4] _evaluate(a::TaylorN{Float64}, vals::NTuple{5, PolyVar{true}})
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:233
 [5] _evaluate(a::TaylorN{Float64}, vals::NTuple{5, PolyVar{true}}, #unused#::Val{true})
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:239
 [6] evaluate(a::TaylorN{Float64}, vals::Vector{PolyVar{true}}; sorting::Bool)
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:222
 [7] evaluate
   @ ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:222 [inlined]
 [8] (::TaylorN{Float64})(x::Vector{PolyVar{true}})
   @ TaylorSeries ~/.julia/packages/TaylorSeries/YHybm/src/evaluate.jl:327
 [9] top-level scope
   @ REPL[289]:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants