---
title: Energy, coenergy and magnetic force
heading: Stored magnetic energy as a function of flux linkage and position, force as its derivative at constant flux linkage or the coenergy's at constant current, the force of an electromagnet and the pressure of a magnetic field, reluctance torque, and where the energy goes when the armature moves
eyebrow: S12 · Lesson 4 · Energy, coenergy and magnetic force
xp: 50
---

::: hook
The Lorentz force of lesson 1 works for currents in air, but most of the force in a relay, a solenoid or a machine acts on iron, which carries no current at all. You can't add up $\mathbf{J} \times \mathbf{B}$ to find it. The way around this is energy: if moving the iron changes the magnetic energy stored in the system, the force is the rate of that change. One function of the coil's current and the iron's position, the coenergy, then gives every force and torque in the course.
:::

::: play
- An electromagnet: an N-turn coil on a C-shaped core, pulling an iron armature across two air gaps of length g, each with pole area A. Its force $F = \mu_0N^2Ai^2/(4g^2)$ rises steeply as the gap closes.
- At fixed current, halving the gap doubles the flux density and quadruples the force.
- The readout gives the force per unit area: the magnetic pressure $B^2/2\mu_0$, nearly 4 atmospheres at 1 T.
:::

```sim plot
view: graph
x: g = 0.2..5 mm log
y: F = 1..10000 N log
slider: N = 100..1000 = 500
slider: i = 0.5..5 = 2 A
slider: A = 1..10 = 4 cm²
plot: 4e-7*pi*N^2*A*1e-4*i^2/(4*(g*1e-3)^2) | samples: 300 | label: force
readout: gap flux density at 2 mm, T = 4e-7*pi*N*i/(2*2e-3) | digits: 3
readout: force at 2 mm, N = 4e-7*pi*N^2*A*1e-4*i^2/(4*(2e-3)^2) | digits: 4
readout: pressure at 1 T, kPa = 1/(2*4e-7*pi)/1000 | digits: 3
```

::: predict
## The electromagnet (500 turns, 2 A, two 2 mm gaps of 4 cm² each) pulls with 31.4 N. With the same current, what does it pull when the gaps close to 1 mm?

- [ ] 31.4 N
- [ ] 62.8 N
- [x] 126 N
- [ ] 251 N

::: reveal
The flux density in the gaps is $\mu_0Ni/(2g)$: halving g doubles it, from 0.314 T to 0.628 T. The force goes as $B^2$ times the pole area, so it quadruples. That's why a relay snaps shut: once the armature starts moving, the force grows faster than any spring can keep up with.
:::
:::

::: nameit
## Energy and force

For a lossless coupling field with flux linkage λ and position x, energy conservation $i\,d\lambda = dW_\text{fld} + f\,dx$ makes the stored energy a function $W_\text{fld}(\lambda, x)$, and

$$f = -\frac{\partial W_\text{fld}(\lambda, x)}{\partial x}\bigg|_\lambda$$

## Coenergy

It's usually easier to work with current. The **coenergy** $W'_\text{fld}(i, x) = \lambda i - W_\text{fld} = \int_0^i\lambda\,di'$ gives

$$f = +\frac{\partial W'_\text{fld}(i, x)}{\partial x}\bigg|_i$$

For a linear system, $\lambda = L(x)i$ and $W' = \frac{1}{2}L(x)i^2$, so $f = \frac{1}{2}i^2\frac{dL}{dx}$, and for rotation $T = \frac{1}{2}i^2\frac{dL}{d\theta}$. The force always acts to increase inductance: to shorten air gaps and line iron up with flux.

## Magnetic pressure

On an iron surface facing an air gap, the force per unit area is $B^2/2\mu_0$: 398 kPa at 1 T. An electromagnet with total pole area $A_\text{tot}$ pulls $F = B^2A_\text{tot}/2\mu_0$.

## Reluctance torque

A rotor whose position θ changes the coil's inductance as $L(\theta) = L_0 + L_2\cos 2\theta$ feels $T = -i^2L_2\sin 2\theta$, up to $i^2L_2$, even with no magnet and no rotor winding. Salient-pole synchronous machines and reluctance motors use this torque.

## Where the energy goes

Moving at constant current, a linear system takes $i^2\Delta L$ from the source: half becomes mechanical work and half adds to the stored energy.
:::

::: example
## Find the force of the electromagnet: 500 turns, 2 A, two 2 mm gaps of 4 cm² each.

::: solution
1. **Gap flux density.** The coil drives flux across both gaps in series:
   $$\begin{aligned} B &= \frac{\mu_0Ni}{2g} \\ &= \frac{4\pi \times 10^{-7} \times 1000}{4 \times 10^{-3}} \\ &= 0.314\ \text{T} \end{aligned}$$
2. **Force.** With 8 cm² of pole face,
   $$\begin{aligned} F &= \frac{B^2A_\text{tot}}{2\mu_0} \\ &= 31.4\ \text{N} \end{aligned}$$
3. **Check by coenergy.** The coenergy route gives the same. The inductance is
   $$\begin{aligned} L &= \frac{\mu_0N^2A}{2g} \\ &= 31.4\ \text{mH} \end{aligned}$$
   and the force is
   $$\begin{aligned} F &= \tfrac{1}{2}i^2|dL/dg| \\ &= \frac{\mu_0N^2Ai^2}{4g^2} \\ &= 31.4\ \text{N} \end{aligned}$$

**Answer:** the electromagnet pulls with 31.4 N, with 0.314 T in its gaps.
:::
:::

::: example
## The armature closes from 2 mm to 1 mm gaps at constant 2 A. Where does the energy go?

::: solution
1. **Inductance.** It doubles, from 31.4 to 62.8 mH.
2. **Energy from the source.** At constant current the source supplies
   $$\begin{aligned} W_s &= i^2\Delta L \\ &= 4 \times 31.4\ \text{mH} \\ &= 0.126\ \text{J} \end{aligned}$$
3. **Stored energy.** The stored energy $\frac{1}{2}Li^2$ rises by 0.063 J.
4. **Mechanical work.** The other 0.063 J is the mechanical work done on the armature, the integral of the force over the 1 mm of travel.

**Answer:** the source supplies 0.126 J: 0.063 J goes into stored magnetic energy and the other 0.063 J into mechanical work on the armature.
:::
:::

::: example
## A lifting magnet must hold a 5 kg steel plate across two poles of 3 cm² each, with 0.5 mm of air at each pole face. What flux density and what ampere-turns does it need?

::: solution
1. **Force needed.** The force must equal the weight, 49.1 N, over 6 cm² of pole face.
2. **Flux density.** From $B^2 = 2\mu_0F/A_\text{tot}$,
   $$B = 0.453\ \text{T}$$
3. **Ampere-turns.** The flux crosses both 0.5 mm gaps in series:
   $$\begin{aligned} Ni &= \frac{B \cdot 2g}{\mu_0} \\ &= \frac{0.453 \times 1\ \text{mm}}{\mu_0} \\ &= 361\ \text{A·turns} \end{aligned}$$
4. **Sensitivity to the gap.** Because the force goes as $1/g^2$ at fixed ampere-turns, a little dirt or paint on the plate costs much of the holding force.

**Answer:** it needs 0.453 T at the poles, which takes 361 ampere-turns.
:::
:::

::: check
given: B = 0.3 | 1 | 1.6
answer: B^2/(2*4e-7*pi)/1000
unit: kPa
tolerance: 0.5%

## What pressure does a {B} T field exert on an iron surface across an air gap?

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

::: misses
- [B^2/(4e-7*pi)/1000] The energy density, and the pressure, is $B^2/2\mu_0$.
- [any] Not yet. Magnetic energy per unit volume.
:::
:::

::: check
given: N = 200 | 800; i = 0.5 | 3; g = 0.5 | 2
answer: 4e-7*pi*N*i/(2*g*1e-3)
unit: T
tolerance: 0.5%

## An electromagnet's {N}-turn coil carries {i} A across two air gaps of {g} mm in series (ideal iron). What's the flux density in the gaps?

::: right
Right. $\mu_0Ni/(2g)$ = {answer} T.
:::

::: misses
- [4e-7*pi*N*i/(g*1e-3)] The flux crosses two gaps in series.
- [any] Not yet. The MMF drops across the total gap length.
:::
:::

::: check
given: B = 0.2 | 0.6 | 1.2; A = 1 | 5 | 20
answer: B^2*A*1e-4/(2*4e-7*pi)
unit: N
tolerance: 0.5%

## An electromagnet's gaps carry {B} T over a total pole area of {A} cm². What force does it exert?

::: right
Right. $B^2A/2\mu_0$ = {answer} N.
:::

::: misses
- [any] Not yet. Magnetic pressure times area.
:::
:::

::: check
given: i = 0.5 | 2 | 10; d = 1 | 5 | 30
answer: 0.5*i^2*d
unit: N
tolerance: 0.5%

## A coil's inductance rises {d} mH per millimeter of plunger travel. With {i} A flowing, what force acts on the plunger?

::: right
Right. $\frac{1}{2}i^2\,dL/dx$ = {answer} N (mH/mm is H/m).
:::

::: misses
- [i^2*d] The coenergy is $\frac{1}{2}Li^2$.
- [any] Not yet. Force is the coenergy's derivative at constant current.
:::
:::

::: check
given: i = 2 | 5 | 20; L = 5 | 20 | 80
answer: i^2*L*1e-3
unit: N·m
tolerance: 0.5%

## A coil's inductance varies with rotor angle as $L_0 + L_2\cos 2\theta$ with $L_2$ = {L} mH. With {i} A, what's the largest reluctance torque?

::: right
Right. $T = -i^2L_2\sin 2\theta$, peaking at $i^2L_2$ = {answer} N·m.
:::

::: misses
- [0.5*i^2*L*1e-3] Differentiating $\cos 2\theta$ brings out a factor of 2.
- [any] Not yet. $T = \frac{1}{2}i^2\,dL/d\theta$.
:::
:::

::: check
given: i = 1 | 3 | 8; b = 30 | 100
answer: 0.5*i^2*b*1e-3
unit: J
tolerance: 0.5%

## At a constant {i} A, an armature moves and the coil's inductance rises by {b} mH. How much mechanical work is done on the armature?

::: right
Right. Half of the $i^2\Delta L$ the source supplies: {answer} J.
:::

::: misses
- [any] Not yet. The source gives $i^2\Delta L$; half goes to stored energy.
:::
:::

::: check
kind: parts
given: m = 2 | 10 | 50; A = 2 | 5 | 10; g = 0.2 | 0.5 | 1

## An electromagnet must hold a {m} kg plate across two poles of {A} cm² each, with {g} mm of air at each face.

::: part
answer: sqrt(2*4*pi*1e-7*m*9.81/(2*A*1e-4))
unit: T
tolerance: 0.5%

### What gap flux density does it need?

::: misses
- [sqrt(2*4*pi*1e-7*m*9.81/(A*1e-4))] Both poles pull.
- [any] $B^2A_\text{tot}/2\mu_0 = mg$.
:::
:::

::: part
answer: sqrt(2*4*pi*1e-7*m*9.81/(2*A*1e-4))*2*g*1e-3/(4*pi*1e-7)
unit: A
tolerance: 0.5%

### How many ampere-turns?

::: misses
- [sqrt(2*4*pi*1e-7*m*9.81/(2*A*1e-4))*g*1e-3/(4*pi*1e-7)] The flux crosses two gaps.
- [any] $Ni = B \cdot 2g/\mu_0$.
:::
:::
:::

::: check
kind: derivation
vars: N = 10..2000, i = 0.1..20, g = 0.0001..0.005, A = 0.0001..0.01

## An N-turn coil carries i amperes through two air gaps of length g in series, each of area A (ideal iron).

::: step
answer: 4*pi*1e-7*N*i/(2*g)

### What is the gap flux density?
:::

::: step
answer: 4*pi*1e-7*N^2*A/(2*g)

### What is the coil's inductance?
:::

::: step
answer: 4*pi*1e-7*N^2*A*i^2/(4*g^2)

### What total force pulls the armature?
:::

::: right
Right. The coenergy route, $\frac12i^2|dL/dg|$ with the inductance's $1/g$, gives the same force as the magnetic pressure.
:::
:::

::: explain
## Why is it easier to find a magnetic force from the coenergy at constant current than from the energy at constant flux linkage?

::: model
Both give the same force, since force is a property of the state, not of how the state is held. The difference is practical: devices are described by their currents, which the circuit sets, and an inductance that depends on position. At constant current the coenergy of a linear device is just $\frac{1}{2}L(x)i^2$, and differentiating with respect to x needs only $dL/dx$. Working at constant flux linkage instead means writing the energy as $\lambda^2/2L(x)$, differentiating that, and then substituting back for λ, with a sign to keep track of. The coenergy also extends cleanly to several coils, where it becomes $\frac{1}{2}\sum L_{jk}i_ji_k$ and gives the mutual torque of every rotating machine.
:::
:::

::: practice

::: check
given: B = 0.4 | 1.5; A = 2 | 30
answer: B^2*A*1e-4/(2*4e-7*pi)
unit: N
tolerance: 0.5%

## Force: {B} T over {A} cm²?

::: misses
- [any] $B^2A/2\mu_0$.
:::
:::

::: check
given: i = 0.3 | 6; d = 2 | 50
answer: 0.5*i^2*d
unit: N
tolerance: 0.5%

## Force: {i} A, {d} mH/mm?

::: misses
- [any] $\frac{1}{2}i^2\,dL/dx$.
:::
:::

::: check
given: i = 1 | 15; L = 3 | 60
answer: i^2*L*1e-3
unit: N·m
tolerance: 0.5%

## Peak reluctance torque: {i} A, $L_2$ = {L} mH?

::: misses
- [any] $i^2L_2$.
:::
:::
:::
