Sub topic 5
Meshes and Mesh Currents in Planar Circuits
This chapter assumes you know voltage, current and resistance, Ohm's law, and series and parallel resistor combinations. It also assumes you can solve two or three linear equations. Kirchhoff's laws were introduced earlier. Here you decide which loops to use and what unknowns to assign to them. The next chapters cover the equations themselves.
What a mesh is
A loop is any closed path through the circuit that visits each node at most once. A mesh is a loop that contains no other loop inside it. In a circuit drawn on a flat page, a mesh is one of the "windows" of the drawing.
A circuit with two side-by-side windows has three loops: the left window, the right window, and the outer path around both. Only the two windows are meshes. The outer loop encloses them, so it is not a mesh.
| Term | Meaning | Count in the two-window circuit |
|---|---|---|
| Node | A point where two or more elements connect | 2 essential nodes (top and bottom) |
| Branch | A path with elements in series between two nodes | 3 |
| Loop | Any closed path | 3 |
| Mesh | A loop with no loop inside it | 2 |
Mesh analysis needs a planar circuit. This is a circuit you can draw on a flat surface without any wire crossing another one. A circuit that looks tangled is still planar if you can redraw it without crossings. Moving a wire around or flipping a branch to the other side of a node often does this.
Counting meshes
For a connected planar circuit, the number of meshes is:
M = B − N + 1
Here B is the number of branches and N is the number of nodes. Count essential nodes only. An essential node is a node where three or more branches meet. Two components in series with nothing else attached form one branch, not two branches with a node between them. Treat any stretch of ideal wire as a single node.
Check this against the two-window circuit. It has B = 3 and N = 2, so M = 3 − 2 + 1 = 2.
The formula tells you how many equations you need before you write any. If your windows count disagrees with the formula, you have probably miscounted a node or missed a branch.
The two-mesh example
The circuit used in this chapter has two essential nodes, N1 on top and N2 on the bottom, joined by three branches:
- Left branch: a 10 V source V1 in series with R1 = 2 Ω.
- Middle branch: R2 = 4 Ω, shared by both meshes.
- Right branch: R3 = 6 Ω in series with a 5 V source V2.
Mesh 1 is the left window, made of the left and middle branches. Mesh 2 is the right window, made of the middle and right branches. R2 is the only element that belongs to both meshes.
What a mesh current is
A mesh current is a current that we imagine circulating around the edge of one mesh. It is a mathematical device, not necessarily a current you could measure with a meter in a given wire.
You assign one mesh current to each mesh, usually called i1, i2, and so on. Each one is an unknown. Because there are M meshes, you get M unknowns, and KVL around each mesh gives M equations.
The physical current in a wire is then built from the mesh currents:
- A branch that belongs to only one mesh (an outer branch) carries exactly that mesh's current.
- A branch shared by two meshes carries the algebraic sum of the two mesh currents. If the two currents run in opposite directions through the branch, you subtract them.
With both mesh currents clockwise, the shared branch R2 sees i1 flowing down and i2 flowing up. The net current downward through R2 is i1 − i2.
Why mesh currents automatically satisfy KCL
Take any node. Each mesh current that arrives at a node through one branch must leave through another branch of the same mesh, because the mesh current follows a closed loop. A closed loop never accumulates charge at a node. So every mesh current contributes zero net current to every node.
Branch currents are sums of mesh currents. A sum of quantities that each add zero at a node also adds zero. KCL therefore holds at every node without you writing any KCL equation. This is why mesh analysis needs only KVL.
Check it on the example. Take every branch current as positive when it flows from N1 down to N2:
- Left branch: the clockwise mesh 1 current flows up the left side, so the branch current is −i1.
- Middle branch: i1 flows down and i2 flows up, so the branch current is i1 − i2.
- Right branch: the clockwise mesh 2 current flows down the right side, so the branch current is +i2.
All three currents leave N1 in the reference direction, so KCL at N1 requires their sum to be zero:
(−i1) + (i1 − i2) + i2 = 0
The mesh currents cancel for any values of i1 and i2.
Bookkeeping branches and meshes in code
Larger circuits get hard to track by eye. A useful habit is to write down, for each branch, a reference direction and which meshes pass through it with which sign. The script below does this for the example. It counts the meshes with M = B − N + 1, solves for the mesh currents, converts them into branch currents, and tests KCL at the top node. The resistance matrix and source vector are only supplied here as inputs. Chapters later in the plan derive them.
import numpy as np
nodes = ["N1", "N2"]
# Reference direction for every branch: N1 (top) -> N2 (bottom).
# Each mesh entry is +1 if a clockwise mesh current flows along the
# reference direction in that branch, and -1 if it flows against it.
branches = {
"left": {"m1": -1},
"middle": {"m1": +1, "m2": -1},
"right": {"m2": +1},
}
num_meshes = len(branches) - len(nodes) + 1
print(f"B = {len(branches)}, N = {len(nodes)}, meshes = {num_meshes}")
# Mesh currents for R1 = 2, R2 = 4, R3 = 6 ohm, V1 = 10 V, V2 = 5 V
R = np.array([[6.0, -4.0],
[-4.0, 10.0]])
v = np.array([10.0, -5.0])
i1, i2 = np.linalg.solve(R, v)
mesh_i = {"m1": i1, "m2": i2}
branch_i = {
name: sum(sign * mesh_i[m] for m, sign in meshes.items())
for name, meshes in branches.items()
}
for name, value in branch_i.items():
print(f"{name:6s} branch current (top to bottom) = {value:+.4f} A")
# All reference directions leave N1, so their sum must be zero.
print(f"KCL at N1: sum = {sum(branch_i.values()):+.2e} A")The output shows the left branch at −1.8182 A. The negative sign means the real current flows up the left branch, which agrees with i1 flowing clockwise there. The middle branch carries +1.5909 A downward and the right branch carries +0.2273 A downward. The KCL sum is zero to within floating-point rounding.
Edge cases when identifying meshes
- Crossing wires. If two wires cross on the page but do not touch, try redrawing the circuit. If no redrawing removes every crossing, the circuit is nonplanar and mesh analysis does not apply. A later chapter covers this case.
- Dangling branches. A branch that connects to nothing at one end carries no current and forms no mesh. Ignore it.
- The outer region. The unbounded area outside the circuit is not a mesh and gets no mesh current.
- Elements on the outer edge. A branch on the boundary belongs to exactly one mesh. Its current equals that mesh current, up to a sign.
- Current sources. A current source in an outer branch fixes that mesh current directly. A current source in a shared branch needs the supermesh technique, which gets its own chapter.
- Shorted branches. A wire in parallel with a resistor shorts it. The resistor carries no current, and that branch is no longer a separate mesh boundary. Redraw first, then count.
Procedure
- Redraw the circuit with no crossing wires. If this is impossible, stop, because the circuit is nonplanar.
- Mark the essential nodes and the branches. Compute M = B − N + 1.
- Identify the M windows. Confirm that the count matches M.
- Give each mesh a current i1 to iM, all clockwise.
- For each branch, note which meshes pass through it and in which direction.
At this point you have the unknowns. Writing KVL for each mesh to get the equations is the next chapter's subject.
Exercise
A planar circuit has 7 branches and 5 essential nodes. How many mesh currents do you need? In a branch shared by mesh 1 and mesh 3, where both clockwise currents flow in opposite directions through the branch, what is the net current in the direction of i1?
Show answer
M = B − N + 1 = 7 − 5 + 1 = 3 mesh currents. Because i1 and i3 flow in opposite directions through the shared branch, the net current in the direction of i1 is i1 − i3.
Exercise
In the two-mesh example, mesh 1 is changed to flow counterclockwise while mesh 2 stays clockwise. With reference direction top to bottom, what is the current in the middle branch in terms of i1 and i2? Why does it differ from the all-clockwise case?
Show answer
A counterclockwise mesh 1 flows up through the middle branch, and a clockwise mesh 2 also flows up there. Both currents run against the top-to-bottom reference, so the branch current is −i1 − i2, a sum instead of a difference. The mesh currents are different unknowns now (i1 has the opposite meaning), so the physical results are the same only after solving. This is why a uniform direction makes shared branches easy to handle.