Magpylib Material Response
The field of magnets and coils next to steel, soft iron and other magnets: solved, and handed back to Magpylib.
Magpylib computes its field in closed form, at any point. These are its field lines, cut through the middle.
To Magpylib the plate isn't there. Its magnets have a fixed polarization, and nothing else answers: the field stays as it was.
The magnet's field magnetizes the plate, and the plate's field adds to the magnet's. Turn up its susceptibility, and the flux takes the short way back, through the steel.
+29 %
Half a millimetre above the magnet the field is 473 mT, not 367 mT. Magpylib alone misses that; this package computes it.
Lift the magnet: the pull falls from
33 N at contact to
0.5 N at 8 mm. A solved model is a
Magpylib source, so magpy.getFT reads the force off it.
Three solvers, one model
A part that is linear and uniform inside carries its whole response as a charge on its faces: north red, south green. No volume mesh; … panels, 0.17 s.
One polarization per cell, for what face charge can't do: saturation on a B–H curve, anisotropy, B inside a part. 2,916 cells, 0.8 s.
NGSolve, independent of the other two, to check them. 14,229 elements, 4.3 s.
Three solvers, one answer
Bz on the axis above the magnet, on the plate and alone.
Each solve, at its real pace
Face charge is done 26× sooner than finite elements.
Timed on an Apple M4 Pro.
In code
import magpylib as magpy
from magpylib_material_response import solve_face_charge
magnet = magpy.magnet.Cuboid(
dimension=(0.01, 0.01, 0.005), position=(0, 0, 0.0055), polarization=(0, 0, 1.2)
)
plate = magpy.magnet.Cuboid(dimension=(0.04, 0.04, 0.006), polarization=(0, 0, 0))
plate.susceptibility = 1000 # soft iron
solved = solve_face_charge(magpy.Collection(magnet, plate))
magpy.getB(solved, (0, 0, 0.0085)) # Bz: 0.473 T, and 0.367 without the plate