Sub topic 5
Writing KCL Equations at Each Node
This chapter assumes you know Ohm's law, Kirchhoff's current law (KCL), series and parallel resistors, and how to solve a small linear system. It also assumes you have already chosen a reference node and labeled the other node voltages.
The idea
After you pick a reference node (ground, 0 V), every other node gets one unknown voltage. Nodal analysis writes one KCL equation per unknown node. Three unknown nodes give three equations in three unknowns.
For each resistor, Ohm's law gives the current in terms of the node voltages at its ends. With conductance g = 1/R, the current from node a to node b is:
i = g (Va − Vb)
If b is ground, Vb = 0 and the current is just g Va.
A repeatable procedure
- Pick a non-reference node and choose a direction convention. A common choice is "currents leaving the node" with a sum of zero.
- For every resistor touching that node, write g (Vthis − Vother).
- Add the current sources. A source pushing current into the node counts as a negative leaving current, or equivalently moves to the right-hand side as a positive number.
- Set the sum equal to zero and collect terms.
- Repeat for every other non-reference node.
Keep the same convention at every node. Mixing "entering" and "leaving" is the most common source of sign errors.
Worked example
A 2 A current source feeds node 1. R1 = 4 Ω connects node 1 to ground. R2 = 2 Ω connects node 1 to node 2. R3 = 6 Ω connects node 2 to ground.
Node 1. Currents leaving node 1 through the resistors equal the 2 A entering:
(1/4) V1 + (1/2)(V1 − V2) = 2
Collecting terms:
(1/4 + 1/2) V1 − (1/2) V2 = 2
Node 2. No source is attached, so the leaving currents sum to zero:
(1/2)(V2 − V1) + (1/6) V2 = 0
Collecting terms:
−(1/2) V1 + (1/2 + 1/6) V2 = 0
From the second equation, (2/3) V2 = (1/2) V1, so V2 = (3/4) V1. Substitute into the first:
(3/4) V1 − (3/8) V1 = 2, so (3/8) V1 = 2 and V1 = 16/3 V ≈ 5.333 V.
Then V2 = (3/4)(16/3) = 4 V.
You can confirm this with code:
import numpy as np
# R1 = 4 ohm (node 1 to ground), R2 = 2 ohm (node 1 to node 2), R3 = 6 ohm (node 2 to ground).
g1, g2, g3 = 1/4, 1/2, 1/6
G = np.array([[g1 + g2, -g2],
[-g2, g2 + g3]])
i = np.array([2.0, 0.0])
v = np.linalg.solve(G, i)
print(v) # [5.33333333 4. ]Patterns to notice
Look at the coefficients in the two equations.
- The coefficient of a node's own voltage is the sum of all conductances touching that node. For node 1 this is 1/4 + 1/2.
- The coefficient of another node's voltage is the negative of the conductance between the two nodes. Between nodes 1 and 2 this is −1/2.
- The right-hand side holds the net source current entering the node.
These patterns let you write each equation directly by inspection, and they lead to the matrix form in the next chapter.
Common errors
- Wrong sign on the neighbor term. The current through R2 leaving node 1 is g2 (V1 − V2), not g2 (V2 − V1).
- Using resistance instead of conductance. If you write V/R, divide by R. Do not multiply by R.
- Forgetting a branch. Count the resistors touching the node and confirm each appears once.
- Switching conventions. Decide on "leaving" or "entering" and keep it for every node.
Exercise
A 3 A source feeds node 1. R1 = 1 Ω connects node 1 to ground. R2 = 1 Ω connects node 1 to node 2. R3 = 2 Ω connects node 2 to ground. Write the two KCL equations (leaving-current convention) and solve for V1 and V2.
Show answer
Node 1: 1·V1 + 1·(V1 − V2) = 3, which is 2 V1 − V2 = 3. Node 2: 1·(V2 − V1) + (1/2) V2 = 0, which is −V1 + 1.5 V2 = 0. The second equation gives V1 = 1.5 V2. Substituting gives 3 V2 − V2 = 3, so V2 = 1.5 V and V1 = 2.25 V.
Exercise
In the worked example, what is the current through R2, and in which direction does it flow?
Show answer
I = g2 (V1 − V2) = (1/2)(16/3 − 4) = (1/2)(4/3) = 2/3 A. It is positive, so it flows from node 1 to node 2.