Techniquecore
Gmin stepping
Also called conductance stepping, gmin continuation.
Adds a large conductance from every node to ground and reduces it in steps to zero, solving the DC equations at each step from the last answer to reach convergence.
Gmin stepping finds the DC operating point of a circuit that plain Newton cannot solve. It connects a conductance from every node to ground, solves the circuit with a large , where the equations are close to linear and easy, and then lowers step by step, starting each Newton run from the previous solution, until the conductance is removed. It is a technique of the circuit simulation half of the logic and circuit simulation sub-area, and a homotopy continuation whose parameter is a physical conductance.
In plain words
A circuit can be hard to solve because some parts of it are floating or very sensitive: a node held only by switched-off transistors, or a loop with large gain. Tie every node to ground through a strong resistor, and all voltages are pulled close to zero. That circuit is easy.
Now weaken those resistors a little. The answer moves only a little, so the previous answer is a good guess, and Newton's method finds the new one in a few steps. Repeat, making the extra resistors weaker each time, until they are so weak that they no longer matter, and then remove them.
When it applies
Use it for the DC operating point after Newton, with junction voltage limiting, has failed from the usual start. It suits circuits with nodes that are almost floating, such as the internal nodes of stacks of transistors that are off, and circuits whose Jacobian is singular at the starting point. It needs only one change to modified nodal analysis: add to each diagonal entry of a node row. It is a standard fallback in SPICE, tried before or after source stepping.
The template
Write the operating point equations as with , the node voltages and the currents of the voltage sources, and let select the node voltages. The gmin circuit with conductance is
KCL with an extra current leaving each node to ground. At it is the given circuit.
GMIN-STEPPING(F, γ_0, γ_min, ρ)- 1
γ ← γ_0; x ← 0 - 2
x ← NEWTON(H(·, γ), x) ▷ the easy circuit - 3
while γ > γ_min do - 4
γ' ← max(γ / ρ, γ_min) - 5
(x', ok) ← NEWTON(H(·, γ'), x) ▷ hole: the corrector, Newton with limiting - 6
if ok then γ ← γ'; x ← x' - 7
else ρ ← a smaller factor; if ρ is too close to 1 then return FAILURE ▷ hole: the step rule - 8
x ← NEWTON(F, x) ▷ remove the added conductance - 9
return x
In SPICE3 the fixed version starts at a conductance times GMIN, divides by a fixed factor at each step, and after reaching GMIN sets the added conductance to GSHUNT (zero by default) for the final solve. The dynamic version of ngspice starts at S, divides by an adaptive factor, and after a failure goes back to the last good point and replaces the factor by its fourth root. In both, the conductance GMIN ( S by default) that every pn junction model places across its junction stays in the circuit.
Assumptions for the proofs. Every resistive device is a two-terminal element with a continuous, nondecreasing law ; the voltage sources form no loop, so has independent columns; and is the set of changes of node voltages that keep every voltage source satisfied. Monotone laws give , and summing over the devices with gives
Theorem 1 (every gmin circuit has one solution). Under the assumptions, for every the equation has exactly one solution , even when has none.
Proof. Pick with ; it exists because has full row rank. Every solution has with . Let be the orthogonal projection onto and , a continuous map of into itself. By , , so is uniformly monotone on and has exactly one zero by the uniform monotonicity theorem (Ortega and Rheinboldt, Section 6.4). At that zero, the KCL vector is orthogonal to , and is the column space of , so has exactly one solution . Conversely every solution of gives a zero of this way, so the solution is unique.
Theorem 2 (the large end). Let be the node voltage vector of least norm with . Then
Proof. Let . The least norm solution lies in the column space of , which is , so ; also . Multiply the KCL rows of by : . By the first term is at least , so , and the Cauchy-Schwarz inequality gives the bound.
So for large the solution is close to a known point, and Newton started there meets an almost linear problem: the start of the homotopy is easy. Without voltage sources and the bound is when the device laws pass through the origin.
Theorem 3 (the path is smooth). If in addition the device laws are continuously differentiable, then is continuously differentiable on : the homotopy path has no turning points and no branch points.
Proof. The Jacobian of in is with and the diagonal of the slopes . If it maps to zero, then , so , hence , then and . The Jacobian is nonsingular at every point, and the implicit function theorem gives a continuously differentiable solution curve through each ; by uniqueness these pieces are the one curve .
With small enough steps the corrector of line L5 therefore always converges for monotone circuits, by the local convergence of Newton along the compact pieces of the path. The theorems say nothing about the end : if the given circuit has no operating point, the path runs off to infinity. Transistor circuits are not monotone, and for them the path can turn back; then fixed decreasing steps fail, and only methods that follow the arc length of the path, as in homotopy continuation, can pass the turn.
Theorem 4 (the error of a small leftover conductance). Let solve and solve , and suppose the device and resistor laws are uniformly monotone on with constant , that is holds with right side whenever . Then
Proof. Let . Subtract the KCL rows of from those of and multiply by ; the terms with and the sources vanish, which leaves . So .
The bound is tight: a current source into a single resistor has , and , and the change equals the bound. Linear resistors that connect every node to ground or to a node held by a voltage source make at least the smallest eigenvalue of their conductance matrix on . For a circuit that is not monotone, the implicit function theorem at a solution with nonsingular Jacobian gives the first-order form , so the change is at most to first order.
Worked example. A 5 V source drives a diode ( A, mV) through ; the operating point is V. With from the diode node to ground (the source node is held by the source, so its changes only the source current):
| (S) | ||||||
|---|---|---|---|---|---|---|
| (V) | 0.04950 | 0.45451 | 0.68808 | 0.6925395 | 0.692543629 | 0.692543633 |
Theorem 4 with S bounds the change at S by V. The first-order form is sharper: is the conductance S at the solution, so the change is about V, as measured. The circuit with no solution, a current source pulling 1 mA out of the anode of a diode, shows the other end: the gmin circuit has the solution , which runs to V at S, a sign that has no solution.
Classic examples
- The DC analysis of SPICE3 and ngspice tries gmin stepping when Newton fails from the initial junction voltages, before source stepping.
- Pseudo-transient analysis is the other conductance-like regularization: the companion conductance of an added capacitor plays the role of , but centred at the previous point instead of ground.
- The artificial parameter homotopies of Melville, Trajković, Fang and Watson for the operating point problem, of the form , act like a conductance in series with a source at every node, so that the start is a chosen point instead of zero; they come with conditions under which the path reaches a solution.
- In MOS transistor models and diode models the fixed GMIN across each junction keeps the MNA matrix nonsingular when a node is held only by devices that are off; SPICE3 steps the node conductance down to the same value before it removes it.
Variations
- Fixed factor steps. Divide by a fixed factor, such as 10, at each step, and stop at the first failure (SPICE3).
- Adaptive factor. Divide by a factor that grows after easy steps and shrinks after failures, and return to the last good point after a failure (dynamic gmin in ngspice).
- Gmin on device junctions only. Step the conductance across each pn junction instead of from each node to ground; the proofs are the same with replaced by the junction incidence.
- Combined with source stepping. ngspice's source stepping first solves the circuit with all sources off under gmin stepping, and then raises the sources with the conductance in place.
- Keep a final shunt. Leave a small conductance GSHUNT from every node to ground in the final circuit; Theorem 4 bounds the error this makes.
Pitfalls
- Turning points. For circuits with positive feedback, such as latches and Schmitt triggers, the solution path in can fold back. A step past the fold has no nearby solution, and the corrector fails or jumps to another branch.
- Too small an end value. Removing the conductance is the last step and can itself fail when a node is truly floating; the MNA matrix of the final circuit is then singular, and the right answer is to report the floating node.
- A wrong solution that looks right. If the final is kept and is not small next to the conductances of the circuit, the answer is that of a different circuit; Theorem 4 says how small it must be.
- No operating point. When has no solution, every gmin circuit still has one, so success at each step proves nothing about the end; node voltages that grow like are the sign.
Exercises
- For the circuit of a current source into a diode, write and show that is decreasing in for .
- Prove Theorem 2 for a circuit without voltage sources directly from , and show that the bound is reached by a single linear resistor.
- Give a circuit with two nodes, one diode and one resistor for which of Theorem 4 is zero, and compute exactly.
- For the tunnel-diode law driven by V through , write as a function of along the gmin path and decide which of the three operating points the path from reaches.
References
- Farid N. Najm, Circuit Simulation, Wiley-IEEE Press, 2010, Chapter 4, Section 4.4.4 (gmin stepping) and Section 4.4.6 (the justification of the continuation methods)
- ngspice source, src/spicelib/analysis/cktop.c, the functions spice3_gmin (fixed factor steps) and dynamic_gmin (adaptive factor), which set CKTdiagGmin and remove it at the end
- James M. Ortega and Werner C. Rheinboldt, Iterative Solution of Nonlinear Equations in Several Variables, SIAM Classics in Applied Mathematics 30, 2000 (first published 1970), Section 6.4, the uniform monotonicity theorem (a continuous, uniformly monotone map of R^n onto itself has exactly one zero)
- Robert C. Melville, Ljiljana Trajković, San-Chin Fang and Layne T. Watson, Artificial parameter homotopy methods for the DC operating point problem, IEEE Transactions on Computer-Aided Design 12(6), 861 to 877, 1993, the conductance homotopies for the operating point problem and the conditions under which their paths reach a solution
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag 55H27K Edit this page History Report an error Markdown