How can we define the precision we require in a numerical differential equation solver? What is it that I have to optimize to know? And how do I know that I'm at a sufficient time-step value?

For example, in those programs like Mathematica and Matlab, how does the differential equations solver know the suitable step size for your problem? How could that be automatically determined?

A full explanation of the approach would be nice (or maybe a term that can be googled).

  • $\begingroup$ Are you asking about (systems of) ordinary differential equations? "Stiffness" is a term of art you should know. If a system is "stiff" then decreasing the step size causes numerical instability (in forward difference schemes), but if a system is not stiff, then decreasing step size improves the accuracy of solutions. To deal with this there are terms "adaptive step size" and "implicit methods" which you should become familiar with. $\endgroup$
    – hardmath
    Oct 24, 2013 at 21:54

2 Answers 2


What is typically done for ODEs is to solve at each timestep using two methods of different order. The discrepancies between the results are then used to estimate the error and then decide whether to decrease or increase the timestep length.

You can find more information on the subject here. Two examples of these types of schemes are RKF45 and Dormand-Prince.


for 1-D transport problem, under implicit method, we use Courant number, a dimensionless number to choose appropriate time steps:

$$\frac{u\Delta t}{\Delta x}\le C_{\max}$$

$C_{\max}$ should be less than 1, if we make it as 1, we get

$$\Delta t\le \frac{\Delta x}{u}$$

The basic idea is that, at one time step, a particle placed in the problem domain should never transport through two nodes where solving properties are defined.

for 2-D one can expand it as:

$$\frac{u_{x}\Delta t}{\Delta x}+\frac{u_{y}\Delta t}{\Delta y}\le C_{\max}$$

  • 1
    $\begingroup$ The CFL condition is a necessary condition for stability, which is in turn a necessary -- but not sufficient -- condition for accuracy. Choosing a given Courant number less than one may satisfy stability restrictions, but not accuracy. $\endgroup$ Oct 25, 2013 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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