From first principles
Find a stability limit directly from repeated multiplication
A small perturbation around an equilibrium often satisfies a linear equation \(y'=\lambda y\). Begin with real \(\lambda<0\), for which the continuous value is multiplied by \(e^{h\lambda}\), strictly between zero and one. Apply Euler’s left- and right-endpoint approximations to the integral of this same rate. Let \(z=h\lambda\):
Solve each update for its new value and iterate \(n\) steps. Persistence of roundoff or initial error is governed by the same powers:
For strict decay, \(|R|<1\) is necessary. Forward Euler on this real mode requires \(-2<z<0\), and avoiding sign alternation further requires \(z\ge-1\). Backward Euler damps every negative real \(z\), even when the step is too large to approximate a transient accurately. With modes at \(-1\) and \(-1000\) s⁻¹, the fastest mode restricts a forward step to less than 0.002 s even after that transient has become tiny. This mismatch between stability and the resolution needed for the slow observable is the source of stiffness in this example.
Background · Stability function
On the scalar linear test equation, absolute stability depends on the point h times lambda. It gives only part of the story for a nonnormal matrix or nonlinear problem.
Open full-size diagram
Derivation and applications
Separate unconditional stability from damping of an unresolved mode
A stiff dissipative mode may have decayed almost completely during a single time step. Merely keeping its computed amplitude bounded is then a weak requirement. Examine the family of one-step formulas that weights the old and new slopes with \(1-\theta\) and \(\theta\). On the scalar test equation \(y'=-\lambda y\), \(\lambda>0\), define the dimensionless decay over a step as \(r=h\lambda\). Collecting the new value on the left gives
The denominator is positive for \(\theta\ge0\). The amplification never exceeds one from above; enforcing \(G\ge-1\) supplies the other half of the real-axis stability condition:
Thus all positive step sizes are stable along the negative real eigenvalue axis for \(\theta\ge1/2\). Now investigate what actually appears in the stored solution when the mode is unresolved:
The trapezoidal choice \(\theta=1/2\) approaches a sign-reversing factor of unit magnitude. Backward Euler \(\theta=1\) suppresses the fast mode. These properties govern the handling of transients; the order of approximation for a smooth, resolved mode is a separate question.
Worked example
Check a relaxation after one coarse step
Take \(\lambda=1000\) s⁻¹, \(h=0.100\) s and an initial perturbation of \(1.00\) K. The exact remnant is \(e^{-100}\) K, negligible. Trapezoidal stepping leaves \((1-50)/(1+50)=-0.961\) K, while backward Euler leaves \(1/101=0.00990\) K. After two trapezoidal steps the perturbation becomes positive again at \(0.923\) K. That oscillatory persistence is numerical, even though the amplification satisfies the stability condition.
Second application
Choose a step for monotonically decreasing transients
Suppose a solver uses \(\theta=0.750\) and should preserve positivity for a spectrum of decay rates up to \(400\) s⁻¹. The numerator of \(G\) requires \(1-0.250h\lambda\ge0\), hence \(h\le0.0100\) s. A \(0.0200\) s step would remain stable on every mode but gives \(G=(1-2)/(1+6)=-1/7\) for the fastest one. A positivity requirement can impose a finite time step even when boundedness does not.
OneSimulation laboratory
Compare time-step error with conservation
Start from this chapter. Use the Euler amplification factor to distinguish stability from nonnegative concentration. Test the step that consumes the entire amount in one update.
Compare recorded OneSimulation runs on this page. To test your own inputs, download the Python model and run the model in an activated OneSimulation environment.
Run the isothermal reaction from \(A=1,\ B=0\) mol/m³ to \(t=5/k=6.25\) s. Measure the maximum A error over all stored times and the drift of \(A+B\). First double the number of RK4 steps. Then restore 100 steps and change the time integrator. Download the Python experiment · OneSimulation first-order decay model.
python ordinary-differential-equations.py
python ordinary-differential-equations.py --steps 200
python ordinary-differential-equations.py --method euler
| Method, steps | Final A (mol/m³) | Max. A error (mol/m³) | Max. drift (mol/m³) |
|---|---|---|---|
| RK4, 100 | 0.00673794883 | 2.00 × 10⁻⁸ | 4.44 × 10⁻¹⁶ |
| RK4, 200 | 0.00673794711 | 1.22 × 10⁻⁹ | 3.33 × 10⁻¹⁶ |
| Euler, 100 | 0.00592052922 | 9.39 × 10⁻³ | 4.44 × 10⁻¹⁶ |

As a fourth run, try --method euler --steps 5. This lands exactly on the nonnegativity limit. Predict both the final concentration and the largest error before running it.
Change parameters · Change the laboratory inputs
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Problem sheet 1 · Predict when a conservative calculation loses all reactant
Examine a single amplification factor
For the real decay problem \(y'=-\lambda y\), \(\lambda>0\), the physical solution multiplies by \(e^{-h\lambda}\) over a step. A linear one-step method replaces this by \(R(z)\), with \(z=-h\lambda\). Absolute stability at \(z\) means repeated multiplication does not amplify magnitude, conventionally \(|R(z)|\leq1\). A truly decaying mode requires a strict inequality for numerical damping. Positivity and phase fidelity impose additional requirements beyond this magnitude test.
Forward Euler has \(R=1+z\). In the complex plane the stability region is the disk of radius one centred at \(-1\). On the real negative axis, decay requires \(0<h\lambda<2\); nonnegative decay requires \(h\lambda\leq1\). Backward Euler has \(R=1/(1-z)\), and the trapezoidal method has \(R=(1+z/2)/(1-z/2)\). Both contain the entire left half-plane in their stability regions. As \(z\) becomes large and negative, backward Euler tends to zero while trapezoidal tends to minus one. The former strongly damps unresolved fast components; the latter can keep them as alternating numerical transients.
Follow a slow and a fast component together
Let \(u'=-u,\ v'=-1000v\), with \(u(0)=v(0)=1\). At \(t=0.1\) the exact slow state is 0.90484, while the fast state is \(e^{-100}\), effectively zero on a plot at unit scale. Suppose the slow state is the desired observable. One forward Euler step of 0.1 s gives \(u=0.9\) but \(v=-99\). The method becomes unstable even though the desired slow response is well resolved. To damp the fast mode explicitly, \(h\) must stay below 0.002 s whenever that mode can be excited.
Backward Euler with \(h=0.1\) gives
Trapezoidal gives
The second-order rule is especially accurate on the slow mode but retains a conspicuous oscillatory fast component. Neither the maximum order nor a broad stability region alone identifies the right integrator. The observable, acceptable transient error and stiffness all enter the decision.
Trace the cost back to the model
A diffusion equation discretised on a spatial mesh produces modes with rates up to order \(D/h_x^2\). Halving spatial spacing roughly quadruples the magnitude of the fastest eigenvalue. An explicit time step chosen for a coarse grid can therefore fail after spatial refinement, even if the initial physical signal looks smooth. Small high-frequency components from boundary changes, rounding or nonlinear interactions may excite modes absent from an idealised initial state.
Implicit stability shifts work into linear or nonlinear systems inside each time step. An oversized implicit step can miss a forcing pulse altogether, or produce a poor slow-phase estimate despite decaying every homogeneous mode. Compare the output on two time grids, distinguish the time required to resolve a source from the time required merely for stability, and inspect at least one fast component when interpreting unexpected oscillations. The distinction is visible in a reaction where exact species totals coexist with substantial errors in the individual states. Compare reaction histories under Euler and RK4.
Explain why a tiny initial fast component can still matter
Take the same two-rate model but start with \(v_0=10^{-12}\) and apply forward Euler with \(h=0.01\). The physical fast mode should disappear almost immediately. The numerical factor is \(1-10=-9\), so after twelve steps its magnitude is \(9^{12}10^{-12}\simeq0.282\). An initial disturbance that was invisible in the output has become comparable with the desired slow signal in little physical time.
If the fast variable started exactly at zero in a perfectly decoupled model, exact arithmetic would keep it zero. That special trajectory would give a misleading sense of stability. Roundoff, forcing or a weak coupling can generate a nonzero fast component at later stages. A robust experiment deliberately perturbs fast directions and examines whether numerical damping agrees with the model under those perturbations. This is especially relevant when a mesh refinement adds high-frequency modes that were absent from the coarser spectrum.
Separate damping of a perturbation from tracking a moving state
A useful stiff test has an exact slow path \(g(t)\) embedded in \(y'=\lambda(y-g(t))+g'(t)\), with \(\lambda<0\). Subtracting \(g\) gives
An initial condition on the path stays on it, whereas an off-path disturbance decays exponentially. A numerical method must therefore address two different tasks: damp erroneous components perpendicular to the slow path and follow the path as it moves. A homogeneous stability test measures only the first.
Apply backward Euler and define \(e_n=y_n-g(t_n)\). Subtract \(g(t_{n+1})\) after the implicit update. The error satisfies
The last two terms are the error in approximating the change of \(g\) using its new endpoint derivative. Even with \(e_n=0\), this forcing can create error at the next time. The factor \(1/(1-h\lambda)\) damps both old error and newly created defect. Increasing stiffness changes their balance, while changing the time step alters both the source and its propagation.
Track a quadratic path with a fast relaxation
Take \(g=t^2,\ \lambda=-100\) per second, \(h=0.1\) s, \(e_0=0\). Since \(h(2t_{n+1})-(t_{n+1}^2-t_n^2)=h^2\), the recurrence is
The first error is \(0.00090909\), so the first computed state is 0.01090909 when the exact value is 0.01. The second error is approximately 0.00099174. Solving the scalar recurrence shows that the error tends to 0.001, the fixed point of \(11e=e+0.01\). Stability does not force it to vanish because each step creates a new tracking defect.
For comparison, trapezoidal integration of the slow-path derivative integrates the linear function \(g'=2t\) exactly over each interval. Substituting the exact nodal values \(g(t_n)\) therefore satisfies its full discrete equations, so an exactly initialized trajectory stays on this particular path. However, a small off-path perturbation is multiplied per step by \((1-5)/(1+5)=-2/3\), whereas backward Euler multiplies it by \(1/11\). Thus one method is exact on the specified moving path and the other damps unrelated fast perturbations more rapidly.
A numerical test that initialises precisely on \(g\) and uses only this quadratic path could make the trapezoidal method appear flawless. Add a known small perturbation and measure its sign and amplitude separately. Conversely a test with \(g=0\) detects damping but cannot expose a tracking defect. Both controlled initialisations are needed to tell whether an observed error arises from resolving the moving forcing or dissipating the artificially fast component.
A final scaling experiment holds the stiffness fixed and halves the step. The long-time tracking error in this quadratic case is \(h/|\lambda|\), obtained by cancelling the fixed-point terms in the recurrence. With \(h=0.05\) and the same relaxation rate it becomes 0.0005. A one-step error alone, evaluated from the exact state on each grid, would not reveal the same accumulation mechanism. Report whether an observed order concerns a local defect, a settled tracking error or an initial fast transient.
Separate boundedness from physical decay in a stiff mode
For \(y'=-k y\) with positive initial state, an unresolved fast mode should disappear on the reporting timescale. Compare the actual signed factors. A magnitude-only graph would conceal a spurious sign change.

Read values from the plot
| Step × positive decay rate | Exact | Backward Euler | Trapezoidal rule |
|---|---|---|---|
| 0.01 | 0.99005 | 0.9901 | 0.99005 |
| 0.088011 | 0.91575 | 0.91911 | 0.9157 |
| 0.7746 | 0.46089 | 0.56351 | 0.44165 |
| 6.8173 | 0.0010947 | 0.12792 | −0.54635 |
| 60 | 8.7565e−27 | 0.016393 | −0.93548 |
Change parameters · Separate boundedness from physical decay in a stiff mode
Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.
Study the full derivation
Why stiff stability does not guarantee the expected order · Dynamics and numerical time integration
A differential equation is constructed to have a smooth, known solution and a rapidly damped error mode. Use it to distinguish stability of the homogeneous equation, tracking of a moving target and the effect of off-grid stage forcing.