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, with = 1 µs and . 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?
At least 5 million: stability needs ns, and 10 ms / 2 ns = , though after the first few nanoseconds the solution only changes on a millisecond scale. An implicit method could take a few hundred steps.
Name it
Stiffness
A system is stiff when its time constants span a large ratio , and you care about behavior on the slow scale. Explicit methods' stability regions are bounded, so they need (forward Euler: ), however smooth the solution.
Implicit methods
Backward Euler evaluates the slope at the new point:
On it multiplies by , below 1 in size for every and every h (A-stable), and tending to 0 for very fast modes (L-stable): stiff transients are simply wiped out.
| Method | G on | Order | Stiff modes |
|---|---|---|---|
| backward Euler | 1 | damped to zero | |
| trapezoidal | 2 | : they ring | |
| BDF2 (Gear) | (two-step) | 2 | damped |
| SDIRK, Radau | (multistage) | 2 to 5 | damped |
The cost
Each implicit step solves an equation for : 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 in parallel with a current source , 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 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
- Forward Euler. The 1 µs mode's factor is so it explodes.
- Backward Euler. 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.
- Trapezoidal rule. 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
- Discretize.
- The conductance.
- The current source. In parallel sits a source A, pointing to push current in the direction that keeps near .
- Each step. Each step then solves a resistive circuit.
Answer a 10 S conductance in parallel with a A current source.
Worked example
A fast mode has . What do backward Euler and the trapezoidal rule do to it in one step?
Show the solution
- Backward Euler. One step nearly removes the mode, as the true solution would ().
- Trapezoidal rule. The mode survives, flipping sign every step.
- 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).
- 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 ?
Check
Backward Euler on , 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?
For a mode that decays as , an explicit method predicts the next value from the current slope, multiplying by something like . For a very fast mode, is a large negative number unless h is tiny, so the factor exceeds 1 in size and the mode, which should be gone, grows instead. An implicit method uses the slope at the end of the step, giving a factor like , which shrinks toward zero as grows more negative: large steps damp fast modes even harder. The step can then be chosen for accuracy on the slow behavior you care about, at the price of solving an equation each step.
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.