A new MATLAB and octave interface to a popular magnetics finite element code

FEMM (Finite Element Method Magnetics) is a free, open source, high quality 2D finite element modelling tool extremely popular in academia for both research and teaching, particularly in the field of electrical machine design. However, FEMM suffers from being tied to the Microsoft Windows platform, and having a slow interface to external programs. This paper presents a successful project to extract the core algorithms from FEMM, make them cross-platform and compile them into a set of libraries and command-line programs. In addition the creation of a new Matlab and Octave interface with direct access to the libraries is described with an example of its use. The libraries use only the C++ standard template libraries for maximum portability. For students and researchers, the tools can be used without knowledge of C++, but for more advanced students and those who might want to add further improvements, the code has also been substantially reorganised for clarity. The new C++ toolbox is referred to as “xfemm”, and the interface “mfemm”.