Sub topic 11
Solving Multi-Loop Circuits with Mesh Currents
This chapter assumes you can write a single-loop KVL equation with the passive sign convention, apply Ohm's law, and solve a small linear system. You should also know the statement of Kirchhoff's current law (KCL): the currents entering a node sum to zero. Here you combine all three to solve circuits that have more than one loop.
Why one loop is not enough
In a series circuit, one current flows through every element, so one KVL equation is enough. When a circuit has a branch shared by two loops, the current in that branch is not known in advance, and a single equation cannot find it.
Mesh analysis handles this with a systematic method. You assign one unknown current to each mesh. You write one KVL equation per mesh. You then solve the resulting linear system.
A mesh is a loop that contains no other loop inside it. A planar circuit with a given number of meshes needs exactly that many independent KVL equations.
Mesh currents are bookkeeping, not physical currents
A mesh current is a loop current that circulates around one mesh. It is a mathematical device. No single wire necessarily carries exactly that current.
- A branch that belongs to only one mesh carries that mesh current.
- A branch shared by two meshes carries the difference of the two mesh currents.
- The sign of the difference depends on which mesh current you take as the reference direction.
Because each mesh current enters and leaves every node it touches, KCL is satisfied automatically at every node. This is the reason mesh analysis needs only KVL equations. KCL is built into the definition of the unknowns.
The procedure
- Identify the meshes. Count them and label each with a mesh current.
- Choose a direction for every mesh current. Use clockwise for all of them. This makes every shared-branch term have the same form and keeps the matrix symmetric.
- For each mesh, walk around it in the direction of its mesh current. Write a KVL equation.
- For each resistor, the voltage drop is the resistance times the current in the direction of the walk. For a shared resistor, use the mesh current of the mesh you are walking minus the mesh current of the neighbouring mesh.
- For each source, count it as a rise if you meet the minus terminal first, and a drop if you meet the plus terminal first.
- Collect the unknowns on the left and the source terms on the right.
- Solve the system.
- Compute branch currents, voltages and powers, then check them.
Worked example
Take the circuit in the diagram above. Mesh 1 holds a 10 V source and R1 = 2 ohm. Mesh 2 holds R3 = 6 ohm and a 4 V source that acts as a voltage drop in the clockwise direction. The resistor R2 = 4 ohm is shared.
Walking clockwise around mesh 1, the source is a rise of 10 V. The drops are 2 I1 across R1 and 4 (I1 - I2) across R2.
-10 + 2*I1 + 4*(I1 - I2) = 0Collecting terms gives 6 I1 - 4 I2 = 10.
Walking clockwise around mesh 2, the current I2 flows through R2 in the opposite sense to I1, so the drop across R2 is 4 (I2 - I1). Then comes the 6 ohm drop and the 4 V drop.
4*(I2 - I1) + 6*I2 + 4 = 0Collecting terms gives -4 I1 + 10 I2 = -4.
In matrix form:
| Equation | Coefficient of I1 | Coefficient of I2 | Right side |
|---|---|---|---|
| Mesh 1 | 6 | -4 | 10 |
| Mesh 2 | -4 | 10 | -4 |
The diagonal entries are the total resistance in each mesh (2 + 4 = 6 and 4 + 6 = 10). The off-diagonal entries are the negative of the shared resistance. This pattern holds whenever all mesh currents run in the same rotational direction and the circuit contains only resistors and independent voltage sources.
The code below solves the system and checks the residual.
import numpy as np
# Two meshes, both with clockwise mesh currents I1 and I2.
# Mesh 1: 10 V source, R1 = 2 ohm, shared R2 = 4 ohm.
# Mesh 2: shared R2 = 4 ohm, R3 = 6 ohm, and a 4 V source that is a
# voltage drop in the clockwise direction.
#
# KVL mesh 1: -10 + 2*I1 + 4*(I1 - I2) = 0 -> 6*I1 - 4*I2 = 10
# KVL mesh 2: 4*(I2 - I1) + 6*I2 + 4 = 0 -> -4*I1 + 10*I2 = -4
A = np.array([[6.0, -4.0],
[-4.0, 10.0]])
b = np.array([10.0, -4.0])
I1, I2 = np.linalg.solve(A, b)
print(f"I1 = {I1:.4f} A, I2 = {I2:.4f} A") # about 1.9091 A and 0.3636 A
print(f"Current in shared R2 = {I1 - I2:.4f} A") # about 1.5455 A
# Residual of each mesh equation should be zero.
print(A @ np.array([I1, I2]) - b)The solution is I1 = 21/11 A, about 1.9091 A, and I2 = 4/11 A, about 0.3636 A. The current through R2, directed downward in the direction of I1 on that branch, is I1 - I2 = 17/11 A, about 1.5455 A.
Note that I2 is positive, so mesh 2 really does circulate clockwise even though its own 4 V source opposes that direction. Mesh 1 drives current through the shared resistor, and that is enough to overcome the 4 V source.
Checking the answer
Two checks catch most errors.
Loop sum
Substitute the currents back into each original KVL equation, not the collected form. For mesh 1, the drops are 2 (1.9091) = 3.8182 V and 4 (1.5455) = 6.1818 V. Their sum is 10.0000 V, which equals the source rise.
For mesh 2, the drop across R2 is 4 (I2 - I1) = -6.1818 V. The drop across R3 is 6 (0.3636) = 2.1818 V. The source drop is 4 V. The sum is -6.1818 + 2.1818 + 4 = 0, as required.
Power balance
Total power absorbed by all elements must equal total power delivered by the sources.
- R1 absorbs 2 (1.9091)^2 = 7.2893 W.
- R2 absorbs 4 (1.5455)^2 = 9.5537 W.
- R3 absorbs 6 (0.3636)^2 = 0.7934 W.
- The resistors absorb 17.6364 W in total.
The 10 V source delivers 10 (1.9091) = 19.0909 W. The 4 V source carries I2 = 0.3636 A into its plus terminal in the clockwise direction, so it absorbs 4 (0.3636) = 1.4545 W. Delivered power minus absorbed power by the 4 V source is 19.0909 - 1.4545 = 17.6364 W. This matches the resistor total.
A source can absorb power. A positive current entering the plus terminal means the source is being charged, not discharging.
Choosing directions and handling signs
You may choose any direction for a mesh current. The final sign tells you the true direction. A negative answer means the current runs opposite to the arrow you drew. It does not mean you made an error.
Choosing all clockwise currents is a convention for speed and for a clean matrix, not a requirement. If you mix directions, the off-diagonal terms become positive for those pairs, and the matrix is no longer in the familiar form. The answers for branch currents stay the same.
Circuits with current sources
An ideal current source has a fixed current but an unknown voltage. This changes the method.
- If a current source lies in only one mesh, that mesh current is known. It equals the source current with the appropriate sign. You skip the KVL equation for that mesh, because you cannot write it without the unknown source voltage.
- If a current source lies on a branch shared by two meshes, you cannot write KVL through it either. Combine the two meshes into a supermesh. The supermesh equation is a KVL equation around the outer boundary of both meshes, leaving out the source branch. You also add a constraint equation from the source, such as I1 - I2 = I_s.
The count still works. Each mesh contributes one equation, either a KVL equation, a known-current equation, or a constraint.
Common mistakes
- Mixing up the sign of the shared-resistor term. Always write (own mesh current) minus (neighbour mesh current) when walking your own mesh.
- Forgetting the neighbour's current in a shared branch, and using only I1 across R2.
- Treating the source polarity the wrong way. Decide rise or drop by which terminal you meet first, not by the arrow you drew for current.
- Writing KVL through a current source without introducing its voltage as an unknown.
- Reading a mesh current as the current in every branch of that mesh. Only unshared branches carry exactly the mesh current.
Summary of the method
Mesh analysis converts a multi-loop circuit into a linear system with one equation per mesh. KCL is satisfied by construction. KVL supplies the equations. Ohm's law converts voltage drops into current terms. A loop sum and a power balance confirm the result.
Exercise
A circuit has two clockwise meshes sharing a 5 ohm resistor. Mesh 1 has a 9 V source (a rise) and a 1 ohm resistor. Mesh 2 has a 3 ohm resistor and no source. Find I1, I2 and the current in the shared resistor.
Show answer
Mesh 1: -9 + 1I1 + 5(I1 - I2) = 0, so 6 I1 - 5 I2 = 9. Mesh 2: 5(I2 - I1) + 3I2 = 0, so -5 I1 + 8 I2 = 0, which gives I2 = 5 I1 / 8. Substituting: 6 I1 - 25 I1 / 8 = 9, so 23 I1 / 8 = 9 and I1 = 72/23, about 3.130 A. Then I2 = 45/23, about 1.957 A. The shared resistor carries I1 - I2 = 27/23, about 1.174 A.
Exercise
In the worked example, the 4 V source in mesh 2 is reversed so that it is a rise in the clockwise direction. Write the new mesh 2 equation and state how the right side of the matrix equation changes.
Show answer
Mesh 2 becomes 4(I2 - I1) + 6I2 - 4 = 0, which collects to -4 I1 + 10 I2 = 4. The right side of the matrix equation changes from [10, -4] to [10, 4]. The coefficient matrix does not change, because it depends only on the resistors.
Exercise
Why does mesh analysis not need a separate KCL equation at each node?
Show answer
Each mesh current is a closed loop, so it enters and leaves every node it passes through. Branch currents are built from differences of mesh currents, so the currents at every node already sum to zero. KCL holds by construction.