Networks, and how a solve is checked

The conductance added so it would invert

A solver that refuses a node with no direct-current path can be made to answer by adding a tiny conductance from every node to ground, which is what a circuit simulator does. Kirchhoff's law then holds to machine precision, and the numbers are of three kinds. A real divider's node is exact at any conductance. 1 µA into a capacitor reads a megavolt at 10⁻¹² S, ten times that at 10⁻¹³, and is purely the reciprocal of what was added. A floating 9 V source reads ±4.5 V, a centre tap nobody built, and follows the ratio of two conductances that do not exist. Scaling the conductance finds the first kind and misses the third. One test current per node finds them all, because a node held only by what was added has a resistance to ground near one over it.

Assumes: The answer that is perfect and absurd · What a network answers, and how the answer is checked

The answer that is perfect and absurd described four kinds of netlist a nodal solver must decline, and a more dangerous fifth next door to them. A wire written into a netlist as a small resistance returns the right node voltage to fifteen figures, passes both verifications, and reports two hundred thousand amperes. Its moral was stated as a rule: the repair for a network that does not determine its own voltages is to find out what is physically missing, and writing in a very small or very large element is a way of being told something absurd in perfect arithmetic. It did not look at the repair that most circuit simulators apply to every netlist automatically, on every run, and that its users mostly do not know about.

The repair is a small conductance from every node to ground. In the SPICE family it has a name and a default value, 10−1210^{-12} S, and with it a node that has nothing else connected at direct current has a voltage. A singular matrix becomes an invertible one and the solver stops objecting. There is nothing wrong with that as an engineering decision, since a simulator with a transient to run needs a starting point, and the great majority of the nodes it applies to are nowhere near needing it. What is interesting is what it does to the question the first essay was asking. Once a conductance has been added, the solver has an answer to every question, and the residual is at machine precision for every one of them. Which of those numbers belongs to the circuit?

What a simulator's small conductance reports: at 10⁻¹² S a resistive divider reads 5 V, 1 µA into a capacitor reads 1 MV with a residual at machine precision, and the slope says which of those belongs to the circuit. computed by solving, not by drawing on the nodal matrix at direct current, with a conductance g from each node to ground. A divider of two 1 kΩ on 10 V (flat, 5 V at every g); 1 µA into a capacitor, which the solver refuses without g and which reads I/g with it (slope −1, 1 MV at 10⁻¹² S, 100 mV at 10⁻⁵ S); a biased stage behind a coupling capacitor, 100 mV (flat until g is comparable with its 1 MΩ); and two capacitors in series on 10 V, whose node reads 0 mV at every g, since a conductance to ground is the only thing at that node and it has nothing to divide against. Every one of these passes Kirchhoff's law with g included to machine precision. The residual has no way to tell these answers apart.
Fig. 1 The node voltage reported on the nodal matrix at direct current, with a conductance from each node to ground, for a divider of two 1 kΩ on 10 V (flat at 5.00 V), 1 µA into a capacitor (slope −1, a megavolt at 10−1210^{-12} S), a biased stage behind a coupling capacitor, and two capacitors in series on 10 V, whose node reads zero at every conductance. The solver refuses the second and fourth without one, and Kirchhoff’s law holds to machine precision at every point on the figure.

Three kinds of number

The first is what everyone hopes for. A resistive divider reads 5.00 V at every conductance from 10−1210^{-12} to 10−510^{-5} S, with a fractional change far below anything that matters until the added conductance starts to be comparable with the divider’s own. Those are real answers. The added element was never relevant to them, and that is by far the commonest case in a real netlist.

The second is an answer that is purely the reciprocal of what was added. A current into a capacitor at direct current has nowhere to go and the solver refuses it, correctly, since at direct current the current has no path. With a conductance from the node, the voltage is I/gI/g. So 1 µA reads a megavolt at 10−1210^{-12} S and 10 MV at 10−1310^{-13} on a solver that would allow it, and the slope against gg is exactly −1-1. This is the integrator’s input, the bias current on a coupling capacitor, or a bootstrap capacitor’s node. A designer who sees a megavolt in a simulator’s operating point will usually notice that something is odd, and a designer seeing the same effect at 3.2 V on a higher conductance may not.

The third kind reads quite reasonable values. Two capacitors in series on 10 V read zero at the middle, at every gg, since the conductance to ground is the only thing at that node at direct current. That is a number with no dependence on gg at all, and it is flat on the same axis as the divider. A bias point is a solution said that a circuit’s operating point is an answer to an equation and it depends on what is in the equation. This zero is an answer to an equation with an extra term in it that decided the whole answer, without leaving a mark on the slope.

A centre tap nobody built

The third kind becomes clearest on the commonest floating subcircuit there is: a source and a resistor connected to nothing else. A battery on a floating instrument, the secondary of a transformer, an isolated supply’s output. Its two node voltages have a definite difference and no definite level.

A floating 9 V battery and resistor read +4.5 V and −4.5 V, a centre tap nobody built, and the level follows the ratio of two conductances that do not exist: +8.91 and −0.09 if one is a hundred times the other. computed by solving, not by drawing: the two node voltages of a floating 9 V source and 1 kΩ, with a small conductance from each to ground, against the ratio of the two. 0.01: 8.911 and -0.089; 0.1: 8.182 and -0.818; 0.3: 6.923 and -2.077; 1: 4.500 and -4.500; 3: 2.250 and -6.750; 10: 0.818 and -8.182; 100: 0.089 and -8.911. Equal conductances, which is what a simulator adds, give a symmetrical ±4.5 V. The difference is 9.000 V at every ratio. In a real circuit the level would be set by whatever leakage or stray the floating part has, and those are exactly what the netlist does not contain. Anything downstream that reads an absolute level on this subcircuit, an insulation margin or a common-mode range, is reading the two added conductances.
Fig. 2 The two node voltages of a floating 9 V source and 1 kΩ, with a small conductance from each to ground, against the ratio of the two conductances. Equal conductances: +4.50 V and −4.50 V. One a hundred times the other: 0.09 and −8.91 V, or 8.91 and −0.09. The difference is 9.000 V at every ratio, and the level is 9/(1+ratio)9/(1 + \text{ratio}) exactly.

With equal conductances from its two terminals, a floating 9 V battery reads +4.5 V and −4.5 V. Nobody built a centre tap, and it is drawn on the output as confidently as anything else. The level follows the ratio of the two conductances exactly, and those conductances do not exist. In a real instrument the level is set by the stray and leakage paths to whatever is nearest, by the common-mode currents of the mains, and by anything else that has been left out of the netlist.

The difference across the part is right at every ratio, so anything that reads only differences in this subcircuit is safe, and that is usually what is wanted. The danger is in the things that read levels. An amplifier’s common-mode range, a clamp, an insulation margin, a protection diode to the supply rail, all read an absolute voltage. A protection diode that is drawn from a floating node to ground and seems comfortably reverse-biased at −4.5 V is being reassured by the added conductances. So the simulation of an isolated stage with its reference node floating can show correct gains, correct waveforms, correct power, and a common-mode voltage that means nothing, with no warning of any kind.

Nor does scaling find it. Because both conductances are scaled together, a tenfold change in the simulator’s minimum conductance leaves the ratio and the level alone. A careful designer’s natural test, changing the setting and seeing whether the answer moves, says this node is sound.

One test current per node

A test that does work is available, and it is cheap: it asks how hard the node is being held. At each node, inject a small test current and read how far the node moves. That gives the node’s resistance to ground with everything else in the circuit present. If that resistance is near 1/g1/g, then the added conductance is what the node is standing on.

One test current per node sorts a netlist: 6 of these 8 node voltages are held by nothing but the added conductance, though scaling it moves only the 1 kV a nanoamp reads on a capacitor. computed by solving, not by drawing on a netlist with a real divider, a coupling capacitor to a node with nothing else on it, a capacitor pair carrying 1 nA, and a floating 3 V source with its resistor, with g = 10⁻¹² S from every node. For each node, its resistance to ground found with a test current, times g. Near one, the node's voltage is held by the added conductance and nothing else. vcc: 12 V, 0.0e+0, slope against g 0.00; b: 2.16 V, 1.8e-8, slope against g 0.00; c1: 0 mV, 5.0e-1, slope against g 0.00; e: 0 mV, 5.0e-1, slope against g 0.00; f: 1 kV, 1.0e+0, slope against g 1.00; h: 1 V, 3.3e-1, slope against g 0.00; j: 1 V, 3.3e-1, slope against g -0.00; k: -2 V, 3.3e-1, slope against g 0.00. Scaling every g moves only node f. The floating source's nodes do not move under scaling, since equal conductances set their level by a ratio, and the nodes behind the coupling capacitor read zero at every g, since nothing drives them. The test current finds all six. The floating source's difference, 3.000 V, is exact, though neither of its levels means anything.
Fig. 3 A small netlist with a real divider, a coupling capacitor to a node with nothing else on it, a capacitor pair carrying 1 nA, and a floating 3 V source with its resistor. For each node, its resistance to ground from a test current, times the added 10−1210^{-12} S. Near one, the node is held by the added conductance alone. Supply and divider: zero and 1.8×10−81.8 \times 10^{-8}. Behind the coupling capacitor: 0.5. On the capacitor pair: 1.0. On the floating source: 0.33 each.

The figure’s netlist is deliberately a mix. Supply and divider read 00 and 1.8×10−81.8 \times 10^{-8} on this score, far below one, and those are real answers. The two nodes behind the coupling capacitor read 0.5: each of them is held by two conductances. They report 0 V at every gg, and scaling cannot identify them, since 0 V is unmoved. The capacitor pair’s node reads 1.0, and it reports a kilovolt, which scaling does find. The three nodes of the floating source read 0.33. They report +1, +1 and −2 V, which scaling cannot move.

So a scale change finds one of these six and the test current finds all six, because it measures the right thing. Only three kinds of number are in this output, and the score separates them by many decades with no judgement needed. Since the matrix is already factored, each extra test current costs one back-substitution, so running all of them on a large netlist is cheap, and yet no ordinary simulator reports it. A column in an operating-point printout, for each node, saying what fraction of its holding comes from something the user did not draw, would be a very useful number.

What a network answers measured what a solve does and does not guarantee, and this is an extension of the list. A verification tells whether a solution satisfies the equations it was built from. It cannot tell whether those equations include terms that nobody put in the circuit.

Nothing degrades on the way to the refusal

The original essay’s central finding was that a nearly singular network is answered exactly until the moment it is refused. The added conductance behaves the same way, and for the same reason.

Nothing degrades on the way to the refusal: down to 1e-13 S the real node is exact to the arithmetic and the invented one is exactly I/g, up to 1000 kV, and neither number gives any warning. computed by solving, not by drawing: the fractional error of two node voltages against their closed forms, the real divider's node (solid) and 1 µA into a capacitor, I/g (dots), against the added conductance, down to the solver's refusal at 1e-13 S, where the pivot ratio passes the threshold 1e-12. 1e-3 S: 0.0e+0, 0.0e+0, reading 1 mV; 1e-6 S: 0.0e+0, 0.0e+0, reading 1 V; 1e-9 S: 0.0e+0, 0.0e+0, reading 1000 V; 1e-12 S: 0.0e+0, 0.0e+0, reading 1000 kV. A smaller conductance is not a more accurate answer. It is the same answer, with a larger number in it.
Fig. 4 The fractional error of two node voltages against their closed forms, the real divider’s node (solid) and 1 µA into a capacitor, I/gI/g (dots), against the added conductance, down to the solver’s refusal at 10−1310^{-13} S. Both are at the arithmetic’s floor at every conductance on the way there, at which the capacitor’s node reads up to a megavolt.

As the added conductance falls, the real node stays exact to the arithmetic and the invented one is exact to its own formula, I/gI/g. Neither gives any warning. Then the pivot passes the solver’s threshold at a part in 101210^{12} of the matrix norm, and it refuses. A smaller conductance is not a more accurate answer, and it is the same answer with a larger number in it. Where the matrix is worst, and where the answer is not separated a matrix’s condition from the accuracy of a particular node, and the same separation is at work here: the node that is ruining the matrix’s condition is not the node whose answer is at risk. There is no limit in which g→0g \to 0 reveals what the circuit is doing, because in that limit the question has no answer. It is sometimes supposed that reducing the conductance moves a simulation closer to the truth, and for a real node it does nothing and for an invented one it moves the number further off.

The solver used here refuses at a part in 101210^{12} of the norm and so, with a voltage source’s stamp of one in its matrix, it refuses a conductance below about 10−1210^{-12} S, right at SPICE’s default. That is a coincidence of two different engineering choices, and it shows how close the default sits to where double precision starts to be a concern, in the way the number that was wrong describes for other quantities on this kind of solve. A million-ohm circuit has a conductance norm that is a good deal lower, which is why a simulator scales its matrix before it factors it.

When the answer comes true

A number that depends on a conductance nobody built is not necessarily meaningless. In a real circuit, there is leakage, and at long enough times a node will settle to a value set by it. The question is how long.

When the direct-current answer comes true: two capacitors in series on 10 V start at 3.33 V, the ratio of the capacitors, and reach the leakages' divider with a time constant of 1500 s, or 0.42 hours. computed by solving, not by drawing: the voltage between a 1 nF and a 2 nF capacitor in series on a 10 V step, against time, for three sets of leakage, in closed form, the first checked at direct current on the netlist. It starts at the capacitors' ratio, 3.333 V, and it tends with a time constant of (C₁ + C₂)/(g₁ + g₂) to the leakages' ratio. both leak 10⁻¹² S: tends to 5.00 V, time constant 0.42 hours; upper leaks ten times more: tends to 9.09 V, time constant 0.08 hours; only a g to ground: tends to 0.00 V, time constant 0.83 hours. A simulator's direct-current point with a conductance from each node reports the last of these: 0 V. On a bench a meter of a few hundred millivolts' resolution would read the capacitors' ratio for hours, and a 1 µF pair with the same leakage would hold it for 17.4 days.
Fig. 5 The voltage between a 1 nF and a 2 nF capacitor in series on a 10 V step, against time, for three sets of leakage, in closed form. It starts at the capacitors’ ratio, 3.33 V, and tends with a time constant of (C1+C2)/(g1+g2)(C_1 + C_2)/(g_1 + g_2) to the leakages’ ratio: 5.00 V if both leak 10−1210^{-12} S, 9.09 V if the upper leaks ten times more, and 0 V, what a conductance to ground alone reports, in 0.83 hours.

The series capacitors make this concrete. On a 10 V step the middle node starts at the capacitors’ ratio, 3.33 V, as any quick estimate says. It then relaxes, with a time constant of (C1+C2)/(g1+g2)(C_1 + C_2)/(g_1 + g_2), towards the ratio of the leakages. If both leak 10−1210^{-12} S it tends to 5 V with a time constant of 1,500 s. If the upper one leaks ten times as much it tends to 9.09 V. So in the steady state, the voltage is decided by leakage ratios that no data sheet gives to any accuracy, and it may take half an hour or more to reach it. A simulator’s operating point reports 0 V, since it has one conductance to ground and none across the capacitors, and that is the leakage arrangement that reads lowest.

A bench voltmeter on that same node would read the capacitors’ ratio for a while, and then its own input conductance would begin to take over. At 1 µF and 2 µF with the same leakage, the time constant is 17.4 days. So all three of these numbers are correct, in that each is the right answer to some question. The capacitors’ ratio is the answer at a microsecond, the leakages’ ratio is the answer at a fortnight, and the simulator’s zero is the answer in a circuit that has one specific leakage in it and no others. A designer has to know which is being asked. The capacitance that is not one number found a similar dependence of a capacitor on the time scale of the question, and a stack of series capacitors is usually protected with balancing resistors for exactly this reason: it removes the ratio that nobody knows and puts in one that somebody chose.

The time domain also corrects a misreading of the third kind of number. A floating battery’s real common-mode voltage is not invented; it is just undetermined by this netlist. It has a physical value, set by stray capacitance at a fast time scale and by leakage at a slow one, and a designer who needs it has to add those paths. That is the first essay’s rule again: find out what is physically missing, because the solver has correctly reported that something is.

What to do about a floating part

The test current tells which nodes to worry about, and then something has to be done for each, and that is a modelling decision. A coupling capacitor’s far side with a bias resistor drawn has no problem at all: it was a matter of adding what the real circuit has. A floating instrument should have its common-mode path drawn in, with a stray capacitance to chassis and a leakage resistance of realistic size, so that its level means something and can be varied to see what depends on it. A current into an ideal capacitor is usually a modelling error, an integrator without its reset or feedback path; a real one has an amplifier’s offset and a finite open-loop gain, and a direct-current solve should be given a feedback resistor large enough not to matter in band. The current that does not reach the input deals with a similar path in a measurement, whose stray conduction is the actual subject.

None of these are difficult. What is difficult is noticing that any of them is needed, because the output looks fine. That is the real difference between a refusal and an answer: a solver that refuses forces the user to confront the missing path, and a solver that adds a conductance removes the prompt and leaves the problem. The refusal the first essay defended is a piece of information, and gg throws that information away for the convenience of always having a starting point.

What this leaves out

The conductance here is added at direct current and treated at its nominal value, and nothing nonlinear is in these netlists. In a nonlinear circuit the conductance is also a convergence aid. Simulators use gmin stepping, starting large and stepping down so that a stiff Newton iteration has a path to follow, and that is a different use with its own failure modes, including finding a different operating point if the circuit has several, which the temperature’s own fold sets out. Those solutions are real in the sense of satisfying the circuit, and the question is which one the device will actually be in. In a transient run, the conductance is present too, adding a time constant to every floating node, and at 10−1210^{-12} S it is usually much longer than the simulation. The 1,500 s here is an example, and it means a transient’s early behaviour is the capacitors’ and its final value would have been the conductances’, if a run were ever that long.

The number worth carrying

A small conductance from every node makes any matrix invert and makes Kirchhoff’s law hold to machine precision. The numbers it then gives are of three kinds: real ones, which do not depend on it; ones that are its reciprocal, a megavolt for a microamp at 10−1210^{-12} S; and ones that are the ratio of what was added, a centre tap of ±4.5 V on a floating battery. Scaling the conductance finds only the second kind. A test current at each node finds them all, because a node held by nothing else has a resistance near 1/g1/g: 0.33 to 1.0 on that score against 10−810^{-8} and below for a real node. And the invented value is also the true steady state of some circuit, at a time constant of C/gC/g, so that the answer may be right for a circuit nobody built, after a time nobody waits.

Still open: the operating point it chooses, a capacitor’s leakage by its dielectric, and a score worth printing

Stepping towards a different answer. Gmin stepping walks a nonlinear circuit down a family of operating points, and a circuit with several may arrive at a different one than a transient would. Whether the path taken has any physical meaning, and which of a latching circuit’s two states a large added conductance selects, is a question with direct consequences for start-up behaviour that a direct-current solve appears to report.

Leakage that is not a resistance. A real capacitor’s leakage has a dielectric relaxation in it, as well as a true conduction, and it depends on voltage and temperature. The relaxation to the leakage ratio is therefore not one exponential, and the series pair’s settling may take far longer than its time constant suggests. What a balancing resistor has to overcome, in current and in time, is a measurement rather than a formula.

A score in the output. The test current’s score could be computed for every node in a real netlist at almost no cost. How many nodes of an ordinary mixed-signal design sit near one is unknown here, and a survey of real designs would say how often a simulator’s output contains a number that is the simulator’s own. It would be a useful figure to have, and a low one would be a comfort.

Part 2 on singular network

One argument about Singular network, and one of 2 essays on it so far, each part numbered by how much of the idea it assumes. What sits either side of it:

The objects named here

The third axis, after the field and the idea: the things themselves, and every essay that touches each one.

Kirchhoffs current lawModel refusalModified nodal analysisNumerical errorSingular matrixVerification