Sub topic 2
Kirchhoff's Current Law Refresher
Nodal analysis rests on one rule: Kirchhoff's current law (KCL). This chapter restates KCL precisely and fixes a sign convention. It also shows how to turn each branch current into a voltage expression, and it lists the mistakes that most often break nodal equations later.
This chapter assumes you already know the following:
- Voltage, current, and resistance, including the reference direction of a current.
- Ohm's law, V = I R.
- Series and parallel resistor combinations.
- How to solve a small linear system.
What KCL says
A node is a point where two or more circuit elements join. In the lumped circuit model, every wire between elements counts as part of the same node, because an ideal wire has no resistance and holds the same voltage everywhere.
KCL states that the algebraic sum of the currents at any node is zero at every instant:
- Currents entering the node, summed, equal currents leaving the node, summed.
- Equivalently, if you give each current a sign, the signed sum is 0.
The reason is conservation of charge. In the lumped model, a node cannot store charge. Any charge that flows in must flow out at the same rate.
The law is about current, not voltage. It does not care what the elements are. A resistor, a battery, and a current source all obey it.
Choosing a sign convention
You can write KCL with currents entering as positive or with currents leaving as positive. Both give the same final answers. Nodal analysis uses one specific choice, so adopt it now.
| Convention | Equation at a node | Typical use |
|---|---|---|
| Sum of currents leaving = 0 | Each resistor contributes (V_node − V_other) / R | Nodal analysis (this tutorial) |
| Sum of currents entering = 0 | Each resistor contributes (V_other − V_node) / R | Equivalent, but easier to get backwards |
| Entering = leaving | Two sums, one on each side | Quick hand checks on a single node |
In this tutorial, currents leaving the node are positive. The reason is that a current leaving through a resistor has a clean formula. The current flows from the node toward the other end, so it is positive when the node's voltage is higher than the other end's.
From KCL to voltages
Consider a resistor R between node k and node j. Take its current to flow from k to j. Ohm's law gives
I = (Vk − Vj) / R = G (Vk − Vj), where G = 1/R.
The quantity G is the conductance, measured in siemens (S). This current leaves node k, so it appears with a plus sign in node k's equation. The same current enters node j, so it appears with a minus sign in node j's equation.
For a node k with several resistors, KCL becomes
Σ Gkj (Vk − V_j) = 0 (sum over all resistors touching node k).
If a resistor goes to ground, Vj = 0 and the term is just G Vk. If a current source touches the node, it contributes a known current instead of a voltage expression. Chapter 6 covers that case.
A worked example
A node X connects to three elements:
- A 12 V source through a 4 Ω resistor.
- Ground through a 6 Ω resistor.
- Ground through a 12 Ω resistor.
Write KCL with leaving currents positive:
(Vx − 12)/4 + Vx/6 + V_x/12 = 0
Multiply every term by 12 to clear the fractions:
3(Vx − 12) + 2 Vx + Vx = 0 6 Vx = 36 V_x = 6 V
Now find each branch current leaving X:
- Through the 4 Ω resistor: (6 − 12)/4 = −1.5 A. The negative sign means 1.5 A actually flows into X from the source.
- Through the 6 Ω resistor: 6/6 = 1 A leaving.
- Through the 12 Ω resistor: 6/12 = 0.5 A leaving.
The sum is −1.5 + 1 + 0.5 = 0, as KCL requires.
The negative sign is not an error. Signs in nodal analysis come from the reference directions you chose, not from the true flow direction. If a computed current is negative, the real current runs opposite to the arrow you assumed.
Checking KCL numerically
You can confirm this with a short script. It computes each leaving current from the node voltages and sums them.
v_x = 6.0
v_source = 12.0
# Each entry: (description, voltage at the far end, resistance in ohms)
branches = [
("4 ohm to 12 V source", v_source, 4.0),
("6 ohm to ground", 0.0, 6.0),
("12 ohm to ground", 0.0, 12.0),
]
total = 0.0
for name, v_far, r in branches:
leaving = (v_x - v_far) / r
total += leaving
print(f"{name}: {leaving:+.3f} A leaving X")
print(f"Sum of leaving currents: {total:.3f} A")The script prints −1.500, +1.000, and +0.500 A, then a sum of 0.000 A. Chapter 11 uses the same idea to verify full solutions.
KCL for a group of nodes
KCL also holds for any closed boundary drawn around part of a circuit. The total current crossing the boundary is zero, because charge cannot accumulate inside it. Inside the boundary, many currents may be unknown, but you only need the ones that cross it.
This is how supernodes work. When a voltage source connects two non-reference nodes, you cannot write the source's current as a function of voltage. Instead, you draw one boundary around both nodes and write a single KCL equation for the pair. Chapter 9 develops this fully.
How many independent KCL equations?
A circuit with N nodes has N equations of the form "sum of leaving currents = 0". They are not all independent. Every branch current leaves one node and enters another. When you add all N equations, each current appears once with a plus sign and once with a minus sign, so the total is 0 = 0.
Therefore any one equation follows from the other N − 1. This is why nodal analysis picks a reference node and writes only N − 1 equations. The following code shows the dependence for a three-node loop. Each column is a branch, +1 marks the node it leaves, and −1 marks the node it enters.
import numpy as np
# Branches: 0 -> 1, 1 -> 2, 2 -> 0 (columns). Nodes 0, 1, 2 (rows).
A = np.array([
[ 1, 0, -1],
[-1, 1, 0],
[ 0, -1, 1],
])
print(A.sum(axis=0)) # [0 0 0]: every column sums to zero
print(np.linalg.matrix_rank(A)) # 2: only N - 1 rows are independentThe column sums are all zero, so the rows add up to the zero vector. The rank is 2, which is N − 1 for N = 3.
Common errors
- Mixing conventions inside one equation. If one term is "current leaving" and another is "current entering", the equation is wrong. Pick leaving for every term at every node.
- Reversing the voltage difference. For a current leaving node k toward node j, the expression is (Vk − Vj), with the node you are writing the equation for first. Writing (Vj − Vk) flips that term's sign.
- Applying Ohm's law across a source. A voltage source has a fixed voltage but an unknown current, so you cannot write its current as G times a voltage difference. Use a known node voltage or a supernode instead.
- Forgetting a branch. Count the elements touching the node. A missing resistor or source is the most common cause of a failed KCL check.
- Treating series elements as separate nodes. Two elements in series carry the same current. Only a point where three or more elements meet is a node you need to write an equation for.
- Assuming a negative result is wrong. A negative branch current only means the actual direction is opposite to your assumed arrow.
Summary of the working rule
For every non-reference node k:
- List every element touching k.
- For each resistor, write G (Vk − Vother) as the current leaving k.
- For each current source, write its signed contribution: positive if it pulls current out of k, negative if it pushes current into k.
- Set the sum to 0.
The next chapters build on this rule: how to choose the reference node, how to label the unknowns, and how to assemble the equations into matrix form.
Exercise
A node Y connects to three resistors that go to nodes at 10 V, 4 V, and 0 V (ground). The resistances are 2 Ω, 4 Ω, and 8 Ω respectively. Write the KCL equation with leaving currents positive, solve for V_y, and give the current in each resistor leaving Y.
Show answer
The equation is (Vy − 10)/2 + (Vy − 4)/4 + Vy/8 = 0. Multiply by 8: 4(Vy − 10) + 2(Vy − 4) + Vy = 0, so 7 Vy = 48 and Vy = 48/7, about 6.857 V. The leaving currents are (6.857 − 10)/2 = −1.571 A, (6.857 − 4)/4 = 0.714 A, and 6.857/8 = 0.857 A. These sum to 0 within rounding error.
Exercise
A student writes KCL at a node with two resistors as (V1 − V2)/Ra + (V2 − V3)/Rb = 0 for node 2. What is wrong, and what is the corrected equation?
Show answer
The first term uses (V1 − V2), which is the current entering node 2 from node 1, while the second term uses (V2 − V3), which is the current leaving node 2. The terms use opposite conventions. With leaving currents positive, the equation is (V2 − V1)/Ra + (V2 − V3)/Rb = 0.
Exercise
A circuit has 6 nodes, including the reference node. How many independent KCL equations does it have, and why is the sixth equation redundant?
Show answer
There are 5 independent equations. Each branch current leaves one node and enters another, so adding all 6 node equations cancels every current and gives 0 = 0. Any one equation therefore follows from the other five.