Magnet field lines - 2D dipole map

Drag two magnets around and watch their field lines, forces and energy.

Switch to 3D

Presets

Playback

Parameters

Model checks

The science

The field of a magnet

Far from a bar magnet its field is that of a magnetic dipole with moment m: B(r) = (μ0 / 4π) [3 (m·&rhat;) &rhat; - m] / r³. On the axis this is B = μ0 m / (2π r³), and on the equator it is half as strong and points the other way. So the field falls as 1/r³, much faster than the 1/r² of an electric charge. Field lines are curves tangent to B; they leave the north pole and re-enter the south pole, and they never cross because B has one direction at each point. Outside the sources, curl B = 0, so B = -∇ΦM, which is why the line integral of B around any loop that encloses nothing is zero.

Forces between magnets

A second dipole in the field of the first has energy U = -m2·B1 and feels a torque τ = m2 × B1 that turns it along the field, plus a force F = ∇(m2·B1). Two coaxial magnets aligned head to tail attract with F = 3 μ0 m1 m2 / (2π d&sup4;), falling as the fourth power of the distance. The map colours the field strength on a logarithmic scale and the needles are compass probes.

Honest simplifications: a bar magnet is treated as an ideal point dipole, so the field is exact only beyond about two magnet lengths and the lines near each magnet are indicative; the picture is a cut through a 3D field in the plane containing both moments; no magnetic materials, saturation or demagnetisation, and the force on magnet 2 is computed only from the field of magnet 1 (as the force on a rigid dipole).

What to try
  • Choose Repel (N-N facing) and Attract (N-S facing), and compare the field line pattern between the magnets.
  • Drag magnet 2 away and watch the force fall as 1/d to the fourth.
  • Rotate magnet 2 and read the torque graph: it is zero where the magnet lies along the field, a stable point.
  • Turn on the field strength map to see the saddle point of zero field between two repelling magnets.
Field strength against distance, log-log (slope -3)
Field strength along the line through both magnets
Energy and torque of magnet 2 against its angle