---
title: Energy stored in the magnetic field
heading: Where an inductor keeps its energy
eyebrow: B6 · Lesson 8 · Magnetic energy
xp: 40
---

::: hook
A capacitor stores energy in its electric field (B3.9). An inductor stores energy too, in its magnetic field, and gives it back when the current falls, sometimes violently, as the spark at a switch shows. A switching power supply runs on this: it fills an inductor's field with energy from the input, then empties it into the output, hundreds of thousands of times a second.

::: play
- An inductor carries current $I$. The curve is its stored energy against current; the dot is your setting.
- Double the current. By what factor does the energy grow?
- The second readout computes the same energy from the field's energy density times the solenoid's volume. Compare them.
:::
:::

```sim plot
view: graph
x: i = 0..5 A
y: U = 0..150 mJ
slider: I = 0..5 step 0.1 = 2 A
slider: N = 100..1000 step 50 = 500
slider: A = 1..10 step 0.5 = 4 cm²
slider: l = 5..20 step 1 = 10 cm
plot: 0.5*4*pi*1e-7*N^2*A*1e-4/(l/100)*i^2*1000*10 | label: ½LI² (× 10)
point: I, 0.5*4*pi*1e-7*N^2*A*1e-4/(l/100)*I^2*1000*10
readout: L = 4*pi*1e-7*N^2*A*1e-4/(l/100)*1000 mH
readout: ½LI² in mJ = 0.5*4*pi*1e-7*N^2*A*1e-4/(l/100)*I^2*1000
readout: B²/2μ₀ × volume in mJ = (4*pi*1e-7*N/(l/100)*I)^2/(2*4*pi*1e-7)*A*1e-4*l/100*1000
```

::: predict
## The current in an inductor is doubled. How much more energy does it store?

- [ ] Twice as much
- [x] Four times as much
- [ ] The same
- [ ] Half as much

::: reveal
Four times as much. Twice the current makes twice the field, and the field's energy density goes as $B^2$. It's the same square law as a capacitor's voltage, or a moving mass's speed. That's why big inductors carrying large currents, like the magnets in an MRI, store enough energy to be dangerous if the current is interrupted carelessly.
:::
:::

::: nameit
## Energy in an inductor and in the field

**Building up current takes work.** Raising an inductor's current means pushing against its back-voltage $L\,di/dt$. The power going in is $vi = Li\,di/dt$, and adding it up from zero to $I$:

$$U = \int_0^I Li\,di = \frac12LI^2$$

**The energy is in the field.** For a long solenoid, put $L = \mu_0N^2A/\ell$ and $B = \mu_0NI/\ell$ into $\tfrac12LI^2$:

$$U = \frac{B^2}{2\mu_0} \times (A\ell)$$

$A\ell$ is the volume inside the solenoid, where the field is. So the magnetic field carries an energy density

$$u_B = \frac{B^2}{2\mu_0}$$

the twin of the electric field's $\tfrac12\varepsilon_0E^2$. A 1 T field holds about 400 kJ per cubic meter, far more than any electric field in air can, which is one reason motors and transformers use magnetic fields to handle energy.

**Getting it back.** When the current falls, the field collapses and returns its energy to the circuit. If the circuit is broken suddenly, it has nowhere to go but a spark. Relay coils and motor windings driven by transistors get a **flyback diode** across them, which lets the current keep circulating and die away gently, dissipating the energy safely.

**Twins:**

| Capacitor | Inductor |
|---|---|
| $\tfrac12CV^2$ | $\tfrac12LI^2$ |
| $\tfrac12\varepsilon_0E^2$ per m³ | $B^2/2\mu_0$ per m³ |
| voltage can't jump | current can't jump |
:::

::: example
## How much energy does a 10 mH inductor carrying 2 A store?

::: solution
1. **Stored energy.**
   $$\begin{aligned} U &= \frac12LI^2 \\ &= \frac12 \times 0.01 \times 4 \\ &= 20\ \text{mJ} \end{aligned}$$
2. **At switch-off.** All of it must go somewhere when the current is switched off.

**Answer:** the inductor stores 20 mJ.
:::
:::

::: example
## Compare the energy density of a 1 T magnetic field with that of a 3 MV/m electric field in air.

::: solution
1. **Magnetic energy density.**
   $$\begin{aligned} u_B &= \frac{B^2}{2\mu_0} \\ &= 4.0 \times 10^5\ \text{J/m}^3 \end{aligned}$$
2. **Electric energy density.**
   $$\begin{aligned} u_E &= \frac12\varepsilon_0E^2 \\ &= 40\ \text{J/m}^3 \end{aligned}$$
3. **Compare.** A practical magnetic field stores about ten thousand times more energy per volume, which is why power converters store energy in inductors and transformers.

**Answer:** the 1 T field stores $4.0 \times 10^5$ J/m³, about ten thousand times the 40 J/m³ of the electric field.
:::
:::

::: check
given: L = 1..100 int; I = 2..5 int
answer: 0.5*L*1e-3*I^2*1000
unit: mJ
tolerance: 0.5%

## A {L} mH inductor carries {I} A. How much energy does it store, in mJ?

::: right
Right. $\tfrac12LI^2$ = {answer}.
:::

::: misses
- [L*I^2] Include the ½.
- [0.5*L*I] Square the current.
- [any] Not yet. $U = \tfrac12LI^2$.
:::
:::

::: check
given: B = 0.1 | 0.5 | 1.5 | 2
answer: B^2/(2*4*pi*1e-7)/1000
unit: kJ/m^3
tolerance: 0.5%

## What is the energy density of a {B} T magnetic field, in kJ/m³?

::: right
Right. $B^2/(2\mu_0)$ = {answer}.
:::

::: misses
- [B^2/(4*pi*1e-7)/1000] Include the 2 in the denominator.
- [B/(2*4*pi*1e-7)/1000] Square the field.
- [any] Not yet. $u = B^2/(2\mu_0)$.
:::
:::

::: check
given: U = 1..10 int; L = 30 | 100 | 300
answer: sqrt(2*U*1e-3/(L*1e-3))
unit: A
tolerance: 0.5%

## What current makes a {L} mH inductor store {U} mJ?

::: right
Right. $I = \sqrt{2U/L}$ = {answer}.
:::

::: misses
- [2*U*1e-3/(L*1e-3)] Take the square root.
- [sqrt(U*1e-3/(L*1e-3))] Include the 2: $U = \tfrac12LI^2$.
- [any] Not yet. Solve $U = \tfrac12LI^2$ for I.
:::
:::

::: check
given: L = 10..100 step 10; I = 1 | 2; t = 1 | 10 | 100
answer: 0.5*L*1e-3*I^2/(t*1e-6)
unit: W
tolerance: 0.5%

## A {L} mH inductor carrying {I} A is emptied of its energy in {t} µs. What is the average power during that time?

::: right
Right. $\tfrac12LI^2/t$ = {answer}: small energy, but delivered fast, so a large power.
:::

::: misses
- [0.5*L*1e-3*I^2] That's the energy. Divide by the time.
- [any] Not yet. Power = energy/time.
:::
:::

::: check
kind: choice

## Why do relay coils driven by a transistor have a diode connected across them?

- [ ] To protect against reversed power
- [x] To give the coil's current a path when the transistor switches off, so its stored energy dies away without a destructive voltage spike
- [ ] To make the relay switch faster
- [ ] To filter noise from the supply

::: right
Right. Without it, $L\,di/dt$ would drive a huge voltage across the turning-off transistor.
:::

::: misses
- [1] It conducts only when the coil's own voltage reverses at switch-off.
- [3] It actually makes release a bit slower, since the current decays gradually.
- [4] Its job is the coil's stored energy.
:::
:::

::: check
kind: parts
given: L = 1 | 10 | 100; I = 0.5 | 2 | 10; B = 0.1 | 0.5 | 1.5

## An inductor of {L} mH carries {I} A; separately, a region of air holds a {B} T field.

::: part
answer: 0.5*L*1e-3*I^2*1e3
unit: mJ
tolerance: 0.5%

### How much energy does the inductor store?

::: misses
- [L*1e-3*I^2*1e3] Include the ½.
- [any] Not yet. $U = \tfrac12LI^2$.
:::
:::

::: part
answer: B^2/(2*4*pi*1e-7)/1e3
unit: kJ/m^3
tolerance: 0.5%

### What is the energy density of the field?

::: misses
- [B^2/(4*pi*1e-7)/1e3] It's $B^2/(2\mu_0)$.
- [any] Not yet. $u = B^2/(2\mu_0)$.
:::
:::

::: right
Right. At 1 T, magnetic fields store about 400 kJ/m³, ten thousand times what an electric field holds at air's breakdown.
:::
:::

::: explain
## Where is an inductor's energy stored, and how does it get there?

::: model
The energy is stored in the magnetic field the current produces, mostly in the volume inside the coil, at a density $B^2/2\mu_0$. It gets there because building up the current means pushing against the coil's induced back-voltage, $L\,di/dt$: the source does work against that voltage, and that work becomes field energy. When the current falls, the collapsing field induces a voltage that drives the current on, handing the energy back to the circuit.
:::
:::

::: practice

::: check
given: k = 2 | 3 | 4
answer: k^2
tolerance: 0.5%

## An inductor's current is raised {k} times. By what factor does its energy grow?

::: misses
- [k] Energy goes as current squared.
- [any] $U \propto I^2$.
:::
:::

::: check
given: B = 0.5 | 1 | 2; V = 1 | 10 | 100
answer: B^2/(2*4*pi*1e-7)*V*1e-6
unit: J
tolerance: 0.5%

## A {B} T field fills {V} cm³. How much energy does it hold?

::: misses
- [B^2/(2*4*pi*1e-7)*V] Convert cm³ to m³.
- [any] $u \times$ volume.
:::
:::

::: check
given: L = 1..10 int; I = 2..9 int
answer: 0.5*L*I^2
unit: µJ
tolerance: 0.5%

## A {L} µH inductor carries {I} A. How much energy does it hold, in µJ?

::: misses
- [L*I^2] Include the ½.
- [any] $\tfrac12LI^2$.
:::
:::
:::
