Sub topic 6
Choosing directions and signs consistently
Mesh analysis produces correct answers only when every sign in every equation follows one rule. This chapter fixes that rule. It assumes you know Ohm's law, KVL around a single loop, and how to solve two or three linear equations. It also assumes you can already spot the meshes of a planar circuit.
Why signs are the main source of errors
When a mesh analysis goes wrong, the cause is rarely the algebra. It is usually a sign error that was already in the equations. A wrong sign on one shared resistor or one source gives a clean-looking answer that does not match the circuit.
Two kinds of choice carry signs:
- The direction you assign to each mesh current.
- The sign of each term you write when you apply KVL.
The directions are arbitrary. The signs are not. Once you pick a direction, KVL fixes every sign that follows. If a mesh current comes out negative, the current simply flows opposite to the direction you chose. Nothing is wrong.
Step 1: Pick a direction for each mesh current
Draw one arrow inside each mesh and label it $i1, i2, \dots$. The recommended convention is that every mesh current is clockwise. The reason is the shared branch.
Look at two adjacent meshes that share a resistor $Rs$. If both currents are clockwise, they pass through $Rs$ in opposite directions. The current in $R_s$ is the difference of the two mesh currents. Every shared resistor then appears with the same sign pattern, which makes the equations regular and the matrix form symmetric.
| Choice | Currents in a shared branch | Sign of shared-resistor term in the other mesh |
|---|---|---|
| Both clockwise | Opposite directions | Negative |
| One clockwise, one counterclockwise | Same direction | Positive |
Mixed directions are legal. You get the same physical answer. They only make errors more likely, so use them only when you have a reason.
Step 2: Write voltage drops across resistors
Walk around the mesh in the direction of its own mesh current. Current flowing in the direction of travel produces a voltage drop across a resistor. Ohm's law gives the size of the drop.
For mesh $k$ with resistor $R$, the term depends on which currents flow through $R$:
- If only mesh $k$'s current flows through $R$, the drop is $+R\,i_k$.
- If $R$ is shared with mesh $m$ and both currents are clockwise, the net current in the direction of travel is $ik - im$. The drop is $R\,(ik - im)$.
Writing the shared drop as $R\,(ik - im)$ is the safest habit. It forces you to state the current in the direction you are traveling.
Step 3: Write signs for voltage sources
For sources, the sign depends on the direction of travel through the source, not on the mesh current.
As you walk around the mesh in the direction of $i_k$, look at which source terminal you reach first:
| You enter the source at | You leave at | Effect on the loop | Where it goes in the equation |
|---|---|---|---|
| Negative terminal | Positive terminal | Voltage rise | Source vector entry is $+V$ |
| Positive terminal | Negative terminal | Voltage drop | Source vector entry is $-V$ |
Writing KVL as "sum of drops equals sum of rises" gives
$$\sum (\text{resistor drops}) = \sum (\text{source rises}).$$
The right side is the source-vector entry for that mesh. Resistor terms stay on the left. A source that pushes current in the direction of your mesh current enters with a plus sign. A source that opposes it enters with a minus sign.
The procedure as a flow
The sequence below works for any planar resistive circuit with voltage sources.
Worked example
Take the two-mesh circuit used in the Python example for this tutorial.
- Mesh 1 contains $V1 = 10\ \text{V}$, $R1 = 2\ \Omega$, and the shared resistor $R_2 = 4\ \Omega$.
- Mesh 2 contains the shared $R2$, $R3 = 6\ \Omega$, and $V_2 = 5\ \text{V}$.
- $V1$ aids the clockwise current in mesh 1. $V2$ opposes the clockwise current in mesh 2.
Both mesh currents are clockwise.
Mesh 1. Walking clockwise, the drops are $R1 i1$ and $R2 (i1 - i2)$. The source $V1$ is a rise.
$$2 i1 + 4 (i1 - i_2) = 10$$
Mesh 2. Walking clockwise, the drops are $R2 (i2 - i1)$ and $R3 i2$. The source $V2$ opposes the walking direction, so you cross it from positive to negative, which is a drop of $5\ \text{V}$. Moving it to the right side gives a rise of $-5$.
$$4 (i2 - i1) + 6 i_2 = -5$$
Collect terms:
$$6 i1 - 4 i2 = 10$$ $$-4 i1 + 10 i2 = -5$$
Check the pattern. The diagonal entries are positive and equal the total resistance around each mesh. The off-diagonal entries are negative and equal the shared resistance. The source vector is $[10, -5]$. This pattern is the sign check you can run before solving anything.
Solving gives $i1 = 80/44 \approx 1.818\ \text{A}$ and $i2 = 10/44 \approx 0.227\ \text{A}$. The current in $R2$, in mesh 1's direction, is $i1 - i_2 \approx 1.591\ \text{A}$.
A mixed-direction mesh gives the same physics
To confirm that the direction choice is arbitrary, reverse mesh 2 so it is counterclockwise. Call its current $j2$. Now both $i1$ and $j2$ pass through $R2$ in the same direction, so the shared current is $i1 + j2$.
In mesh 2, walking counterclockwise, $V_2$ is now a rise of $+5$. The equations become
$$6 i1 + 4 j2 = 10$$ $$4 i1 + 10 j2 = 5$$
The off-diagonal entries are now positive. The code below solves both versions and compares the shared-branch current.
import numpy as np
R1, R2, R3 = 2.0, 4.0, 6.0
V1, V2 = 10.0, 5.0
# Version A: both meshes clockwise.
RA = np.array([[R1 + R2, -R2],
[-R2, R2 + R3]])
vA = np.array([V1, -V2])
i1, i2 = np.linalg.solve(RA, vA)
shared_A = i1 - i2
# Version B: mesh 2 counterclockwise (current j2).
RB = np.array([[R1 + R2, R2],
[R2, R2 + R3]])
vB = np.array([V1, V2])
i1b, j2 = np.linalg.solve(RB, vB)
shared_B = i1b + j2
print(f"A: i1 = {i1:.4f} A, i2 = {i2:.4f} A, shared = {shared_A:.4f} A")
print(f"B: i1 = {i1b:.4f} A, j2 = {j2:.4f} A, shared = {shared_B:.4f} A")
print(f"Same physical current in R2: {np.isclose(shared_A, shared_B)}")
print(f"j2 equals -i2: {np.isclose(j2, -i2)}")The program reports the same shared-branch current of about 1.5909 A in both versions. It also shows that $j2 = -i2$, so reversing a mesh current only flips the sign of that unknown.
Common sign errors
These are the mistakes that appear most often.
- Treating a shared resistor as if only one mesh current flows through it. Write the drop as $R\,(ik - im)$ so both currents appear.
- Taking the source sign from the arrow in the circuit diagram. The sign depends on the terminal you enter first, given your direction of travel.
- Mixing mesh directions without adjusting the off-diagonal signs. Each shared resistor gets a minus sign for an opposed pair and a plus sign for an aligned pair.
- Moving a source across the equals sign without flipping its sign. A drop on the left becomes a negative rise on the right.
- Reading a negative answer as an error. A negative mesh current means the real current opposes the arrow you drew.
Checking signs with a quick sanity test
Two fast checks catch most mistakes before you start solving:
- Symmetry. In a circuit with only resistors and independent voltage sources, entry $(k, m)$ of the resistance matrix equals entry $(m, k)$. An asymmetric matrix means a sign or a shared-resistor value is wrong.
- Dominance. Each diagonal entry is at least the sum of the magnitudes of the off-diagonal entries in its row, because the mesh's own resistance includes every shared resistor. If it is smaller, you left out a resistor.
These checks do not prove the source vector is right. For that, use the power-balance check covered later in this tutorial.
Exercise
A mesh has a 12 V source and a 3 ohm resistor. The mesh current i1 is clockwise. Walking clockwise you enter the source at its positive terminal and leave at its negative terminal. The mesh shares a 5 ohm resistor with mesh 2, whose current i2 is also clockwise. Write the KVL equation for mesh 1 and state the signs of the matrix entries it gives.
Show answer
Entering at the positive terminal and leaving at the negative one is a voltage drop, so the source contributes -12 V on the right side. The drops are 3 i1 + 5 (i1 - i2) = -12, which simplifies to 8 i1 - 5 i2 = -12. The diagonal entry +8 is the total resistance in mesh 1. The off-diagonal entry -5 is the negative of the shared resistance, as expected when both currents are clockwise.
Exercise
In the worked example, mesh 2 is redrawn with a counterclockwise current j2. The shared 4 ohm resistor is still shared with mesh 1, whose current i1 is clockwise. What sign does the off-diagonal entry take, and why?
Show answer
The entry is +4. Clockwise i1 and counterclockwise j2 pass through the shared resistor in the same direction, so the current in it is i1 + j2. The mesh 1 equation has the term 4 (i1 + j2), which puts +4 on j2.