TactivergeLite

Lite / Independent Engineering Research / Week 7

Stability regions and stiffness

The fast part of your model died out in a millisecond, yet your simulation still crawls along in microsecond steps. Why?

About 45 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Circuits with tiny parasitic capacitances, chemical reactions, thermal models with thin layers: real models often mix very fast and very slow dynamics. Explicit methods then need tiny steps for stability, not accuracy, and become absurdly slow.

Predict

Explicit Euler on y′ = −1000y with h = 0.003. The exact solution decays to zero almost instantly. What does Euler do?

  1. Decays smoothly
  2. Blows up, alternating in sign
  3. Stays constant
Guess first, then reveal

Each step multiplies y by 1 + hλ = 1 − 3 = −2. The numerical solution doubles in size every step, flipping sign, while the true solution has vanished.

Discover

Switch to 'Stiffness test y′ = λy'. Slide z = hλ from −0.5 towards −3.5. Note where Euler starts oscillating, where it blows up, and where RK4 finally fails too.

What the interactive shows (text version)

In stiffness mode the diagram plots twenty steps of the numerical solution of y′ = λy for Euler and RK4 at a chosen z = hλ. Text gives each method's amplification factor and says when Euler blows up although the exact solution decays.

You can also open the interactive on the full site when you have a faster connection.

Understand

Stability regions

For a system x′ = Ax, each eigenvalue λ of A gives a test equation. An explicit method is stable only if hλ lies inside its stability region for every eigenvalue. So the fastest-decaying mode (largest |λ|) sets the maximum step, even if that mode is physically irrelevant after a moment.

What stiffness means

A problem is stiff when it has decaying modes on very different time scales, and you want to follow the slow one. Example: eigenvalues −1 and −1000. Accuracy for the slow mode would allow h ≈ 0.1, but explicit Euler stability needs h ≤ 0.002: fifty times more steps, purely to avoid blowing up.

The remedy

Implicit methods (backward Euler, the trapezoidal rule, BDF methods) solve an equation each step, often a linear system with (I − hA) via LU from week 2, but stay stable with large steps. Library solvers flagged for stiff problems (such as 'BDF' or 'Radau' options) do this automatically.

Explain it another way

Intuitive

A stiff problem is a convoy with a hyperactive scout and a slow lorry. Explicit methods must pace themselves to the scout, long after the scout has stopped.

Technical

Stiffness ratio = max|Re λ| / min|Re λ| over the decaying modes. Ratios of 10³ to 10⁶ are common in circuit and chemistry models.

Applied

A power-electronics simulation with a 1 µs switching transient and a 1 s thermal response is stiff; stiff solvers are the default in circuit simulators for this reason.

Derivation: Amplification factors and stability limits
  1. Test equation: y′ = λy, exact yₙ₊₁ = e^{hλ}yₙ. Let z = hλ.

  2. Explicit Euler: yₙ₊₁ = yₙ + hλyₙ = (1 + z)yₙ, so R(z) = 1 + z.

  3. Stable (no growth) iff |1 + z| ≤ 1. For real λ < 0: −2 ≤ z ≤ 0, so h ≤ 2/|λ|.

  4. RK4 on the test equation gives R(z) = 1 + z + z²/2 + z³/6 + z⁴/24 (the Taylor series of e^z to z⁴). On the negative real axis |R| ≤ 1 for z ≥ about −2.79.

  5. Implicit (backward) Euler: yₙ₊₁ = yₙ + hλyₙ₊₁, so R(z) = 1/(1 − z), with |R| < 1 for every z < 0: stable for any step on decaying problems.

Worked example 1

x′ = Ax with eigenvalues −2 and −500. Largest stable explicit Euler step?

Need h ≤ 2/|λ| for both: 2/2 = 1 and 2/500 = 0.004. The binding one is h ≤ 0.004.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

s

s

Practice 4. Which system is stiff (if we care about the slow behaviour)?
Practice 5. Why can backward Euler take large steps on y′ = −1000y?

Apply it

Simulate y′ = −1000(y − cos t), y(0) = 0, to t = 2 with explicit Euler (h = 0.0019 and 0.0021) and backward Euler (h = 0.05; solve the linear update by hand). Plot all three and explain the difference in one paragraph.

Reflect

How would you notice stiffness in a simulation if nobody told you the eigenvalues?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Local and global error, and the convergence studyModels from first principles, and non-dimensionalising →