there is one thing I don’t understand. Is the tolerance to compute the step size updated at each timestep or fixed at all timestep. Also, when we look at the documentation and how the tolerance is computed (see picture) then we compute abs(y). Is y in this case the y value at the current timestep or the whole solution series up to that point. Thanks
1 Answer
The error estimate used for time step adaptation is an estimate of the local error, i.e. the truncation error Indices by the temporal scheme over one time step. To ensure a given relative precision, you need to take your current solution as reference, hence the term rtol * abs(y)
. Note that if your solution does not vary much and stays close to the initial solution, then using abs(y0)
could also make sense.
You can find more background on time step adaptation (using embedded Runge-Kutta as are most of solve_ivp's schemes) in the book by Haired and Wanner "Solving ordinary differential equations" for example.