## Expressing magnetostatic equation as a partial differential equation

Hi,

I am trying to model the magnetic field from two permanent magnets using Matlab, although my particular problem here relates to the physics/maths involved (though if someone could also give me advice on how to implement this particular problem in Matlab that would be awesome!). My system consists of two square magnetic regions (each of side length 5mm and gap between magnets of 1mm - although this is variable), which I have successfully modelled (although at a too low mesh density) using other PDE/FEM software using the equation:

curl(curl(A)-Br)/mu[0]) + J = 0

Where Br is the remnant magnetisation, mu[0] is the permeability of free space and J is the free charge density, which is zero in this case. I know Br is 1.24T and is parallel to the axis that runs through both magnet centres.

However, I really want to be able to use Matlab, but this requires that I express the equation above in what I presume is the standard PDE format. This is something like: