Unit 10, lesson 59

Stiffness, Stability, and Implicit Methods

Why fast decaying modes make a problem stiff, how the test equation and amplification factors give regions of absolute stability, and why the A-stable implicit Euler method is stable without always being accurate.

  • Video 59
  • Stiffness and Implicit Methods

An explicit solver can creep forward in tiny steps while the curve it computes looks as gentle as a cosine wave. The usual reason is a fast decaying mode in the equation, which the solution of interest never displays but the method still has to handle at every step. Throughout, tt is the independent variable and y′=dy/dty' = dy/dt. This lesson measures what one step of a method does to such a mode, explains why explicit Euler fails at steps that look harmless, and shows what the implicit Euler method repairs and what it leaves open.

Key terms

Stiffness

Definition An initial-value problem is stiff on an interval when some of its modes decay much faster than the solution being followed changes, so that stability, rather than the accuracy needed for that solution, forces an explicit method to take very small steps. For a linear system X′=AX+g(t)X' = AX + g(t) with a constant matrix AA, the fast modes belong to eigenvalues λ\lambda of AA with Re⁡λ<0\operatorname{Re}\lambda < 0 and ∣Re⁡λ∣\lvert \operatorname{Re}\lambda \rvert large compared with the rates at which the solution itself varies. For a nonlinear system X′=f(t,X)X' = f(t, X), the eigenvalues of the Jacobian matrix ∂f/∂X\partial f/\partial X along the solution play the same role as a local guide. Stiffness is a practical judgment that depends on the interval, the accuracy required and the method, not a property that one formula decides.

In plain words The answer you want moves slowly, but the equation pulls every nearby solution back toward it very hard. An explicit method feels that pull at every step, and its numbers blow up unless the step is tiny, even though the curve itself would allow much larger steps.

Example For t≥0t \ge 0 consider

y′=−1000 (y−cos⁡t)−sin⁡t,y(0)=1.\begin{aligned} y' &= -1000\,(y - \cos t) \\[0.4em] &\quad - \sin t, \qquad y(0) = 1. \end{aligned}

The function y=cos⁡ty = \cos t solves it, because its derivative −sin⁡t-\sin t equals the right side when y−cos⁡t=0y - \cos t = 0, and cos⁡0=1\cos 0 = 1. For any solution, the deviation e=y−cos⁡te = y - \cos t satisfies e′=y′+sin⁡t=−1000ee' = y' + \sin t = -1000e, so every solution of the equation is

y(t)=cos⁡t+(y(0)−1)e−1000t.\begin{aligned} y(t) &= \cos t \\[0.4em] &\quad + \bigl(y(0) - 1\bigr)e^{-1000t}. \end{aligned}

The solution of interest varies on a time scale of about 11, while a deviation from it shrinks by a factor of ee every 0.0010.001 units of time. Explicit Euler with the step h=0.01h = 0.01, which looks modest for a cosine, starts from y(0)=1y(0) = 1 and returns about −1.7×104-1.7 \times 10^{4} at t=0.1t = 0.1 and about −6.1×1013-6.1 \times 10^{13} at t=0.2t = 0.2. The implicit Euler method with the same step stays within 5×10−65 \times 10^{-6} of cos⁡t\cos t for 0≤t≤100 \le t \le 10.

Test equation and amplification factor

Definition The test equation is y′=λyy' = \lambda y with a constant λ\lambda, real or complex. Its nonzero solutions y(t)=y(0)eλty(t) = y(0)e^{\lambda t} decay to 00 exactly when Re⁡λ<0\operatorname{Re}\lambda < 0, and one step of length hh multiplies them by ehλe^{h\lambda}. A Runge-Kutta method, including explicit and implicit Euler, applied to the test equation with step hh produces

yn+1=R(hλ) yn,y_{n+1} = R(h\lambda)\,y_n,

where the function RR depends only on the method. The number R(hλ)R(h\lambda) is the amplification factor of one step, and z=hλz = h\lambda is the scaled eigenvalue. The test equation stands for one mode of a linear system. If X′=AXX' = AX with A=VDV−1A = VDV^{-1}, where DD is diagonal with entries λ1,…,λn\lambda_1, \dots, \lambda_n, the substitution X=VwX = Vw splits the system into wi′=λiwiw_i' = \lambda_i w_i, and these methods treat each wiw_i exactly as they treat the test equation with λ=λi\lambda = \lambda_i. For instance, Euler gives Xn+1=(I+hA)XnX_{n+1} = (I + hA)X_n, which multiplies each wiw_i by 1+hλi1 + h\lambda_i.

In plain words Follow one decaying mode through one step and ask what is left of it. The exact equation multiplies the mode by ehλe^{h\lambda}, and the method multiplies it by R(hλ)R(h\lambda). When these two numbers behave very differently, the method mistreats that mode.

Example Euler’s method gives yn+1=yn+hλyny_{n+1} = y_n + h\lambda y_n, so R(z)=1+zR(z) = 1 + z. For the deviation equation e′=−1000ee' = -1000e of the stiff example with h=0.01h = 0.01, the scaled eigenvalue is z=−10z = -10, and

R(−10)=−9,e−10≈4.54×10−5.\begin{gathered} R(-10) = -9, \\[0.4em] e^{-10} \approx 4.54 \times 10^{-5}. \end{gathered}

The exact mode keeps less than a ten-thousandth of itself over one step, while Euler flips its sign and makes it nine times larger. In the forced problem each Euler step also makes a small local error, and these factors of −9-9 multiply it, which is the blowup described above.

Region of absolute stability

Definition The region of absolute stability of a one-step method with amplification factor RR is the set of complex numbers zz with ∣R(z)∣<1\lvert R(z) \rvert < 1. When z=hλz = h\lambda lies in it, the numerical solution of the test equation tends to 00 as n→∞n \to \infty for every starting value. Some books also include the boundary points where ∣R(z)∣=1\lvert R(z) \rvert = 1. For Euler’s method the region is the open disk

{z∈C:∣1+z∣<1}\{ z \in \mathbb{C} : \lvert 1 + z \rvert < 1 \}

of radius 11 centered at −1-1. For a real λ<0\lambda < 0 this means 0<h<2/∣λ∣0 < h < 2/\lvert \lambda \rvert. For every explicit Runge-Kutta method, RR is a polynomial that is not constant, so ∣R(z)∣→∞\lvert R(z) \rvert \to \infty as ∣z∣→∞\lvert z \rvert \to \infty and the region is bounded.

In plain words The region is the set of scaled eigenvalues that the method damps. A step is stable for a mode only if the step size times the mode’s rate lands inside it, so a faster mode forces a smaller step.

Example With λ=−1000\lambda = -1000, Euler is absolutely stable only for h<2/1000=0.002h < 2/1000 = 0.002. The classical Runge-Kutta method has

R(z)=1+z+z22+z36+z424,\begin{aligned} R(z) &= 1 + z + \frac{z^2}{2} \\[0.4em] &\quad + \frac{z^3}{6} + \frac{z^4}{24}, \end{aligned}

and its region meets the negative real axis in the interval −2.785<z<0-2.785 < z < 0, to three decimals, so here it needs about h<0.00279h < 0.00279. Its higher order buys a slightly larger stable step, not freedom from the restriction. Euler’s disk touches the imaginary axis only at 00. For an undamped mode λ=iω\lambda = i\omega with ω≠0\omega \ne 0 it gives ∣1+ihω∣=1+h2ω2>1\lvert 1 + ih\omega \rvert = \sqrt{1 + h^2\omega^2} > 1, so the computed oscillation grows for every h>0h > 0.

Implicit Euler method

Definition For y′=f(t,y)y' = f(t, y) with step hh and tn+1=tn+ht_{n+1} = t_n + h, the implicit Euler method, also called backward Euler, defines yn+1y_{n+1} as a solution of

yn+1=yn+h f(tn+1,yn+1).y_{n+1} = y_n + h\,f(t_{n+1}, y_{n+1}).

The slope is taken at the new point, so each step requires solving an equation for the unknown yn+1y_{n+1}. If ff is Lipschitz in yy with constant LL for all yy and hL<1hL < 1, this equation has exactly one solution, and simple fixed-point iteration converges to it. A stiff problem has a large LL, and that condition would bring back the small steps, so stiff solvers usually solve the step equation by Newton’s method with the Jacobian ∂f/∂y\partial f/\partial y. On smooth problems the global error is of order hh, the same order as explicit Euler. On the test equation the method gives yn+1=yn+hλyn+1y_{n+1} = y_n + h\lambda y_{n+1}, so for hλ≠1h\lambda \ne 1

R(z)=11−z.R(z) = \frac{1}{1 - z}.

In plain words Explicit Euler uses the slope where it stands, and implicit Euler uses the slope where it is going to land. The price is an equation to solve at every step. The gain is that a fast decaying mode stays damped.

Example For the stiff example, the implicit step reads

yn+1=yn−hsin⁡tn+1−1000h yn+1+1000hcos⁡tn+1.\begin{aligned} y_{n+1} &= y_n - h\sin t_{n+1} \\[0.4em] &\quad - 1000h\,y_{n+1} \\[0.4em] &\quad + 1000h\cos t_{n+1}. \end{aligned}

The equation is linear in yn+1y_{n+1}, and collecting the terms with yn+1y_{n+1} on the left gives

yn+1=yn+1000hcos⁡tn+11+1000h−hsin⁡tn+11+1000h.\begin{aligned} y_{n+1} &= \frac{y_n + 1000h\cos t_{n+1}}{1 + 1000h} \\[0.4em] &\quad - \frac{h\sin t_{n+1}}{1 + 1000h}. \end{aligned}

The denominator 1+1000h1 + 1000h comes from solving for the unknown, not from evaluating a future slope at a guessed value. With h=0.01h = 0.01 each step multiplies the deviation from cos⁡t\cos t by

R(−10)=11+10=111,R(-10) = \frac{1}{1 + 10} = \frac{1}{11},

apart from a small local error, so the deviation shrinks to 1/11≈0.0911/11 \approx 0.091 of its size where explicit Euler multiplied it by −9-9. For a nonlinear ff the same step is a nonlinear equation for yn+1y_{n+1}, solved by a few Newton iterations to a chosen tolerance.

A-stability

Definition A method is A-stable if its region of absolute stability contains every complex zz with Re⁡z<0\operatorname{Re} z < 0. Then, for the test equation with any λ\lambda satisfying Re⁡λ<0\operatorname{Re}\lambda < 0, the numerical solution tends to 00 for every step h>0h > 0. The implicit Euler method is A-stable. If Re⁡z<0\operatorname{Re} z < 0, then

∣1−z∣≥Re⁡(1−z)=1−Re⁡z>1,\begin{aligned} \lvert 1 - z \rvert &\ge \operatorname{Re}(1 - z) \\[0.4em] &= 1 - \operatorname{Re} z > 1, \end{aligned}

so ∣R(z)∣=1/∣1−z∣<1\lvert R(z) \rvert = 1/\lvert 1 - z \rvert < 1. Its region is in fact the whole exterior ∣z−1∣>1\lvert z - 1 \rvert > 1 of the closed disk of radius 11 centered at 11. No explicit Runge-Kutta method is A-stable, because its region is bounded. A-stability is defined through the linear test equation, so for a nonlinear problem it describes the behavior near a solution through linearization and is not by itself a proof of stability.

In plain words An A-stable method damps every decaying mode of the test equation at every step size, however fast the mode is. The step can then be chosen for accuracy rather than for stability, at least as far as the linear test equation can tell.

Example For implicit Euler, R(−10)=1/11R(-10) = 1/11 and R(−1000)=1/1001R(-1000) = 1/1001, and R(z)→0R(z) \to 0 as ∣z∣→∞\lvert z \rvert \to \infty, so the fastest modes are damped the most. A-stability alone does not promise such strong damping. The trapezoidal rule

yn+1=yn+h2(f(tn,yn)+f(tn+1,yn+1))\begin{aligned} y_{n+1} &= y_n + \tfrac{h}{2}\bigl(f(t_n, y_n) \\[0.4em] &\qquad + f(t_{n+1}, y_{n+1})\bigr) \end{aligned}

has R(z)=(1+z/2)/(1−z/2)R(z) = (1 + z/2)/(1 - z/2), whose absolute value is also below 11 whenever Re⁡z<0\operatorname{Re} z < 0, so it is A-stable too. But R(−1000)=−499/501≈−0.996R(-1000) = -499/501 \approx -0.996, so a very fast mode is barely reduced and changes sign at every step.

Numerical and physical stability

Definition Physical stability is a property of the differential equation. A solution is stable if perturbations of it stay small, and asymptotically stable if they also decay to 00. For the test equation the perturbations decay exactly when Re⁡λ<0\operatorname{Re}\lambda < 0. Numerical stability is a property of a method used with a particular step on a particular problem. For the test equation it means ∣R(hλ)∣<1\lvert R(h\lambda) \rvert < 1, so that perturbations of the computed values decay. Accuracy is a third question, how close the computed values are to the true solution, and it is judged from the method’s order, from error estimates and from refinement. A computation can pass any one of these tests and fail another.

In plain words The equation decides whether disturbances ought to die out. The method and its step decide whether the computed disturbances do die out. Neither answer says how many digits of the result are correct.

Example For e′=−1000ee' = -1000e with h=0.01h = 0.01, the equation is stable, explicit Euler is not, and implicit Euler is. Implicit Euler is still inaccurate for the transient itself, because one step keeps 1/11≈0.0911/11 \approx 0.091 of the deviation, while the exact factor is e−10≈4.5×10−5e^{-10} \approx 4.5 \times 10^{-5}. If the fast transient is the object of study, the step must be small compared with 0.0010.001. If only the slow cosine matters, strong damping of the transient is exactly what is wanted. The opposite mismatch also occurs. For the growing equation y′=3yy' = 3y with h=1h = 1, implicit Euler has R(3)=1/(1−3)=−1/2R(3) = 1/(1 - 3) = -1/2, so the computed values shrink and alternate in sign while the true solution grows by the factor e3≈20.1e^3 \approx 20.1 per unit of time.

Check yourself

  1. For the test equation y′=−50yy' = -50y, find the steps h>0h > 0 for which explicit Euler is absolutely stable. Then find the amplification factors of explicit and implicit Euler with h=0.1h = 0.1, and compare them with the exact factor over one step.
Show the answer

With λ=−50\lambda = -50 the condition ∣1−50h∣<1\lvert 1 - 50h \rvert < 1 means 0<h<2/50=0.040 < h < 2/50 = 0.04. For h=0.1h = 0.1 the scaled eigenvalue is z=−5z = -5. Explicit Euler has R(−5)=1−5=−4R(-5) = 1 - 5 = -4, so the computed values flip sign and grow fourfold at every step. Implicit Euler has

R(−5)=11+5=16≈0.167,R(-5) = \frac{1}{1 + 5} = \frac{1}{6} \approx 0.167,

so it is stable. The exact factor is e−5≈0.0067e^{-5} \approx 0.0067, which shows that the implicit values decay, but much more slowly than the true solution.

  1. A classmate argues that the classical Runge-Kutta method, being fourth order, can handle e′=−1000ee' = -1000e with h=0.01h = 0.01 where Euler fails. Compute its amplification factor at this step and decide whether the claim is right.
Show the answer

The scaled eigenvalue is z=−10z = -10, and

R(−10)=1−10+50−10006+1000024=291.\begin{aligned} R(-10) &= 1 - 10 + 50 \\[0.4em] &\quad - \tfrac{1000}{6} + \tfrac{10000}{24} \\[0.4em] &= 291. \end{aligned}

Each step multiplies the mode by 291291, which is even worse than Euler’s factor −9-9. The method is stable on the negative real axis only for −2.785<z<0-2.785 < z < 0, approximately, so it needs about h<0.00279h < 0.00279 here. The claim is wrong. The order describes how the error behaves as h→0h \to 0 and says nothing about stability at a fixed step.

  1. Take the stiff example with the new initial value y(0)=2y(0) = 2, so the exact solution is y=cos⁡t+e−1000ty = \cos t + e^{-1000t}. Compute one implicit Euler step with h=0.01h = 0.01 and compare it with y(0.01)y(0.01). Is the step stable, and is it accurate?
Show the answer

With h=0.01h = 0.01 the formula from the implicit Euler card gives

y1=2+10cos⁡0.0111−0.01sin⁡0.0111≈1.0909.\begin{aligned} y_1 &= \frac{2 + 10\cos 0.01}{11} \\[0.4em] &\quad - \frac{0.01\sin 0.01}{11} \\[0.4em] &\approx 1.0909. \end{aligned}

The exact value is y(0.01)=cos⁡0.01+e−10≈0.999995y(0.01) = \cos 0.01 + e^{-10} \approx 0.999995, so the error is about 0.0910.091. The deviation from cos⁡t\cos t went from 11 to about 1/111/11, while the true deviation fell to e−10≈4.5×10−5e^{-10} \approx 4.5 \times 10^{-5}. The step is stable, because it damped the deviation instead of amplifying it. Explicit Euler would give y1=2−0.01⋅1000⋅1=−8y_1 = 2 - 0.01 \cdot 1000 \cdot 1 = -8, a deviation of about −9-9. Still, the implicit step does not resolve the transient. Each later step divides the leftover deviation by about 1111 again, so from t=0.05t = 0.05 on, the computed values stay within 5×10−65 \times 10^{-6} of the true solution for t≤10t \le 10. The method damps the transient correctly in the end without following it accurately on the way.

How this lesson connects