VectorContinuousCallback creating too many time steps?

I have a VectorContinuousCallback of four variables. As you can see below, things are pretty monotonic and should be relatively straightforward for rootfinding.

For some reason, though, my simulation is taking a few thousand time steps around some of the zero-crossings.

I’m not really sure what’s going on here. One possible hint is when I zoom into the 0-displacement line on the above plot, it looks like this:

I didn’t have this problem a couple of months ago, but I have since done a lot of refactoring to the model, so I’m not sure if its something I changed or if something changed in an with an update to DifferentialEquations.jl. I’m willing to bet its me, it usually is, but so far nothing has jumped out as obviously wrong in my code. I’ve tried playing around with abstol, reltol, and interp_positions too, but those don’t seem to be doing the trick either. I’m getting the results I’m expecting, it’s just taking quite a few more time steps to get them.

Any thoughts here?

Open an issue and we can investigate

1 Like