Sub topic 4
Kirchhoff's Current Law and why mesh currents satisfy it
This chapter assumes you know voltage, current, and resistance, Ohm's law, and how to solve a small linear system. It also assumes you have seen the terms node, branch, and loop. Mesh analysis writes only Kirchhoff's Voltage Law (KVL) equations, so this chapter explains why you never have to write Kirchhoff's Current Law (KCL) equations as well.
Kirchhoff's Current Law
KCL says that the algebraic sum of the currents at any node is zero. A node is a point where two or more circuit elements join. Charge cannot pile up at a node in a DC circuit, so the current flowing in must equal the current flowing out.
Pick one rule and keep it. This chapter counts a current as positive when it leaves the node:
sum of (currents leaving the node) = 0
Equivalently, the sum of the currents entering equals the sum leaving. Both forms say the same thing. Mixing the two conventions in one equation is the most common source of sign errors.
KCL also holds for any closed surface that encloses part of a circuit, not only a single node. Such a region is called a supernode, and the current entering it equals the current leaving it. You will use this idea again when you meet the supermesh.
How many independent KCL equations exist
A circuit with n nodes has only n - 1 independent KCL equations. The nth equation is the negative sum of the others, because every branch current leaves one node and enters another. In nodal analysis you pick a reference node for this reason.
Why mesh currents satisfy KCL automatically
A mesh current is a loop current. It circulates around a closed path and never starts or stops anywhere. Think about what that means at a node.
- Suppose a mesh current reaches a node along one branch.
- The mesh is a closed loop, so the same current must continue along the next branch of that loop.
- At that node, the mesh current contributes +i to the current entering and +i to the current leaving.
- The net contribution of that mesh to the KCL sum at that node is zero.
A node's KCL sum is the sum of contributions from every mesh passing through it. Each contribution is zero, so the total is zero for any values of the mesh currents. KCL is satisfied by construction, before you solve anything.
This is why a circuit with b branches and n nodes needs only b - n + 1 equations in mesh analysis. That count equals the number of meshes in a planar circuit. The mesh currents already encode the n - 1 KCL equations, and KVL supplies the rest.
Branch currents from mesh currents
Every branch current is the algebraic sum of the mesh currents that pass through that branch.
| Branch location | Meshes through it | Branch current |
|---|---|---|
| On the outer edge of the circuit | One | That mesh current, with a sign set by direction |
| Shared by two meshes | Two | Sum of the two, signed by direction |
For two clockwise mesh currents, the two meshes run in opposite directions through the shared branch. The shared-branch current in mesh 1's direction is therefore i1 - i2.
A worked example
Use the two-mesh circuit from this tutorial's running example. Mesh 1 contains V1 = 10 V, R1 = 2 ohm, and the shared resistor R2 = 4 ohm. Mesh 2 contains R2, R3 = 6 ohm, and V2 = 5 V opposing the clockwise current. Both mesh currents are clockwise.
KVL around each mesh gives:
- Mesh 1: (R1 + R2) i1 - R2 i2 = V1, so 6 i1 - 4 i2 = 10
- Mesh 2: -R2 i1 + (R2 + R3) i2 = -V2, so -4 i1 + 10 i2 = -5
The determinant is 6(10) - (-4)(-4) = 44. Cramer's rule gives:
- i1 = (10 × 10 - (-4)(-5)) / 44 = 80/44 ≈ 1.818 A
- i2 = (6 × (-5) - (-4)(10)) / 44 = 10/44 ≈ 0.227 A
The middle branch carries i1 - i2 = 70/44 ≈ 1.591 A, flowing downward through R2.
Now check KCL at the top node, where the three branches meet. Mesh 1 runs up the left branch and across the top, so its current i1 enters the node from the left. Mesh 2 runs up through R2 and across the top, then down the right branch. At the top node:
- Entering: i1 from the left branch.
- Leaving: i1 - i2 down through R2, and i2 down the right branch.
The sum leaving is (i1 - i2) + i2 = i1, which equals the current entering. KCL holds for any i1 and i2, not only for the solved values.
Checking KCL numerically
You can show the same thing with matrices. Let the branches be b1 (left, reference direction up), b2 (middle, down), and b3 (right, down). Let the nodes be the top node and the bottom node.
- The node-branch matrix A has a row per node. An entry is +1 if the branch current leaves that node, -1 if it enters, and 0 otherwise. KCL says A j = 0 for the branch current vector j.
- The mesh-branch matrix M has a row per mesh. An entry is +1 if the clockwise mesh current runs along the branch's reference direction, -1 if it runs against it, and 0 if the mesh does not touch the branch. The branch currents are j = M^T i.
The following script builds both matrices. It then draws random mesh currents and confirms that the resulting branch currents satisfy KCL.
import numpy as np
# Branches: b1 = left (up), b2 = middle R2 (down), b3 = right (down)
# Nodes: top, bottom. +1 means the branch current leaves the node.
A = np.array([[-1, 1, 1], # top node
[ 1, -1, -1]]) # bottom node
# Meshes: both clockwise.
# Mesh 1 goes up b1 and down b2. Mesh 2 goes up b2 (against b2's
# reference direction) and down b3.
M = np.array([[1, 1, 0],
[0, -1, 1]])
# KCL holds for the structure itself: A @ M.T is the zero matrix.
print("A @ M.T =")
print(A @ M.T)
# Any mesh currents give branch currents that satisfy KCL.
rng = np.random.default_rng(0)
i = rng.normal(size=2)
j = M.T @ i
print("mesh currents:", np.round(i, 4))
print("branch currents:", np.round(j, 4))
print("KCL residual at each node:", np.round(A @ j, 12))
# The solved example: i1 = 80/44, i2 = 10/44
i = np.array([80 / 44, 10 / 44])
j = M.T @ i
print("example branch currents:", np.round(j, 4))
print("KCL residual:", np.round(A @ j, 12))The product A M^T is zero because each mesh row of M is a closed loop. Each loop enters and leaves every node it touches. This property does not depend on the resistor or source values.
What KCL does and does not do in mesh analysis
- It does not give you equations to solve. Mesh currents already satisfy it.
- It does give you a way to recover branch currents. Add the mesh currents through each branch, with signs.
- It gives you a check. Compute each branch current from the mesh currents, then confirm the sum at a node is zero. This catches arithmetic slips in your branch-current bookkeeping, though it cannot catch an error in the KVL equations. A wrong mesh equation still gives branch currents that balance at every node.
- It becomes a constraint when a current source sits in a branch shared by two meshes. The source fixes the difference between the two mesh currents, for example i1 - i2 = 3 A. That is a KCL statement about the shared branch, and it is the extra equation used in the supermesh.
Common errors
- Mixed mesh directions. If one mesh is clockwise and another counterclockwise, the shared-branch current becomes a sum instead of a difference. KCL still holds, but your KVL signs for the resistance matrix change. Using clockwise throughout keeps the off-diagonal terms negative.
- Forgetting the sign on a shared branch. The shared branch carries i1 - i2 in mesh 1's direction and i2 - i1 in mesh 2's direction. Report the direction you mean.
- Treating KCL as a check of the KVL equations. Node balance of the branch currents is guaranteed whatever values you got. It confirms your bookkeeping, not your solution.
- Counting meshes wrongly. The number of mesh currents must equal b - n + 1. If you have too few, you lose independence. If you have too many, a loop that encloses another loop is redundant.
Exercise
A planar circuit has 7 branches and 5 nodes. How many mesh currents do you need, and how many independent KCL equations does the circuit have?
Show answer
The number of meshes is b - n + 1 = 7 - 5 + 1 = 3 mesh currents. The number of independent KCL equations is n - 1 = 4. Since 3 + 4 = 7 = b, the mesh currents and the KCL equations together account for all branch currents.
Exercise
In a two-mesh circuit with both mesh currents clockwise, i1 = 3 A and i2 = 5 A. What current flows through the shared branch in mesh 1's direction, and in which direction does it really flow? Confirm KCL at a node where the shared branch meets the two outer branches.
Show answer
The shared-branch current in mesh 1's direction is i1 - i2 = 3 - 5 = -2 A. The negative sign means 2 A flows in mesh 2's direction instead. At the top node, 3 A enters through the outer branch of mesh 1. The shared branch contributes -2 A leaving (that is, 2 A entering), and 5 A leaves through the outer branch of mesh 2. Entering is 3 + 2 = 5 A, leaving is 5 A, so KCL holds.