Modifying the input parameters to function in a function while solving differential equations

I see, I think recompute is the way to go here. In the presence of adaptive time stepping, attempting to keep track of the computed value independent of the state vector would be quite difficult. I would not be surprised to learn that the solver might call check() at a time for which an interpolated value of u was used, so no corresponding call to df() existed.

1 Like