This animation shows the magnetic field of a current-carrying coil suspended by a spring above a permanent magnet.
Depending on the direction of current flow in the wire (ie. the direction in which the batteries are connected),
the coil will either be repelled upwards away from the magnet, or attracted downwards towards it. In the first case,
the effective dipole moment of the coil opposes the dipole moment of the magnet, resulting in a pressure in the magnetic
field between them, which pushes against the coil. When the batteries are reversed, the effective dipole moment of the coil
points upwards, in the same direction as the dipole moment of the magnet. The result is a tension in the field that pulls the