Ive take a course in computational physics and was asked to implement some numerical methods to solve ODES. I was reading up on the algorithms described in the textbook: NUMERICAL RECIPES IN FORTRAN.

I dont really understand what the following parameter in rkqs is needed for as shown in the textbook. It seems to be saying that if the estimated truncation error in the integration step is above the ERRCON threshold, increase step size by a factor X, and if its below, increase it by a larger factor Y.

Can anyone explain how ERRCON is calculated and its importance? enter image description here

enter image description here

  • $\begingroup$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. $\endgroup$
    – Community Bot
    Commented Mar 3, 2022 at 14:45
  • 2
    $\begingroup$ The text above the subroutine prototype gives the definition and says there’s more below. Did you read the subsequent text? Did it not help? $\endgroup$
    – Bill Barth
    Commented Mar 3, 2022 at 17:00
  • $\begingroup$ Is this something you have to se, or just the first thing you found? Hairer along with his books on "Solving ODE" published some of the solvers used there, among others the DoPri45 solver. It might work better than the NR method. $\endgroup$ Commented Mar 3, 2022 at 17:23
  • $\begingroup$ @Bill_Barth Sorry I thought my message was sufficient description of the text below, I didnt want to add the full page to the question since its long, and I assumed this was a well known text book. Ive added the extra description now, and yes it was not helpful. $\endgroup$ Commented Mar 4, 2022 at 15:49

1 Answer 1


You need to realize that the error estimate of the embedded method, especially in the extrapolation case, is more guidance than locally exact. So it can happen that the error estimate is quite low in a situation where the actual step error is not so.

The resulting unwarranted step size increase usually gets corrected in the next step, as he actually not optimal step size gives an oversized error that is also reflected in the error estimate. Depending on the implementation this will also lead to step rejection, in general substantial oscillations in the step size magnitude can be observed. To dampen this behavior, the step size increase factor gets limited by an upper ceiling, here $5$.

There exist discussion on how smooth this cut-off and the general relation between error estimate and step size factor should be, that some dampening based on a past segment of step sizes might stabilize the integration and reduce the density of rejected steps, see https://www.sciencedirect.com/science/article/pii/S0377042705001123?via%3Dihub

  • $\begingroup$ Thanks! So ERRCON is basically an error control term which acts to limit the oscillations in step size as youvd mentioned. Ill check the article out as well $\endgroup$ Commented Mar 5, 2022 at 9:15

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.