A1343 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A13 · Lesson 43 · Stiffness and implicit methods

When a transient that ended long ago still dictates the step size

Almost every real circuit has time constants spread over many decades: a 1 ms filter pole next to a parasitic capacitance that settles in a nanosecond. Such a system is stiff. The fast transient is over almost at once, and accuracy would allow big steps after that, but an explicit method like forward Euler or RK4 stays stable only if its step is comparable to the fastest time constant, for the whole simulation. Implicit methods remove that limit by solving an equation at each step, and they're why SPICE can simulate a microsecond switching converter for seconds.

  • The circuit has two decaying modes, e−t/τ1 with τ1 = 1 µs and e−t/1 ms. The black curve is exact; the stems at each step show forward Euler (orange) and backward Euler (dashed).
  • With h below 2 µs, forward Euler tracks the slow decay. Push h past 2 µs: the 1 µs mode, long gone in the true solution, comes back with alternating sign and grows without bound.
  • Backward Euler stays stable at any h, and its step can grow to the size the slow decay needs, about 50 µs here, for 50 times fewer steps.

Predict

A circuit's fastest time constant is 1 ns and its slowest 1 ms. With forward Euler, about how many steps does a 10 ms simulation need at least?

Name it

Stiffness

A system is stiff when its time constants span a large ratio τslow/τfast, and you care about behavior on the slow scale. Explicit methods' stability regions are bounded, so they need h≲τfast (forward Euler: h<2τfast), however smooth the solution.

Implicit methods

Backward Euler evaluates the slope at the new point:

yn+1=yn+hf(tn+1,yn+1)

On y˙=λy it multiplies by G=11−hλ, below 1 in size for every Reλ<0 and every h (A-stable), and tending to 0 for very fast modes (L-stable): stiff transients are simply wiped out.

MethodG on y˙=λyOrderStiff modes
backward Euler11−hλ1damped to zero
trapezoidal1+hλ/21−hλ/22G→−1: they ring
BDF2 (Gear)(two-step)2damped
SDIRK, Radau(multistage)2 to 5damped

The cost

Each implicit step solves an equation for yn+1: a linear system for a linear circuit, a Newton iteration (lesson 34) for a nonlinear one. In a circuit simulator, backward Euler turns each capacitor into a conductance C/h in parallel with a current source Cvn/h, its companion model, and each time step is a DC solve of the resulting circuit.

Trapezoidal ringing

The trapezoidal rule is second-order and A-stable, so SPICE uses it by default, but for modes with h≫τ its factor approaches −1: the fast mode flips sign each step and decays slowly, showing up as a sawtooth on node voltages. Switching to Gear's method (BDF2) removes it.

Worked example

The play's circuit: compare forward Euler, backward Euler and the trapezoidal rule at h = 50 µs.

Show the solution
  1. Forward Euler. The 1 µs mode's factor is 1−50=−49 so it explodes.
  2. Backward Euler. 11+50=0.0196 The mode is gone after one step, and 5 ms takes 100 steps instead of the 2500 that forward Euler would need at 2 µs.
  3. Trapezoidal rule. 1−251+25=−0.923 Stable, but the fast mode alternates in sign and still has 45% of its size after 10 steps.

Answer forward Euler explodes, backward Euler removes the fast mode in one step, and the trapezoidal rule stays stable but leaves the fast mode flipping sign, with 45% left after 10 steps.

Worked example

Write backward Euler's companion model for a 10 µF capacitor with a 1 µs step.

Show the solution
  1. Discretize. i=Cvn+1−vnh
  2. The conductance. C/h=10S
  3. The current source. In parallel sits a source Cvn/h=10vn A, pointing to push current in the direction that keeps v near vn.
  4. Each step. Each step then solves a resistive circuit.

Answer a 10 S conductance in parallel with a 10vn A current source.

Worked example

A fast mode has hλ=−100. What do backward Euler and the trapezoidal rule do to it in one step?

Show the solution
  1. Backward Euler. 11−hλ=1101=0.0099 One step nearly removes the mode, as the true solution would (e−100).
  2. Trapezoidal rule. 1+hλ/21−hλ/2=−4951=−0.96 The mode survives, flipping sign every step.
  3. A-stable and L-stable. Both methods are stable for every step size (A-stable), but only backward Euler damps very fast modes strongly (L-stable).
  4. In simulators. That's the source of the trapezoidal sawtooth on switching circuits, and why simulators switch to backward Euler for a step or two after each switching event.

Answer backward Euler multiplies the mode by 0.0099, nearly removing it; the trapezoidal rule multiplies it by −0.96, so it survives and flips sign each step.

Check

A circuit's fastest time constant is 10 ns. Below what step must forward Euler stay?

Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.

Check

Backward Euler with step 50 µs on a mode with τ = 1 µs: by what factor is that mode multiplied each step?

Check

And the trapezoidal rule's factor for that mode?

Check

In a backward-Euler companion model, what conductance stands for a 10 µF capacitor with a 0.1 µs step?

Write units the way you normally would: 1.5 S, 1500 mS and 0.0015 kS are the same answer.

Check

A circuit's time constants run from 1 × 10⁻⁶ s to 0.001 s. At least how many forward-Euler steps does a 1 s simulation need?

Check

A SPICE simulation of a switching converter shows a sawtooth on a node that should be smooth, flipping sign every time step. What's the likely cause and fix?

Check

A circuit's fastest time constant is 1 µs and its slowest 1 ms. You simulate 1 s.

(a)

At least how many steps does forward Euler need, from its stability limit?

(b)

How many does backward Euler need if accuracy asks for h=τslow/20?

Check

Backward Euler on y˙=λ(y−g), with g the value at the new time.

Step 1

Write λ as l. What is the new y?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why can an implicit method take large steps on a stiff circuit when an explicit one can't?

Practice

Keep practicing

9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.