0
$\begingroup$

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

enter image description here

$\endgroup$
1
  • 3
    $\begingroup$ Yes typically the sum you highlighted is updated in each time step with whatever current value $abs(y)$ is for the previous time step. $\endgroup$ May 6, 2021 at 19:43

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.