Open orkolorko opened 1 year ago
Thanks @orkolorko for bringing this up and open the discussion. I agree that it may be counterintuitive and it requires documentation... as always, lack of time is the reason.
Let me argue why this is designed the way it is. The polynomial part is a truncated Taylor series, which has terms of the form $(x-x_0)^k$, where $x\in D$ is the actual value we are interested, $D$ is the domain, and $x_0\in D$ is the expansion point. The Taylor approximation makes sense if $h = x-x_0$ is "small enough"; $h$ is the quantity actually used in evaluate
(defined in TaylorSeries.jl). So, in order to check that $h$ makes sense, we have to check that $x = x_0 + h \in D$, which is what iscontained
does.
Does this explanation makes sense?
Dear @lbenet , thank you, for the explanation.
I think it makes sense and I think it is a good interpretation of the mathematical idea,
i.e., the fact that TaylorModel1(6, 5, Interval(4,6))
is not a point, but a function with an associated domain
and expansion point.
I think what confused me the most is the tube plot in the documentation and the associated recipe: Tube plot
tm6 = TaylorModel1(6, interval(x0), a)
ftm6 = f(tm6)
plot(ftm6, label="6th order")
plots a "tube" around the original function, but ftm6(x)
is computing the value of
$$ \sum_{i=0}^6 a_i x^i+\Delta $$
In Mioara's thesis Def. 2.1.3, and in the documentation of the package a Taylor model is defined as a polynomial such that
$$ P(x)-f(x)\in \Delta, \forall x \in [a,b] $$
but what is exposed by the interface is ftm6(x) = P(x+x_0)
, i.e., ftm6
is translated.
I think both the approaches work equally well but this needs clarifying; if you want I can try to write down a small note on this in the documentation and submit it as a pull request.
Yes, please, help us with the documentation or whatever other improvement it is worth adding to the package!
Dear all, I have a question on the behavior of the
evaluate
function, or to be more precise, on the behavior of theiscontained
function.At the moment it is defined as
this leads to, in my opinion, unexpected behavior: as an example if
tm
is a Taylor model centered at 5, with domain [4,6], thentm(5)
fails theiscontained
assertion, i.e., the evaluation fails on the expansion point.Minimum failing code:
If this is a design choice of the package I think this should be documented.