SciML / DiffEqCallbacks.jl

A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
https://docs.sciml.ai/DiffEqCallbacks/stable/
Other
85 stars 44 forks source link

Better derivative tolerance handling in LinearizingSavingCallback #185

Closed staticfloat closed 6 months ago

staticfloat commented 7 months ago

The linearizing saving callback used the same tolerance handling for derivatives as for the primal, however derivatives are typically determined by a lower order integrator than the primal, as such they should have looser tolerances applied to them, hence the sqrt() that loosens the tolerances according to the derivative level.

This adds tests with Rosenbrock23, which has discontinuous derivatives which fail the tests without these loosened tolerances.

staticfloat commented 7 months ago

@oscardssmith I am loosening both tolerances here; when I spoke with you the other day you recommended loosening only one, do you still think that's the correct thing to do?

staticfloat commented 6 months ago

I have opened #186 as an alternative way forward that is simpler, faster and has fewer performance pitfalls, but I'm going to test it downstream a bit first.