Case Study 3.2 — Currents in a Circuit: Kirchhoff's Laws as a Linear System
Field: electrical engineering / physics. This case study shows a system whose coefficient matrix is square and invertible, giving a unique solution, and reinforces the chapter's row-and-column reading on a problem you can hold in your hands.
The problem: how much current flows where?
Build a simple circuit on a breadboard: a $10$-volt battery drives current through one resistor, after which the current splits at a junction and flows through two parallel branches with their own resistors before rejoining. A natural, practical question is: how much current flows in each branch? You cannot read it off directly — the branches interact, because the voltage the battery supplies has to be shared out across the whole network in a way that obeys two physical laws simultaneously. As with Leontief's economy in the companion case study, "everything constrains everything," and that is the signature of a system of linear equations.
The two governing laws, due to Gustav Kirchhoff (1845) [verify], are both linear, which is exactly why the analysis reduces to the machinery of this chapter:
- Kirchhoff's Current Law (KCL): at any junction, the current flowing in equals the current flowing out. (Charge is conserved.)
- Kirchhoff's Voltage Law (KVL): around any closed loop, the voltage rises and drops sum to zero. (Energy is conserved.)
Each law, applied to our circuit, produces one linear equation in the unknown currents. Collect them and you have a square system $A\mathbf{x} = \mathbf{b}$.
Setting it up
Label the three currents $I_1, I_2, I_3$ (in amperes). $I_1$ is the current leaving the battery through a $2\,\Omega$ resistor; at the junction it splits into $I_2$ through a $4\,\Omega$ branch and $I_3$ through a $6\,\Omega$ branch. We write one equation from KCL and two from KVL.
KCL at the junction. Current in equals current out: $I_1 = I_2 + I_3$, which we rearrange into standard form, $$I_1 - I_2 - I_3 = 0.$$
KVL around the first loop (battery → $2\,\Omega$ → $4\,\Omega$ branch → back). The battery supplies $10$ V; the drops are $2 I_1$ across the first resistor and $4 I_2$ across the $4\,\Omega$ branch (using Ohm's law, voltage $=$ resistance $\times$ current): $$2 I_1 + 4 I_2 = 10.$$
KVL around the inner loop (the two parallel branches, $4\,\Omega$ and $6\,\Omega$, share the same voltage). The drop across the $4\,\Omega$ branch equals the drop across the $6\,\Omega$ branch: $4 I_2 = 6 I_3$, i.e. $$4 I_2 - 6 I_3 = 0.$$
Three equations, three unknowns. In matrix form $A\mathbf{x} = \mathbf{b}$ with $\mathbf{x} = (I_1, I_2, I_3)^{\mathsf{T}}$:
$$ A = \begin{bmatrix} 1 & -1 & -1 \\ 2 & 4 & 0 \\ 0 & 4 & -6 \end{bmatrix}, \qquad \mathbf{b} = \begin{bmatrix} 0 \\ 10 \\ 0 \end{bmatrix}. $$
The two pictures
In the row picture, each equation is a plane in the three-dimensional "current space" whose axes are $I_1, I_2, I_3$. The physically realized currents are the single point where all three planes intersect — if they intersect at one point. The KCL plane passes through the origin (zero currents trivially conserve charge); the two KVL planes are tilted by the resistor values and the battery voltage. We expect a unique intersection because the three physical constraints are genuinely independent — KCL is not derivable from the two KVL equations, and the two loops are distinct.
In the column picture, we ask whether the source vector $\mathbf{b} = (0, 10, 0)^{\mathsf{T}}$ — which encodes "no net current imbalance, $10$ volts of drive in loop one, balanced inner loop" — can be written as a combination $I_1 \mathbf{a}_1 + I_2 \mathbf{a}_2 + I_3 \mathbf{a}_3$ of the coefficient columns. The columns describe how each unit of current in a branch contributes to the conservation balances; the solution is the unique blend of branch currents whose combined effect equals the driving vector. Independent columns guarantee that blend is unique.
Solving and verifying
Because the three constraints are independent, the coefficient matrix is invertible (nonzero determinant), so the chapter's square-system dichotomy promises exactly one solution:
# Kirchhoff: solve A x = b for the three branch currents I1, I2, I3.
import numpy as np
A = np.array([[1.0, -1.0, -1.0], # KCL: I1 - I2 - I3 = 0
[2.0, 4.0, 0.0], # KVL loop 1: 2 I1 + 4 I2 = 10
[0.0, 4.0, -6.0]]) # KVL inner: 4 I2 - 6 I3 = 0
b = np.array([0.0, 10.0, 0.0])
print("det(A) =", round(np.linalg.det(A), 4)) # -> -44.0 (nonzero => unique)
I = np.linalg.solve(A, b)
print("currents =", np.round(I, 4)) # -> [2.2727 1.3636 0.9091]
print("KCL check:", round(I[0] - I[1] - I[2], 6)) # -> 0.0 (current in = current out)
The solver returns $I_1 \approx 2.2727$ A, $I_2 \approx 1.3636$ A, $I_3 \approx 0.9091$ A — in exact fractions, $\tfrac{25}{11}$, $\tfrac{15}{11}$, and $\tfrac{10}{11}$ amperes. The determinant is $-44$, decisively nonzero, which is the chapter's algebraic certificate that the three planes meet at exactly one point (and that the column combination is unique). The KCL check confirms charge conservation: $I_1 = I_2 + I_3$ since $\tfrac{25}{11} = \tfrac{15}{11} + \tfrac{10}{11}$. Two sanity checks, both passing — exactly the verification habit the chapter trains.
We can also read the physics back out. More current ($1.3636$ A) flows through the $4\,\Omega$ branch than through the $6\,\Omega$ branch ($0.9091$ A), as it must: current prefers the path of lower resistance, and the $4{:}6$ resistor ratio produces the $0.9091 : 1.3636$ — that is, $2{:}3$ — current split. The mathematics of the linear system reproduces Ohm's intuition exactly.
One more independent check ties the solution to energy conservation, the physical principle behind KVL. The power dissipated in a resistor is $P = I^2 R$, and the total dissipated power must equal the power the battery delivers, $P = V I_1$:
# Energy check: power dissipated in the resistors == power from the battery.
I1, I2, I3 = 25/11, 15/11, 10/11
dissipated = I1**2 * 2 + I2**2 * 4 + I3**2 * 6
delivered = 10 * I1
print(round(dissipated, 4), round(delivered, 4)) # -> 22.7273 22.7273
Both come to $22.73$ watts. That the same solution vector satisfies an equation we never put into the system — energy balance — is a strong sign the model and its solution are correct, and it illustrates a recurring benefit of linear-systems thinking: a unique solution, certified by a nonzero determinant, is consistent with every valid physical law at once, not merely the ones we happened to write down.
What if the circuit were under- or over-constrained?
The chapter's trichotomy has direct electrical meaning. Suppose you redundantly wrote KCL at both ends of the same single wire — you would get two identical equations, the coefficient matrix would lose rank, and the system would become dependent (infinitely many "solutions" in the math), signaling that you had not actually pinned down the currents and needed another independent loop equation. Conversely, if you wrote a fourth equation that contradicted the others — say, by mis-stating the battery voltage in one loop — the system would become inconsistent, and np.linalg.solve would either refuse (singular) or, with a genuinely over-determined non-square system, you would turn to np.linalg.lstsq to find the best-fit currents and inspect the residual. In circuit analysis the inconsistent case usually means a modeling error: real charge and energy are always conserved, so a contradiction is the algebra catching a mistake in your equations, precisely as the chapter's "$0 = c$" contradiction warned.
What this case study illustrates
A tangible breadboard circuit became a square linear system $A\mathbf{x} = \mathbf{b}$ the moment we wrote down Kirchhoff's two conservation laws — both of them linear, which is the whole reason the analysis is tractable. The row picture is three planes meeting at one point in current space; the column picture asks whether the driving vector is a unique combination of the coefficient columns; and the nonzero determinant certifies, in a single number, that the solution exists and is unique. Unlike the economics case, here the answer is a crisp unique point rather than a balance of a self-consuming web — a clean illustration of the invertible branch of the dichotomy. And the linearity means superposition holds: double the battery voltage and every current doubles, a fact engineers exploit constantly (the "superposition theorem" of circuit theory is literally the Chapter 1 principle applied to $A\mathbf{x} = \mathbf{b}$). From grain bundles to economies to the current in a wire, the same handful of ideas — a system, its two pictures, and the shape of its solution set — keep doing the work.