Circuit to equations
Nodal analysis turns a circuit into equations. Pick a reference node, ground, at 0 V. The other two nodes have unknown voltages, v1 and v2, measured from ground. Two unknowns need two equations.
KCL at node 1: current leaving through resistors equals source current entering. Leaving through R1 is v1/R1; through R2 it is (v1 − v2)/R2. So v1/1k + (v1 − v2)/1k = 6 mA.
Same rule at node 2. Leaving through R2 back toward node 1 is (v2 − v1)/R2; leaving through R3 is v2/R3. Source I2 brings 1 mA in. So (v2 − v1)/1k + v2/2k = 1 mA.
The matrix
Conductance is G = 1/R, measured in siemens (S). Here G1 = 1 mS, G2 = 1 mS, G3 = 0.5 mS. Collect the v1 and v2 terms: 2v1 − v2 = 6 and −v1 + 1.5v2 = 1. Millisiemens times volts gives milliamps.
Stack the two equations as a matrix: G v = i. Read G straight off the circuit. Each diagonal entry is the total conductance touching that node. Each off-diagonal entry is minus the conductance joining the two nodes, so G is symmetric.
Each row is a straight line in the v1–v2 plane: every point on it satisfies one node's KCL. Only where the two lines cross are both nodes balanced. That crossing, v1 = 5 V and v2 = 4 V, is the answer.
Solving it
The determinant Δ tells whether a single answer exists. For a 2×2 matrix, multiply the diagonal and subtract the other product: Δ = 2×1.5 − (−1)(−1) = 2 mS². Not zero, so the lines cross exactly once.
Cramer's rule: replace column k of G with i, take that determinant, divide by Δ. Δ1 = 6×1.5 − (−1)(1) = 10, so v1 = 10/2 = 5 V. Δ2 = 2×1 − (6)(−1) = 8, so v2 = 4 V.
Gaussian elimination: add 0.5 × row 1 to row 2. The v1 term cancels, leaving 1·v2 = 4, so v2 = 4 V. The new row is a level line through the same crossing. Back-substitute: v1 = (6 + 4)/2 = 5 V.
Put the answer back. R1 carries 5 mA, R2 1 mA, R3 2 mA. Node 1: 6 in = 5 + 1 out. Node 2: 1 + 1 = 2. Sources supply 34 mW; resistors absorb 25 + 1 + 8 = 34 mW.
G depends only on the resistors. Invert it once and any source values give v = G⁻¹i at once. Raise I2 to 3 mA: v1 = 6 V, v2 = 6 V. Circuit simulators such as SPICE solve these matrix equations for thousands of nodes.
What is happening
# step 1/11 · unknowns
# about: Node 1 (v1), Node 2 (v2), Reference node (0 V)
reference node ground, 0 V by choice
node 1 voltage v1 (unknown)
node 2 voltage v2 (unknown)
n non-reference nodes → n unknowns
→ n KCL equations
Once v1 and v2 are known, Ohm's law
gives every branch current.
The figure is an ideal DC circuit: current sources of 6 mA and 1 mA, resistors of 1, 1 and 2 kΩ, and wires with no resistance. Every voltage, current, matrix entry and power shown is computed from these values by the lesson's model. Working in kΩ, mS, mA and V keeps the numbers small: 1 mS × 1 V = 1 mA, and 1 mA × 1 V = 1 mW.