## 3 Construction and Application of Magnetic Field Visualization Teaching Platform
### Magnetic Field Calculation Based on Neural Network  
Using finite element calculation, the calculation results were organized into original data. The original data set was divided into a training set and a test set. After the model was generated by learning the data of the training set, the data of the test set was predicted to verify the accuracy of the model. The accuracy R of the neural network method for the learning model of the magnetic field of the inductor with magnetic core was 0.981. It can be seen that the prediction accuracy of the model to the data was relatively high. The magnetic flux density predicted by the neural network algorithm was compared with the magnetic flux density calculated by the finite element method, and the results are shown in Figure 8. Each point in Figure 8 corresponds to a point in the magnetic field of the cloud image. However, the coordinates of the points in Figure 8 are not the coordinates in the cloud map; instead, the abscissa is the magnetic flux density calculated by the finite element, and the ordinate is the magnetic flux density predicted by the neural network. The closer the point is to the straight line, the closer the predicted value was to the calculated value, the more accurate the prediction was. It can be seen that the magnetic flux  
Figure 6: Meshing result. Figure 7: Finite element calculation result. density prediction result by the neural network method was very close to the finite element calculation result, and there was some error between the predicted value and the calculated value near 0.15. In the teaching of the magnetic field of an inductor with a magnetic core, the magnetic field in the magnetic core and its vicinity is worthiest of attention, and the magnetic field in the air domain far away from the magnetic core is secondary. Therefore, as long as the neural network prediction model can guarantee the prediction accuracy within a sufficient range, even if the numerical accuracy of a few points is insufficient, the influence of these points can be ignored, and the final output of the model is valid. The neural network prediction result of inductor with magnetic core is shown in Figure 9. It can be seen that the distribution trend of the predicted result in Figure 9 and the calculated result in Figure 7 is basically the same. The magnetic flux density in the middle of the magnetic core is the largest, the magnetic flux density at both ends of the magnetic core is smaller, and the magnetic flux density at the tip of the magnetic core is larger. The magnetic flux density in the coil is small, and the magnetic flux density in the air decreases with the increase of the distance from the magnetic core. In order to check the accuracy of the neural network model for other shapes of inductor magnetic field calculation, we changed the shape of the inductor and performed the calculation again. The magnetic field cloud diagrams calculated using the finite element and neural network models are shown in Figure 10.  
It can be seen from the figure that the magnetic flux density was concentrated in the iron core, and the magnetic flux density was especially concentrated at the corners of the iron core. The magnetic flux density was smaller near the air gap. The calculation results were more accurate, and the distribution trends of the calculation results and the predicted results were basically the same. In order to compare the calculation gap between the two more accurately, the different calculated values of each point in the cloud image were compared, as shown in Figure 11. Each point in the image corresponds to a point in the cloud image. The abscissa is the magnetic flux density calculated by the finite element, and the ordinate is the magnetic flux density predicted by the neural network. The closer the point is to the straight line, the closer the predicted value was to the calculated value, the more accurate the prediction was.