---
title: Nodal analysis
heading: One equation per node solves any circuit
eyebrow: C1 · Lesson 9 · Nodal analysis
xp: 50
---

::: hook
Series and parallel shortcuts run out quickly. A bridge, or two sources feeding the same node, can't be reduced that way. Nodal analysis always works: name the voltage at each node, write KCL at each one using Ohm's law for the currents, and solve the resulting equations. It's the method circuit simulators use, including the one running every circuit in this course, and it turns a circuit into exactly the kind of matrix equation you solved in A7.

::: play
- A 10 V source and a 2 mA current source both feed this network. The meters read the two node voltages, $v_a$ and $v_b$.
- Check KCL at node a with the readings: the current arriving through $R_1$ should equal what leaves through $R_2$ and $R_3$.
- Raise the current source. Both node voltages rise. Does $v_a$ rise as much as $v_b$?
:::
:::

```sim circuit
V1 in 0 10          @ 0,0 down
R1 in a 1k          @ 0,0 right
R2 a 0 2k           @ 2,0 down
R3 a b 1k           @ 2,0 right
R4 b 0 2k           @ 4,0 down
I1 0 b 2m           @ 6,2 up
slider: I1.amp 0..10m
slider: R3 100..10k log
scope: v(a), v(b)
time: 0..1m s
meter: v(a), v(b), i(R3)
```

::: predict
## A node connects to a 12 V source through 1 kΩ and to ground through 3 kΩ. Nothing else touches it. Which equation gives its voltage $v$?

- [ ] $v = 12 \times 1/4$
- [x] $\frac{12 - v}{1} = \frac{v}{3}$ (currents in kΩ and mA)
- [ ] $12 = v \times 4$
- [ ] $v = 12 - 3$

::: reveal
The current arriving through the 1 kΩ, $(12 - v)/1$ mA, must equal the current leaving through the 3 kΩ, $v/3$ mA. Solving, $36 - 3v = v$, so $v = 9$ V, the same as the divider formula gives. Nodal analysis is just this, done at every node at once.
:::
:::

::: nameit
## The method

1. **Pick a ground** (usually the node with the most connections, or the source's − side) and label every other node's voltage: $v_a$, $v_b$, ...
2. **Write KCL at each unknown node**, expressing every current with Ohm's law: a resistor $R$ between nodes a and b carries $(v_a - v_b)/R$ from a to b. Current sources contribute their value directly.
3. **Solve** the equations together.

For the circuit above, with conductances $G = 1/R$ and the source fixing $v_\text{in} = 10$ V:

$$\begin{aligned} \text{node a:}\quad & G_1(v_a - 10) + G_2v_a + G_3(v_a - v_b) = 0 \\ \text{node b:}\quad & G_3(v_b - v_a) + G_4v_b = I_1 \end{aligned}$$

**The matrix form.** Collecting terms gives $\mathbf{G}\mathbf{v} = \mathbf{i}$:

$$\begin{pmatrix} G_1 + G_2 + G_3 & -G_3 \\ -G_3 & G_3 + G_4 \end{pmatrix}\begin{pmatrix} v_a \\ v_b \end{pmatrix} = \begin{pmatrix} 10G_1 \\ I_1 \end{pmatrix}$$

The pattern is always the same, so you can write it down by inspection:

- **diagonal** entry for a node: the sum of all conductances touching it;
- **off-diagonal** entry for two nodes: minus the conductance directly between them;
- **right-hand side**: current pushed into the node by current sources, plus $G \times$(source voltage) for each resistor that leads to a known voltage.

The matrix is symmetric for circuits of resistors and independent sources.

**Voltage sources.** A voltage source to ground simply fixes that node's voltage (one fewer unknown). A source between two unknown nodes makes a **supernode**: write one KCL equation for the two nodes together, plus the source's equation $v_a - v_b = V$.

**Millman's theorem.** One node connected to several sources $V_k$ through resistors $R_k$ (a source of 0 V means a resistor to ground) sits at the conductance-weighted average:

$$v = \frac{\sum V_k/R_k}{\sum 1/R_k}$$
:::

::: example
## 12 V feeds a node through 1 kΩ, 6 V feeds it through 2 kΩ, and 2 kΩ connects it to ground. What is the node's voltage?

::: solution
1. **KCL at the node.** In mA, with kΩ:
   $$\frac{v - 12}{1} + \frac{v - 6}{2} + \frac{v}{2} = 0$$
2. **Solve.**
   $$\begin{aligned} 2v &= 12 + 3 \\ v &= 7.5\ \text{V} \end{aligned}$$

**Answer:** the node sits at 7.5 V.
:::
:::

::: example
## A 5 V source sits between nodes $a$ (+) and $b$, each with 1 kΩ to ground, and 10 mA is injected into $a$. Find both node voltages.

::: solution
1. **KCL on the supernode.** Treat $a$, $b$ and the source as one supernode:
   $$\frac{v_a}{1} + \frac{v_b}{1} = 10\ \text{mA}$$
2. **Add the source's equation.**
   $$v_a - v_b = 5$$
3. **Solve.**
   $$\begin{aligned} v_b &= 2.5\ \text{V} \\ v_a &= 7.5\ \text{V} \end{aligned}$$

**Answer:** $v_a$ = 7.5 V and $v_b$ = 2.5 V.
:::
:::

::: example
## A 10 V source feeds node a through 1 kΩ. Node a has 2 kΩ to ground and 2 kΩ to node b; node b has 1 kΩ to ground and 1 mA injected into it. Find both node voltages.

::: solution
1. **KCL at a.** In kΩ and mA:
   $$\begin{aligned} \frac{v_a - 10}{1} + \frac{v_a}{2} + \frac{v_a - v_b}{2} &= 0 \\ 2v_a - 0.5v_b &= 10 \end{aligned}$$
2. **KCL at b.**
   $$\begin{aligned} \frac{v_b - v_a}{2} + \frac{v_b}{1} &= 1 \\ -0.5v_a + 1.5v_b &= 1 \end{aligned}$$
3. **Determinant.**
   $$\begin{aligned} \Delta &= 2 \times 1.5 - 0.25 \\ &= 2.75 \end{aligned}$$
4. **Solve.**
   $$\begin{aligned} v_a &= \frac{10 \times 1.5 + 0.5 \times 1}{2.75} \\ &= 5.64\ \text{V} \\ v_b &= \frac{2 \times 1 + 0.5 \times 10}{2.75} \\ &= 2.55\ \text{V} \end{aligned}$$
5. **Check at a.** 4.36 mA arrives from the source, 2.82 mA leaves to ground and 1.55 mA leaves to b.
6. **What a simulator does.** The two equations, written straight from the conductances, are all a circuit simulator solves too.

**Answer:** $v_a$ = 5.64 V and $v_b$ = 2.55 V.
:::
:::

::: check
given: Vs = 10 | 12 | 15; R1 = 1 | 2; R2 = 3 | 4 | 6; I = 1 | 2 | 3
answer: (Vs/R1 + I)/(1/R1 + 1/R2)
unit: V
tolerance: 0.5%

## A node connects to a {Vs} V source through {R1} kΩ and to ground through {R2} kΩ, and a current source pushes {I} mA into it. What is its voltage?

::: right
Right. KCL: $(V_s - v)/R_1 + I = v/R_2$, so $v = (V_s/R_1 + I)/(1/R_1 + 1/R_2)$ = {answer}.
:::

::: misses
- [Vs*R2/(R1 + R2)] That's the divider alone. Add the current source's contribution.
- [(Vs/R1 - I)/(1/R1 + 1/R2)] The current source pushes current into the node, raising its voltage.
- [any] Not yet. Write KCL at the node in mA and kΩ.
:::
:::

::: check
given: V1 = 5 | 10; V2 = 12 | 15 | 20; R1 = 1 | 2; R2 = 3 | 4; R3 = 5 | 10
answer: (V1/R1 + V2/R2)/(1/R1 + 1/R2 + 1/R3)
unit: V
tolerance: 0.5%

## A node connects to a {V1} V source through {R1} kΩ, to a {V2} V source through {R2} kΩ, and to ground through {R3} kΩ. What is its voltage?

::: right
Right. Millman: $(V_1/R_1 + V_2/R_2)/(1/R_1 + 1/R_2 + 1/R_3)$ = {answer}.
:::

::: misses
- [(V1/R1 + V2/R2)/(1/R1 + 1/R2)] Include the resistor to ground in the sum of conductances.
- [(V1 + V2)/2] Weight each source by its conductance.
- [any] Not yet. KCL at the node: currents in from each source equal the current to ground.
:::
:::

::: check
given: R1 = 1 | 2; R2 = 4 | 5; R3 = 8 | 10
answer: 1/R1 + 1/R2 + 1/R3
unit: mS
tolerance: 0.5%

## Resistors of {R1} kΩ, {R2} kΩ and {R3} kΩ all touch node a. What is node a's diagonal entry in the conductance matrix, in mS?

::: right
Right. The sum of the conductances: {answer}.
:::

::: misses
- [R1 + R2 + R3] That's the sum of resistances. Add the conductances, 1/R.
- [1/(R1 + R2 + R3)] Add each conductance separately.
- [any] Not yet. $G_{aa} = \sum 1/R$ for everything touching a.
:::
:::

::: check
kind: parts
given: Ia = 1 | 2 | 3; Ib = 5 | 7; R1 = 1 | 2; R2 = 1 | 2 | 4; R3 = 1 | 2

## A current source pushes {Ia} mA into node a and another pushes {Ib} mA into node b. $R_1$ = {R1} kΩ connects a to ground, $R_2$ = {R2} kΩ connects a to b, and $R_3$ = {R3} kΩ connects b to ground.

::: part
answer: (Ia*(1/R2 + 1/R3) + Ib/R2)/((1/R1 + 1/R2)*(1/R2 + 1/R3) - 1/R2^2)
unit: V
tolerance: 0.5%

### What is $v_a$?

::: misses
- [Ia*R1] Node a also connects to b through R2.
- [any] Write the 2×2 conductance matrix and solve it (Cramer's rule works well).
:::
:::

::: part
answer: (Ib*(1/R1 + 1/R2) + Ia/R2)/((1/R1 + 1/R2)*(1/R2 + 1/R3) - 1/R2^2)
unit: V
tolerance: 0.5%

### What is $v_b$?

::: misses
- [Ib*R3] Node b also connects to a through R2.
- [any] Solve the same system for the second unknown.
:::
:::

::: right
Right. $\begin{pmatrix} G_1 + G_2 & -G_2 \\ -G_2 & G_2 + G_3\end{pmatrix}\begin{pmatrix} v_a \\ v_b\end{pmatrix} = \begin{pmatrix} I_a \\ I_b\end{pmatrix}$, solved.
:::
:::

::: check
kind: choice

## A voltage source connects node a to node b, with neither node at ground. How do you handle it in nodal analysis?

- [ ] Ignore it
- [x] Treat a and b as one supernode: one KCL equation around both, plus $v_a - v_b = V$
- [ ] Replace it with a resistor
- [ ] It can't be solved by nodal analysis

::: right
Right. The source's current is unknown, so you write KCL around both nodes together and add the source's voltage equation.
:::

::: misses
- [1] It sets the difference between the two node voltages.
- [3] It isn't a resistor; its current is whatever the circuit needs.
- [4] The supernode handles it.
:::
:::

::: check
kind: parts
given: V = 10 | 12; a = 2 | 4; I = 1 | 2

## A {V} V source feeds node a through 1 kΩ. Node a has {a} kΩ to ground and 2 kΩ to node b; b has 1 kΩ to ground and {I} mA injected.

::: part
answer: (V*1.5 + 0.5*I)/((1.5 + 1/a)*1.5 - 0.25)
unit: V
tolerance: 0.5%

### What's $v_a$?

::: misses
- [any] Solve the two KCL equations, by Cramer's rule.
:::
:::

::: part
answer: ((1.5 + 1/a)*I + 0.5*V)/((1.5 + 1/a)*1.5 - 0.25)
unit: V
tolerance: 0.5%

### What's $v_b$?

::: misses
- [any] Second row of Cramer's rule.
:::
:::
:::

::: check
kind: derivation
vars: a = 0.5..10, b = 0.5..10, c = 0.01..0.4, I = -5..5, J = -5..5

## Two nodes have conductance matrix rows (a, −c) and (−c, b), with injected currents I and J (and c < a, b).

::: step
answer: a*b - c^2

### What's the determinant?
:::

::: step
answer: (I*b + J*c)/(a*b - c^2)

### What's the first node's voltage?
:::

::: step
answer: (J*a + I*c)/(a*b - c^2)

### And the second's?
:::

::: right
Right. Cramer's rule on a 2 × 2 nodal system.
:::
:::

::: explain
## Why does nodal analysis always give exactly as many equations as unknowns?

::: model
Each node other than ground has one unknown voltage, and at each such node KCL gives one equation, with every current written in terms of node voltages by Ohm's law. So there's one equation for each unknown. A voltage source removes an unknown (it fixes a voltage or a difference) and also removes one KCL equation (its current is unknown), so the count still balances. Ground's own KCL equation is the sum of the others, so it adds nothing new.
:::
:::

::: practice

::: check
given: Vs = 6 | 9 | 12; R1 = 1 | 2; R2 = 3 | 6
answer: Vs*R2/(R1 + R2)
unit: V
tolerance: 0.5%

## A node connects to {Vs} V through {R1} kΩ and to ground through {R2} kΩ. Its voltage?

::: misses
- [Vs*R1/(R1 + R2)] That's the drop across the first resistor.
- [any] KCL: $(V_s - v)/R_1 = v/R_2$.
:::
:::

::: check
given: I = 1..5 int; R1 = 2 | 4; R2 = 6 | 12
answer: I*R1*R2/(R1 + R2)
unit: V
tolerance: 0.5%

## {I} mA is pushed into a node that connects to ground through {R1} kΩ and {R2} kΩ. Its voltage?

::: misses
- [I*(R1 + R2)] The two resistors are in parallel.
- [any] $v = I (R_1 \parallel R_2)$.
:::
:::

::: check
given: R = 1 | 2 | 5
answer: -1/R
unit: mS
tolerance: 0.5%

## A {R} kΩ resistor connects nodes a and b. What is its entry in row a, column b of the conductance matrix?

::: misses
- [1/R] Off-diagonal entries are negative.
- [any] $-1/R$.
:::
:::
:::
