SciML / DifferentialEquations.jl

Multi-language suite for high-performance solvers of differential equations and scientific machine learning (SciML) components. Ordinary differential equations (ODEs), stochastic differential equations (SDEs), delay differential equations (DDEs), differential-algebraic equations (DAEs), and more in Julia.
https://docs.sciml.ai/DiffEqDocs/stable/
Other
2.84k stars 225 forks source link

CVODE_BDF: Statistics is wrong if zero crossings occur #763

Open MartinOtter opened 3 years ago

MartinOtter commented 3 years ago

If CVODE_BDF is used with zero crossing functions and state events occur, then the reported statistics is wrong ( sol.destats.naccept, sol.destats.nreject, sol.destats.nf, sol.destats.njacs, sol.destats.nreject ), for example njacs=1, although 20 state events occurred. Most likely, the statistics data is not accumulated, but reset to zero when the integration is restarted after an event occurred.

ChrisRackauckas commented 3 years ago

Yeah we've noticed that Sundials does something funny with its stats, but never really figured out how to correct it.

ChrisRackauckas commented 3 years ago

Maybe whenever we reinit! we need to add the old stats onto it.