TaylorSeries.jl icon indicating copy to clipboard operation
TaylorSeries.jl copied to clipboard

Integrate is not increasing the order of the underlying Taylor1

Open rcalxrc08 opened this issue 9 months ago • 1 comments

Noticed by @dpsanders What about the integration? Should we increase the order? and still open.

using TaylorSeries
x_fl=1.0
max_order=20
x=taylor_expand(identity,x_fl,order=max_order)
y=exp(x)
der=derivative(y)
@assert get_order(der)==max_order-1 #Correct the derivative is consuming one order.
y_reconstructed=integrate(der,exp(x_fl))
@assert get_order(y_reconstructed)==max_order #assertion error, the integral is not adding one order

To be noticed that if integrate was actually reconstructing the order, one could implement easily but not efficiently any function for Taylor1.

rcalxrc08 avatar Sep 16 '23 13:09 rcalxrc08

Sorry for the late response...

I see your point and somewhat agree with it (at least, I haven't been able to construct an example where increasing the order yields a wrong answer). It is not complicated to implement this for Taylor1, but trickier for TaylorN where there is a maximum order.

Give me some more time...

lbenet avatar Sep 24 '23 00:09 lbenet