---
title: Mesh analysis
heading: Loop currents, and KVL around each loop
eyebrow: C1 · Lesson 10 · Mesh analysis
xp: 50
---

::: hook
Nodal analysis writes KCL at every node. Mesh analysis does the opposite: it imagines a current circulating around each window of the circuit and writes KVL around each one. Where two loops share a resistor, the real current is the difference of the two loop currents. For circuits with many nodes but few loops, such as a ladder of sources in series, it gives fewer equations.

::: play
- Two sources, each with its own resistor, share the middle resistor $R_2$. The meters read the current in each resistor.
- Which way does the current in $R_2$ flow? Set $V_2$ equal to $V_1$, then much larger.
- Check: the current in $R_2$ is the difference between the currents in $R_1$ and $R_3$ (KCL at the middle node).
:::
:::

```sim circuit
V1 in 0 12          @ 0,0 down
R1 in a 1k          @ 0,0 right
R2 a 0 2k           @ 2,0 down
R3 b a 1k           @ 4,0 left
V2 b 0 6            @ 4,0 down
slider: V2.amp 0..24
slider: R2 100..10k log
scope: v(a)
time: 0..1m s
meter: i(R1), i(R2), i(R3)
```

::: predict
## Two loop currents, $i_1$ = 5 mA and $i_2$ = 2 mA, both circulate clockwise in neighboring meshes. What current flows in the resistor they share?

- [ ] 7 mA
- [x] 3 mA
- [ ] 5 mA
- [ ] 2.5 mA

::: reveal
3 mA. Going clockwise, the two loops pass through the shared resistor in opposite directions, so the actual current there is the difference, $i_1 - i_2$, in the direction of $i_1$. Mesh currents are bookkeeping devices: the current in an outside resistor equals its loop's current, and a shared resistor carries the difference.
:::
:::

::: nameit
## The method

1. **Draw a clockwise mesh current** in each window of the circuit (a loop with no other loop inside it): $i_1$, $i_2$, ...
2. **Write KVL around each mesh**, going clockwise. A resistor that only mesh 1 passes through drops $Ri_1$; one shared with mesh 2 drops $R(i_1 - i_2)$.
3. **Solve** for the mesh currents, then find any branch current from them.

For the circuit above, with $V_1$ in mesh 1 and $V_2$ in mesh 2 (both + at the top):

$$\begin{aligned} \text{mesh 1:}\quad & V_1 - R_1i_1 - R_2(i_1 - i_2) = 0 \\ \text{mesh 2:}\quad & -R_3i_2 - V_2 - R_2(i_2 - i_1) = 0 \end{aligned}$$

**The matrix form**, $\mathbf{R}\mathbf{i} = \mathbf{v}$:

$$\begin{pmatrix} R_1 + R_2 & -R_2 \\ -R_2 & R_2 + R_3 \end{pmatrix}\begin{pmatrix} i_1 \\ i_2 \end{pmatrix} = \begin{pmatrix} V_1 \\ -V_2 \end{pmatrix}$$

The pattern mirrors nodal analysis:

- **diagonal**: the total resistance around the mesh;
- **off-diagonal**: minus the resistance shared by the two meshes;
- **right-hand side**: the sum of source voltages around the mesh, counted positive when they push current clockwise.

**Current sources.** A current source on an outside branch fixes that mesh's current. One shared by two meshes makes a **supermesh**: write KVL around the loop that avoids it, plus the source's equation $i_1 - i_2 = I$.

**Choosing a method.** Nodal analysis needs one equation per node (minus ground); mesh analysis needs one per window. Pick the smaller count. Nodal analysis works for every circuit, while mesh analysis needs a circuit that can be drawn flat with no crossing wires (a **planar** circuit), which is why simulators use nodal analysis.
:::

::: example
## A 10 V source and 1 kΩ form the left window, 1 kΩ the right window, and 1 kΩ is shared. Find the mesh currents, both clockwise.

::: solution
1. **Mesh equations.** In mA and kΩ:
   $$\begin{aligned} 10 &= 2i_1 - i_2 \\ 0 &= -i_1 + 2i_2 \end{aligned}$$
2. **Solve.** The second equation gives $i_2 = i_1/2$, so
   $$\begin{aligned} 10 &= 1.5i_1 \\ i_1 &= 6.67\ \text{mA} \\ i_2 &= 3.33\ \text{mA} \end{aligned}$$
3. **Shared resistor.** It carries their difference, 3.33 mA.

**Answer:** $i_1$ = 6.67 mA and $i_2$ = 3.33 mA, and the shared resistor carries 3.33 mA.
:::
:::

::: example
## In a two-window circuit, a 2 mA source on the right window's outer branch sets $i_2$ = 2 mA. The left window has 10 V and 1 kΩ, and 2 kΩ is shared. Find $i_1$.

::: solution
1. **Left mesh.** Only the left mesh needs an equation:
   $$10 = 1 \cdot i_1 + 2(i_1 - 2)$$
2. **Solve.**
   $$\begin{aligned} 3i_1 &= 14 \\ i_1 &= 4.67\ \text{mA} \end{aligned}$$

**Answer:** $i_1$ = 4.67 mA.
:::
:::

::: example
## The left window has a 12 V source and 2 kΩ; the right window has 1 kΩ and a 6 V source opposing clockwise current; 4 kΩ is shared. Find the mesh currents and the shared resistor's current.

::: solution
1. **Mesh equations.** Clockwise in both windows, in kΩ and mA:
   $$\begin{aligned} 6i_1 - 4i_2 &= 12 \\ -4i_1 + 5i_2 &= -6 \end{aligned}$$
2. **Determinant.**
   $$\begin{aligned} \Delta &= 30 - 16 \\ &= 14 \end{aligned}$$
3. **Solve.**
   $$\begin{aligned} i_1 &= \frac{12 \times 5 + 4 \times (-6)}{14} \\ &= 2.57\ \text{mA} \\ i_2 &= \frac{6 \times (-6) + 4 \times 12}{14} \\ &= 0.857\ \text{mA} \end{aligned}$$
4. **Shared resistor.** The 4 kΩ carries their difference, 1.71 mA downward, and drops 6.86 V.
5. **The 6 V source.** Both currents are positive, so the 6 V source is being charged: current enters its + terminal.

**Answer:** $i_1$ = 2.57 mA and $i_2$ = 0.857 mA, and the shared 4 kΩ carries 1.71 mA downward.
:::
:::

::: check
given: V1 = 10 | 12; V2 = 3 | 5; R1 = 1 | 2; R2 = 3 | 4; R3 = 5 | 6
answer: (V1/R1 + V2/R3)/(1/R1 + 1/R2 + 1/R3)/R2
unit: mA
tolerance: 0.5%

## In the circuit above, $V_1$ = {V1} V, $V_2$ = {V2} V, $R_1$ = {R1} kΩ, $R_2$ = {R2} kΩ and $R_3$ = {R3} kΩ. What current flows down through $R_2$?

::: right
Right. Solving the mesh equations, $i_1 - i_2$ = {answer}. (Nodal analysis on the middle node gives the same.)
:::

::: misses
- [V1/(R1 + R2)] That ignores the second source. Both push current down through R2.
- [V1/(R1 + R2) + V2/(R3 + R2)] Superposing isn't that simple: each source's current divides between R2 and the other branch.
- [any] Not yet. Solve the 2×2 mesh system, then take $i_1 - i_2$.
:::
:::

::: check
given: R1 = 1 | 2.2; R2 = 3.3 | 4.7; R3 = 6.8 | 10
answer: R2 + R3
unit: kΩ
tolerance: 0.5%

## Mesh 2 passes through $R_2$ = {R2} kΩ (shared with mesh 1) and $R_3$ = {R3} kΩ. Mesh 1 also contains $R_1$ = {R1} kΩ. What is the diagonal entry for mesh 2?

::: right
Right. The total resistance around mesh 2: {answer}.
:::

::: misses
- [R1 + R2 + R3] Only count resistors that mesh 2 passes through.
- [R3] Include the shared resistor too.
- [any] Not yet. Add every resistance around mesh 2.
:::
:::

::: check
given: V = 6 | 9 | 12; R1 = 1 | 2; R2 = 3 | 6; R3 = 4 | 8
answer: V*(R2 + R3)/((R1 + R2)*(R2 + R3) - R2^2)
unit: mA
tolerance: 0.5%

## A {V} V source drives $R_1$ = {R1} kΩ in series with the parallel pair $R_2$ = {R2} kΩ and $R_3$ = {R3} kΩ. Using meshes (mesh 1 through the source, $R_1$ and $R_2$; mesh 2 through $R_2$ and $R_3$), what is $i_1$?

::: right
Right. $i_1 = V(R_2 + R_3)/((R_1 + R_2)(R_2 + R_3) - R_2^2)$ = {answer}, the same as $V/(R_1 + R_2 \parallel R_3)$.
:::

::: misses
- [V/(R1 + R2)] Mesh 2 takes part of the current through R3.
- [V/(R1 + R2 + R3)] R2 and R3 are in parallel.
- [any] Not yet. Solve the 2×2 system, or check with series-parallel.
:::
:::

::: check
given: I = 2 | 3 | 5; R1 = 1 | 2; R2 = 3 | 4
answer: I*R2
unit: V
tolerance: 0.5%

## A {I} mA current source sits on the outside branch of mesh 2, so $i_2$ = {I} mA. $R_2$ = {R2} kΩ belongs to mesh 2 only. What voltage is across $R_2$?

::: right
Right. Its current is the mesh current, so $v = i_2R_2$ = {answer}.
:::

::: misses
- [I*(R1 + R2)] Only R2 is in question.
- [any] Not yet. The current source fixes the mesh current.
:::
:::

::: check
kind: choice

## A circuit has 6 nodes (including ground) and 2 windows. Which method needs fewer equations?

- [ ] Nodal: 6 equations
- [ ] Nodal: 5 equations
- [x] Mesh: 2 equations
- [ ] They're always equal

::: right
Right. Nodal needs 5 equations here, mesh only 2.
:::

::: misses
- [1] Ground doesn't need an equation.
- [2] Mesh needs only one per window: 2.
- [4] They depend on different counts.
:::
:::

::: check
kind: parts
given: i = 2 | 3; j = 0.5 | 1; R = 2 | 4; V = 12 | 15

## Mesh currents are {i} mA and {j} mA, both clockwise, sharing a {R} kΩ resistor; mesh 1 contains a {V} V source.

::: part
answer: (i - j)^2*R
unit: mW
tolerance: 0.5%

### What power does the shared resistor absorb?

::: misses
- [i^2*R] The shared resistor carries the difference of the mesh currents.
- [any] $(i_1 - i_2)^2R$.
:::
:::

::: part
answer: V*i
unit: mW
tolerance: 0.5%

### What power does the source deliver?

::: misses
- [any] Its voltage times its mesh current.
:::
:::
:::

::: check
kind: derivation
vars: a = 1..10, b = 1..10, c = 0.1..0.9, V = -20..20, W = -20..20

## Two meshes have resistance rows (a, −c) and (−c, b) and source terms V and W (and c < a, b).

::: step
answer: a*b - c^2

### What's the determinant?
:::

::: step
answer: (V*b + W*c)/(a*b - c^2)

### What's the first mesh current?
:::

::: step
answer: (W*a + V*c)/(a*b - c^2)

### And the second?
:::

::: right
Right. Mesh analysis is nodal analysis's twin, with resistances in place of conductances.
:::
:::

::: explain
## Why does the current in a resistor shared by two meshes equal the difference of the two mesh currents?

::: model
Each mesh current is imagined to circulate all the way around its own loop. A shared resistor is passed through by both loops, but going clockwise in each, they cross it in opposite directions. The actual current in the resistor is the sum of the two, counted with their directions, which is the difference $i_1 - i_2$. Because every mesh current enters and leaves each node it passes through, KCL is satisfied automatically.
:::
:::

::: practice

::: check
given: i1 = 5..9 int; i2 = 1..4 int
answer: i1 - i2
unit: mA
tolerance: 0.5%

## Mesh currents {i1} mA and {i2} mA (both clockwise) share a resistor. Its current, in the direction of $i_1$?

::: misses
- [i1 + i2] They cross the shared resistor in opposite directions.
- [any] $i_1 - i_2$.
:::
:::

::: check
given: R1 = 1 | 2; R2 = 3 | 5
answer: R1 + R2
unit: kΩ
tolerance: 0.5%

## Mesh 1 passes through {R1} kΩ and the shared {R2} kΩ. Its diagonal entry?

::: misses
- [any] Total resistance around the mesh.
:::
:::

::: check
given: R = 1 | 2 | 5
answer: -R
unit: kΩ
tolerance: 0.5%

## Meshes 1 and 2 share a {R} kΩ resistor. What is the off-diagonal entry in their resistance matrix?

::: misses
- [R] With both mesh currents clockwise, the shared term is negative.
- [any] $-R$.
:::
:::
:::
