Description
Hi, I stumbled across a problem in CVode
which seems to yield a wrong yout
if h
becomes zero.
After CVode
: Internal t = 0 and h = 0 are such that t + h = t on the next step. The solver will continue anyway.
and CVodeGetDky
: Illegal value for t.t = 900 is not between tcur - hu = 0 and tcur = 0
, CVode
still returns CV_SUCCESS
, but yout
is not the correct value for tout
, but for the time when h
became zero.
The problem seems to be the multiplication with cv_mem->cv_h
for checking whether tout
was reached and subsequently ignoring the return value of CVodeGetDky
(CV_BAD_T
), here:
Lines 3298 to 3305 in a9bc74f
Similar checks exist in CVodeF
here:
Lines 560 to 561 in a9bc74f
and here:
Lines 472 to 473 in a9bc74f
CVodeF
leads to the same warnings, but returns CV_BAD_T
. That is at least not CV_SUCCESS
, but it is somewhat misleading, as CVodeGetDky
should not have been called in the first place.
This happens in a more complex application and I am not sure I can easily provide a minimal reproducible example.