Sub topic 3
Choosing the Reference Node
This chapter assumes you can apply Ohm's law, combine series and parallel resistors, and solve a small linear system. It also assumes you know Kirchhoff's current law (KCL) as a statement about currents at a node. The previous chapters covered conductance and KCL. Here you decide which node is the zero point for every voltage in the circuit, and you see why that decision matters.
Why a reference node is required
A voltage is always a difference between two points. Saying "node 1 is at 5 V" only means something if you also say "relative to what." The reference node, usually called ground, is that "what." You define its voltage as 0 V, and every other node voltage is measured against it.
The reference node is also needed mathematically. KCL equations contain only voltage differences, such as (V1 − V2)/R. If you add the same constant to every node voltage, every difference stays the same and every equation is still satisfied. Without a reference, a solution is never unique. If one set of node voltages works, so does that set shifted by 1 V, or by 100 V.
In matrix terms, the full conductance matrix of a circuit with a node set that has no reference is singular. Each row sums to zero, because each resistor adds +g to a diagonal entry and −g to an off-diagonal entry in the same row. Fixing one node at 0 V removes the ambiguity, and it removes one equation and one unknown at the same time.
For a circuit with N nodes, you therefore write N − 1 equations in N − 1 unknowns. The equation you drop is not lost information. The currents leaving all N nodes sum to zero, because every branch current leaves one node and enters another. So the N-th KCL equation is a combination of the other N − 1, and it adds nothing new.
What the choice changes and what it does not
The choice of reference node changes the node voltages. It does not change anything you can measure across a component.
| Quantity | Depends on the reference choice? |
|---|---|
| Node voltages | Yes. They all shift by the same constant. |
| Voltage across any element | No |
| Branch currents | No |
| Power in any element | No |
| Number of unknowns | Only if a voltage source touches the reference (see below) |
| Effort to solve by hand | Yes. This is the real reason to choose carefully. |
Because only the effort changes, any node is a legal reference. A good choice gives you fewer unknowns and fewer terms per equation.
Rules of thumb for picking the reference
- Prefer the node with the most connected elements. Every element touching the reference contributes a simpler term to the equations of its other node, because the reference voltage is zero. The more elements touch it, the more terms vanish.
- Prefer a terminal of a voltage source. If the reference is one terminal of a voltage source, the other terminal's voltage is known immediately. That node needs no KCL equation.
- If a voltage source is floating, put the reference on one of its terminals. A floating source has neither terminal at the reference, so it forces you to use a supernode. Moving the reference to one terminal removes that complication when the circuit allows it.
- Use the common rail. Many schematics have a long bottom wire joining the negative terminals of the sources. That wire is almost always the right reference.
- Ignore physical earth. In DC analysis the reference does not need to be connected to earth or a chassis. It is a bookkeeping choice.
If rules conflict, favor rule 2 or 3, because eliminating an unknown saves more work than simplifying a term.
Worked example: the same circuit with two references
Use the circuit from the Topic Spine. A 2 A current source pushes current into node 1. R1 = 4 Ω joins node 1 to node 0. R2 = 2 Ω joins node 1 to node 2. R3 = 6 Ω joins node 2 to node 0.
Reference at node 0. The unknowns are V1 and V2. KCL at each node gives:
- Node 1: V1/4 + (V1 − V2)/2 = 2
- Node 2: (V2 − V1)/2 + V2/6 = 0
Solving gives V1 = 16/3 V (about 5.333 V) and V2 = 4 V.
Reference at node 2. Now node 2 is 0 V. The unknowns are the voltages of nodes 0 and 1. The source takes 2 A out of node 0 and puts it into node 1. Write the equations:
- Node 1: V1/2 + (V1 − V0)/4 = 2
- Node 0: (V0 − V1)/4 + V0/6 = −2
Solving gives V1 = 4/3 V and V0 = −4 V.
The node voltages differ, but the physical results agree. The voltage across R2 is V1 − V2 = 16/3 − 4 = 4/3 V in the first case and 4/3 − 0 = 4/3 V in the second. The voltage across R1 is 16/3 V in the first case and 4/3 − (−4) = 16/3 V in the second. Each node voltage in the second solution equals the first one minus 4 V, which is the old voltage of node 2.
The following program stamps the equations for any chosen reference and confirms this.
import numpy as np
def solve_with_reference(num_nodes, resistors, sources, ref):
"""Solve for all node voltages with node `ref` fixed at 0 V.
resistors: list of (node_a, node_b, ohms)
sources: list of (from_node, to_node, amps); the source pushes current into to_node.
"""
keep = [k for k in range(num_nodes) if k != ref]
index = {node: row for row, node in enumerate(keep)}
n = len(keep)
G = np.zeros((n, n))
i = np.zeros(n)
for a, b, r in resistors:
g = 1.0 / r
for node in (a, b):
if node != ref:
G[index[node], index[node]] += g
if a != ref and b != ref:
G[index[a], index[b]] -= g
G[index[b], index[a]] -= g
for frm, to, amps in sources:
if to != ref:
i[index[to]] += amps
if frm != ref:
i[index[frm]] -= amps
v = np.zeros(num_nodes)
v[keep] = np.linalg.solve(G, i)
return v
resistors = [(1, 0, 4.0), (1, 2, 2.0), (2, 0, 6.0)]
sources = [(0, 1, 2.0)]
for ref in (0, 2):
v = solve_with_reference(3, resistors, sources, ref)
print(f"ref={ref}: nodes 0,1,2 =", [round(float(x), 4) for x in v])
print(" voltage across R2 (node 1 to node 2):", round(float(v[1] - v[2]), 4))
# ref=0: nodes 0,1,2 = [0.0, 5.3333, 4.0]
# voltage across R2 (node 1 to node 2): 1.3333
# ref=2: nodes 0,1,2 = [-4.0, 1.3333, 0.0]
# voltage across R2 (node 1 to node 2): 1.3333Both runs print the same voltage across R2. Only the zero point moved.
How the choice affects the amount of work
The reference node controls two counts. The first is the number of equations. The second is how many terms each equation has.
Take a circuit with a 12 V source whose negative terminal joins the common rail, and several resistor branches hanging off the positive terminal.
- If the reference is the negative terminal of the source, the positive terminal is fixed at 12 V. You skip its KCL equation and treat 12 V as a known value in the neighboring equations.
- If the reference is some other node, the source is floating. Both of its terminals are unknown, and the source forces a fixed difference between them. You then need a supernode, which the later chapter on floating voltage sources covers.
Both approaches give correct answers. The first is shorter, which means fewer chances for an arithmetic mistake.
Next, count the work when you can choose between two candidate nodes. Suppose node A has four elements attached and node B has two. Choosing A as the reference removes four terms across the equations. Choosing B removes only two. Choose A.
Common errors
- Using two references. Marking two different nodes with a ground symbol and treating both as 0 V implies those nodes are connected by a wire. If they are not actually connected, you have changed the circuit. Choose one reference per connected circuit.
- Mixing reference choices between equations. If you write one equation assuming the reference is node 0 and another assuming it is node 2, the results are meaningless. Pick once and keep it.
- Writing an equation at the reference node. The reference has no unknown voltage. Its KCL equation is redundant, so leave it out.
- Forgetting to restate results. If a question asks for a voltage "at node 3," the answer depends on the reference you chose. State your reference with the answer.
- Choosing a reference in a disconnected piece. Each separate sub-circuit that shares no wire with the others needs its own reference, or its matrix is singular. The chapter on singular matrices covers this case.
Summary of the decision
- Look for voltage sources. If you find one, choose one of its terminals, typically the negative one on the common rail.
- If there is no voltage source, choose the node with the most connected elements.
- Mark the reference with a ground symbol and write its voltage as 0 V.
- Count the unknowns. For N nodes, there are N − 1 unknown voltages, minus any that a grounded voltage source fixes.
- Label the remaining nodes and continue to the next chapter's labeling step.
Exercise
A circuit has 6 nodes and no voltage sources. How many KCL equations do you write, and why is it safe to skip the one at the reference node?
Show answer
You write 5 equations, one for each non-reference node. The sum of the currents leaving all 6 nodes is zero, because each branch current leaves one node and enters another. The equation at the reference node is therefore the negative sum of the other five and carries no new information.
Exercise
In the worked example with the reference at node 0, V1 = 16/3 V and V2 = 4 V. If you move the reference to node 1, what are the voltages of nodes 0 and 2, and what is the voltage across R3?
Show answer
Every node voltage shifts by the old voltage of the new reference, which is 16/3 V. Node 0 becomes 0 − 16/3 = −16/3 V, node 1 becomes 0 V, and node 2 becomes 4 − 16/3 = −4/3 V. The voltage across R3 (node 2 to node 0) is −4/3 − (−16/3) = 4 V, the same as before.
Exercise
A circuit has a 9 V source with its positive terminal at node A and its negative terminal at node B. Neither node is currently the reference. Which node should you choose as the reference to avoid a supernode, and what is the voltage of the other terminal?
Show answer
Choose node B, the negative terminal. Then node A is fixed at +9 V relative to the reference, so the source no longer floats and node A needs no KCL equation.