Networks, and how a solve is checked

The node a solver should not call zero

Across two hundred random networks of thirteen nodes, resistances spread over six decades, calling the worst node zero costs a median 1.16 decimal digits against the best and up to 1.66; a node at random costs 0.29. No cheap rule finds the best node. The most strongly connected one — the most total conductance meeting at it — loses a median 0.08 and 0.30 at the ninetieth percentile, the most connections 0.11 and 0.33, the source's return 0.03 and 0.34, and every one of them sometimes loses a whole digit. But the least connected node is the worst of all in 74% of the networks, because the reference sets the transfer resistances in the inverse matrix, whose norm carries 85% of the difference. The rule worth having is a rule against: never call the weakest node zero.

Assumes: What a network answers, and how the answer is checked

The node that is not in the circuit found that a circuit does not care which node is called zero and the arithmetic does: on a star whose resistances spanned nine decades, the worst reference cost four decimal digits of the answer, and it was the reference the condition number had named before the error was looked at. The reference a sweep should keep carried the question to a sweep in frequency and found the best node moving with it. Both took the reference from the netlist, and the first ended by asking the question a solver writer actually faces: if a solver chose its own reference, by what rule, and does any simple rule beat the netlist’s own choice?

Every network in this collection is solved by the same matrix, and what a network answers set out the two independent checks every answer passes; the reference is the one choice in that matrix the checks are blind to. Those essays measured two networks each, a chain and a star, chosen because they had an obvious answer. A rule has to be judged on networks nobody chose. This essay builds a seeded family of them — random meshes of resistors with a source, each tried from every node — and measures each rule against the best answer that network allows.

The family, and what is measured

Each network has thirteen nodes. A random tree joins them so that every node has a path to every other, and ten more resistors are added between random pairs, so that the network has loops. Each resistance is drawn log-uniformly over a stated number of decades — six, unless the figure says otherwise — and one node, chosen at random, is the netlist’s ground, with a one-volt source from another node to it. That last detail matters: in a real netlist the ground is where the sources return, and it is the reference a solver inherits.

For every node of every network the nodal matrix is assembled with that node called zero, and its condition number is computed — the product of the matrix’s norm and its inverse’s norm, in the largest-row-sum norm, which the matrix that is ill, and the answer that is not established as the measure of how many digits the arithmetic may lose. Each network’s best reference sets a zero, and a rule is scored by the decimal digits its choice loses against that zero.

Five rules over two hundred networks

Two hundred random networks of thirteen nodes, resistances over 6 decades: the digits a rule for choosing the reference losescomputed by solving, not by drawing: every node of every network tried as the reference and the nodal matrix's condition number computed each time; each curve is one rule's loss against that network's best reference, sorted. Median, ninetieth percentile and worst, in decimal digits: the worst node 1.16, 1.37, 1.66; a node at random (mean) 0.29, 0.50, 0.78; the source's return 0.03, 0.34, 0.89; most connections 0.11, 0.33, 1.19; most conductance 0.08, 0.30, 1.04. The least connected node is the worst of all in 74% of the networks.00.50011.50200.2000.4000.6000.8001share of the 200 networks (sorted)decimal digits lost against the best referencethe worst nodemost conductance: 0.30 at 90%solved, then checked — 200 networks, every referenceworst node 1.16 digits at the median
Fig. 1 Two hundred random networks of thirteen nodes, resistances over six decades: the decimal digits each way of choosing the reference loses against that network’s best, sorted. The worst node: 1.16 at the median, 1.66 at worst. A node at random: 0.29. The source’s return: 0.03, 0.34 at the ninetieth percentile. Most connections: 0.11 and 0.33. Most conductance: 0.08 and 0.30. The slider is the resistances’ spread.

The stakes first. Calling the worst node zero costs a median of 1.16 decimal digits against the best, and 1.66 in the worst network of the two hundred. A node chosen at random costs 0.29 on average. That is the whole range a rule can act on: about a digit, on networks of this size and spread. It is less than the star’s four digits, which needed a particular structure — a milliohm and a megohm in series on one arm — and random networks rarely build one.

Three rules are cheap enough for a solver to apply without solving anything. Call zero the node with the most total conductance meeting at it: a median loss of 0.08 digits, 0.30 at the ninetieth percentile, 1.04 at worst. The node with the most connections: 0.11, 0.33 and 1.19. And keep the source’s return, the netlist’s own ground: 0.03, 0.34 and 0.89. All three beat a node at random at the median, and all three sometimes lose a whole digit. None finds the best node reliably — the strongest node is within a tenth of a digit of the best in 54 per cent of the networks, the most connected in 48 and the source’s return in 65 — and among the three there is no clear winner; their ninetieth percentiles are within four hundredths of a digit of each other.

The spread of the resistances

Sliding the spread changes the picture less than expected. With every resistor equal — no spread at all — the worst node costs a median of 0.65 digits, and the two structural rules, most connections and most conductance, are then the same rule and nearly perfect: zero at the median and 0.13 at the ninetieth percentile, because with equal resistors the most connected node really is the most strongly tied to the rest. The source’s return is a poor choice there, 0.38 at the median, no better than a node at random, because with equal resistors nothing makes the ground special.

From three decades of spread the worst node costs a little over a digit and stays near it — 1.05 at three decades, 1.16 at six, 1.17 at nine — and the rules settle: most conductance at 0.01, 0.08 and 0.14 digits at the median for three, six and nine decades, most connections at 0.06, 0.11 and 0.16. A wider spread makes the worst node worse and makes connections a poorer guide to strength, because one node can carry five resistors of a megohm and another two of an ohm.

One network, every node

One random network of thirteen nodes: the condition number from each reference, against the conductance that meets at it. computed by solving, not by drawing. The network whose worst-to-best spread, 1.16 digits, is the family's median. Each dot is one node called zero. The best reference, κ = 2.21e+4, has 3 connections and 8.07e-1 S meeting at it; the worst, κ = 3.18e+5, has 5 and 9.99e-5 S. The rank correlation between conductance and condition number is -0.63: more conductance, better conditioning, as a tendency rather than a law.
Fig. 2 The network whose worst-to-best spread, 1.16 digits, is the family’s median: each dot is one node called zero, its condition number against the total conductance meeting at it. The best reference, κ = 2.21×10⁴, has 3 connections and 0.807 S; the worst, κ = 3.18×10⁵, has 5 connections and only 9.99×10⁻⁵ S. Rank correlation −0.63.

The typical network shows both the tendency and its limit. More conductance at a node means a better-conditioned matrix with that node as zero, with a rank correlation of −0.63 across the thirteen nodes — a strong tendency and not a law. The best node has three connections and 0.807 siemens meeting at it. The worst has five connections and only a ten-thousandth of a siemens: five resistors, every one of them large. A rule that counted connections would have preferred the worst node to the best. A rule that weighed conductance would have avoided it, and in this network would have chosen a node near, but not at, the best.

Why the weak node is the bad one

The condition number is the product of two norms, and the reference moves one of them far more than the other.

Two hundred networks: how far each of the two norms in the condition number moves as the reference moves. computed by solving, not by drawing. The condition number is ‖M‖·‖M⁻¹‖ in the largest-row-sum norm. Across each network's references, ‖M‖ (dashed) spans a median of 0.15 digits and ‖M⁻¹‖ (solid) 1.07. ‖M‖ is the largest total conductance at any node left in the matrix; ‖M⁻¹‖ is the largest sum of transfer resistances to the reference. Between the best and worst reference the inverse carries a median 85% of the difference in digits.
Fig. 3 Across each network’s references: the spread of the matrix’s own norm ∥M∥\|M\| (dashed), a median of 0.15 digits, and of its inverse’s norm ∥M−1∥\|M^{-1}\| (solid), 1.07 digits. Between the best and worst reference, the inverse carries a median 85% of the difference.

The matrix’s own norm, in the row-sum form, is the largest total conductance at any node left in the matrix. Calling a node zero removes its row, so the norm moves only if the removed node was the one with the largest row — and across each network’s references it spans a median of only 0.15 digits. The inverse’s norm is a different object. Each entry of the inverse of a nodal matrix is a transfer resistance: the voltage at one node, relative to the reference, per unit current injected at another. Its row-sum norm is the largest total of transfer resistances to the reference, and it spans a median 1.07 digits across the references. Between each network’s best and worst reference the inverse carries a median 85 per cent of the difference.

That is the whole mechanism. A node tied weakly to everything else is a long way, in resistance, from every other node, so every transfer resistance to it is large and the inverse’s norm is large. A node tied strongly to the rest is close to every node, and the inverse is small. The total conductance at a node is a cheap estimate of how strongly it is tied — cheap because it reads only the node’s own resistors, and an estimate because a node can have large conductance to one neighbour that is itself weakly tied to the rest.

The rule against

That mechanism is asymmetric, and the asymmetry is the useful result.

Two hundred networks: how often each rule lands within a tenth of a digit of the worst reference. computed by solving, not by drawing. The share of networks in which the rule's reference loses within 0.1 digit of what the worst reference loses: most conductance 3%, most connections 1%, the source's return 0%, least conductance 74%. No rule tested reliably finds the best reference, but the least connected node reliably finds the worst — so the rule worth having is one against a node, not one for a node.
Fig. 4 The share of two hundred networks in which each rule’s reference lands within a tenth of a digit of the worst reference: most conductance 3%, most connections 1%, the source’s return 0%, least conductance 74%.

A node with the least total conductance is a node whose resistors are all large, and such a node is far from everything; the estimate that fails for the strongest node — a big conductance to a neighbour that is itself remote — cannot fail in the same way for the weakest, because a node whose own resistors are all large is remote from everything whatever lies beyond them. So the rules are not mirror images. The least connected node is the worst reference in 74 per cent of the networks and within a tenth of a digit of it in the same share; the most connected rules land near the worst in one to three per cent. Finding the best node takes knowledge of the whole network. Finding the worst takes a glance at each node’s own resistors.

A solver, then, should carry a rule against: never call zero the node with the least conductance meeting at it. It costs nothing, it needs nothing but the netlist, and against random networks it removes the tail where a whole digit is lost.

The star the rule would have refused

The earlier essay’s star is a good test of the rule against, because it was built by hand to have a bad reference and nobody asked the rule. Its five nodes are a source node, a hub one milliohm from it, a node x a kilohm from the hub with a large resistor to ground, a node y a large resistor from the hub with ten milliohms to ground, and ground. With nine decades in the large resistors, the conductances meeting at each node are a thousand siemens at the source and at the hub, a hundred at y and at ground — and a thousandth at x, which is tied to the rest only through a kilohm on one side and a gigohm on the other. The rule against names x.

x is the worst reference of the five: its condition number is 8.0 × 10⁶ against 1.0 × 10⁶ for the best, the factor of eight the earlier essay reported, and against a double-double solve the reference that cost four digits of the answer. The rule needed nothing but the five nodes’ own resistors to find it.

What a solver would do with it

The rule turns into two lines of a solver. Before assembling the matrix, sum the conductance of the resistors at each node; if the netlist’s ground has the least, choose another — any of the strongly tied ones does about as well as any other, on the figures above. Otherwise keep the ground the netlist gives, which is at the median the best of the three rules and costs nothing to explain to a user who expects node voltages measured from it.

The second half matters more than it looks. A solver that silently moves the reference must move every node voltage it reports back by the same constant, which the node that is not in the circuit showed is exact for branch quantities and shifts every node voltage rigidly. That is a translation at the end of the solve, and it is what lets the rule live inside a solver without a user ever seeing it. In the family here the netlist’s ground was itself the weakest node in 19 of the 200 networks, nearly one in ten — a random choice of ground, which is what a netlist’s ground is from the arithmetic’s point of view, lands on the weakest node about as often as chance says it should.

Bigger networks

Random networks of 6, 12 and 24 nodes, resistances over six decades: what the worst reference and the strongest node lose. computed by solving, not by drawing, two hundred networks at 6 and 12 nodes and a hundred at 24. The worst reference loses a median 0.90, 1.16, 1.41 digits (ninetieth percentile 1.08, 1.37, 1.63); a node at random 0.32, 0.29, 0.27; the most strongly connected node 0.04, 0.08, 0.00 (ninetieth percentile 0.30, 0.30, 0.26). The least connected node is the worst in 69%, 74%, 76% of them.
Fig. 5 Random networks of 6, 12 and 24 nodes, resistances over six decades: the worst reference loses a median of 0.90, 1.16 and 1.41 digits (faint; ninetieth percentile 1.08, 1.37 and 1.63); a node at random 0.32, 0.29 and 0.27 (dashed); the most strongly connected node 0.04, 0.08 and 0.00 at the median (solid) and 0.30, 0.30 and 0.26 at the ninetieth percentile. The least connected node is the worst in 69%, 74% and 76% of them.

The stakes grow with size: the worst reference costs a median of 0.90 digits at six nodes, 1.16 at twelve and 1.41 at twenty-four, because a larger network has room for a node further, in resistance, from the rest. The strongest-node rule does not get worse: its median loss is 0.04, 0.08 and 0.00, its ninetieth percentile about 0.3 throughout. And the least connected node becomes more reliably the worst — 69, 74 and 76 per cent — as the network grows. On a circuit of a few hundred nodes, as a simulator sees one, the worst node’s cost will be larger and the rule against it more reliable still; that is an extrapolation from three sizes, and it is stated as one.

What the netlist’s ground is worth

The source’s return deserves its own paragraph, because it is what every solver does by default. At the median it is the best of the three rules — 0.03 digits at six decades — and its ninetieth percentile is no worse than the others’. The reason is the source: a voltage source fixes the difference between its two nodes, so its return node is joined to the source node by a constraint stronger than any resistor, and the pair behaves as one well-tied node. With equal resistors, where nothing else distinguishes the ground, it is no better than random.

So the inherited reference is a good one for the reason that the circuit’s designer put a source there, not because ground is special to the arithmetic. A netlist whose ground is a sense line or a shield, tied to the rest through large resistors, inherits a weak reference — exactly the case where the rule against applies.

What a digit is worth

A digit of sixteen is small, and on these networks the worst choice still leaves fourteen and a half correct. The digits the arithmetic did not have found that the digits a matrix loses matter when the answer is a small difference of large node voltages, and where the matrix is worst, and where the answer is not found the condition number a ceiling on the loss rather than the loss itself. Both hold here. The rule against matters most in exactly the analyses that already spend digits: a bridge’s imbalance, a sensitivity by finite difference, a nearly singular network that the conductance added so it would invert found being propped up with an invented conductance. In those, a digit lost to the reference is a digit the analysis did not have to give. And where digits are short, the step that returns the digits — one round of iterative refinement — buys back more than any choice of reference can, which puts the rule in proportion: it is free insurance, not a cure. A network that is genuinely singular, like the answer that is perfect and absurd, is refused from every reference, and no rule about which node to call zero changes that.

How the family was built and measured

Each network is seeded, so every figure is reproducible: a random tree over thirteen nodes, ten more resistors between random pairs with no duplicates and no self-loops, resistances 10 to the power of the spread times a uniform draw, one node renamed ground at random, and a one-volt source from another node to it. For each node the netlist is relabelled so that node is ground, the modified nodal matrix is assembled at direct current, and its condition number is computed by forming the inverse column by column with the same elimination the solver uses. A rule reads only the netlist — each node’s count of resistors and the sum of their conductances — and is scored against the best of that network’s thirteen condition numbers. The two-norm decomposition reads the same two factors the condition number is the product of.

A condition number bounds the loss rather than measuring it; the earlier essay measured the loss itself against a double-double solve on one star and found the two in agreement, which is why the bound is used here across two hundred networks where a double-double solve of each would add nothing but time. Random networks are not real circuits: they have no hierarchy, no repeated blocks and no supply rails, and a real circuit’s worst node is probably more extreme.

Still open: a rule that solves, the frequency, and the circuits that are not random

A rule that solves a little. The strongest-node rule reads only a node’s own resistors. A rule that also read its neighbours’ — a two-step estimate of how far the node is from the rest — might find the best node far more often, at the price of a pass over the netlist. Whether one more step of neighbourhood closes most of the gap between 0.08 digits and zero is a question with the same family as its test bench.

The rule at s = jω. The earlier essay found the best reference moving with frequency on an RC chain, from the middle node to ground where the capacitors return. With capacitors to ground in each random network, the total admittance at a node becomes frequency dependent, and whether the rule against — the weakest node — stays the worst at every frequency is the obvious next measurement.

Circuits that are not random. An amplifier’s netlist has rails tied by small resistors and a feedback network tied by large ones, and a hierarchy no random mesh has. A family drawn from real circuit topologies — RC chains, bridges, amplifier stages joined by bias networks — would say whether the weakest node is as reliably the worst there, where the stakes may be several digits rather than one.

Part 4 on nodal analysis

One argument about Nodal analysis, and one of 4 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.

Condition numberConditioningModified nodal analysisNumerical errorReference nodeVerification