# Force between magnets

Magnets exert forces and torques on each other due to the complex rules of electromagnetism. The forces of attraction field of magnets are due to microscopic currents of electrically charged electrons orbiting nuclei and the intrinsic magnetism of fundamental particles (such as electrons) that make up the material. Both of these are modeled quite well as tiny loops of current called magnetic dipoles that produce their own magnetic field and are affected by external magnetic fields. The most elementary force between magnets, therefore, is the magnetic dipole–dipole interaction. If all of the magnetic dipoles that make up two magnets are known then the net force on both magnets can be determined by summing up all these interactions between the dipoles of the first magnet and that of the second.

It is always more convenient to model the force between two magnets as being due to forces between magnetic poles having magnetic charges 'smeared' over them. Such a model fails to account for many important properties of magnetism such as the relationship between angular momentum and magnetic dipoles. Further, magnetic charge does not exist. This model works quite well, though, in predicting the forces between simple magnets where good models of how the 'magnetic charge' is distributed is available.

## Magnetic poles vs. atomic currents

Field of a cylindrical bar magnet calculated with Ampère's model

Two models are used to calculate the magnetic fields of and the forces between magnets. The physically correct method is called the Ampère model while the easier model to use is often the Gilbert model.

Ampère model: In the Ampère model, all magnetization is due to the effect of microscopic, or atomic, circular bound currents, also called Ampèrian currents throughout the material. The net effect of these microscopic bound currents is to make the magnet behave as if there is a macroscopic electric current flowing in loops in the magnet with the magnetic field normal to the loops. The Ampère model gives the exact magnetic field both inside and outside the magnet. It is usually difficult to calculate the Ampèrian currents on the surface of a magnet, though, whereas it is often easier to find the effective poles for the same magnet.

Gilbert model: However, a version of the magnetic pole approach is used by professional magneticians to design permanent magnets. In this approach, the pole surfaces of a permanent magnet are imagined to be covered with so-called magnetic charge, north pole particles on the north pole and south pole particles' on the south pole, that are the source of the magnetic field lines. If the magnetic pole distribution is known, then outside the magnet the pole model gives the magnetic field exactly. In the interior of the magnet this model fails to give the correct field. This pole model is also called the Gilbert model of a magnetic dipole.[1] Griffiths suggests (p. 258): "My advice is to use the Gilbert model, if you like, to get an intuitive 'feel' for a problem, but never rely on it for quantitative results."

### Magnetic dipole moment

Far away from a magnet, the magnetic field created by that magnet is almost always described (to a good approximation) by a dipole field characterized by its total magnetic dipole moment, m. This is true regardless of the shape of the magnet, so long as the magnetic moment is non-zero. One characteristic of a dipole field is that the strength of the field falls off inversely with the cube of the distance from the magnet's center.

The magnetic moment, therefore, of a magnet is a measure of its strength and orientation. A loop of electric current, a bar magnet, an electron, a molecule, and a planet all have magnetic moments. More precisely, the term magnetic moment normally refers to a system's magnetic dipole moment, which produces the first term in the multipole expansion[note 1] of a general magnetic field.

Both the torque and force exerted on a magnet by an external magnetic field are proportional to that magnet's magnetic moment. The magnetic moment, like the magnetic field it produces, is a vector field; it has both a magnitude and direction. The direction of the magnetic moment points from the south to north pole of a magnet. For example the direction of the magnetic moment of a bar magnet, such as the one in a compass is the direction that the north poles points toward.

In the physically correct Ampère model, magnetic dipole moments are due to infinitesimally small loops of current. For a sufficiently small loop of current, I, and area, A, the magnetic dipole moment is:

$\mathbf{m} = I\mathbf{A}$,

where the direction of m is normal to the area in a direction determined using the current and the right-hand rule. As such, the SI unit of magnetic dipole moment is ampere metre2. More precisely, to account for solenoids with many turns the unit of magnetic dipole moment is Ampere-turn metre2.

In the Gilbert model, the magnetic dipole moment is due to two equal and opposite magnetic charges that are separated by a distance, d. In this model, m is similar to the electric dipole moment p due to electrical charges:

$m=q_m d \,$,

where qm is the 'magnetic charge'. The direction of the magnetic dipole moment points from the negative south pole to the positive north pole of this tiny magnet.

### Magnetic force due to non-uniform magnetic field

Magnets are drawn into regions of higher magnetic field. The simplest example of this is the attraction of opposite poles of two magnets. Every magnet produces a magnetic field that is stronger near its poles. If opposite poles of two separate magnets are facing each other, each of the magnets are drawn into the stronger magnetic field near the pole of the other. If like poles are facing each other though, they are repulsed from the larger magnetic field.

The Gilbert model almost predicts the correct mathematical form for this force and is easier to understand qualitatively. For if a magnet is placed in a uniform magnetic field then both poles will feel the same magnetic force but in opposite directions, since they have opposite magnetic charge. But, when a magnet is placed in the non-uniform field, such as that due to another magnet, the pole experiencing the large magnetic field will experience the large force and there will be a net force on the magnet. If the magnet is aligned with the magnetic field, corresponding to two magnets oriented in the same direction near the poles, then it will be drawn into the larger magnetic field. If it is oppositely aligned, such as the case of two magnets with like poles facing each other, then the magnet will be repelled from the region of higher magnetic field.

In the physically correct Ampère model, there is also a force on a magnetic dipole due to a non-uniform magnetic field, but this is due to Lorentz forces on the current loop that makes up the magnetic dipole. The force obtained in the case of a current loop model is

$\mathbf{F}=\nabla \left(\mathbf{m}\cdot\mathbf{B}\right)$,

where the gradient is the change of the quantity m · B per unit distance, and the direction is that of maximum increase of m · B. To understand this equation, note that the dot product m · B = mBcos(θ), where m and B represent the magnitude of the m and B vectors and θ is the angle between them. If m is in the same direction as B then the dot product is positive and the gradient points 'uphill' pulling the magnet into regions of higher B-field (more strictly larger m · B). B represents the strength and direction of the magnetic field. This equation is strictly only valid for magnets of zero size, but is often a good approximation for not too large magnets. The magnetic force on larger magnets is determined by dividing them into smaller regions having their own m then summing up the forces on each of these regions.

## Gilbert Model

The Gilbert model assumes that the magnetic forces between magnets are due to magnetic charges near the poles. While physically incorrect, this model produces good approximations that work even close to the magnet when the magnetic field becomes more complicated, and more dependent on the detailed shape and magnetization of the magnet than just the magnetic dipole contribution. Formally, the field can be expressed as a multipole expansion: A dipole field, plus a quadrupole field, plus an octopole field, etc. in the Ampère model, but this can be very cumbersome mathematically.

### Calculating the magnetic force

Calculating the attractive or repulsive force between two magnets is, in the general case, an extremely complex operation, as it depends on the shape, magnetization, orientation and separation of the magnets. The Gilbert model does depend on some knowledge of how the 'magnetic charge' is distributed over the magnetic poles. It is only truly useful for simple configurations even then. Fortunately, this restriction covers many useful cases.

#### Force between two magnetic poles

If both poles are small enough to be represented as single points then they can be considered to be point magnetic charges. Classically, the force between two magnetic poles is given by:[2]

$F={{\mu q_{m1} q_{m2}}\over{4\pi r^2}}$

where

F is force (SI unit: newton)
qm1 and qm2 are the magnitudes of magnetic poles (SI unit: ampere-meter)
μ is the permeability of the intervening medium (SI unit: tesla meter per ampere, henry per meter or newton per ampere squared)
r is the separation (SI unit: meter).

The pole description is useful to practicing magneticians who design real-world magnets, but real magnets have a pole distribution more complex than a single north and south. Therefore, implementation of the pole idea is not simple. In some cases, one of the more complex formulas given below will be more useful.

#### Force between two nearby magnetized surfaces of area A

The mechanical force between two nearby magnetized surfaces can be calculated with the following equation. The equation is valid only for cases in which the effect of fringing is negligible and the volume of the air gap is much smaller than that of the magnetized material:[3][4]

$F=\frac{\mu_0 H^2 A}{2} = \frac{B^2 A}{2 \mu_0}$

where:

A is the area of each surface, in m2
H is their magnetizing field, in A/m.
μ0 is the permeability of space, which equals 4π×10−7 T·m/A
B is the flux density, in T

#### Force between two bar magnets

Field of two attracting cylindrical bar magnets
Field of two repelling cylindrical bar magnets

The force between two identical cylindrical bar magnets placed end to end is approximately:[3]

$F=\left[\frac {B_0^2 A^2 \left( L^2+R^2 \right)} {\pi\mu_0L^2}\right] \left[{\frac 1 {x^2}} + {\frac 1 {(x+2L)^2}} - {\frac 2 {(x+L)^2}} \right]$

where

B0 is the magnetic flux density very close to each pole, in T,
A is the area of each pole, in m2,
L is the length of each magnet, in m,
R is the radius of each magnet, in m, and
x is the separation between the two magnets, in m
$B_0 \,=\, \frac{\mu_0}{2}M$ relates the flux density at the pole to the magnetization of the magnet.

Note that all these formulations are based on the Gilbert's model, which is usable in relatively great distances. Other models, (e.g., Ampère's model) use a more complicated formulation that sometimes cannot be solved analytically. In these cases, numerical methods must be used.

#### Force between two cylindrical magnets

For two cylindrical magnets with radius $R$, and height $h$, with their magnetic dipole aligned and the distance between them greater than a certain limit, the force can be well approximated (even at distances of the order of $h$) by,[5]

$F(x) = \frac{\pi\mu_0}{4} M^2 R^4 \left[\frac{1}{x^2} + \frac{1}{(x+2h)^2} - \frac{2}{(x + h)^2}\right]$

Where $M$ is the magnetization of the magnets and $x$ is the distance between them. For small values of $x$, the results are erroneous as the force becomes large for close-to-zero distance.

In disagreement to the statement in the previous section, a measurement of the magnetic flux density very close to the magnet $B_0$ is related to $M$ by the formula

$B_0 = (\mu_0/2)*M$

The effective magnetic dipole can be written as

$m = M V$

Where $V$ is the volume of the magnet. For a cylinder this is $V = \pi R^2 h$.

When $h \ll x$ the point dipole approximation is obtained,

$F(x) = \frac{3\pi\mu_0}{2} M^2 R^4 h^2\frac{1}{x^4} = \frac{3\mu_0}{2\pi} M^2 V^2\frac{1}{x^4} = \frac{3\mu_0}{2\pi} m_1 m_2\frac{1}{x^4}$

Which matches the expression of the force between two magnetic dipoles.

## Ampère model

French scientist André Marie Ampère found that the magnetism produced by permanent magnets and the magnetism produced by electromagnets are the same kind of magnetism.

Because of that, the strength of a permanent magnet can be expressed in the same terms as that of an electromagnet.

The strength of magnetism of an electromagnet that is a flat loop of wire through which a current flows, measured at a distance that is great compared to the size of the loop, is proportional to that current and is proportional to the surface area of that loop.

For purpose of expressing the strength of a permanent magnet in same terms as that of an electromagnet, a permanent magnet is thought of as if it contains small current-loops throughout its volume, and then the magnetic strength of that magnet is found to be proportional to the current of each loop (in Ampere), and proportional to the surface of each loop (in square meter), and proportional to the density of current-loops in the material (in units per cubic meter), so the dimension of strength of magnetism of a permanent magnet is Ampere times square meter per cubic meter, is Ampere per meter.

That is why Ampere per meter is the correct unit of magnetism, even though these small current loops are not really present in a permanent magnet.

The validity of Ampere's model means that it is allowable to think of the magnetic material as if it consists of current-loops, and the total effect is the sum of the effect of each current-loop, and so the magnetic effect of a real magnet can be computed as the sum of magnetic effects of tiny pieces of magnetic material that are at a distance that is great compared to the size of each piece.

This is very useful for computing magnetic force-field of a real magnet ; It involves summing a large amount of small forces and you should not do that by hand, but let your computer do that for you ; All that the computer program needs to know is the force between small magnets that are at great distance from each other.

In such computations it is often assumed that each (same-size) small piece of magnetic material has an equally strong magnetism, but this is not always true : a magnet that is placed near another magnet can change the magnetization of that other magnet. For permanent magnets this is usually only a small change, but if you have an electromagnet that consists of a wire wound round an iron core, and you bring a permanent magnet near to that core, then the magnetization of that core can change drastically (for example, if there is no current in the wire, the electromagnet would not be magnetic, but when the permanent magnet is brought near, the core of the electromagnet becomes magnetic).

Thus the Ampere model is suitable for computing the magnetic force-field of a permanent magnet, but for electromagnets it can be better to use a magnetic-circuit approach.

### Magnetic dipole-dipole interaction

If two or more magnets are small enough or sufficiently distant that their shape and size is not important then both magnets can be modeled as being magnetic dipoles having a magnetic moments m1 and m2.

field from a perfect dipole, both electric or magnetic.

The magnetic field of a magnetic dipole in vector notation is:

$\mathbf{B}(\mathbf{m}, \mathbf{r}) = \frac {\mu_0} {4\pi r^3} \left(3(\mathbf{m}\cdot\hat{\mathbf{r}})\hat{\mathbf{r}}-\mathbf{m}\right) + \frac{2\mu_0}{3}\mathbf{m}\delta^3(\mathbf{r})$

where

B is the field
r is the vector from the position of the dipole to the position where the field is being measured
r is the absolute value of r: the distance from the dipole
$\hat{\mathbf{r}} = \mathbf{r}/r$ is the unit vector parallel to r;
m is the (vector) dipole moment
μ0 is the permeability of free space
δ3 is the three-dimensional delta function.[note 2]

This is exactly the field of a point dipole, exactly the dipole term in the multipole expansion of an arbitrary field, and approximately the field of any dipole-like configuration at large distances.

Frames of reference for calculating the forces between two dipoles

If the coordinate system is shifted to center it on m1 and rotated such that the z-axis points in the direction of m1 then the previous equation simplifies to[6]

$B_{z}(\mathbf{r}) = \frac{\mu_0}{4 \pi} m_1 \left(\frac{3\cos^2\theta-1}{r^3}\right)$
$B_{x}(\mathbf{r}) = \frac{\mu_0}{4 \pi} m_1 \left(\frac{3\cos\theta\sin\theta}{r^3}\right)$,

where the variables r and θ are measured in a frame of reference with origin in m1 and oriented such that m1 is at the origin pointing in the z-direction. This frame is called Local coordinates and is shown in the Figure on the right.

The force of one magnetic dipole on another is determined by using the magnetic field of the first dipole given above and determining the force due to the magnetic field on the second dipole using the force equation given above. Using vector notation, the force of a magnetic dipole m1 on the magnetic dipole m2 is:

$\mathbf{F}(\mathbf{r}, \mathbf{m}_1, \mathbf{m}_2) = \frac{3 \mu_0}{4 \pi r^5}\left[(\mathbf{m}_1\cdot\mathbf{r})\mathbf{m}_2 + (\mathbf{m}_2\cdot\mathbf{r})\mathbf{m}_1 + (\mathbf{m}_1\cdot\mathbf{m}_2)\mathbf{r} - \frac{5(\mathbf{m}_1\cdot\mathbf{r})(\mathbf{m}_2\cdot\mathbf{r})}{r^2}\mathbf{r}\right]$

where r is the distance-vector from dipole moment m1 to dipole moment m2, with r=||r||. The force acting on m1 is in opposite direction. As an example the magnetic field for two magnets pointing in the z-direction and aligned on the z-axis and separated by the distance z is:

$\mathbf{F}(z,m_1, m_2) = -\frac{3 \mu_0 m_1 m_2}{2 \pi z^4}$, z-direction.

The final formulas are shown next. They are expressed in the global coordinate system,

$F_r(\mathbf{r}, \alpha, \beta) = - \frac{3 \mu_0}{4 \pi}\frac{m_2 m_1}{r^4}\left[2\cos(\phi - \alpha)\cos(\phi - \beta)- \sin(\phi - \alpha)\sin(\phi - \beta)\right]$
$F_{\phi}(\mathbf{r}, \alpha, \beta) =- \frac{3 \mu_0}{4 \pi}\frac{m_2 m_1}{r^4}\sin(2\phi - \alpha - \beta)$

## Notes

1. ^ The magnetic dipole portion of the magnetic field can be understood as being due to one pair of north/south poles. Higher order terms such as the quadrupole can be considered as due to 2 or more north/south poles ordered such that they have no lower order contribution. For example the quadrupole configuration has no net dipole moment.
2. ^ δ3(r) = 0 except at r = (0,0,0), so this term is ignored in multipole expansion.

## References

1. ^ Griffiths, David J. (1998). Introduction to Electrodynamics (3rd ed.). Prentice Hall. ISBN 0-13-805326-X., section 6.1.
2. ^ "Basic Relationships". Geophysics.ou.edu. Retrieved 2009-10-19.
3. ^ a b "Magnetic Fields and Forces". Retrieved 2009-12-24.
4. ^ "The force produced by a magnetic field". Retrieved 2013-11-07.
5. ^ David Vokoun, Marco Beleggia, Ludek Heller, Petr Sittner, Magnetostatic interactions and forces between cylindrical permanent magnets, Journal of Magnetism and Magnetic Materials, Volume 321, Issue 22, November 2009, Pages 3758-3763, doi:10.1016/j.jmmm.2009.07.030. [Article http://www.sciencedirect.com/science/article/B6TJJ-4WSRF7C-2/2/5ede3141fb91e35e83abf6edab5abb94]. Retrieved 02.2009
6. ^ Schill, R. A. (2003). "General relation for the vector magnetic field of a circular current loop: A closer look". IEEE Transactions on Magnetics 39 (2): 961–967. Bibcode:2003ITM....39..961S. doi:10.1109/TMAG.2003.808597.