-
Notifications
You must be signed in to change notification settings - Fork 16
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
Multiplication does not work? #172
Comments
Thanks for opening ths issue for a clarification. Yes, it seems that it will always result a julia> using TaylorModels
julia> x = TaylorModelN(1, 6, IntervalBox(0..0, 0..0), IntervalBox(-1..1, -1..1))
[1, 1] x₁ + [0, 0]
julia> y = TaylorModelN(2, 6, IntervalBox(0..0, 0..0), IntervalBox(-1..1, -1..1))
[1, 1] x₂ + [0, 0]
julia> get_order(x)
6
julia> x*y
ERROR: AssertionError: rnegl_order ≤ get_order()
Stacktrace:
[1] *(a::TaylorModelN{2, Interval{Float64}, Float64}, b::TaylorModelN{2, Interval{Float64}, Float64})
@ TaylorModels ~/.julia/dev/TaylorModels/src/arithmetic.jl:291
[2] top-level scope
@ REPL[6]:1 The trick is, to set-up the internal (Taylor) parameters, so it actually works, either through julia> set_variables("x y", order=12)
2-element Vector{TaylorN{Float64}}:
1.0 x + 𝒪(‖x‖¹³)
1.0 y + 𝒪(‖x‖¹³)
julia> x = TaylorModelN(1, 6, IntervalBox(0..0, 0..0), IntervalBox(-1..1, -1..1))
[1, 1] x + [0, 0]
julia> y = TaylorModelN(2, 6, IntervalBox(0..0, 0..0), IntervalBox(-1..1, -1..1))
[1, 1] y + [0, 0]
julia> x*y
[1, 1] x y + [0, 0] Soooorry, for the lack of documentation. It's lack of time. |
Thanks! Yes, I figured changing the internal parameters would make this work. However, it still seems unsatisfactory because the result of multiplication will be truncated at the sum of the total degrees of the operands. If we remove the assertion and have Thoughts? |
Mmmmm, not sure I follow you in this... Taylor models are defined with a polynomial of given order, say n, and the idea is to stick to that order. If two polynomials of that order are multiplied, the result is a polynomial of order 2n. If you impose that your Taylor model resulting from that multiplication has the same order as the factors, you indeed have to truncate to order n, and put the "missing part" into the residual; that's precisely what we do. We follow on that both Berz and Makino as well as Joldes. If you impose |
Yes, I agree this incurs a smaller error. The alternative (for my purpose) is to have a |
I can't recall now why we have it for the 1-variable cases, and not for the |
Incidentally: a place where we silently change the internal parameters is in the validated integration methods, precisely to account for products and powers ( |
Maybe the assertion should just be removed then? I don't see it there for |
TaylorModels.jl/src/arithmetic.jl
Line 291 in e840b99
It seems to me that this assertion is always going to be false? Also, judging by the code just below, the idea is to bound the error due to dropping terms with total degree
beyond get_order()
. That is useless if we don't allow for the added total order to be larger, right?TL;DR: Is the assertion needed or in the right direction?
The text was updated successfully, but these errors were encountered: