# How can we define Magnetic Potential Energy if it is non-conservative?

I recently learnt that for a circular wire carrying electric current or for a magnetic dipole, if it is kept in a uniform magnetic field, we can define its magnetic potential energy. This would mean that the magnetic field is conservative in this case. However, as far as I know, the curl of the magnetic field vector isn't 0 meaning it is non-conservative. So, how exactly can we define potential energy for the magnetic field if it is non-conservative? I think it'll be possible if the current density is 0, but I don't see how exactly it becomes 0.

• > This would mean that the magnetic field is conservative in this case. This is not so. Field being conservative means that for every closed path in space, circulation of the field over that path is zero. Potential energy of magnetic moment in external magnetic field exists regardless of that; it is a function of local value of the magnetic field, not of its global properties. In other words, potential energy of magnetic moment has nothing to do with magnetic potential, only with magnetic field vector. Aug 4, 2023 at 18:36

## 2 Answers

There are situations in magneto-statics where scalar magnetical potentials makes perfectly sense. The most well-known example is a permanent magnet and its surroundings of air for instance. There is no electron current around. The magnetical field comes from the magnetization of the permanent magnet, more precisely said the change of magnetization.

Let's work it out a bit more accurately. First we define the magnetic field $$\mathbf{H}$$:

$$\mathbf{H} = \frac{1}{\mu_0} \mathbf{B} - \mathbf{M}$$

If we take the divergence we get (note $$\nabla\cdot \mathbf{B}=0\,$$ Maxwell equation):

$$\mathbf{\nabla}\cdot \mathbf{H} = \frac{1}{\mu_0}\mathbf{\nabla}\cdot \mathbf{B} - \mathbf{\nabla}\cdot\mathbf{M} = - \mathbf{\nabla}\cdot\mathbf{M}$$

Now we consider the case of a permanent magnet+surroundings which has inside the magnet a constant non-zero magnetization $$\mathbf{M}$$. We will call the volume occupied by the permanent magnet as $$B$$ and its border $$\partial B$$. We actually realize that inside the magnet the divergence of the magnetization is zero, because it is constant. So we conclude that

$$\mathbf{\nabla}\cdot \mathbf{H}|_{\partial B} = \mathbf{\nabla}\mathbf{M}\quad\text{otherwise}\quad \mathbf{\nabla}\cdot \mathbf{H}=0 \tag{1}$$

Furthermore there is no electron current around neither an electric diplacement field, so we have also

$$\mathbf{\nabla}\times \mathbf{H}=0$$

everywhere in our set-up. This a constellation very well-known from electrostatics (Remember $$\mathbf{\nabla}\cdot \mathbf{E} =4\pi \rho$$). We can introduce the magnetic potential $$\varphi_m$$ via the gradient

$$\mathbf{\nabla}\varphi_m = \mathbf{H}\quad\text{that solves}\quad \mathbf{\nabla}\times \mathbf{\nabla}\varphi_m=0$$.

If the distribution of (change of) magnetization is known, i.e. if $$\mathbf{\nabla}\cdot \mathbf{M}$$ is known (and of course for a permanent magnet it is known) we now solve for the magnetic potential via the Poisson respectively the Laplace equation:

$$\Delta\varphi_m= \mathbf{\nabla \cdot \nabla} \varphi_m = \mathbf{\nabla}\cdot \mathbf{M}|_{\partial B}$$

This is just an example, but one can imagine many different constellations where this technique can be applied. In particular this is done in the design of larger magnets for instance for accelerators.

Of course if a current-carrying wire is around and one wants to know the magnetic potential around a loop which contains the wire a magnetic potential makes no sense anymore, respectively sophisticated techniques like those mentioned in hyportnex's post have to be applied.

This means a scalar magnetical potential cannot always used. But at the end it is the same with electric problems: A scalar electric potential can only be used if there is no time-changing magnetic field around. However, if that's not the case then $$\mathbf{\nabla}\times \mathbf{E}\neq0$$ and a scalar electric potential cannot be defined.

You can define a potential function by making "branch cuts" in an analogous manner to the way it is done in complex analysis. This being a 3D not 2D problem the cuts are not lines but surfaces. In the case of an infinite current line, you can exclude a "half plane" emanating from the current line to infinity; for a loop current you can spread a disk-like surface on the loop.

By preventing a line integral, say $$\int_{\mathcal L} \mathbf H \cdot d\ell$$, over a path $$\mathcal L$$ to cross these surfaces you in effect turn a multi-connected domain created by excluding the currents into a singly connected domain so that no line integral of the field may loop around the currents themselves. This way, any and all contour integrals are uniquely defined and their values depend only on their initial and end points thereby leading to a well defined potential function.

• Oh, this makes sense. Is this always possible though? Aug 4, 2023 at 14:38
• What do you mean by "always"? Do you mean it in a "theoretical" topological sense or in a useful practical sense? Aug 4, 2023 at 14:41
• you may find it interesting that when defined this way the potential of a current loop at a point is proportional to the solid angle seen the loop from that point but if you cross to the *other * side through the spanned surface then the angle will jump to the opposite sign demonstrating the multivalued nature of the potential. Here is a great answer discussing this issue physics.stackexchange.com/questions/315975/… Aug 4, 2023 at 14:52
• Okay thanks, it makes sense! By always I meant it in a theoretical sense, as in if there is some case when we will not be able to exclude the half-plane, like say in the case of a hypothetical finite non-looping wire. Aug 4, 2023 at 14:57