# A Rectangular Toroidal Current-Based Approach for Lung Biopsy Needle Tracking
## 2 Materials and Methods
### Simulation of the Rectangular Circulating Current Emission Model  
To validate the rectangular circulating current magnetic field model, simulations were conducted to compare the simulated magnetic flux density with the calculated values from the proposed model, ensuring its accuracy. COMSOL software (version 6.1) is commonly used for simulating the magnetic field generated by the emission board. This software is a general-purpose simulation tool applicable across various engineering, manufacturing, and research fields. Its AC/DC Module is a powerful and flexible tool for analyzing static and low-frequency electromagnetic problems, providing extensive modeling capabilities and numerical methods to solve Maxwell's equations for in-depth electromagnetic field and EMI/EMC studies. For the simulation of the electromagnetic tracking system, this module supports detailed 3D modeling of coils, allowing for precise calculations of current distribution within each wire. It also provides an equivalent approximation approach to simplify modeling by analyzing current distributions in complex coil structures, which is particularly effective for multi-turn coils.  
The simulation process includes the following steps, as shown in Figure 3a:  
1. Modeling the transmitting coil: A single transmitting coil is modeled with coordinates identical to those of the actual magnetic field emission board. A rectangular simulation domain is created to enclose the transmitting coil, with a total volume of (insert volume value here).
2. Assigning material properties: The transmitting coil is assigned copper as its material, while the surrounding simulation domain is set as air.
3. Steady-state simulation: The transmitting coil is excited with a constant current of 1A.
4. Magnetic field analysis: The simulation results provide the magnetic flux density at each point within the simulation domain.  
Figure 3: Simulation model of rectangular coil and real comparison: (**a**) Magnetic field strength simulation of the rectangular coil, which decreases sharply with increasing distance. (**b**) Ratio of simulated magnetic field strength to theoretical calculated strength. The ratio primarily ranges from 1 to 1.3. The theoretical calculation, based on subsequent calibration, can be used for model computation.  
The simulation results are exported, including the coordinates, 1200 simulation points, and their corresponding magnetic flux density values. By substituting these coordinates into the mathematical model of the rectangular circulating magnetic field, the computed magnetic flux density values are obtained.  
The ratio between the computed magnetic flux density and the corresponding simulated magnetic flux density is calculated for each point. The distribution of these ratio values across all simulation points is shown in Figure 3b. A ratio closer to 1 indicates higher consistency between the simulation and the theoretical model. Figure 3 demonstrates that most ratio values fall within the range of 1 to 1.3, indicating that the simulated rectangular circulating magnetic field closely aligns with the theoretical model. This confirms that the simulation approach can be effectively used for electromagnetic tracking calculations.