Loop Potential Energy Calculator – U = −μB cos θ, Torque & Flip Work
Use this free Loop Potential Energy Calculator to find the potential energy of a magnetic moment in a field, U = −μ × B × cos θ, together with the torque at that angle and the work needed to flip the loop through 180°.
A current loop in a magnetic field is a small store of energy whose balance depends on which way it points. Aligned with the field, the loop sits at the bottom of an energy well; anti-aligned, it perches at the top; and between those extremes the energy follows a cosine, U = −μB cos θ, where μ is the loop's magnetic moment. This calculator evaluates that energy — and the torque τ = μB sin θ that tries to rotate the loop downhill — for any moment, field and angle.
The minus sign and the cosine carry the whole story. At θ = 0 the energy is at its minimum, U = −μB: the aligned loop is the stable one, the orientation a compass needle chooses and a motor's rotor is dragged toward. At θ = 180° the energy peaks at +μB — an unstable perch from which the slightest nudge sends the loop flipping. The total energy difference between the two, 2μB, is the price of flipping a loop against the field, a quantity that reappears at every scale: it is the barrier in a magnetic memory bit, the splitting between spin states in MRI, and the work a motor's supply does each half-turn.
Energy and torque are two views of one landscape: the torque is the slope of the energy curve, τ = −dU/dθ, so it vanishes exactly where the energy is flat (at the top and bottom, θ = 0° and 180°) and peaks where the energy falls fastest (θ = 90°). Keeping both numbers in view, as this calculator does, turns a static formula into an intuition: the loop rolls on the cosine landscape like a ball on a wavy track, pulled hardest at the steepest point and free, for an instant, at both the summit and the valley floor.
Formula
U = −μ × B × cos θ and τ = μ × B × sin θ • U in joules (J), τ in newton-metres (N·m), μ in A·m², B in tesla (T), θ the angle between the magnetic moment and the field. U is lowest (−μB) when the moment aligns with the field and highest (+μB) when it points against it.
The two formulas are one fact viewed twice: the torque is the negative slope of the energy, τ = −dU/dθ, which is why the torque peaks at θ = 90° where the cosine falls fastest, and vanishes at both energy extremes. Flipping a loop from aligned to anti-aligned costs ΔU = 2μB regardless of the path taken. The moment itself is μ = N × I × A for a coil of N turns carrying current I around area A. For atomic-scale moments the same landscape applies with quantum rules: only certain orientations are allowed, and the energy steps between them — ΔU = 2μB for a spin-½ particle — are what resonance experiments measure.
| Symbol | Meaning | Units |
|---|---|---|
| U | potential energy of the loop's orientation | joules (J) |
| μ | magnetic moment of the loop (= NIA) | A·m² |
| B | magnetic field strength | tesla (T) |
| θ | angle between μ and B | degrees (°) |
| τ | torque on the loop, μB sin θ | newton-metres (N·m) |
One landscape, two quantities: energy and its slope
Plot U against θ and you get an inverted cosine valley: floor at 0°, summit at 180°, and slopes between. The torque at any point is exactly the steepness of that slope — mathematically τ = −dU/dθ = μB sin θ — which explains the torque's whole personality. At the valley floor the landscape is flat, so no torque, and the equilibrium is stable because every step away climbs. At the summit the landscape is equally flat — no torque again — but the equilibrium is unstable because every step away descends. At 90° the slope is steepest, the torque maximal, and the loop there is like a ball on the valley's wall: held, it stays; released, it accelerates toward alignment.
This unity is the deep reason the energy viewpoint is powerful. Forces and torques must be computed direction by direction, but energy is a single number whose landscape predicts equilibria, stability, oscillation frequencies and flip costs all at once. A loop released near alignment oscillates in the valley with a frequency set by the valley's curvature (and its moment of inertia) — the working principle of the tangent galvanometer's needle and of sensitive magnetometers that time a magnet's swing to measure the field holding it.
How to use
- Enter the loop's magnetic moment in A·m² — or build it as N × I × A for your coil (200 turns × 0.5 A × 0.01 m² = 1 A·m², for instance).
- Enter the field strength in tesla and the angle between the moment and the field, in degrees.
- Click "Calculate" to get the potential energy in joules and the torque in newton-metres.
- Read the signs physically: negative U means the orientation is favoured (below the θ = 90° reference); the torque's job is always to decrease θ toward alignment.
Worked examples
Example 1 — a loop at 60°. A loop has magnetic moment μ = 2 A·m² in a field of B = 0.5 T, at θ = 60°.
U = −μ B cos θ = −2 × 0.5 × cos 60° = −1 × 0.5 = −0.5 J.
τ = μ B sin θ = 2 × 0.5 × sin 60° = 0.866 N·m, turning the loop toward alignment.
Flipping the loop from θ = 0° to θ = 180° would cost ΔU = 2μB = 2 J — the full height of the energy landscape for this loop and field.
Example 2 — the three landmarks. For the same μB = 1 J landscape: at θ = 0°, U = −1 J and τ = 0 (stable rest); at θ = 90°, U = 0 and τ = 1 N·m (maximum pull, energy at the reference level); at θ = 180°, U = +1 J and τ = 0 (unstable balance). One loop, one field, and the whole behaviour is in those three rows — everything between is interpolation on a cosine.
Example 3 — a small coil at 30°. A coil with μ = 0.05 A·m² in B = 1.5 T at θ = 30°: U = −0.05 × 1.5 × cos 30° = −0.0650 J, and τ = 0.05 × 1.5 × sin 30° = 0.0375 N·m. The full aligned-to-anti-aligned flip costs ΔU = 2μB = 0.150 J; starting from the 30° position, the climb to anti-alignment costs U(180°) − U(30°) = 0.075 − (−0.0650) = 0.140 J.
Example 4 — a proton in an MRI field. A proton's moment is μp = 1.411 × 10⁻²⁶ A·m². In an MRI scanner's B = 1.5 T, the flip energy is ΔU = 2μB = 2 × 1.411 × 10⁻²⁶ × 1.5 = 4.23 × 10⁻²⁶ J. As a photon, that energy is a frequency f = ΔU/h = 4.23 × 10⁻²⁶ ÷ 6.626 × 10⁻³⁴ = 63.9 MHz — the radio frequency an MRI scanner actually transmits to flip hydrogen spins, and the signal it listens for. This page's formula, at atomic scale, is MRI.
Example 5 — a compass needle in the Earth's field. A needle with μ = 0.1 A·m² in the Earth's B ≈ 50 µT: the energy scale is μB = 0.1 × 50 × 10⁻⁶ = 5 × 10⁻⁶ J, so the full flip costs 1 × 10⁻⁵ J and the maximum torque is 5 × 10⁻⁶ N·m. Feeble beyond everyday intuition — yet quite enough to swing a light, well-balanced needle, which is why compasses work and why their needles are made light and their pivots fine.
Example 6 — past the summit. A loop with μ = 5 A·m² in B = 0.8 T held at θ = 120°: U = −5 × 0.8 × cos 120° = −4 × (−0.5) = +2.0 J (above the 90° reference — it has climbed past the landscape's midpoint), with τ = 5 × 0.8 × sin 120° = 3.464 N·m pulling it back toward alignment. Released, it would give up ΔU = U(120°) − U(0°) = 2.0 − (−4.0) = 6.0 J of energy on its way down to alignment — energy that becomes kinetic, then heat in whatever damps the swing.
Loop energy in real life
MRI and NMR. Example 4 is the whole of magnetic resonance: spin states split by 2μB, radio photons at that exact energy flip them, and the returning signal images the body. The field strength of a scanner (1.5 T, 3 T) is chosen through this formula.
Electric motors. A motor's rotor is a loop (or its permanent-magnet equivalent) forever chasing the valley floor as the stator field rotates; the torque curve τ = μB sin θ is the motor's heartbeat, and commutation exists to keep the angle near the productive slope.
Compasses and magnetometers. A needle resting at the valley floor reports the field's direction; timing its small oscillations in the valley measures the field's strength — a measurement technique older than electronics.
Magnetic memory and recording. A stored bit is a magnetic moment held in one of two orientations; the barrier between them is the flip energy 2μB (with anisotropy playing B's role), sized to resist thermal flips for a decade yet yield to the write head.
Galvanometers. The moving-coil meter balances the magnetic torque μB sin θ (nearly constant near θ = 90° by design) against a spring — the deflection reads the current that makes μ, which is how analogue meters turn this formula into a dial.
Satellite attitude control. Magnetorquers — coils on spacecraft — exchange torque with the Earth's field exactly as τ = μ × B prescribes, dumping momentum and steering satellites with no fuel, at torques this formula predicts to the milli-newton-metre.
The quantum echo: from loops to spins
Nothing in the derivation required the "loop" to be made of wire. An electron's spin carries a magnetic moment, and its energy in a field obeys the same −μB cos θ — with one quantum amendment: θ is not free. A spin-½ particle offers only two orientations, effectively aligned and anti-aligned, with energies ∓μB and a gap of 2μB. That gap, divided by Planck's constant, is a frequency — 28 GHz per tesla for electrons, 42.6 MHz per tesla for protons — and shining radiation at exactly that frequency flips the spins resonantly. Electron spin resonance, NMR and MRI are all this page's energy landscape explored with photons. The classical loop and the quantum spin share a formula because they share a truth: a magnetic moment in a field is an energy store whose currency is μB.
Measuring with the landscape: the oscillation method
The valley's curvature is a measuring instrument. Suspend a small magnet so it can swing in the field and time its oscillations: the period is T = 2π√(Irot ÷ μB), where Irot is the magnet's moment of inertia. A needle with μ = 0.1 A·m² and Irot = 2 × 10⁻⁵ kg·m² in the Earth's 50 µT field has a period of about 12.6 s — slow, stately and very measurable with a stopwatch. Combine the period (which yields the product μB) with a deflection measurement (which yields the ratio μ/B) and both the magnet's moment and the Earth's field fall out separately: the classic two-measurement method by which μ and B were mapped in the nineteenth century, using nothing but this page's energy landscape, a thread and a clock. Modern fluxgate and SQUID magnetometers are faster and finer, but the oscillation method remains the calibration bedrock — and a beautiful examination question.
Quick reference: U and τ across the landscape (μB = 1)
| θ | U ÷ μB = −cos θ | τ ÷ μB = sin θ | Character |
|---|---|---|---|
| 0° | −1.000 | 0 | stable equilibrium |
| 30° | −0.866 | 0.500 | gentle slope |
| 45° | −0.707 | 0.707 | — |
| 60° | −0.500 | 0.866 | Example 1 |
| 90° | 0 | 1.000 | maximum torque |
| 120° | +0.500 | 0.866 | past the midpoint |
| 150° | +0.866 | 0.500 | near the summit |
| 180° | +1.000 | 0 | unstable equilibrium |
The symmetry is exact: U(θ) mirrors about 90°, and τ(θ) mirrors with it. Any orientation's behaviour can be read off this one table scaled by your μB — which is why μB is the only number worth memorising for a given loop and field.
Common mistakes
- Dropping the minus sign. U = −μB cos θ: aligned is negative (lowest). Reporting +μB at θ = 0 inverts the landscape and with it every conclusion about stability.
- Measuring θ from the loop's plane. θ is between the moment (the loop's normal) and B. If your angle is between the loop's face and the field, convert: θ = 90° − that angle.
- Expecting torque where the energy is extreme. At 0° and 180° the torque is zero — the landscape is flat at both its floor and its summit. Maximum torque lives at 90°, where U = 0.
- Quoting the flip cost as μB. Aligned to anti-aligned is the full landscape height, 2μB. μB alone is the cost from alignment to the 90° reference.
- Forgetting μ is NIA for a coil. A 200-turn coil's moment is 200 × I × A, not I × A. Understating μ by the turns count understates both U and τ by the same factor.
FAQ
Why is the potential energy negative when the loop is aligned?
U is defined as zero at θ = 90° and measured relative to that. Alignment is the configuration the field "wants", so it sits below zero — the field would do positive work (releasing μB) to rotate the loop there from 90°.
What if ΔU for the flip comes out negative?
That happens when θ > 90°: the loop is already past halfway, so flipping it the rest of the way releases energy instead of costing it — left alone, the torque would snap it around on its own.
How does this explain MRI?
Protons are tiny magnetic moments. In the scanner's field they settle into the low-energy aligned state, and a radio pulse supplies exactly the flip energy (2μB per spin, delivered as photons) to knock them into the high-energy state; the signal comes from them falling back.
Is the anti-aligned position really an equilibrium if the torque is zero?
Yes, but an unstable one — like a pencil balanced on its point. The torque vanishes exactly at 180°, but any nudge creates a torque that grows as the loop tips, flipping it to alignment.
What supplies the energy when a loop flips to alignment?
For a loop held at constant current, the power supply does net work (the induced EMF fights it as the flux changes) — a subtle point: at constant current the supply provides twice the mechanical energy gained, the other half appearing as the field's energy change. At constant flux the bookkeeping differs; the landscape U = −μB cos θ is the constant-current result.
How does a loop oscillate in a field?
Released near alignment, it swings like a pendulum in the cosine valley, with small-oscillation frequency set by √(μB/I_rot) where I_rot is its moment of inertia. Timing that swing is a classic way to measure B.
Does the loop's shape matter?
Only through μ = NIA — the area, not the shape. A circular and a square loop of equal area and turns in the same field have identical U(θ) and τ(θ) landscapes.
What is the energy of a bar magnet in a field?
The same formula, with the magnet's own moment: U = −μB cos θ. A compass needle is this equation with a pivot; its μ is measured by timing its oscillations or by its deflection against a known field.
What happens to the released energy when a loop flips?
It becomes rotational kinetic energy, then — through friction, air drag or eddy currents in nearby conductors — heat. In a motor the same descent is harvested as work each half-turn instead of being wasted.
Is there an electric analogue?
Yes: an electric dipole in an electric field has U = −pE cos θ with torque pE sin θ — identical mathematics, which is why polar molecules align in fields and why the two topics are taught as twins.