Sub topic 5
Writing KCL Equations at Each Node
This chapter assumes you can apply Ohm's law, state Kirchhoff's current law (KCL), and solve two or three linear equations by hand. It also assumes you can pick a reference node and label the other node voltages, as the previous chapters covered. Here you turn a labeled circuit into a set of equations.
One Equation per Unknown Node
A circuit with N nodes has N − 1 unknown node voltages once one node is the reference at 0 V. KCL gives one independent equation for each unknown node. The result is N − 1 equations in N − 1 unknowns, which you can solve.
The procedure for every non-reference node k is the same:
- List every branch that touches node k.
- Write the current in each branch as a function of node voltages, taking the current to be leaving node k.
- Add the leaving currents and set the sum equal to zero, or equal to the source current entering the node.
Branch Current from Node Voltages
A resistor R between nodes a and b carries a current from a to b of
i(a→b) = (Va − Vb) / R = g (Va − Vb)
where g = 1/R is the conductance in siemens (S). The current flows from the higher voltage to the lower one. If Va is lower than Vb, the result is negative, which means the current really flows from b to a. You do not need to guess the true direction in advance.
If node b is the reference node, then Vb = 0 and the current simplifies to Va / R. Every resistor connected to ground contributes a term with a single voltage.
The "Leaving" Convention
Pick one convention and use it on every node. This chapter uses currents leaving the node.
- A resistor from node k to node j contributes g (Vk − Vj).
- A resistor from node k to ground contributes g Vk.
- A current source pushing I into node k is a current arriving, so it moves to the right-hand side as +I.
- A current source pulling I out of node k contributes −I on the right-hand side.
So each equation reads: sum of resistor currents leaving node k = sum of source currents entering node k.
Worked Example: Two Nodes
A 2 A source feeds node 1. Resistor R1 = 4 Ω connects node 1 to ground. Resistor R2 = 2 Ω connects node 1 to node 2. Resistor R3 = 6 Ω connects node 2 to ground.
Node 1. Two resistors leave node 1, and the source enters it:
V1/4 + (V1 − V2)/2 = 2
Node 2. Two resistors leave node 2, and no source touches it:
(V2 − V1)/2 + V2/6 = 0
Collect the terms:
- Node 1: 0.75 V1 − 0.5 V2 = 2
- Node 2: −0.5 V1 + (2/3) V2 = 0
The second equation gives V2 = 0.75 V1. Substituting into the first gives 0.75 V1 − 0.375 V1 = 2, so 0.375 V1 = 2 and V1 = 16/3 V ≈ 5.333 V. Then V2 = 4 V.
Check the branch currents. R1 carries (16/3)/4 = 4/3 A to ground. R2 carries (16/3 − 4)/2 = 2/3 A toward node 2. R3 carries 4/6 = 2/3 A to ground. At node 1, 4/3 + 2/3 = 2 A, which matches the source. At node 2, 2/3 A arrives and 2/3 A leaves.
The Pattern in Each Equation
Look at the collected form of the node 1 equation: 0.75 V1 − 0.5 V2. The coefficient 0.75 is 1/4 + 1/2, the sum of the conductances touching node 1. The coefficient −0.5 is minus the conductance between nodes 1 and 2. This pattern holds in every resistive circuit without dependent sources.
| Part of the equation | What it contains | Sign |
|---|---|---|
| Coefficient of Vk | Sum of all conductances connected to node k | Positive |
| Coefficient of Vj (j ≠ k) | Conductance of the resistors directly between k and j | Negative |
| Right-hand side | Source currents entering node k, minus those leaving | As written |
This pattern is why the equations later fit naturally into the matrix form G v = i. For now, use it as a way to check your own bookkeeping. If a coefficient does not match the table, you have probably dropped a branch.
A Three-Node Example
A larger ladder shows the same steps. A 6 A source feeds node 1. The resistors are:
- R1 = 2 Ω from node 1 to ground
- R2 = 1 Ω from node 1 to node 2
- R3 = 2 Ω from node 2 to ground
- R4 = 1 Ω from node 2 to node 3
- R5 = 1 Ω from node 3 to ground
Write the leaving currents at each node:
- Node 1: V1/2 + (V1 − V2)/1 = 6
- Node 2: (V2 − V1)/1 + V2/2 + (V2 − V3)/1 = 0
- Node 3: (V3 − V2)/1 + V3/1 = 0
Collected:
- 1.5 V1 − V2 = 6
- −V1 + 2.5 V2 − V3 = 0
- −V2 + 2 V3 = 0
The third equation gives V3 = V2/2. Substituting into the second gives −V1 + 2.5 V2 − 0.5 V2 = 0, so V1 = 2 V2. The first equation becomes 3 V2 − V2 = 6, so V2 = 3 V, V1 = 6 V and V3 = 1.5 V.
A series-parallel reduction confirms this. R4 + R5 = 2 Ω in parallel with R3 gives 1 Ω. Adding R2 gives 2 Ω, which in parallel with R1 gives 1 Ω. So V1 = 6 A × 1 Ω = 6 V.
Checking Equations with a Short Script
A residual check is a cheap way to catch a wrong equation or a wrong solution. The script below computes the current leaving each node from the node voltages and compares it with the source current entering that node.
# Each resistor is (node_a, node_b, ohms); node 0 is ground.
resistors = [(1, 0, 2.0), (1, 2, 1.0), (2, 0, 2.0), (2, 3, 1.0), (3, 0, 1.0)]
injected = {1: 6.0, 2: 0.0, 3: 0.0} # source current entering each node
v = {0: 0.0, 1: 6.0, 2: 3.0, 3: 1.5} # candidate solution
for node in (1, 2, 3):
leaving = 0.0
for a, b, r in resistors:
if a == node:
leaving += (v[a] - v[b]) / r
elif b == node:
leaving += (v[b] - v[a]) / r
print(node, leaving, injected[node])
# 1 6.0 6.0
# 2 0.0 0.0
# 3 0.0 0.0Each pair of printed numbers should match. A mismatch tells you which node has the problem.
Common Errors
- Mixed directions. Writing (V1 − V2) in one term and (V2 − V1) in another term at the same node breaks the equation. Always put the voltage of the node you are writing the equation for first.
- Missing ground branches. A resistor to ground contributes g Vk even though no second voltage appears. Forgetting it is the most common mistake in two-node problems.
- Wrong source sign. A source pushing current into node k goes on the right-hand side as a positive number. A source pulling current out of it goes there as a negative number. Do not move the sign by habit; decide it from the arrow.
- Mixed units. Use ohms with volts and amps, or kilohms with volts and milliamps. Do not mix them in one equation.
- Writing an equation at ground. The reference node has a known voltage and needs no equation.
Exercises
Exercise
A 3 A source feeds node 1. R1 = 2 Ω connects node 1 to ground, R2 = 4 Ω connects node 1 to node 2, and R3 = 4 Ω connects node 2 to ground. Write the KCL equation at each node and solve for V1 and V2.
Show answer
Node 1: V1/2 + (V1 − V2)/4 = 3, which collects to 0.75 V1 − 0.25 V2 = 3. Node 2: (V2 − V1)/4 + V2/4 = 0, which collects to −0.25 V1 + 0.5 V2 = 0. The second equation gives V1 = 2 V2. Substituting: 1.5 V2 − 0.25 V2 = 3, so V2 = 2.4 V and V1 = 4.8 V. Check at node 1: 4.8/2 = 2.4 A through R1 plus (4.8 − 2.4)/4 = 0.6 A through R2 equals 3 A.
Exercise
In the first worked example (2 A source, R1 = 4 Ω, R2 = 2 Ω, R3 = 6 Ω), the source is reversed so that it pulls 2 A out of node 1. What changes in the equations, and what are the new node voltages?
Show answer
Only the right-hand side of the node 1 equation changes, from +2 to −2. The coefficients stay the same because the resistors are unchanged. The system is linear, so both voltages change sign: V1 = −16/3 V and V2 = −4 V.
Exercise
A circuit has five nodes including the reference node. How many KCL equations do you need, and why is the equation at the reference node not needed?
Show answer
You need four equations, one for each non-reference node. The reference node's voltage is defined as 0 V, so it is not an unknown. Its KCL equation is also the negative of the sum of the other four, so it adds no new information.