Closed mauro3 closed 9 years ago
I was deducing minimal allowed stepsize from eps(T)
where T
is the type of the time variable. When eps
is changed to eps(t)
, where t
is the current time your example works fine (the epsilon for t=0.0
is ~e-324
...).
EDIT: After thinking about it, the van der Pol equation should be time independent, so starting from t=1.0
brings the bug back...
How does the time step evolve? Your fix above suggests that the time step is >eps(1)
at t~1 even though the solution repeats after t~1.6. Maybe it's a problem with the initial steps? Anyway, using eps(t)
instead of eps(T)
is probably good irrespective.
This fixes the two errors I made when implementing DASSL.
dy0
keyword argument).dy0
was not given I was not obtaining it from solving F(t,y0,dy0)=0
for dy0
.These two errors combined were forcing the stepsize to go way below the sensible values thus causing the premature termination of integration due to h<hmin
.
In this fix I also rewrote the way error estimates are generated and handled (now it's clearer and simpler) and I slightly changed the order/timestep selection strategy.
Now it is possible to run the solver (with or without Jacobian) with the local error tolerances reduced to 1e-14
and still have h>1e-16
(although for this particular example it leads to larger global error due to roundoff errors).
thanks
Solving the van der Pol (VDP) equation with stringent error tolerances (reltol=abstol<0.2e-8) leads to a "step size too small" error. However, the tests on http://www.dm.uniba.it/~testset/problems/vdpol.php#stats show that DASSL works for VDP up to 10 significant digits, with DASSL.jl I only get 7 significant digits.
Test case:
produces: