Magpylib Documentation#

Magpylib is an open-source Python package for calculating static magnetic fields of magnets, currents, and other sources. It uses analytical expressions, solutions to macroscopic magnetostatic problems, implemented in vectorized form which makes the computation extremely fast and leverages the open-source Python ecosystem for spectacular visualizations!

Resources

Getting Started

link to Getting Started

Scientific Reference

link to Journal

How it works

In Magpylib, sources (magnets, currents, …) and observers (sensors, position grids, …) are created as Python objects with position and orientation attributes. These objects can be grouped and moved around. The system can be viewed graphically through various backends. The magnetic field is computed in the observer reference frame. Magpylib collects all inputs, and vectorizes the computation for maximal performance.