---
title: Why circuits produce simultaneous equations
heading: Each node gives one equation, and the answer is where they meet
eyebrow: A7 · Lesson 3 · Circuits and simultaneous equations
xp: 40
---

::: hook
A voltage divider has one unknown voltage and one equation, so you solve it in a line. Add a second junction and the two unknown voltages depend on each other: you can't find one without the other. The way out is to write one equation per junction and solve them together. Each equation is a straight line, and the answer is where the lines cross.

::: play
- The circuit: 10 V drives node 1 through $R_1$; $R_2$ goes from node 1 to ground; $R_3$ joins node 1 to node 2; $R_4$ goes from node 2 to ground. All values in kΩ.
- Each line is the set of $(V_1, V_2)$ pairs that satisfy one node's current law. The dot is where both hold: the circuit's actual voltages.
- Change the resistors and watch the lines move. Below, the same circuit is simulated: check that its meters read the dot's coordinates.
:::
:::

```sim plot
view: graph
x: V1 = 0..10 V
y: V2 = 0..10 V
slider: R1 = 1..10 step 0.5 = 2
slider: R2 = 1..10 step 0.5 = 4
slider: R3 = 1..10 step 0.5 = 2
slider: R4 = 1..10 step 0.5 = 6
plot: V1 + R3*((V1 - 10)/R1 + V1/R2) | label: node 1's equation
plot: V1*R4/(R3 + R4) | color: ch2 | label: node 2's equation
point: (10/R1)/(1/R1 + 1/R2 + (1 - R4/(R3 + R4))/R3), (10/R1)/(1/R1 + 1/R2 + (1 - R4/(R3 + R4))/R3)*R4/(R3 + R4) | color: ch3 | label: solution
readout: V₁ = (10/R1)/(1/R1 + 1/R2 + (1 - R4/(R3 + R4))/R3) V
readout: V₂ = (10/R1)/(1/R1 + 1/R2 + (1 - R4/(R3 + R4))/R3)*R4/(R3 + R4) V
```

::: predict
## Two straight lines in a plane. How many points can satisfy both equations?

- [ ] Always exactly one
- [x] Usually one; none if the lines are parallel; infinitely many if they're the same line
- [ ] Always two
- [ ] Always infinitely many

::: reveal
Usually exactly one: where they cross. Two parallel lines never meet, so no pair satisfies both; two identical lines meet everywhere. A sound circuit always gives the first case. Lesson 16 shows what the other two cases mean physically, and how to spot them before you try to solve.
:::
:::

::: nameit
## Kirchhoff's current law, one node at a time

At every junction, the currents leaving add to zero (charge doesn't pile up). Writing each current through a resistor as the voltage across it over its resistance gives, at node 1 and node 2:

$$\frac{V_1 - V_s}{R_1} + \frac{V_1}{R_2} + \frac{V_1 - V_2}{R_3} = 0 \qquad\qquad \frac{V_2 - V_1}{R_3} + \frac{V_2}{R_4} = 0$$

Both are **linear**: each unknown appears only multiplied by a constant. Collecting terms gives the standard form

$$\begin{aligned} \Big(\tfrac{1}{R_1} + \tfrac{1}{R_2} + \tfrac{1}{R_3}\Big)V_1 - \tfrac{1}{R_3}V_2 &= \tfrac{V_s}{R_1} \\ -\tfrac{1}{R_3}V_1 + \Big(\tfrac{1}{R_3} + \tfrac{1}{R_4}\Big)V_2 &= 0 \end{aligned}$$

or, as a matrix equation, $G\mathbf{v} = \mathbf{i}$:

$$\begin{bmatrix} \frac{1}{R_1} + \frac{1}{R_2} + \frac{1}{R_3} & -\frac{1}{R_3} \\ -\frac{1}{R_3} & \frac{1}{R_3} + \frac{1}{R_4} \end{bmatrix}\begin{bmatrix} V_1 \\ V_2 \end{bmatrix} = \begin{bmatrix} V_s/R_1 \\ 0 \end{bmatrix}$$

$G$ is the **conductance matrix**. Notice its pattern: each diagonal entry is the total conductance touching that node, and each off-diagonal entry is minus the conductance joining two nodes. That pattern lets you write $G$ for any resistor circuit by inspection, which is nodal analysis (C1), and it's exactly what a circuit simulator builds.

With two unknowns, each equation is a line and the solution is where they cross. With three nodes, each equation is a plane in 3D; with a thousand, a "hyperplane" you can't draw, but the algebra is the same, and the rest of this course is about solving $G\mathbf{v} = \mathbf{i}$ and understanding when it can't be solved.

```sim circuit
V1 a 0 10        @ 0,0 down
R1 a n1 2k       @ 0,0 right
R2 n1 0 4k       @ 2,0 down
R3 n1 n2 2k      @ 2,0 right
R4 n2 0 6k       @ 4,0 down
slider: R2 1k..10k
slider: R4 1k..10k
meter: v(n1), v(n2)
```
:::

::: example
## KCL gives $2v_1 - v_2 = 10$ and $-v_1 + 2v_2 = 0$. Solve for the node voltages.

::: solution
1. **Solve the second equation for $v_1$.** It gives $v_1 = 2v_2$.
2. **Substitute into the first.**
   $$4v_2 - v_2 = 10$$
   $$\begin{aligned} v_2 &= \frac{10}{3} \\ &= 3.33\ \text{V} \end{aligned}$$
3. **Back to $v_1$.**
   $$\begin{aligned} v_1 &= \frac{20}{3} \\ &= 6.67\ \text{V} \end{aligned}$$
4. **Row picture.** In the row picture, the two lines cross at $(6.67, 3.33)$.

**Answer:** $v_1$ = 6.67 V and $v_2$ = 3.33 V.
:::
:::

::: example
## When would two KCL equations have no solution, or infinitely many?

::: solution
1. **When it happens.** Only if their lines are parallel: the left sides are multiples of each other.
2. **Real circuits.** A real resistor circuit with a ground never does this.
3. **Where it comes from.** It happens in a model with a mistake, such as a node with no path to ground, whose voltage the equations can't pin down.

**Answer:** only when the two lines are parallel, which for a circuit means a mistake in the model, such as a node with no path to ground.
:::
:::

::: example
## A 10 V source feeds node 1 through 1 kΩ. Node 1 has 1 kΩ to ground and 1 kΩ to node 2, and node 2 has 1 kΩ to ground. Find both node voltages.

::: solution
1. **KCL at node 1.** Working in volts, milliamps and kilohms, the currents leaving sum to zero:
   $$(v_1 - 10) + v_1 + (v_1 - v_2) = 0$$
   or $3v_1 - v_2 = 10$.
2. **KCL at node 2.**
   $$(v_2 - v_1) + v_2 = 0$$
   or $-v_1 + 2v_2 = 0$.
3. **Solve.** The second equation gives $v_1 = 2v_2$. Substituting:
   $$6v_2 - v_2 = 10$$
   so $v_2$ = 2 V and $v_1$ = 4 V.
4. **Row picture.** Two lines in the $(v_1, v_2)$ plane, meeting at $(4, 2)$.

**Answer:** $v_1$ = 4 V and $v_2$ = 2 V.
:::
:::

::: check
kind: parts
given: R = 1k | 2k | 5k Ω

## In the circuit above, make all four resistors {R}, with $V_s$ = 10 V.

::: part
answer: 3/R
unit: S
tolerance: 0.5%

### What is $G_{11}$, the total conductance touching node 1?

::: misses
- [1/R] Three resistors touch node 1: $R_1$, $R_2$ and $R_3$. Add all three conductances.
- [2/R] Count again: $R_1$, $R_2$ and $R_3$ all connect to node 1.
- [any] Add $1/R$ for each resistor touching node 1.
:::
:::

::: part
answer: -1/R
unit: S
tolerance: 0.5%

### What is $G_{12}$, the entry joining node 1 to node 2?

::: misses
- [1/R] Off-diagonal entries are minus the conductance between the two nodes.
- [any] It's $-1/R_3$.
:::
:::

::: part
answer: 4
unit: V
tolerance: 0.5%

### Solve for $V_1$.

::: misses
- [5] That's what a plain divider of $R_1$ and $R_2$ would give. $R_3$ and $R_4$ also draw current from node 1.
- [2] That's $V_2$.
- [any] Node 2's equation gives $V_2 = V_1/2$; put that into node 1's and solve.
:::
:::

::: part
answer: 2
unit: V
tolerance: 0.5%

### And $V_2$?

::: misses
- [4] That's $V_1$. $R_3$ and $R_4$ halve it.
- [any] $V_2 = V_1 R_4/(R_3 + R_4)$.
:::
:::

::: right
Right. Notice that the answer doesn't depend on {R}: when every resistance scales together, the voltages stay the same.
:::
:::

::: check
given: a1 = 2..5 int; b1 = 1..3 int; a2 = 1..3 int; b2 = 4..6 int; x = -3 | -1 | 1 | 3; y = -4 | -2 | 2 | 4; let c1 = a1*x + b1*y; let c2 = a2*x - b2*y
answer: x
tolerance: 0.001

## Solve for $x$: $\;\given{a1}x + \given{b1}y = \given{c1}$, $\;\given{a2}x - \given{b2}y = \given{c2}$.

::: right
Right. Eliminating y (multiply the first equation by {b2}, the second by {b1}, and add) gives x = {answer}.
:::

::: misses
- [y] That's y. The question asks for x.
- [any] Not yet. Eliminate y: scale the equations so the y terms cancel when you add them.
:::
:::

::: check
kind: choice

## On the graph of the two node equations, what does the crossing point represent?

- [ ] The voltage source's value
- [x] The pair of node voltages that satisfies both nodes' current laws at once: the circuit's actual voltages
- [ ] The current through $R_3$
- [ ] Nothing physical

::: right
Right. Each line holds the voltage pairs that balance one node's currents; only the crossing balances both.
:::

::: misses
- [1] The source's value only sets where node 1's line sits.
- [3] Currents follow from the voltages, but the point itself is a pair of voltages.
- [4] It's the operating point of the circuit.
:::
:::

::: check
kind: parts
given: V = 5 | 10 | 12; k = 1 | 2 | 4

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

::: part
answer: V/(2 + 3/k)
unit: V
tolerance: 0.5%

### What is $v_2$?

::: misses
- [any] KCL at node 2 gives $v_1 = v_2(1 + 1/k)$; put that into node 1's equation, $3v_1 - v_2 = V$.
:::
:::

::: part
answer: V*(1 + 1/k)/(2 + 3/k)
unit: V
tolerance: 0.5%

### What is $v_1$?

::: misses
- [V/2] That ignores the current drawn into node 2.
- [any] $v_1 = v_2(1 + 1/k)$.
:::
:::
:::

::: check
kind: derivation
vars: g = 0.5..5, v = 1..10

## A node with conductance $g$ to ground is fed from a source $v$ through 1 S.

::: step
answer: v/(1 + g)

### KCL says $(x - v) + gx = 0$. What is the node voltage $x$?
:::

::: step
answer: g*v/(1 + g)

### What current flows through $g$?
:::

::: right
Right. One node, one equation: $x = \frac{v}{1 + g}$, the voltage divider written as KCL.
:::
:::

::: check
kind: parts
given: V1 = 5 | 12; V2 = 3 | -5 | 8; k = 1 | 2 | 10; let d = (2 + 1/k)^2 - 1/k^2

## Node 1 is fed from {V1} V through 1 kΩ and node 2 from {V2} V through 1 kΩ. Each node also has 1 kΩ to ground, and {k} kΩ joins the two nodes. Write KCL at both nodes and solve.

::: part
answer: ((2 + 1/k)*V1 + V2/k)/d
unit: V
tolerance: 0.5%

### What is $v_1$?

::: misses
- [V1/2] That ignores node 2. The {k} kΩ link couples the two nodes, so both equations have to be solved together.
- [((2 + 1/k)*V1 - V2/k)/d] Check the sign of the coupling: current flows from the higher node to the lower one, so $v_2$ pushes $v_1$ toward itself.
- [any] Not yet. KCL at node 1 is $(2 + 1/\given{k})v_1 - v_2/\given{k} = \given{V1}$, in kΩ and mA; write node 2's the same way and solve.
:::
:::

::: part
answer: ((2 + 1/k)*V2 + V1/k)/d
unit: V
tolerance: 0.5%

### What is $v_2$?

::: misses
- [V2/2] That ignores node 1's pull through the {k} kΩ link.
- [any] Not yet. Node 2's equation is $(2 + 1/\given{k})v_2 - v_1/\given{k} = \given{V2}$.
:::
:::

::: right
Right. Each node's equation contains the other's voltage, so neither can be found alone: that's why circuits produce simultaneous equations. A larger linking resistor weakens the coupling, and each node heads toward half its own source.
:::
:::

::: explain
## Why does a circuit with two unknown node voltages need two equations solved together?

::: model
Each node's current law involves its own voltage and its neighbors' voltages, because the current through a resistor joining two nodes depends on the difference between them. So the equation for node 1 contains $V_2$ and the equation for node 2 contains $V_1$: neither can be solved alone. Two equations in two unknowns pin down both values at once, at the point where both are satisfied.
:::
:::

::: practice

::: check
given: Ra = 1k..10k E12 Ω; Rb = 1k..10k E12 Ω; Rc = 1k..10k E12 Ω
answer: 1/Ra + 1/Rb + 1/Rc
unit: S
tolerance: 0.5%

## A node connects to three resistors, {Ra}, {Rb} and {Rc}. What is its diagonal entry in the conductance matrix?

::: misses
- [Ra + Rb + Rc] The matrix uses conductances, $1/R$.
- [any] Add the three conductances.
:::
:::

::: check
given: a = 2..5 int; b = 1..3 int; x = -3 | -1 | 1 | 3; y = -4 | -2 | 2 | 4; let c1 = a*x + b*y; let c2 = x - y
answer: y
tolerance: 0.001

## Solve for $y$: $\;\given{a}x + \given{b}y = \given{c1}$, $\;x - y = \given{c2}$.

::: misses
- [x] That's x.
- [any] From the second equation, $x = y + \given{c2}$; substitute into the first.
:::
:::

::: check
given: Vs = 5..20 int; R1 = 1 | 3 | 5 | 7 | 9; R2 = 2 | 4 | 6 | 8
answer: Vs*R2/(R1 + R2)
unit: V
tolerance: 0.5%

## With only $R_1$ = {R1} kΩ and $R_2$ = {R2} kΩ (a plain divider from {Vs} V), node 1's equation is $\frac{V_1 - V_s}{R_1} + \frac{V_1}{R_2} = 0$. Solve for $V_1$.

::: misses
- [Vs*R1/(R1 + R2)] That's the voltage across $R_1$. Node 1 sits across $R_2$.
- [any] Collect the $V_1$ terms and solve.
:::
:::
:::
