# Modelling the magnetic dipole

Kira Seleznyova, Mark Strugatsky, Janis Kliava

► To cite this version:

Kira Seleznyova, Mark Strugatsky, Janis Kliava. Modelling the magnetic dipole. European Journal of Physics, 2016, 37 (2), pp.025203 (1-14). 10.1088/0143-0807/37/2/025203. hal-01275891

HAL Id: hal-01275891

https://hal.science/hal-01275891

Submitted on 18 Feb 2016

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
# Modelling the magnetic dipole

Kira Seleznyova¹,², Mark Strugatsky² and Janis Kliava¹

¹LOMA, UMR 5798 Université de Bordeaux CNRS, F 33405 Talence cedex, France

²Physics and Technology Institute, Crimean Federal V.I. Vernadsky University, Simferopol, Republic of Crimea

E mail: janis.kliava@u.bordeaux.fr

**Abstract**

Three different models of a magnetic dipole, viz., a uniformly magnetised sphere, a circular current loop and a pair of fictitious magnetic charges, have been systematically analysed within the formalism based on the vector potential of the magnetic field. The expressions of the potentials and magnetic fields produced by each dipole model have been obtained. A computer code has been put forward in order to visualise magnetic field lines for different dipole models. It has been shown that the magnetic field outside the uniformly magnetised sphere coincides with that of a point dipole. The other two models give considerably different results at distances small or intermediate in comparison with the dipole size.

Keywords: magnetic dipole, uniformly magnetised sphere, circular current loop, pair of magnetic monopoles, magnetic field lines

## 1. Introduction

In electrostatics, the primary source of the electric field is an electric charge. In contrast, in magnetostatics, insofar as ‘magnetic charges’ magnetic monopoles have not been found in nature, the same fundamental role of primary source of the magnetic field is played by the magnetic dipole. Therefore, adequate modelling of the magnetic dipole is of paramount importance, both in teaching and scientific research.

As far as a *point* dipole is only an abstract idea, in teaching magnetostatics as well as in research in the field of magnetism, it is useful to consider dipole models more realistic physical systems yielding the same magnetic field as the point dipole, at least, at distances much larger than their own size. Most often, as such a model in magnetostatics one considers a circular current loop or, by analogy with electrostatics, a pair of *fictitious* magnetic charges
of opposite sign. Meanwhile, there is the third possibility, that to model the magnetic dipole as a uniformly magnetised three-dimensional body of a simple, e.g., spherical shape. Usually, the uniformly magnetised sphere is considered in a different context, viz., as an illustration of a boundary-value problem in magnetostatics [1, p 198 ff], or an example of application of the vector potential [2, p 236], thus overlooking the opportunity of using it as one more model of the magnetic dipole. Below we shall compare in detail all three dipole models.

Of course, the magnetic field produced by a dipole model at intermediate and shorter distances will differ from that of the point dipole; moreover, the predictions of different models can be quite different. This issue is of importance, e.g., in studying magnetic dipole dipole interactions between paramagnetic ions in solid state, in which case a comparison with experimental observations allows choosing the most adequate description of a given magnetic source.

In teaching electromagnetism, the analogy between electrostatics and magnetostatics suggests that the electric and the magnetic dipole should be introduced in an analogous manner. This can be implemented in two different ways: (i) by calculating the electric and magnetic dipole fields through the Coulomb and Biot Savart laws, respectively and (ii) by deriving them from scalar and vector potentials, respectively. The first way has been explored in detail by Bezerra et al [3]. We have chosen the second way, more sophisticated from the conceptual viewpoint but allowing to considerably simplify certain computations.

In one form or another, the models considered below have been described in a number of textbooks and/or research papers. Meanwhile, we have tried to present them systematically within the same formalism and comparing exact analytical expressions with Taylor expansions to higher-than-first order, providing simple expressions of potentials and fields valid not only at large but also at intermediate distances. A computer code has been put forward, allowing to visualise magnetic field lines computed using both exact expressions and Taylor expansions.

We believe that this paper will be interesting and useful to people involved in teaching both undergraduate and graduate courses as well as in research work in the field of electromagnetism.

## 2. Point dipole: an overview

According to the Biot Savart law of magnetostatics, the magnetic field $B(r)$ produced in a point of space $r = (x, y, z)$ by an arbitrary distribution of steady currents in a volume $V'$ is (e.g., see [1, p 175 ff], [2, p 215 ff]):

$$B(r) = \frac{\mu_0}{4\pi} \int_{V'} \frac{j(r') \wedge (r - r')}{|r - r'|^3} dV'. \quad (1)$$

The same expression is obtained with the help of the relation $B(r) = \nabla \wedge A(r)$, $A(r)$ being the corresponding vector potential:

$$A(r) = \frac{\mu_0}{4\pi} \int_{V'} \frac{j(r')}{|r - r'|} dV'. \quad (2)$$

In equations (1) and (2) $\mu_0$ is the permeability of vacuum, $j(r')$ is the current density in a point $r' = (x', y', z')$ of the magnetic source, and the integration is performed over the whole distribution of currents. The corresponding analysis, outlined below, can be found, e.g., in Jacksons' and Landau and Lifshitz's textbooks ([1, p 184 ff], [4, p 103 ff]).
Equation (2) can be expanded in powers of $r^{-1}$ (the multipole expansion):

$$A(\mathbf{r}) = \frac{\mu_0}{4\pi} \frac{1}{r^{n+1}} \sum_{n=0}^{\infty} \int_{V'} r'^n j(\mathbf{r}') P_n(\cos \alpha) dV', \quad (3)$$

where $P_n$ are the Legendre polynomials and $\alpha$ is the angle between $\mathbf{r}$ and $\mathbf{r}'$. The first term of this development ($n = 0$)

$$A_m = \frac{\mu_0}{4\pi r} \int_{V'} j(\mathbf{r}') dV', \quad (4)$$

is the vector potential of the magnetic monopole, $A_m$, and it is shown to vanish. The second term in equation (3), $n = 1$, the magnetic dipole term

$$A_d = \frac{\mu_0}{4\pi r^3} \int_{V'} (\mathbf{r} \cdot \mathbf{r}') j(\mathbf{r}') dV', \quad (5)$$

can be put in the following form:

$$A_d = -\frac{\mu_0}{4\pi} \mathbf{m} \wedge \nabla \frac{1}{r}, \quad (6)$$

where $\mathbf{m}$ is the magnetic dipole moment:

$$\mathbf{m} = \frac{1}{2} \int_{V'} \mathbf{r}' \wedge j(\mathbf{r}') dV'. \quad (7)$$

Taking the curl of $A_d$, applying the product rule and keeping in mind that $\mathbf{m}$ is a fixed vector, for the magnetic field produced by a point dipole one gets:

$$B_d = \frac{\mu_0}{4\pi} \frac{3(\mathbf{m} \cdot \mathbf{r})\mathbf{r} - r^2\mathbf{m}}{r^5}. \quad (8)$$

According to the Curie symmetry principle [5], the effects generated by a cause can have only higher and not lower symmetry than the cause itself. We put the dipole at the origin $O$ (in subsequent sections, $O$ will be chosen in the centre of the dipole model). As far as the dipole field is invariant with respect to rotation about its axis denoted as $Oz$, the use of cylindrical coordinates $\rho, \varphi, z$ and the corresponding unit vectors $e_\rho, e_\varphi, e_z$ is the most appropriate, and all calculations can be restricted to a plane containing $Oz$. The position of a point in this plane can be defined either by the radius $r$ and the polar angle $\vartheta$ or by the distance $\rho = r \sin \vartheta$ and the height $z = r \cos \vartheta$; below we are thoroughly using the former definition. Thus, equations (6) and (8) become:

$$A_d = \frac{\mu_0 m}{4\pi r^2} \sin \vartheta e_\varphi \quad (9)$$

and

$$B_d = \frac{\mu_0 m}{4\pi r^3} \left[ \frac{3}{2} \sin 2\vartheta e_\rho + (3 \cos^2 \vartheta - 1) e_z \right]. \quad (10)$$

### 3. Uniformly magnetised sphere

The magnetic field produced by a uniformly magnetised sphere, see figure 1, has been addressed, e.g., in [1, p 198 ff]. A related model, that of a spinning spherical shell carrying a uniform surface charge, has been treated in the Griffith's textbook [2, p 236 ff].

We consider the magnetised sphere of radius $R$ and magnetic dipole moment $\mathbf{m} = \frac{4}{3}\pi R^3 \mathbf{M}$ where $\mathbf{M}$ is the magnetisation vector supposed to be uniform, as an assembly of
<figure><img src="image_2.png" /><figcaption>Figure 1. Magnetic dipole modelled by a uniformly magnetised sphere.</figcaption></figure>

elementary dipoles. Taking into account equation (6), the vector potential produced by such a sphere in a point of radius vector **r** can be calculated as a sum of contributions of all volume elements dV' of radius vector **r**' and dipole moment dm = **M**dV':

$$
\mathbf{A} = -\frac{\mu_0}{4\pi} \int_{V'} \mathbf{M} \wedge \nabla' \frac{1}{|\mathbf{r} - \mathbf{r}'|} \mathrm{d}V'. \qquad (11)
$$

For a uniform **M**, the latter expression can be rewritten as

$$
\mathbf{A} = -\frac{\mu_0}{4\pi} \int_{V'} \nabla' \wedge \frac{\mathbf{M}}{|\mathbf{r} - \mathbf{r}'|} \mathrm{d}V'. \quad (12)
$$

In accordance with a well-known theorem of vector analysis, the volume integral in this expression can be transformed to an integral over the surface S' of the sphere:

$$
\mathbf{A}(\mathbf{r}) = \frac{\mu_0}{4\pi} \oint_{S'} \frac{\mathbf{M} \wedge \mathbf{n}}{|\mathbf{r} - \mathbf{r}'|} dS', \quad (13)
$$

where **n** = **r**'/**r**' is the unit vector normal to S' and dS' = R² sin ϑ'dϑ'dϕ'. A comparison between equations (2) and (13) shows that the latter describes the vector potential of a surface current of density *j*<sub>s</sub> (*r*) = **M** ∧ **n**.

We choose the space origin in the centre of the sphere and the z axis parallel to **r**, **r** = **r** *e*<sub>z</sub> (such a choice allows simplifying the calculation, see [2, p 236 ff]). One can see from figure 1 that **r**' = *R* (sin ϑ' cos ϕ', sin ϑ' sin ϕ', cos ϑ') and **r** − **r**'| = (*r*<sup>2</sup> + *R*<sup>2</sup> − 2*r**R cos ϑ')<sup>1/2</sup>. Because of the rotational symmetry about **M**, without loss of generality **M** can be confined in the xz plane, forming an angle ϑ with **r**, **M** = *M* (sin ϑ, 0, cos ϑ), so that

$$
\begin{equation}
\begin{split}
\mathbf{M} \wedge \mathbf{n} = M \left( \right. & - \sin \vartheta' \sin \varphi' \cos \vartheta, \quad \sin \vartheta' \cos \varphi' \cos \vartheta \\
& \left. - \cos \vartheta' \sin \vartheta, \quad \sin \vartheta' \sin \varphi' \sin \vartheta \right).
\end{split}
\tag{14}
\end{equation}
$$

Making these substitutions in equation (13), we remark that integrating over the range
0 ≤ ϕ' < 2π will eliminate contributions of all ϕ'-dependent terms in equation (14). The
remaining integral over ϑ' yields:
$$A = \begin{cases} \frac{\mu_0 m r}{4\pi R^3} \sin \vartheta e_\varphi, & r \le R, \\ \frac{\mu_0 m}{4\pi r^2} \sin \vartheta e_\varphi, & r \ge R. \end{cases} \qquad (15)$$

Taking the curl of $A$ inside and outside the sphere, we get the corresponding magnetic fields $B^{\text{int}}$ and $B^{\text{ext}}$ in cylindrical coordinates:

$$B^{\text{int}} = 2 \frac{\mu_0 m}{4\pi R^3} e_z,$$

$$B^{\text{ext}} = \frac{\mu_0 m}{4\pi r^3} \left[ \frac{3}{2} \sin 2\vartheta e_{\rho} + (3 \cos^2 \vartheta - 1) e_z \right]. \qquad (16)$$

One can see that inside the uniformly magnetised sphere the magnetic field is uniform, as known from magnetostatics. Most interestingly, outside this sphere the magnetic field at any distance coincides with that of the point dipole, see equations (16) and (10).

### 4. Circular current loop

Most often, in magnetostatics one takes a circular loop of electric current (Ampérian current) as a basic model of the magnetic dipole. Let us consider a loop of radius $R$ and area $S = \pi R^2$, placed in the $xy$ plane and centred at the origin, see figure 2. The loop is carrying a current $I$ supposed to flow in counterclockwise direction as seen from above the $xy$ plane; so, by definition, its magnetic moment is $m = \pi R^2 I$. An element of current $Idl$, where $dl$ is an elementary vector tangent to the loop in a point $M$, produces an elementary vector potential in an arbitrary point in space $P$:

$$dA = \frac{\mu_0 m}{4\pi \pi R^2 |MP|} dl. \qquad (17)$$

Because of rotational symmetry about the $z$ axis, without loss of generality $P$ can be positioned in the $yz$ plane. In polar coordinates we get $dl = R d\varphi e_\varphi$. From figure 2 one can see that $\overline{MP} = \overline{MO} + \overline{OP}$ and $|MP| = \sqrt{r^2 + R^2 - 2Rr \sin \vartheta \sin \varphi'}$.

In performing the integration of $dA$ over the current loop, $dl$ should be converted to Cartesian coordinates by substituting $e_\varphi' = -\sin \varphi' e_x + \cos \varphi' e_y$. Thus

$$A = \frac{\mu_0 m}{4\pi \pi R} \int_0^{2\pi} \frac{-\sin \varphi' e_x + \cos \varphi' e_y}{\sqrt{r^2 + R^2 - 2Rr \sin \vartheta \sin \varphi'}} d\varphi'. \qquad (18)$$

It turns out that $A_y = 0$. Identifying $A_x$ as $-A_\varphi$, and denoting $r_\pm^2 = r^2 + R^2 \pm 2Rr \sin \vartheta$ and $k = 2\sqrt{Rr \sin \vartheta}/r_+$, we get:

$$A = \frac{\mu_0}{4\pi} \frac{8m}{Rk^2 r_+} \left[ \left(1 - \frac{1}{2}k^2\right) K(k) - E(k) \right] e_\varphi \qquad (19)$$

where $K(k)$ and $E(k)$ are, respectively, complete elliptic integrals of the first and second kind. From this equation we derive the cylindrical components of the magnetic field vector:

$$B_\varphi = \frac{\mu_0}{4\pi} \frac{2m}{R^2 r_+ r_-^2} \cot \vartheta \left[ (r^2 + R^2)E(k) - r_-^2 K(k) \right], \\ B_z = \frac{\mu_0}{4\pi} \frac{2m}{R^2 r_+ r_-^2} \left[ (R^2 - r^2)E(k) - r_+^2 K(k) \right]. \qquad (20)$$
<figure><img src="image_3.png" /><figcaption>Figure 2. Magnetic dipole modelled by an Ampérian current.</figcaption></figure>

As one can see, in the model of a current loop, the vector potential and the magnetic field can be analytically expressed only through the elliptical integrals. In order to obtain simpler expressions valid at intermediate distances, we have applied expansions in Taylor series to the sixth order in the small parameter $\epsilon = R/r$. Expanding equation (19) we get:

$$A = \frac{\mu_0 m}{4\pi r^2} \left( -P_1^1 + \frac{1}{4}P_3^1\epsilon^2 - \frac{1}{8}P_5^1\epsilon^4 + \frac{5}{64}P_7^1\epsilon^6 \right) e_{\varphi}. \quad (21)$$

The same development applied to equation (20) yields approximate expressions for the magnetic field:

$$ \begin{aligned} B_{\rho} &= \frac{\mu_0 m}{4\pi r^3} \left( -P_2^1 + \frac{3}{4}P_4^1\epsilon^2 - \frac{5}{8}P_6^1\epsilon^4 + \frac{35}{64}P_8^1\epsilon^6 \right), \\ B_{\varphi} &= \frac{\mu_0 m}{4\pi r^3} \left( 2P_2^1 - 3P_4^1\epsilon^2 + \frac{15}{4}P_6^1\epsilon^4 - \frac{35}{8}P_8^1\epsilon^6 \right). \end{aligned} \quad (22) $$

Here for brevity we are using the Legendre polynomials $P_n(\cos \vartheta)$ and associated Legendre polynomials $P_n^m(\cos \vartheta)$ shortened to $P_n$ and $P_n^m$, respectively (see [6, p 716 ff and 741 ff]).

## 5. Pair of fictitious magnetic charges

The third model represents the magnetic dipole as an assembly of two fictitious magnetic monopoles, or ‘magnetic charges’ $\pm q$ a distance $d$ apart, see figure 3. By analogy with electrostatics, the magnetic dipole moment is defined as $m = qd$, so that in order to calculate the magnetic field produced by such a model, one is tempted to introduce a scalar magnetic potential, see [1, p 196 ff]. However, for the sake of consistency, we prefer using here a vector potential, and, in accordance with the superposition principle, it can be taken as a sum of the vector potentials of two magnetic monopoles of opposite signs.

The vector potential of a magnetic monopole introduced by Dirac [7]

$$A = \frac{\mu_0 m}{4\pi d r} \frac{1 - \cos \vartheta}{\sin \vartheta} e_{\varphi}, \quad (23)$$

yields a correct expression of the magnetic field expected to be produced by a magnetic monopole. However, it is not quite satisfactory from both mathematical and physical
<figure><img src="image_4.png" /><figcaption>Figure 3. Magnetic dipole modelled by an assembly of two ‘magnetic charges’.</figcaption></figure>

standpoints, as far as it exhibits a singularity along the half-line $\vartheta = \pi$ (the so-called Dirac string); while for a magnetic monopole the direction of this half-line is completely arbitrary. Meanwhile, it can be readily shown that the vector potential of a pair of magnetic monopoles of opposite signs,

$$ \mathbf{A} = \frac{\mu_0 m}{4\pi d} \left( \frac{1 - \cos \vartheta_p}{r_p \sin \vartheta_p} - \frac{1 - \cos \vartheta_m}{r_m \sin \vartheta_m} \right) \mathbf{e}_{\varphi}, \quad (24) $$

has no more such singularities. The latter equation can be rewritten as:

$$ \mathbf{A} = \frac{\mu_0 m}{4\pi r d \sin \vartheta} \left( \frac{r \cos \vartheta + \frac{1}{2} d}{r_m} - \frac{r \cos \vartheta - \frac{1}{2} d}{r_p} \right) \mathbf{e}_{\varphi}, \quad (25) $$

where the connotation of different symbols is shown in figure 3. Obviously, the following relations hold: $r_{p,m} = \sqrt{r^2 \mp dr \cos \vartheta + \frac{1}{2} d^2}$, $\cos \vartheta_{p,m} = \frac{r \cos \vartheta \mp \frac{1}{2} d}{r_{p,m}}$ (the upper and lower signs corresponding to the first and second subscripts, respectively) and $r_{p,m} \sin \vartheta_{p,m} = r \sin \vartheta$.

For the magnetic field components we get:

$$ \begin{aligned} B_{\rho} &= \frac{\mu_0 m}{4\pi d} r \sin \vartheta \left( \frac{1}{r_p^3} - \frac{1}{r_m^3} \right), \\ B_{z} &= \frac{\mu_0 m}{4\pi d} \left( \frac{r \cos \vartheta - \frac{1}{2} d}{r_p^3} - \frac{r \cos \vartheta + \frac{1}{2} d}{r_m^3} \right). \end{aligned} \quad (26) $$

Note that the latter equations can be immediately obtained from the corresponding expressions for the electric dipole by substituting the electric dipole moment and the permittivity of vacuum $\epsilon_0$ by the magnetic dipole moment and $\mu_0^{-1}$, respectively. These expressions are simpler in comparison with those obtained for the model of a current loop. Yet, we still provide the corresponding expansions in the Taylor series, useful for a direct comparison between these two models. In the same approximation as in the previous section, redefining the small parameter as $\epsilon = d/r$, equations (25) and (26) become, respectively:
$$A = -\frac{\mu_0 m}{4\pi r^2} \left( P_1^1 + \frac{1}{12} P_3^1 \varepsilon^2 + \frac{1}{80} P_5^1 \varepsilon^4 + \frac{1}{448} P_7^1 \varepsilon^6 \right) e_{\varphi} \quad (27)$$

and

$$B_{\rho} = -\frac{\mu_0 m}{4\pi r^3} \left( P_2^1 + \frac{1}{4} P_4^1 \varepsilon^2 + \frac{1}{16} P_6^1 \varepsilon^4 + \frac{1}{64} P_8^1 \varepsilon^6 \right), \\ B_{z} = \frac{\mu_0 m}{4\pi r^3} \left( 2P_2 + P_4 \varepsilon^2 + \frac{3}{8} P_6 \varepsilon^4 + \frac{1}{8} P_8 \varepsilon^6 \right). \quad (28)$$

## 6. Comparison between the dipole models

Figure 4 compares radial dependences of $B_z$ in the equatorial plane $\vartheta = \pi/2$ for different dipole models. The calculations have been made using the exact expressions for $B_z$. The model sizes and the distances are scaled in relative distance units (rdu). As one can see, for the uniformly magnetised sphere of radius $R$, $B_z$ remains uniform at $\rho < R$, has a discontinuity at $\rho = R$ and follows the corresponding dependence for the point dipole at $\rho > R$. The analogous dependence for the current loop of radius $R$ has a singularity at $\rho = R$, and for the pair of magnetic charges $B_z$ has a minimum at $\rho = 0$. Thus, at small and intermediate distances in comparison with the model size, the behaviour of all three models is very different. At large distances, see inset in figure 4, the magnetic fields produced by different magnetic dipole models match that of the point dipole, as expected.

A still better insight in the behaviour of different models at small and intermediate distances can be achieved by visualising magnetic field lines. By definition, the elementary vector of the tangent to the field line, $dL$, in each point of this line is parallel to the field vector. The vector product for parallel vectors vanishes, so, for the magnetic field lines we get $dL \wedge B = 0$. In cylindrical coordinates this reduces to $dz/d\rho = B_z/B_\rho$, and we get the following equation for the magnetic field lines:

$$z(\rho) = \int_{y=\rho_{\text{inf}}}^{\rho \le \rho_{\text{sup}}} \frac{B_z(y, z)}{B_\rho(y, z)} dy, \quad (29)$$

where $\rho_{\text{inf}}$ and $\rho_{\text{sup}}$ are, respectively, the smallest and the largest value of $\rho$ for a given field line, and $z \in [\rho_{\text{inf}}, \rho_{\text{sup}}]$ is a dummy variable.

We have put forward a FORTRAN 77 computer code for calculating the magnetic field lines for different dipole models according to both the exact expressions and their Taylor expansions, see the appendix. Visualisation of the field lines calculated using the Taylor expansions allows to estimate contributions of various expansion terms and the general convergence of the Taylor series for different models.

In the current loop model the exact expressions of the magnetic field components, equation (20), are very complicated, so, we have chosen to compute them by numerical integration over the angle $\varphi'$ of the elementary field components expressed through the Biot Savart law, see equation (1) and figure 2:

$$B_{\rho} = \frac{\mu_0 m}{4\pi \pi R} \int_{0}^{2\pi} \frac{z \sin \varphi'}{(R^2 + \rho^2 - 2R\rho \sin \varphi' + z^2)^{3/2}} d\varphi', \\ B_{z} = \frac{\mu_0 m}{4\pi \pi R} \int_{0}^{2\pi} \frac{R - \rho \sin \varphi'}{(R^2 + \rho^2 - 2R\rho \sin \varphi' + z^2)^{3/2}} d\varphi'. \quad (30)$$
<figure><img src="image_5.png" /><figcaption>**Figure 4.** $B_z(\rho, \vartheta = \pi/2)$ dependences for a uniformly magnetised sphere of radius $R = 0.3$ rdu (circles, grey online), a circular current loop of radius $R = 0.3$ rdu, (diamonds, blue online) and a pair of fictitious magnetic charges, $d = 0.3$ rdu apart, (dashed, red online) compared do that of the point dipole (continuous, green online). The inset: shows a zoom in the behaviour of $B_z$ at larger distances.</figcaption></figure>

The corresponding exact expressions for the model of a pair of magnetic charges have been given in the previous section, see equation (26).

The Taylor expansions of the field line equation in the computer code have been obtained by expanding in the Taylor series the ratio $B_z$ over $B_\rho$. For the model of a current loop this results in

$$ \frac{B_z}{B_\rho} = \frac{2}{3} \frac{1}{\sin 2\vartheta} \left[ \begin{aligned} & 3 \cos^2 \vartheta - 1 + \frac{1}{4}(5 \cos^2 \vartheta + 3)\varepsilon^2 - \frac{5}{32}(7 \cos^4 \vartheta - 6 \cos^2 \vartheta - 1)\varepsilon^4 \\ & + \frac{5}{512}(203 \cos^6 \vartheta - 273 \cos^4 \vartheta + 65 \cos^2 \vartheta + 5)\varepsilon^6 \end{aligned} \right], \quad (31) $$

and for that of a pair of magnetic charges we get:

$$ \frac{B_z}{B_\rho} = \frac{2}{3} \frac{1}{\sin 2\vartheta} \left[ \begin{aligned} & 3 \cos^2 \vartheta - 1 - \frac{1}{12}(5 \cos^2 \vartheta + 3)\varepsilon^2 - \frac{1}{144}(7 \cos^4 \vartheta - 15 \cos^2 \vartheta)\varepsilon^4 \\ & - \frac{1}{1728}(26 \cos^6 \vartheta - 63 \cos^4 \vartheta + 45 \cos^2 \vartheta)\varepsilon^6 \end{aligned} \right]. \quad (32) $$

We remind the reader that in equations (31) and (32) $\varepsilon$ has different meaning. In all cases, the numerical integration over $\rho$ in equation (29) has been performed using the Runge Kutta method [8].
<figure><img src="image_6.png" /><figcaption>**Figure 5.** Magnetic field lines for different dipole models scaled in rdu. The external line (red online) corresponds to a pair of magnetic charges *d* = 0.75 apart. The intermediate dashed (green online) and continuous (grey online) lines refer to a point dipole and uniformly magnetised sphere of radius *R* = 0.20, respectively. The internal line (blue online) is due to a current loop of radius *R* = 0.40. All the lines merge at the maximal distance *r*<sub>max</sub> = 2.0.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>**Figure 6.** Magnetic field lines in the models of a current loop (a) and of a pair of magnetic charges (b) calculated using the exact expressions of the magnetic fields (continuous lines) and the Taylor expansions to the 0th, 2nd, 4th and 6th order in the corresponding small parameters. All the lines merge at the maximal distance *r*<sub>max</sub> = 2.0 rdu. With increasing the expansion order, in (a) each subsequent field line remains confined inside the previous one, while in (b) it passes alternately from inside to outside of the exact field line profile.</figcaption></figure>

With the aid of this programme we have visualised the field lines for all models, see figure 5. The calculations have been made using the exact expressions, *vide supra*, and the modelling parameters have been chosen in such a way that all the field lines ostensibly merge at the maximal distance *r*<sub>max</sub> from the source. As one can see, at distances comparable with the model size, the appearance of the field lines predicted by each model is totally different. The lines produced by a uniformly magnetised sphere are parallel to the dipole axis inside the sphere and coincide with those of the point dipole outside the sphere. The lines due to a current loop close on themselves inside the loop while those of a pair of magnetic charges diverge from the positive charge and converge towards the negative one. In all cases, at small distances the behaviour of the field lines has nothing in common with that expected for the point dipole, in which case the field lines close on themselves in the space origin.

In certain applications, e.g. in calculating the interaction energy between magnetic moments embedded in a condensed matrix, one needs a good approximation for the magnetic field produced at intermediate distances from the magnetic source. Obviously, in such cases in the multipole expansion, see equation (3), higher-order terms (quadrupole etc) should be maintained. Figure 6 compares the magnetic field lines calculated using the exact expressions
and Taylor expansions to different orders in the corresponding small parameter for the models of a circular current loop and a pair of fictitious magnetic charges. One can see that in the model of a current loop the expansion up to the 6th order in $\epsilon = R/r$ provides a good approximation for $R/r_{max} \le 3/4$, and in the model of a pair of magnetic charges the same expansion in $\epsilon = d/r$ already for $d/r_{max} = 3/4$ yields a result practically indistinguishable from that of the exact calculation.

## 7. Conclusions

In this work we have presented a consistent approach, based on the vector potential formalism, to the calculation of the magnetic field produced by different models of the magnetic dipole. Of course, exactly the same results could be obtained with the scalar magnetic potential. However, using the vector potential for calculating the magnetic field is more acceptable from the methodological and educational points of view. Indeed, in teaching electrostatics and magnetostatics, it is preferable to respect a certain 'symmetry', viz., to preserve 'parenting relationships' from the scalar potential to the electric field and from the vector potential to the magnetic field.

We have seen that all three models of the magnetic dipole considered in this study yield identical results at large distances. Indeed, the first terms of Taylor expansions of the magnetic field for both the models of a current loop and of a pair of magnetic charges coincide with the exact expression of the magnetic field outside the uniformly magnetised sphere. Therefore, such a sphere represents not only a perfect but also a quite physically realistic model of the point dipole.

However, starting from the second term in the Taylor series, the magnetic field in the models of a current loop and of a pair of magnetic charges totally diverge. Interestingly, for these models this divergence goes in opposite directions, so that the characteristics of the magnetic dipole models at small and intermediate distances become quite sensible to the choice of the dipole model. Our computer code allows visualising these discrepancies; besides, it gives the possibility of comparing the aspect of the magnetic field lines calculated using the exact expressions of the magnetic field and the corresponding approximate expressions obtained by expanding in Taylor series of different order.

# Appendix. Computer code for visualising field lines produced by different magnetic dipole models

C Calculates magnetic field lines for the current loop and pair of charges models

C with both exact expressions and Taylor expansions up to 6th order

C*******************************************************************

IMPLICIT DOUBLE PRECISION (a h,p z)

DIMENSION zp(10001: 10001), zn(10001: 10001)

COMMON/Parametres/me, N, y ( 10001: 10001), Pi, d,nea, nT

COMMON /Angulaire/Sphi(1000), pas ang, Na

Pi = dacos( 1d0)

C*******************************************************************

C me = 1: Current loop; me = 2: Pair of charges

C nea = 1: Exact calculation; nea = 2: Taylor expansion

C nT = 0, 2, 4, 6: order of Taylor expansion

C*******************************************************************
(Continued.)

me = 1

nea = 1

nT = 2

C d = loop radius for me = 1 and d = charge separation for me= 2.

d = 1.5d0

C y sup: maximal distance between the dipole and the observation point.

y inf = 0.d0

y sup = 2.0d0

C Na: number of angles used in integrating the magnetic field over the loop

Na = 90

pas ang = 0.5d0*Pi/dble(Na)

C*******************************************************************

C Preparing the integration

DO i = 1, Na

phi = 36d1/dble(Na)*dble(i)

Sphi(i) = dsind phi

ENDDO

C*******************************************************************

C Discretising y

N = 1000

dN = dble(N)

pas y = (y sup y inf)/dN

DO j = N, N

y (j) = dble(j)*pas y

ENDDO

C*******************************************************************

C Calculating the field line with Runge Kutta method

j = N

C Choosing an initial value of z (z > 0d0) to get a smooth aspect of the field line

z = 0.01d0

1 zp(j) = z

zn(j) = z

zp(j) = z

zn(j) = z

y1 = y (j)

z1 = z

CALL Ratio(y1, z1, a)

z2 = z1 0.5d0*pas y*a

y2 = y1 0.5d0*pas y

CALL Ratio(y2, z2, b)

z3 = z1 0.5d0*pas y*b

CALL Ratio(y2, z3, c)

z4 = z1 pas y*c

y3 = y1 pas y

CALL Ratio(y3, z4, dd)

z = z pas y*(a + 2d0*b + 2d0*c + dd)/6d0

C Continue calculating

2 IF (j. gt. 0. and. z. gt. 0d0) THEN

j = j 1

GOTO 1

ENDIF
(Continued.)

C*******************************************************************

C Creating output file. `zp` and `zn` are the upper and lower parts of the field line.

C
Give an appropriate file name!
`OPEN(2,file = 'Cur loop d = 1.5 exact.txt')`

DO j = N, N

WRITE (2, 3) y (j), zp(j), zn(j)

ENDDO

3 FORMAT (3E24.6)

CLOSE(2)

99 END

C*******************************************************************

SUBROUTINE Ratio (y, z, rat)

C Implements the Runge Kutta procedure

C*******************************************************************

IMPLICIT DOUBLE PRECISION (a, p, z)

DIMENSION rT(0: 6)

COMMON/Parametres/me, N, y ( 10001: 10001), Pi, d, nea, nT

COMMON/Angulaire/Sphi(1000), pas ang, Na

C*******************************************************************

IF (nea. eq. (1)) THEN

C Exact calculation

IF (me. eq. (1)) THEN

C Current loop: integrating the magnetic field over the loop

By = 0d0

Bz = 0d0

DO i = 1, Na

rpm = (y**2 + z**2 2d0*d*y*Sphi(i) + d**2)**1.5

dBy = 1d0/Pi/d*z*Sphi(i)/rpm

dBz = 1d0/Pi/d*(d y*Sphi(i))/rpm

By = (By + dBy*pas ang)

Bz = (Bz + dBz*pas ang)

ENDDO

C*******************************************************************

ELSEIF (me. eq. (2)) THEN

C Pair of charges

rm = ((z 0.5d0*d)**2 + y**2)**1.5

rp = ((z + 0.5d0*d)**2 + y**2)**1.5

Bz = (z 0.5d0*d)/rm (z + 0.5d0*d)/rp

By = y*(1d0/rm 1d0/rp)

C*******************************************************************

ENDIF

rat = Bz/By

C*******************************************************************

ELSEIF (nea. eq. (2)) THEN

C Taylor expansion

z2 = z**2

z4 = z2**2

y2 = y**2

y4 = y2**2

r2 = y2 + z2
(Continued.)

$$P0 = (2d0^*z2 y2)/(y^*z)$$

$$P2 = (3d0^*y2 + 8d0^*z2)/(r2^*y^*z)$$

C*******************************************************************

IF (me. eq. (1)) THEN

C Current loop

$$z00 = 1d0/3d0^*P0$$

$$z02 = 1d0/12d0^*P2^*d^{**2}$$

$$z04 = 5d0/96d0^*(y2 + 8d0^*z2)^*y/(r2^{**3}y^*z^*)^*d^{**4}$$

$$z06 = 5d0/1536d0^*(5^*y4 + 80d0^*y2^*z2 128d0^*z4)^*y/(r2^{**5}y^*z^*)^*d^{**6}$$

C*******************************************************************

ELSEIF (me. eq. (2)) THEN

C Pair of charges

$$z00 = 1d0/3d0^*P0$$

$$z02 = 1d0/36d0^*P2^*d^{**2}$$

$$z04 = 1d0/432d0^*z^*(15d0^*y2 + 8d0^*z2)/(r2^{**3}y^*z^*)^*d^{**4}$$

$$z06 = 1d0/5184d0^*z^*(45d0^*y4 + 27d0^*z2^*y2 + 8d0^*z4)/(r2^{**5}y^*z^*)^*d^{**6}$$

C*******************************************************************

endif

C nT = 0, 2, 4, 6: order of Taylor expansion

$$rT(6) = z00 + z02 + z04 + z06$$

$$rT(4) = z00 + z02 + z04$$

$$rT(2) = z00 + z02$$

$$rT(0) = z00$$

$$rat = rT(nT)$$

endif

RETURN

end

References

[1] Jackson J D 1998 *Classical Electrodynamics* 3rd edn (Hoboken, NJ: Wiley)

[2] Griffiths D J 1999 *Introduction to Electrodynamics* 3rd edn (Upper Saddle River, NJ: Prentice Hall)

[3] Bezerra M, Kort Kamp W J M, Cougo Pinto M V and Farina C 2012 How to introduce the magnetic dipole moment *Eur. J. Phys.* **33** 1313

[4] Landau L D and Lifshitz E M 1971 *The Classical Theory of Fields* 3rd edn (Oxford: Pergamon)

[5] Curie P 1894 Sur la symétrie dans les phénomènes physiques, symétrie d'un champ électrique et d'un champ magnétique *J. Phys.* **3** 393

[6] Arfken G B, Weber H J and Harris F E 2012 *Mathematical Methods for Physicists* 7th edn (Waltham, MA: Academic)

[7] Dirac P A M 1931 Quantised singularities in the electromagnetic field *Proc. R. Soc. A* **133** 60

[8] Atkinson K E 1989 *An Introduction to Numerical Analysis* 2nd edn (New York: Wiley) p 420 ff