Abstract
The characterization of the magnetic field distribution is essential in experiments and devices that use magnetic field coil systems. We present an open-source application software, MFV (Magnetic Field Visualizer), for the visualization of the distribution of the magnetic field produced by circular coil systems. MFV models, simulates, and plots the magnetic field of coil systems composed by any number of circular coils of any size placed symmetrically along the same axis. Therefore, any new design or well-known coil system, such as the Helmholtz or the Maxwell coil, can be easily modeled and simulated using MFV. A graph of the homogeneity of the magnetic field can be also produced, showing the work region where the magnetic field is homogeneous according to a percentage of homogeneity given by the user. A standardized input and output file format are employed to facilitate the exchange and archiving of data. We include some results obtained using MFV, showing its applicability to characterize the magnetic field in different coil systems. Furthermore, the magnetic field results provided by MFV were validated by comparing them with results obtained experimentally in a commercial Helmholtz coil. Obtaining the maximum variability between the experimental and simulation magnetic flux density values along the axis of symmetry is 0.87%.
Keywords
Introduction
The generation of homogeneous magnetic fields is required in a broad range of applications. For instance, magnetic fields are commonly used to stimulate biological systems [1], particularly on in vitro experiments, and for the calibration of magnetic field sensors and probes [2]. The accuracy and reliability of the experiments developed on this kind of applications depend on different factors, but mainly on the distribution and homogeneity of the magnetic field (B). The most common coil system to produce controlled and homogeneous magnetic fields is the Helmholtz coil. However, its homogeneous work region is not large enough for some applications. Therefore, many efforts have been made in order to produce large homogeneous regions, and several coil systems of different sizes, shapes, and number of coils have been proposed [3, 4, 5, 6, 7, 8].
In order to employ a coil system for any kind of application that requires a work region with a homogenous magnetic flux density, it is essential to characterize the magnetic field distribution, and use this information to find the size and shape of a potential region of work where the magnetic field has a specific homogeneity value. Therefore, the development of tools to model and simulate the spatial distribution of the magnetic flux density produced by coil systems can be very useful to carry out experiments in different areas of study. Some simulation software like COMSOL Multiphysics
MFV application software
The aim of MFV is to provide the tools to easily model, simulate, and visualize the magnetic field distribution of any kind of circular coil system. The main advantages of MFV are the following:
High flexibility to model and simulate a great variety of magnetic field coil systems. These systems can be composed by any number of circular coils of any size placed symmetrically along the same axis. The number of turns and the electric current through each coil can also be set by the user. Calculation and visualization of the magnetic flux density distribution and its homogeneity. The visualization corresponds to that of a plane parallel to the axis of symmetry of the coil system, which is enough to characterize the magnetic field distribution in all the system thanks to its rotational symmetry. The homogeneous work region is calculated and visualized according to a percentage of homogeneity given by the user. Parameters of a practical experimentation volume, where the magnetic field is homogeneous, are given to the user. A group of presets of common coil systems with pre-established parameters are provided, including the Helmholtz coil, the Maxwell coil [4], the Tetracoil [3], the Wang coil [7], and the Lee-Whiting coil [8]. The user can set different simulation parameters, including the size of the simulation region and the number of points of the simulation. Availability of options to make zoom and produce graphs of the magnetic field distribution and homogeneity. Input parameters and simulation results can be saved and loaded into the application. The XLSX format is employed to facilitate the exchange and archiving of data. Experimental results formatted accordingly can be loaded into the application to characterize the magnetic field using the available tools. An estimation of the simulation time is given during the simulation. MFV was developed in Python programming language using open-source packages like SciPy [10], Numpy [11], and Matplotlib [12]. This is an advantage for the community due to the reception and impact that Python has had in the scientific community in the last years. MFV does not require to be built in order to be executed, it is composed by executables that can be run directly on Linux and macOS operating systems. In order to be executed on Windows, some simple additional steps must be followed. The executables and instructions to run MFV are available for download at the MFV GitHub repository [13].
Magnetic field
The off-axis magnetic field (magnetic flux density) generated by a single coil placed at a point
and
where
When a coil system is simulated in MFV, the contribution of each coil is calculated according to Eqs (1) and (2) for all the points in the simulation region, based on the superposition principle.
The homogeneity is computed with respect to the value of the total magnetic flux density at the center of the simulation region. It is calculated as the relative difference between the value of the total magnetic field at any point (
Therefore, a homogeneity of 98% corresponds to a region where the values of the magnetic field do not vary more than 2% from the value of reference.
MFV is a very intuitive and easy-to-use application software. Several tooltips and alert messages are included in order to guide the user during the input of parameters and visualization. The interface is composed by three main sections, the input parameters window, the results window, and the zoom and homogeneity windows.
Input parameters
Once the MFV executable is run, the input parameters window pops up, as shown in Fig. 1a. In this window, the user inputs the parameters that describe the coil system to be modeled and simulated. The menu bar located at the top of the window houses three drop-down menus. The “File” menu provides options to refresh the window (“New”), load input parameters (“Load parameters”), load simulation results (“Load results”), and quit the application (“Quit”). Input results and simulation parameters must be loaded from a file in XLSX format. The “Presets” menu contains a group of common coil systems with pre-established parameters. And the “Help” menu provides an option (“About”) to get information about the software. Below the menu bar the user can input the parameters of the coils, including the radius, number of turns, electric current, and position of the coil along the axis of symmetry (
MFV (a) input and (b) simulation parameters windows.
The results window shows the visualization of the magnetic flux density distribution, as shown in Fig. 2. In this window, the menu bar includes the “Colormap” menu, which contains a list of different colormaps that can be used for the visualization of the magnetic field distribution. Also, the “File” menu includes an option to save (“Save as…”) the input parameters and simulation results in a XLSX file format. The main part of the results window is composed by three tabs: the first for the visualization of the magnetic field distribution (see Fig. 2a), the second for the input parameters, and the third for the electric parameters (see Fig. 2b). The graph of the magnetic flux density distribution is accompanied by a color bar that indicates the values of the magnetic flux density in millitesla (mT). The limits of the color bar can be set by using the “Bmin” and “Bmax” entries located at the lower part of the window and clicking the “Apply” button. Three buttons are also provided to allow the user to save the graph, reset the color bar limits, and show or hide the coils in the graph. Graphs are saved in PDF format by default; however, the user can also save the them in PNG format. If the user clicks a point in the graph, a message indicating the coordinates of the point and the value of the magnetic field at that point appears in the lower part of the window, as shown in Fig. 2a. The electrical parameters tab gives information about the characteristics of the wire that should be used to build the simulated coil system based on the American wire gauge (AWG).
(a) Magnetic field distribution and (b) electrical parameter tabs of the results window. The simulated coil system corresponds to a Maxwell coil.
The two buttons located below the tab bar in the results window, “Zoom” and “Homogeneity”, are used for the zoom and homogeneity functionalities of the software. When one of these buttons is clicked, a new window pops up. The zoom functionality allows the user to enter a zoom percentage to zoom in or zoom out the graph of the magnetic field distribution, as shown in Fig. 3a. The homogeneity functionality takes as input a homogeneity percentage and plots the homogeneous region according to that percentage, as shown in Fig. 3b. Because the homogeneous regions are not practical to design an experiment due to their irregular shape, the largest square that can be inscribed in the homogeneous region is computed and shown in the graph. The homogeneity window includes a tab (“Experimentation volume”) where the characteristics of a practical experimentation volume, produced due to the rotational symmetry of the circular coil systems, are provided. The practical experimentation volume corresponds to the solid of revolution generated by rotating the square region around the axis of symmetry. The size of the practical experimentation volume and its location can be useful to the user to know the best position to place a sample in an experiment. Several zoom and homogeneity windows can be opened at the same time allowing the user to compare the different graphics.
(a) Zoom and (b) homogeneity windows. The simulated coil system corresponds to a Maxwell coil.
(a) Experimental and (b) simulation results of the magnetic field distribution of a commercial Helmholtz coil.
In this section, we present some graphs and data obtained using MFV. In order to perform a validation of the results obtained using MFV, the magnetic flux density values of a commercial Helmholtz coil were measured experimentally and contrasted to those of a MFV simulation. The radius, number of turns, and electric current of the commercial Helmholtz coil are equal to 0.0675 m, 320, and 1
Figure 5 shows graphs of the magnetic field distribution of the different presets included in the software. These graphs show how these coil systems present different magnetic field behaviors according to the number of coils, and its distribution and characteristics.
Magnetic field distribution of (a) Helmholtz coil, (b) Maxwell coil, (c) Tetracoil, (d) Wang coil, and (e) Lee-Whiting coil systems.
Moreover, Fig. 6 shows the homogeneous regions of the presets for a 97% homogeneity value. This kind of results give valuable information about the coil systems, improving the understanding of the magnetic field behavior and the potential use of a given coil system for a specific application. Also, it can be used to design new coil systems with custom homogeneities and magnetic field gradients.
Homogeneous region of (a) Helmholtz coil, (b) Maxwell coil, (c) Tetracoil, (d) Wang coil, and (e) Lee-Whiting coil systems for a 97% homogeneity value.
As mentioned before, the “Experimentation volume” tab in the Homogeneity window provides useful information of a potential experimentation volume. Figure 7a shows the experimentation volume parameters of the homogeneous region plotted in Fig. 6a for a Helmholtz coil. The radius, number of turns, and electric current of this Helmholtz coil are equal to 0.2 m, 500, and 1 A, respectively. Because the square region is located at the center of the Helmholtz coil and due to the rotational symmetry of the system, the experimentation volume corresponds to a cylinder. The cylinder has a height, a radius, and a volume of 0.13029 m, 0.06514 m, and 0.00174 m
(a) Experimentation volume parameters and (b) magnitude of the magnetic field along the axis of symmetry of a Helmholtz coil modeled and simulated in MFV.
Different improvements are planned for MFV. Addition of new coil shapes, such as triangular or rectangular shapes, would allow the modeling and simulation of other known coil systems (e.g., the Merritt coil [5]) and new designs that use different coil shapes. A 3D visualization of the magnetic field could be useful to give a more complete picture of the magnetic field distribution in a coil system. The practical experimentation volume can be optimized by finding the largest rectangle that can be inscribed inside the homogeneous region; however, that could require significant computational time and the implementation of an advanced algorithm. Software developers are encouraged to contribute to the development of MFV at its GitHub repository [9].
