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

Don't Understand How to Use TaylorModelN #62

Closed
chelseas opened this issue Nov 20, 2019 · 2 comments
Closed

Don't Understand How to Use TaylorModelN #62

chelseas opened this issue Nov 20, 2019 · 2 comments

Comments

@chelseas
Copy link

I don't understand how to use TaylorModelN. The documentation is insufficient. Specifying the order, the approximation point, and the interval over which it should be valid makes sense, but what else should I need to specify? And why does it seem like I can't evaluate an ND Taylor model over more than 1D?

@lbenet
Copy link
Member

lbenet commented Nov 21, 2019

Thanks for reporting, and sorry for the insufficient documentation; lack of time on our side.

The following example is adapted from the tests:

julia> using TaylorModels

julia> const _order = 2  # this will be maximum order of the expansions
2

julia> const _order_max = 2*(_order+1)  # internally, the actual order needs to be larger
6

julia> set_variables(Interval{Float64}, [:x, :y], order=_order_max)
2-element Array{TaylorN{Interval{Float64}},1}:
  [1, 1] x + 𝒪(‖x‖⁷)
  [1, 1] y + 𝒪(‖x‖⁷)

julia> xT = TaylorN(Interval{Float64}, 1, order=_order)  # "shortcuts" for the independent vars
 [1, 1] x + 𝒪(‖x‖³)

julia> yT = TaylorN(Interval{Float64}, 2, order=_order)  # "shortcuts" for the independent vars
 [1, 1] y + 𝒪(‖x‖³)

julia> xm = TaylorModelN(xT, 0..0, b0, ib0)  # TaylorModelN for `x`
 [1, 1] x + [0, 0]

julia> ym = TaylorModelN(yT, 0..0, b0, ib0)  # TaylorModelN for `y`
 [1, 1] y + [0, 0]

julia> xm * ym
 [1, 1] x y + [0, 0]

julia> xm * ym^2
 [0, 0] + [-0.125, 0.125]

I hope this makes things a bit clearer.

@lbenet
Copy link
Member

lbenet commented Jun 4, 2021

Closing....

@lbenet lbenet closed this as completed Jun 4, 2021
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

2 participants