Sub topic 6
Choosing directions and signs consistently
This chapter assumes you can apply Ohm's law and KVL to a single loop, and that you can solve a two-by-two linear system. Most mistakes in mesh analysis come from signs, not algebra. A few fixed rules remove almost all of them.
Pick one direction for every mesh
A mesh current is a loop current you assign to each mesh. Its direction is arbitrary, because a negative answer only means the real current flows the other way. Make it a habit to draw every mesh current clockwise. With that choice, any resistor shared by two meshes carries the two currents in opposite directions. This fixes the sign pattern of the equations.
Sign rules for the equations
Write KVL for each mesh while travelling in the direction of its own mesh current.
- Resistor drops. A resistor in the mesh contributes +R times its own mesh current. The current enters at the end where you arrive, so this is a voltage drop.
- Shared resistors. A resistor shared with a neighbouring mesh also contributes −R times the neighbour's current. With both meshes clockwise, the neighbour's current opposes yours through that resistor.
- Sources. Put a source on the right-hand side as a rise (+) if your travel direction goes from its − terminal to its + terminal. Use a drop (−) if you go from + to −.
Collected into matrix form, these rules give:
- Diagonal entries are the sum of all resistances in that mesh, so they are always positive.
- Off-diagonal entries are minus the shared resistance, so they are always negative or zero.
- The matrix is symmetric when all meshes are clockwise and the circuit contains only resistors and independent sources.
Worked example
Mesh 1 contains V1 = 10 V, R1 = 2 Ω, and the shared R2 = 4 Ω. Mesh 2 contains R2, R3 = 6 Ω, and V2 = 5 V. Travelling clockwise in mesh 2, you enter V2 at its + terminal, so it is a drop.
- Mesh 1: (2 + 4)i1 − 4i2 = 10
- Mesh 2: −4i1 + (4 + 6)i2 = −5
The solution is i1 ≈ 1.818 A and i2 ≈ 0.227 A. The branch current in R2 is i1 − i2, taken in mesh 1's direction. The subtraction appears because the two clockwise currents oppose each other in that branch.
What happens if you reverse a mesh
You may flip a mesh direction, for example to match a diagram. Then the off-diagonal entry changes sign and the source on that mesh flips with it. This code solves the example again with mesh 2 counterclockwise.
import numpy as np
# Mesh 1 clockwise, mesh 2 counterclockwise.
# Through R2 the two currents now point the same way, so the off-diagonal is +4.
# V2 opposed the clockwise current, so it now aids the counterclockwise one: +5.
R = np.array([[6.0, 4.0],
[4.0, 10.0]])
v = np.array([10.0, 5.0])
i1, i2_ccw = np.linalg.solve(R, v)
print(f"i1 = {i1:.4f} A, i2 (counterclockwise) = {i2_ccw:.4f} A")
print(f"Current through R2 (mesh 1 direction) = {i1 + i2_ccw:.4f} A")The output is i1 = 1.8182 A and i2 = −0.2273 A. This is the same physical answer: the counterclockwise current is the negative of the earlier clockwise one. The branch current in R2 is now i1 + i2, which equals 2.0455 A as before. The all-clockwise convention is simply easier to check, since every off-diagonal term is negative.
Common errors
| Error | Symptom | Fix |
|---|---|---|
| Mixed directions without adjusting signs | Off-diagonal terms have the wrong sign | Use all clockwise, or flip signs deliberately |
| Source polarity read backwards | Answers differ from a simulator | Check which terminal your travel direction enters |
| Using the + terminal as the current direction | Source sign wrong | Judge by travel direction, not by the sign printed on the symbol alone |
| Subtracting a neighbour's current from the diagonal | Matrix not symmetric | Apply shared-resistor terms only in the off-diagonal |
Exercise
In the worked example, V2 is reversed so that it aids the clockwise current in mesh 2. With both meshes still clockwise, what are the new resistance matrix and source vector?
Show answer
The resistance matrix does not change: [[6, -4], [-4, 10]]. The source vector becomes [10, +5], because V2 is now a rise in mesh 2's travel direction.