Within my ODE function additional quantities are calculated which I would like to save to extract them later for e.g. inspection or plotting.
There is the approach with the
SavingCallback; however, the
save_func(u, t, integrator) only has access to the states.
Another option might be to use other callbacks like
My idea was to extend the differential equations with additional states and setting the corresponding differential equations to zero. It works I guess, but there might be better ways? One shortcoming is that I then have to supply initial values for the additional quantities. Any other ideas?