Difference between tstops and d_discontinuities

The docstring says:

    •  tstops: Denotes extra times that the timestepping algorithm must step to. This should be used
       to help the solver deal with discontinuities and singularities, since stepping exactly at the
       time of the discontinuity will improve accuracy. If a method cannot change timesteps (fixed
       timestep multistep methods), then tstops will use an interpolation, matching the behavior of
       saveat. If a method cannot change timesteps and also cannot interpolate, then tstops must be a
       multiple of dt or else an error will be thrown. tstops may also be a function tstops(p,
       tspan), accepting the parameter object and tspan, returning the vector of time points to stop
       at. Default is [].

    •  d_discontinuities: Denotes locations of discontinuities in low order derivatives. This will
       force FSAL algorithms which assume derivative continuity to re-evaluate the derivatives at the
       point of discontinuity. The default is [].

My brain wants to read this as tstops is for discontinuities in f, while d_discontinuities is for discontinuities in f', f''. But the name of the kwargs makes me skeptical. How should I think about those? If f is a step function, should I specify the discontinuity points in tstops or d_discontinuities?

EDIT: just realized that d_ probably stands for “derivative”, so my interpretation was likely correct.

yes

Kind of, but not entirely. tstops just tells the solver where to stop, d_discontinuities tells it to stop there and drop cache. The reason to drop cache is think for example a multistep method, where f(u_{n-1}) is stored from the previous step to be reused in the next. The multistep method needs to realize there is a discontinuity in the f, and thus a discontinuity in u', and thus it cannot just slap a polynomial over it. For something like FBDF, this would mean it would throw out history, drop dt a bit, and do the next step with implicit Euler since that has no history. Or for example, FSAL methods like Tsit5 cache an f call from the previous evaluation, but if you then have a discontinuity you want to re-resolve that so you get the right continuous derivative.