# Why is the magnetic field stronger at the edges of a bar magnet?

I have been performing an experiment at school in which I test the force on an iron surface from the magnetic field of an electromagnet. The electromagnet has a rectangular iron core. The theory predicts that the force increases linear with the surface area of the iron plate. This is because the volume between the plate and the magnet contains a certain amount of energy, which is equal to the force exerted on the plate times the distance between the plate and the magnet.

I found that the force does not increase linear with the surface. This is because of the divergence of the magnetic field of a bar magnet, which is what the core of the electromagnet essentially is. Researching the magnetic field of a bar magnet, I discovered that there is a higher density of field lines at the edges of the poles, and thus a stronger force on the plate. There are some images on this website, such as the one below.

I am curious as to why the field is stronger here. I know that the electric field is stronger at edges and corners because the electrons repel and end up at a higher concentration there, is it the same concept for magnetic fields?

If a magnet is fashioned out of a slab with constant width in the $z$ direction and has constant magnetization $M\hat{z}$, then the magnetic field has $\vec{B}=\mu_0 \vec{M}+\mu_0\vec{H}$. Take the divergence of both sides to get $\nabla \cdot \vec{H}=-\nabla \cdot\vec{M}$. Taking time independence and no free currents, $\nabla\times\vec{H}=0$. So $H$ is like an electric field produced by "magnetic charge" $-\nabla \cdot\vec{M}$. In this case our fictitious magnetic charge is constant with positive sign on the top of the magnet, and constant with negative sign on the bottom. This parallel plate arrangement produces $\approx0$ $H$-field outside the magnet if the plates are very large and close together.