Numerical AnalysisDifferential Equations

Backward Euler and Stiff Equations

Backward Euler uses the slope at the new point, so each step means solving for yₙ₊₁; for y′ = λy with λ < 0 it is stable for every step size.

Not started Jump to practice

The stability limit of explicit methods is a disaster for stiff problems. The fix is to use the slope at the new point: $$y_{n+1} = y_n + hf(t_{n+1}, y_{n+1}).$$ This is backward Euler. The unknown $y_{n+1}$ appears on both sides, so each step means solving an equation: an implicit method.

Key idea

For $y' = \lambda y$, backward Euler gives $y_{n+1} = \frac{y_n}{1 - h\lambda}$. When $\text{Re}\,\lambda < 0$, $\left|\frac{1}{1 - h\lambda}\right| < 1$ for every $h > 0$: no step-size limit from stability. The price is solving for $y_{n+1}$ each step (a division, a linear system, or Newton's method), and the accuracy is still only first order.

Why it works

From $y_{n+1} = y_n + h\lambda y_{n+1}$ we get $(1 - h\lambda)y_{n+1} = y_n$. If $\text{Re}\,\lambda < 0$ and $h > 0$, then $\text{Re}(1 - h\lambda) > 1$, so $|1 - h\lambda| > 1$ and the factor is smaller than 1 in size: the computed solution decays, as the true one does. Geometrically, backward Euler's stability region is everything outside the disk of radius 1 centered at $+1$, which contains the whole left half-plane. A method stable on the whole left half-plane is called A-stable.
A stiff problem: after a quick start, y follows a slow curve near cos t. Forward Euler (orange) needs h ≤ 0.04 for stability; backward Euler (green) is stable for every h.

Worked example: Forward versus backward

For $y' = -20y$, $y(0) = 2$, take one step with $h = 0.2$ by each method.
  1. Forward: $y_1 = (1 + 0.2(-20)) \cdot 2 = (-3)(2) = -6$: wrong sign, growing.
  2. Backward: $y_1 = \frac{2}{1 + 0.2 \cdot 20} = \frac{2}{5} = 0.4$: positive and smaller.
  3. The exact value is $2e^{-4} \approx 0.037$. Backward Euler is not accurate at this step either, but it decays like the solution, and with more steps it heads to 0 instead of exploding.

Answer: $-6$ versus $0.4$

Worked example: A forced problem

Take one backward Euler step with $h = 0.5$ for $y' = -5y + 10$, $y(0) = 0$.
  1. $y_1 = 0 + 0.5(-5y_1 + 10)$, so $y_1 + 2.5y_1 = 5$.
  2. $y_1 = \frac{5}{3.5} = \frac{10}{7} \approx 1.43$, on its way to the steady state $2$ without overshooting.
  3. Forward Euler would give $0 + 0.5(10) = 5$, overshooting the steady state, since $h|\lambda| = 2.5 > 2$.

Answer: $\frac{10}{7}$

Worked example: A nonlinear step

Take one backward Euler step with $h = 0.5$ for $y' = -y^{2}$, $y(0) = 4$.
  1. $y_1 = 4 - 0.5y_1^{2}$, that is, $y_1^{2} + 2y_1 - 8 = 0$.
  2. $(y_1 + 4)(y_1 - 2) = 0$; the positive root is $y_1 = 2$.
  3. The exact solution $y = \frac{4}{1 + 4t}$ gives $y(0.5) = \frac{4}{3}$. In general each step needs Newton's method, started from $y_n$.

Answer: $y_1 = 2$

A problem is stiff when it has components that decay much faster than the solution you want to follow. Explicit methods must use steps small enough for the fastest component; implicit methods may use steps chosen for accuracy alone. That trade (more work per step, far fewer steps) is why stiff solvers are implicit.

Common mistake

Taking the backward Euler step with the slope at the old point. $y_{n+1} = y_n + hf(t_n, y_n)$ is forward Euler again, with all its stability limits, whatever it is called. Check: the unknown $y_{n+1}$ must appear inside $f$, and you must solve for it.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Numerical Analysis.

Sources and further reading

  • Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation (University of Delaware, free online edition): chapter "Diffusion equations", section "Stiffness"
  • MIT OpenCourseWare 18.330, Introduction to Numerical Analysis: lecture notes on implicit methods and stiff equations
@teddyrookbook GitHub