AbstractIn this study, an accurate TMS-coil modeling approach based on conductors cross-section representation with many distributed current filaments coupled with an efficient fast multipole method (FMM) accelerator is developed and tested. Uniform (Litz wire) or skin-effect based current distributions are included into consideration. Speed and accuracy estimates as well as two application examples are given, which indicate that this approach is potentially capable of rapid and accurate evaluation of various detailed TMS coil designs and arrays of such coils.\n\nThe MATLAB-based wire and CAD mesh generator for the coil geometry is interfaced with the FMM FORTAN program, which is also compiled within the MATLAB shell. No extra MATLAB toolboxes are necessary. The CAD model of the coil can be imported into any other computational software package in STL format. The algorithm is organized in the form of a MATLAB-based toolkit. First, a coil model is generated using a dedicated script. Then, we compute high-resolution 2D contour plots for any component of the electric and/or magnetic field in coronal, sagittal, and transverse planes via FMM. These two scripts may be further augmented with a parametric loop to enable rapid analysis.\n\nObjectiveWe show how the fast multipole method can be applied to compute primary electric and magnetic fields for detailed TMS coil models