4.8.26Numerical Methods

Stiff equations — implicit methods, backward Euler

1,609 words7 min readdifficulty · medium2 backlinks

WHAT is a stiff equation?

Take the model test problem (the lens through which we study EVERY method):

y=λy,y(0)=y0,λ<0 (or Reλ<0)y' = \lambda y, \qquad y(0)=y_0, \qquad \lambda < 0 \ (\text{or } \operatorname{Re}\lambda<0)

True solution: y(t)=y0eλt0y(t)=y_0 e^{\lambda t}\to 0. The more negative λ\lambda, the faster the decay, the stiffer the problem.


HOW forward Euler fails (derivation + stability)

Derive forward Euler from the definition of the derivative:

y(t)yn+1ynh    yn+1ynh=f(tn,yn)y'(t)\approx \frac{y_{n+1}-y_n}{h} \;\Rightarrow\; \frac{y_{n+1}-y_n}{h}=f(t_n,y_n)

yn+1=yn+hf(tn,yn)\boxed{y_{n+1}=y_n+h\,f(t_n,y_n)}

Apply to y=λyy'=\lambda y:

yn+1=yn+hλyn=(1+hλ)yn    yn=(1+hλ)ny0y_{n+1}=y_n+h\lambda y_n=(1+h\lambda)\,y_n \;\Rightarrow\; y_n=(1+h\lambda)^n y_0

If λ=1000\lambda=-1000, you need h<0.002h<0.002forever, even after the transient is gone. Disaster.


HOW backward Euler fixes it (derivation + stability)

Derive backward Euler using a backward difference at tn+1t_{n+1}:

y(tn+1)yn+1ynh=f(tn+1,yn+1)y'(t_{n+1})\approx \frac{y_{n+1}-y_n}{h} = f(t_{n+1},y_{n+1})

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

This is implicit: yn+1y_{n+1} is unknown on both sides. Apply to y=λyy'=\lambda y:

yn+1=yn+hλyn+1    (1hλ)yn+1=yny_{n+1}=y_n+h\lambda y_{n+1}\;\Rightarrow\;(1-h\lambda)y_{n+1}=y_n

yn+1=11hλyn    yn=(11hλ)ny0y_{n+1}=\frac{1}{1-h\lambda}\,y_n \;\Rightarrow\; y_n=\Big(\frac{1}{1-h\lambda}\Big)^n y_0

So backward Euler is unconditionally stable for decaying problems — pick hh for accuracy, not survival.

Figure — Stiff equations — implicit methods, backward Euler

HOW do we actually solve the implicit equation?

For linear ff you just rearrange (as above). For nonlinear ff, yn+1=yn+hf(tn+1,yn+1)y_{n+1}=y_n+hf(t_{n+1},y_{n+1}) is a root-finding problem. Solve with Newton's method at each step:

g(y)=yynhf(tn+1,y)=0,y(k+1)=y(k)g(y(k))g(y(k)),g=1hfy.g(y)=y-y_n-h f(t_{n+1},y)=0,\qquad y^{(k+1)}=y^{(k)}-\frac{g(y^{(k)})}{g'(y^{(k)})},\quad g'=1-h\frac{\partial f}{\partial y}.


Worked examples


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine pushing a swing that calms down super fast. If you only look at it and guess where it'll be a moment later (forward Euler), and you wait too long between looks, your guess overshoots wildly and you "fall off." Backward Euler is smarter: you ask "where must I be so that things stay calm AT the next moment?" and solve for that. Because you aim at the calm future, you never overshoot — so you can take big, lazy steps and still get it right.


Flashcards

What makes an ODE stiff?
It has solution components on very different time scales, forcing explicit methods to use tiny hh for stability even where the solution is smooth.
Forward Euler formula (test problem y=λyy'=\lambda y)?
yn+1=(1+hλ)yny_{n+1}=(1+h\lambda)y_n.
Forward Euler stability condition?
1+hλ<1|1+h\lambda|<1; for real λ<0\lambda<0, h<2/λh<2/|\lambda|.
Backward Euler formula?
yn+1=yn+hf(tn+1,yn+1)y_{n+1}=y_n+h f(t_{n+1},y_{n+1}) (implicit).
Backward Euler amplification on y=λyy'=\lambda y?
yn+1=11hλyny_{n+1}=\dfrac{1}{1-h\lambda}y_n.
Backward Euler stability condition?
1/(1hλ)<1|1/(1-h\lambda)|<1, true for all h>0h>0 when Reλ<0\operatorname{Re}\lambda<0.
What does A-stable mean?
The stability region contains the entire left half-plane Re(hλ)<0\operatorname{Re}(h\lambda)<0.
Order of accuracy of backward Euler?
First order, O(h)O(h) — same as forward Euler.
Why use Newton's method inside backward Euler?
To solve the nonlinear implicit equation without the step-size restriction that fixed-point iteration would impose.
Implicit vs explicit defining difference?
Explicit uses ff at known tnt_n; implicit uses ff at unknown tn+1t_{n+1}, so yn+1y_{n+1} must be solved for.

Connections

  • Forward Euler method
  • Region of absolute stability
  • A-stability and L-stability
  • Trapezoidal / Crank–Nicolson method
  • Newton's method for root finding
  • Runge–Kutta methods
  • Eigenvalues and time scales of linear systems

Concept Map

has components on

forces small h for

analyses

more negative lambda

explicit derived from

stable iff

requires

is the

implicit derived from

stable iff

holds any h

cures

Stiff ODE

Wildly different time scales

Stability not accuracy

Test problem y'=lambda y

Faster decay = stiffer

Forward Euler

Forward difference

abs 1+h lambda < 1

h < 2 over abs lambda

Backward Euler

Backward difference at t n+1

abs 1 over 1-h lambda < 1

A-stable

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, kuch ODEs "stiff" hoti hain — matlab unme ek part bahut tezi se decay karta hai (jaise e1000te^{-1000t}) aur ek part slow hota hai. Problem ye hai ki forward Euler jaise explicit method ko chhota sa step hh lena padta hai sirf stability ke liye, accuracy ke liye nahi. y=λyy'=\lambda y pe forward Euler deta hai yn+1=(1+hλ)yny_{n+1}=(1+h\lambda)y_n, aur stable rehne ke liye 1+hλ<1|1+h\lambda|<1 chahiye, yaani λ=1000\lambda=-1000 ho to h<0.002h<0.002. Itne chhote steps me to crores iterations lag jayenge. Yahi stiffness ka dard hai.

Iska ilaaj hai backward (implicit) Euler: ff ko purane point ki jagah naye point tn+1t_{n+1} pe evaluate karo — yn+1=yn+hf(tn+1,yn+1)y_{n+1}=y_n+h f(t_{n+1},y_{n+1}). Ab yn+1y_{n+1} dono taraf aata hai, to solve karna padta hai. Test problem pe milta hai yn+1=11hλyny_{n+1}=\frac{1}{1-h\lambda}y_n, aur jab λ<0\lambda<0 ho to ye har hh ke liye stable rehta hai. Isko A-stable kehte hain — poora left half-plane cover karta hai.

Ek important baat: backward Euler zyada accurate nahi hai, woh bhi sirf first-order (O(h)O(h)) hi hai. Uska asli faayda stability hai — ab tum step size accuracy ke hisaab se choose karo, survival ke liye nahi. Nonlinear case me implicit equation ko Newton's method se solve karte hain, kyunki simple iteration phir wahi stiff restriction laga deti hai. Yaad rakho: "Future-aim stays tame" — future point pe aim karo, system tame (stable) rahega.

Go deeper — visual, from zero

Test yourself — Numerical Methods

Connections