# Magnetic field energy and force of an electromagnet

## Main Question or Discussion Point

I'm reading up on the equations for electromagnets, and in looking over the Wikipedia page on the subject I'm wondering if it's in error or if there is a flaw in my understanding. Specifically, it says that the force exerted by a magnetic field in an electromagnet on a section of core material is $$\frac{B^{2}A}{2\mu_0}$$. The page then goes on to use this equation to find the force an electromagnet has on say a piece of iron that it is lifting, in a closed magnetic circuit with no air gap. Wouldn't using that equation for a closed magnetic circuit in iron be incorrect? Since (as I understand it) the force on a section of the core is given by the gradient of the magnetic field energy, which is dependent on the permeability of the material in which the magnetic field resides.

I have seen the above equation used elsewhere when the force on the armature of a relay separated from the core by an air gap is calculated. In that case the magnetic field energy is assumed to be zero outside the gap because the core material is high permittivity, and the force is just the derivative of the field energy with respect to the length of the gap. When the iron the electromagnet is lifting actually comes in contact with the electromagnet and completes the magnetic circuit, wouldn't the force exerted reduce as well, since there is less magnetic energy available in a magnetic circuit with no air gap? As you can see, my understanding is a bit shakey and I'd appreciate any clarification.