Electric field and magnetic field reconstruction method based on physical prediction and machine learning

Through the neural network method based on physical prediction and machine learning, the problems of a priori hypothesis dependence and resource consumption in electric field and magnetic field measurement are solved, and efficient and accurate reconstruction of complex electric field and magnetic field is achieved, which is suitable for a variety of complex scenarios.

CN119808601AActive Publication Date: 2025-04-11SHANDONG UNIV
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510288070.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-04-11
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

The prior art relies on a priori assumptions about field distribution in electric and magnetic field measurements, and the reconstruction process is time-consuming and resource-consuming, making it difficult to adapt to complex and unknown scenarios.

Method used

Using a method based on physical prediction and machine learning, the reconstruction of electric and magnetic fields is carried out through neural networks using particle information and electromagnetic wave information, regardless of the prior hypothesis of field distribution.

Benefits of technology

It realizes efficient and accurate reconstruction of complex electric and magnetic fields, breaks through the prior hypothesis dependence of traditional methods, and is suitable for extreme environments and unknown scenarios such as deep space exploration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808601A_ABST
    Figure CN119808601A_ABST
Patent Text Reader

Abstract

The invention discloses an electric field and magnetic field reconstruction method based on physical prediction and machine learning, and belongs to the technical field of electric field and magnetic field measurement, and the method comprises the following steps: 1, injecting particles or electromagnetic waves into an electromagnetic field region, and measuring the initial state and the final state of the particles or the electromagnetic waves; 2, preliminarily constructing an electric field network and a magnetic field network structure based on a machine learning module; 3, constructing a physical prediction loss function based on a physical algorithm; step 4, training and optimizing the neural network based on the physical prediction loss function, wherein the trained neural network is the final required electric field network or magnetic field network; and step 5, any point in the electromagnetic field area is selected to be input into the electric field network or the magnetic field network, and the electric field intensity or the magnetic induction intensity corresponding to the point can be obtained. The method does not depend on advanced understanding and hypothesis of field distribution, and can effectively utilize particle information and electromagnetic wave information to reconstruct a complex electric field and a complex magnetic field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric field and magnetic field measurement, and specifically relates to an electric field and magnetic field reconstruction method based on physical prediction and machine learning. Background Art

[0002] Electric and magnetic field measurements are the basic means of studying electromagnetic phenomena and electromagnetic interactions. They can help researchers deeply explore the distribution of magnetic fields and their impact on materials, and therefore are of great significance in engineering. In engineering applications, electric and magnetic field measurements can optimize the distribution of magnetic flux density and improve transformer energy efficiency; in the medical field, electric and magnetic field measurements are the core technology for obtaining high-resolution images, and in other fields, electric and magnetic field measurements also play an indispensable role. Therefore, it is crucial to accurately measure electric and magnetic fields.

[0003] The difficulty in measuring the distribution of electric and magnetic fields is that direct measurement methods are usually challenging, so indirect measurement methods are usually used. Due to engineering limitations (such as high temperatures that make it impossible to use probes, or small spaces that make it impossible to place detectors, etc.), or the inability of detectors to reach the electromagnetic field (such as deep space exploration scenarios), it is impossible to place probes or detectors in the electromagnetic field area for direct in-situ measurements, so active indirect measurement methods are often used, that is, injecting radio frequency waves or charged particles into the electromagnetic field area, and then recording their states before and after entering the electromagnetic field area, and reconstructing the distribution information of the electric and magnetic fields in the area through the changes in states before and after entering the electromagnetic field area.

[0004] In recent years, machine learning algorithms have opened up the field of data-based numerical prediction and data enhancement with high performance, high accuracy and high robustness. Significant achievements have been made in the fields of time series analysis and machine translation. It analyzes a large amount of data, finds patterns and regularities in the data, and then makes predictions or decisions based on these patterns. Its representative algorithms include a series of efficient algorithms such as support vector machines (SVMs), clustering algorithms, and random forests. Machine learning is not affected by the existence of analytical solutions in optimization problems. It focuses on gradient descent or information entropy optimization and focuses on seeking the global optimal solution of numerical solutions. At the same time, its main algorithms all contain nonlinear modules, which makes them have extremely strong nonlinear prediction capabilities. In the field of physics, machine learning algorithms can rely on these nonlinear capabilities to learn high-dimensional features in the data, making accurate predictions possible.

[0005] In the field of electric and magnetic field measurement, existing methods usually reconstruct the electric and magnetic field distribution through iterative calculation based on the assumed properties of the electric and magnetic field distribution. This method consumes a lot of time and computing resources because of the use of computational iterations. At the same time, before reconstruction, it is necessary to have a certain understanding of the electric and magnetic field distribution and make reasonable assumptions. If there is a lack of understanding of the electric and magnetic field distribution in the measured area, or if the field distribution assumptions are wrong, the reconstruction effect will be particularly poor. Therefore, it is urgent to develop a general, efficient, and accurate electric and magnetic field reconstruction method that does not rely on prior knowledge and assumptions about the field distribution. Summary of the invention

[0006] In order to solve the above problems, the present invention proposes a method for reconstructing electric and magnetic fields based on physical prediction and machine learning. Through a neural network, particle information and electromagnetic wave information are effectively used to reconstruct complex electric and magnetic fields. The method of the present invention does not require any assumptions about the form of the electric and magnetic field distribution, and is therefore very suitable for reconstructing complex electric and magnetic fields.

[0007] The technical solution of the present invention is as follows: A method for reconstructing electric and magnetic fields based on physical prediction and machine learning, comprising the following steps: Step 1, injecting particles or electromagnetic waves into the electromagnetic field region, and measuring the initial state and final state of the particles or electromagnetic waves; Step 2: Preliminarily build the electric field network and magnetic field network structure based on the machine learning module; Step 3: Construct a physical prediction loss function based on the physical algorithm; Step 4: Based on the physical prediction loss function, the neural network is trained and optimized, and the trained neural network is the final required electric field network or magnetic field network; Step 5: Select any point in the electromagnetic field area and input the electric field network or magnetic field network to obtain the electric field strength or magnetic induction strength corresponding to the point.

[0008] Furthermore, in step 1, the initial state and final state of the particle or electromagnetic wave include the initial position and initial velocity of the particle or electromagnetic wave entering the field area, the final position and final velocity of the particle or electromagnetic wave leaving the field area, and the total time spent by the particle or electromagnetic wave moving in the field area; defining step The initial position of a particle or electromagnetic wave entering the field is ;No. The initial velocity of a particle or electromagnetic wave entering the field is ;No. The final position of a particle or electromagnetic wave leaving the field is ;No. The final velocity of a particle or electromagnetic wave leaving the field is ;No. The total time it takes for a particle or electromagnetic wave to move in the field is .

[0009] Furthermore, in step 2, the machine learning module adopts a neural network structure; the dimensions of the electric field and the magnetic field are divided into two-dimensional and three-dimensional; In the process of building the two-dimensional electric field and magnetic field network, the input and output of the neural network are both two nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction strength at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave at the next time step calculated by the physical algorithm; the two input nodes correspond to the position components in the X-axis and Y-axis directions respectively; the two output nodes correspond to the electric field strength or magnetic induction strength in the X-axis and Y-axis directions respectively; In the construction of the three-dimensional electric field and magnetic field network, the input and output of the neural network are three nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction intensity at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave in the next time step calculated by the physical algorithm; the three input nodes correspond to the position components in the three directions of the X-axis, Y-axis and Z-axis respectively; the three output nodes correspond to the electric field strength or magnetic induction intensity in the three directions of the X-axis, Y-axis and Z-axis respectively.

[0010] Furthermore, the specific process of step 3 is as follows: Step 3.1: Use the physical algorithm to construct the mapping. The physical algorithm specifically adopts the discrete form of the Boris algorithm, and the formula is: ; ; in, For the The position of a particle or electromagnetic wave in each time step; For the The position of a particle or electromagnetic wave in each time step; is the time step; For the The speed of a particle or electromagnetic wave in a time step; For the The speed of a particle or electromagnetic wave in a time step; is the charge of the particle; is the mass of the particle; express The electric field strength at express Magnetic induction intensity at is the speed of light; Step 3.2: Divide into several discrete time steps and define the index number of the time step , the total number of time steps is ; The time step length of each time step The calculation formula is: ; Based on the Boris algorithm, each time step is iterated. When it iterates to the last time step, the predicted final state of the particle or electromagnetic wave leaving the field is obtained. The predicted final state includes the predicted position and predicted speed. The specific iterative process is: First, at the initial iteration, the time step ; At this time The initial position of a particle or electromagnetic wave and initial velocity are the initial position and initial velocity of entering the field, namely and ; Substitute into Boris algorithm to solve and get the next position and speed; and Substituting into the Boris algorithm, we get the following system of equations: ; ; Solve the above equations to get the position of the particle or electromagnetic wave at the first time step and speed ; express The electric field strength at express Magnetic induction intensity at Then, the time step is increased by 1, that is, ; Continue to substitute the Boris algorithm to solve; for the time step, the previous step has solved the The position of a particle or electromagnetic wave in time steps and speed , then The position of a particle or electromagnetic wave in time steps and speed Solving the following system of equations yields: ; ; in, express The electric field strength at express Magnetic induction intensity at Iterate until , this is the last time step, ; Substitute the position and velocity of the second-to-last time step into the Boris algorithm to obtain the The predicted final position of a particle or electromagnetic wave and prediction speed ; Step 3.3: Finally, construct the physical prediction loss function based on the predicted position and predicted speed : ; in, is the total number of particles or electromagnetic waves; , For different parameters; is the divergence operator; is the magnetic field network; is the constraint term that limits the magnetic field divergence to 0.

[0011] Furthermore, in step 4, when training the neural network, an optimizer is used for training; a learning rate is set; at the same time, a gradient descent method is used to reduce the value of the physical prediction loss function; the total number of training rounds is set in advance, and the training is stopped when the number of training rounds reaches a preset value. At this time, the training is completed and the required electric field network or magnetic field network is obtained.

[0012] Furthermore, the specific process of step 5 is as follows: In the two-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity ; , They are the position components in the X-axis and Y-axis directions respectively; , are the electric field strengths in the X-axis and Y-axis directions respectively; , are the magnetic induction intensities in the X-axis and Y-axis directions respectively; In the three-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity ; , and They are the position components in the three directions of X-axis, Y-axis and Z-axis respectively; , , are the electric field strengths in the three directions of X-axis, Y-axis and Z-axis respectively; , , They are the magnetic induction intensities in the three directions of X-axis, Y-axis and Z-axis respectively.

[0013] The beneficial technical effects brought about by the present invention are as follows.

[0014] 1. Breakthrough in independence and versatility: Breakthrough in the traditional method’s strong reliance on prior assumptions about the electric and magnetic field distributions. The high-dimensional features of the field distributions can be autonomously extracted through neural networks. There is no need to preset mathematical models of the field distributions. The electric and magnetic field structures of any complex form can be effectively reconstructed, which has breakthrough application value in unknown field distribution scenarios such as deep space exploration and plasma devices.

[0015] 2. Enhanced adaptability to complex environments; non-contact field reconstruction is achieved through particle trajectory inversion, which can break through the technical bottleneck of traditional probes that cannot be deployed in extreme environments such as high temperature (>1500℃), strong radiation (>10^4 Gy / h), and microscale (<100μm cavity), forming irreplaceable advantages in the fields of nuclear fusion device monitoring and micro-electromechanical system detection.

[0016] 3. Integration of explainable technologies: Innovatively design loss functions based on physical predictions, while maintaining the prediction accuracy of the neural network, output explainable reconstruction results that conform to the physical constraints of the electric and magnetic fields (such as the divergence of the magnetic field is 0), effectively meeting the stringent reliability requirements of the engineering field. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of the electric field and magnetic field reconstruction method based on physical prediction and machine learning of the present invention.

[0018] Figure 2 A flow chart of constructing a loss function based on physical prediction for the present invention.

[0019] Figure 3 is the real magnetic field in the experiment of this invention Schematic diagram of .

[0020] Figure 4 In the present invention, the experiment Figure 3 Schematic diagram of the predicted magnetic field reconstructed using the method of the present invention.

[0021] Figure 5 In the experiment of this invention Figure 3 and Figure 4 Schematic diagram of the relative error between .

[0022] Figure 6 is another real magnetic field in the experiment of the present invention Schematic diagram of .

[0023] Figure 7 In the present invention, the experiment Figure 6 Schematic diagram of the predicted magnetic field reconstructed using the method of the present invention.

[0024] Figure 8 In the experiment of this invention Figure 6 and Figure 7 Schematic diagram of the relative error between .

[0025] Fig. 9 is another real magnetic field in the experiment of the present invention Schematic diagram of .

[0026] Fig.10 In the present invention, the experiment Fig. 9 Schematic diagram of the predicted magnetic field reconstructed using the method of the present invention.

[0027] Fig.11 In the experiment of this invention Fig. 9 and Fig.10 Schematic diagram of the relative error between .

[0028] Fig.12 Schematic diagram of the Tokamak magnetic field obtained by the method of the present invention in the experiment of the present invention.

[0029] Fig.13 In the experiment of this invention Fig.12 A local enlarged view of the position indicated by the arrow.

[0030] Fig.14 This is a schematic diagram of the electric field network construction in the experiment of the present invention. DETAILED DESCRIPTION

[0031] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments: like Figure 1 As shown, a method for reconstructing electric and magnetic fields based on physical prediction and machine learning includes the following steps: Step 1: Inject a large number of particles or electromagnetic waves into the electromagnetic field region, measure the initial state and final state of the particles or electromagnetic waves, and create a data set; the initial state and final state of the particles or electromagnetic waves include the initial position and initial velocity of the particles or electromagnetic waves entering the field region, the final position and final velocity of the particles or electromagnetic waves leaving the field region, and the total time spent by the particles or electromagnetic waves moving in the field region. The initial position of a particle or electromagnetic wave entering the field is ;No. The initial velocity of a particle or electromagnetic wave entering the field is ;No. The final position of a particle or electromagnetic wave leaving the field is ;No. The final velocity of a particle or electromagnetic wave leaving the field is ;No. The total time it takes for a particle or electromagnetic wave to move in the field is .

[0032] Step 2: Preliminarily build the electric field network and magnetic field network structure based on the machine learning module.

[0033] The machine learning module can adopt any existing neural network structure, including convolutional neural network, fully connected neural network, attention module, etc.

[0034] Divergence is a physical constraint when constructing a magnetic field. When constructing a magnetic field, it is necessary to ensure that the divergence of the magnetic field is 0. During the construction process, the current divergence is verified to be 0 by taking the derivative and the divergence formula. If the divergence is not restricted to 0 in the magnetic field network, a constraint item needs to be added to the loss function to ensure that the divergence is 0.

[0035] Electromagnetic field is the general term for the unity of electric field and magnetic field that are intrinsically connected and interdependent. Under certain circumstances, the electric field that changes with time generates the magnetic field, and the magnetic field that changes with time generates the electric field.

[0036] The dimensions of electric and magnetic fields are divided into two dimensions and three dimensions; In the process of building the two-dimensional electric field and magnetic field network, the input and output of the neural network are both two nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction strength at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave at the next time step calculated by the physical algorithm; the two input nodes correspond to the position components in the X-axis and Y-axis directions respectively; the two output nodes correspond to the electric field strength or magnetic induction strength in the X-axis and Y-axis directions respectively; In the construction of the three-dimensional electric field and magnetic field network, the input and output of the neural network are three nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction intensity at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave in the next time step calculated by the physical algorithm; the three input nodes correspond to the position components in the three directions of the X-axis, Y-axis and Z-axis respectively; the three output nodes correspond to the electric field strength or magnetic induction intensity in the three directions of the X-axis, Y-axis and Z-axis respectively.

[0037] The activation function of the neural network can use ReLU, LeakyReLU, Tanh and other activation functions.

[0038] In the embodiment of the present invention, a three-dimensional electromagnetic field is specifically constructed, and the neural network specifically selects a fully connected neural network, which includes an input layer, an intermediate layer, and an output layer. Among them, the number of nodes in the input layer is 3; three layers are selected in the intermediate layer, and the number of nodes is 16, 32, and 64 in order according to the numerical propagation order; the number of nodes in the final output layer is 3. All activation functions use ReLU.

[0039] Step 3: Construct a physical prediction loss function based on the physical algorithm; the input variables of the loss function include the initial state and final state of the particle or electromagnetic wave. If the divergence of the magnetic field is not guaranteed to be 0 in step 2, then a constraint term needs to be added to the loss function to limit the divergence of the magnetic field to 0. The specific process is: Step 3.1: First, use a physical algorithm to construct a mapping. The physical algorithm described here includes but is not limited to the Boris algorithm, the volume-preserving algorithm, and the symplectic algorithm. For example, the discrete form of the Boris algorithm is used to construct a mapping. The discrete form of the Boris algorithm is: ; ; in, For the The position of a particle or electromagnetic wave in each time step; For the The position of a particle or electromagnetic wave in each time step; is the time step; For the The speed of a particle or electromagnetic wave in a time step; For the The speed of a particle or electromagnetic wave in a time step; is the charge of the particle; is the mass of the particle; represents the electric field network predicted The electric field strength at represents the magnetic field network prediction Magnetic induction intensity at is the speed of light; Step 3.2: Since it is impossible to calculate the absolutely continuous motion state during the entire motion process, it is necessary to select an appropriate number of time steps to be as close to the actual motion state as possible. Divide into several discrete time steps and define the index number of the time step , the total number of time steps is ; The time step length of each time step The calculation formula is: ; Based on the physical algorithm (such as Boris algorithm), each time step is iterated. When it iterates to the last time step, the predicted final state of the particle or electromagnetic wave leaving the field is obtained. The predicted final state includes the predicted position and predicted speed. The specific iterative process is: First, at the initial iteration, the time step ; At this time The initial position of a particle or electromagnetic wave and initial velocity are the initial position and initial velocity of entering the field, namely and ; Substitute into the Boris algorithm to solve, and you can get the next position and speed. and Substituting into the Boris algorithm, we get the following system of equations: ; ; Solve the above equations to get the position of the particle or electromagnetic wave at the first time step and speed ; express The electric field strength at express Magnetic induction intensity at Then, the time step is increased by 1, that is, ; Continue to substitute the Boris algorithm to solve; for the For each time step, the previous step has solved the The position of a particle or electromagnetic wave in time steps and speed , then The position of a particle or electromagnetic wave in time steps and speed It can be obtained by solving the following system of equations: ; ; in, express The electric field strength at express Magnetic induction intensity at Iterate until , this is the last time step, ; Substitute the position and velocity of the second-to-last time step into the Boris algorithm to obtain the The predicted final position of a particle or electromagnetic wave and prediction speed .

[0040] Step 3.3: Finally, construct the physical prediction loss function based on the predicted position and predicted speed : ; in, is the total number of particles or electromagnetic waves; , For different parameters, in the present invention, when training the magnetic field network, , ; is the divergence operator; is the magnetic field network; is a constraint term that limits the magnetic field divergence to 0. When training the electric field network, set , , there is no need to limit the divergence of the electric field network, so is 0.

[0041] The loss function formula represents the distance between the predicted final state of the particle and the actual final state, incorporating physical information. When it decreases, it means that the prediction of the neural network is closer to the actual value, and the neural network will be better at representing the actual electric or magnetic field.

[0042] Step 4: Based on the physical prediction loss function, the neural network is trained and optimized. The trained neural network is the final required electric field network or magnetic field network. When training the neural network, a specified optimizer is used, such as Adam, AdamW, SGD, etc. The learning rate is set to 2e-4, and the gradient descent method is used to reduce the value of the physical prediction loss function. The total number of training rounds is set in advance. When the number of training rounds reaches the preset value, the training is stopped. At this time, the training is completed and the required electric field network or magnetic field network is obtained.

[0043] Step 5: Select any point in the electromagnetic field area and input the electric field network or magnetic field network to obtain the electric field strength or magnetic induction strength corresponding to the point. The specific process is: In the two-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity . , They are the position components in the X-axis and Y-axis directions respectively; , are the electric field strengths in the X-axis and Y-axis directions respectively; , are the magnetic induction intensities in the X-axis and Y-axis directions respectively.

[0044] In the three-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity . , and They are the position components in the three directions of X-axis, Y-axis and Z-axis respectively; , , are the electric field strengths in the three directions of X-axis, Y-axis and Z-axis respectively; , , They are the magnetic induction intensities in the three directions of X-axis, Y-axis and Z-axis respectively.

[0045] In order to prove the feasibility and superiority of the present invention, the following experiment is given.

[0046] In the experiment, the above method was used to invert and reconstruct a two-dimensional magnetic field, and the accuracy of the method was evaluated. The following are three examples of two-dimensional magnetic field measurements, each of which includes the real magnetic field, the predicted magnetic field, and the relative error between them. The relative error is defined as follows: ; in, To predict the magnetic field; is the real magnetic field; is the position coordinate, , They are respectively the X-axis coordinate and the Y-axis coordinate, in m; Figure 3 The real magnetic field Schematic diagram of Figure 4 For Figure 3 A schematic diagram of the predicted magnetic field reconstructed using the method of the present invention; Figure 5 for Figure 3 and Figure 4 The relative error between Figure 5 It can be concluded that the maximum relative error is 4%.

[0047] Figure 6 Another real magnetic field Schematic diagram of Figure 7 For Figure 6 A schematic diagram of the predicted magnetic field reconstructed using the method of the present invention; Figure 8 for Figure 6 and Figure 7 The relative error between Figure 8It can be concluded that the maximum relative error is 4%.

[0048] Fig. 9 Another real magnetic field Schematic diagram of Fig.10 For Fig. 9 A schematic diagram of the predicted magnetic field reconstructed using the method of the present invention; Fig.11 for Fig. 9 and Fig.10 The relative error between Fig.11 It can be concluded that the maximum relative error is 20%.

[0049] It is worth noting that Fig.11 The large relative error of can be attributed to the significant difference between the maximum and minimum values ​​of the magnetic field. Fig. 9 and Fig.10 The values ​​in the lower left corner are very small. Therefore, the relative errors are mainly larger in this area. Nevertheless, these measurements are still considered acceptable.

[0050] Next, the three key indicators of mean square error (MSE), peak signal-to-noise ratio (PSNR) and structural similarity (SSIM) were used to test the above results. MSE is used to measure the average difference between the real magnetic field and the predicted magnetic field, which is used to indicate the accuracy of the method of the present invention. PSNR is commonly used in image processing to evaluate data quality and noise level. SSIM is used to compare the similarity between two images, considering multiple factors such as brightness, contrast and structure, and providing a comprehensive evaluation of the similarity between matrices. The magnetic field area (X-axis range is 1 to 2 meters, Y-axis range is -1 to 0 meters) is divided into a 1000×1000 grid, and the real magnetic field and predicted magnetic field are obtained at each grid point and normalized. Finally, two matrices of size 1000×1000 are obtained, representing the real magnetic field and the predicted magnetic field, respectively. The MSE between the real magnetic field and the predicted magnetic field matrices is calculated according to the following formula: ; in, Represents a grid point The real magnetic field on represents the corresponding predicted magnetic field; , Represents different grid indices. This formula calculates the mean square error between the true magnetic field and the predicted magnetic field point by point. The value of MSE ranges from 0 to positive infinity. MSE=0 means that the prediction is exactly the same as the true value, while a larger MSE means a larger prediction error. Using the above formula, it can be calculated that the MSE of the above three cases are 0.0003, 0.0003 and 0.0001 respectively.

[0051] PSNR is defined as: ; in, Represents the maximum element in the corresponding matrix. Here, since the matrix is ​​of floating point type, it is taken as 1. MSE is the mean square error. The value of PSNR ranges from 0 to positive infinity and is expressed in decibels (dB). It represents the noise level of the signal, and therefore the similarity between the predicted matrix (corresponding to the predicted magnetic field) and the reference matrix (corresponding to the true magnetic field). A larger PSNR value means better performance, because the inverse of the PSNR measures the average relative error. Typically, when the PSNR value exceeds 30dB, the difference between the predicted matrix and the true matrix is ​​almost imperceptible.

[0052] Through the above formula, it can be calculated that the PSNRs of the above three cases are 80.84dB, 80.62dB and 88.49dB respectively.

[0053] SSIM is calculated according to the following formula: ; in, and are two different variables used to stabilize the denominator, is a constant representing the dynamic range of the reference matrix, and is the default value, express The element average of express The element average of yes The element variance of yes The element variance of express and The covariance between . The value of SSIM ranges from -1 to 1. When SSIM is close to 1, the two matrices become similar and the results are good. Using the above formula, it can be calculated that the SSIM of the above three cases are 0.9987, 0.9961, and 0.9845 respectively.

[0054] The above results can be summarized in Table 1 below: Table 1 Experimental results of three magnetic field cases .

[0055] According to the results in Table 1 above, it can be concluded that the method has good accuracy. When applied to a magnetic field similar to the above functional relationship, the relative error remains within 5%. In addition, the reliability of the method of the present invention is demonstrated by the evaluation of three key indicators: mean square error (MSE), peak signal-to-noise ratio (PSNR) and structural similarity (SSIM).

[0056] A set of experiments on three-dimensional magnetic fields are given below.

[0057] This section applies the method of the present invention to a three-dimensional tokamak magnetic field. The basic parameters of the tokamak are set as follows: the magnetic field at the magnetic axis , unit is T; safety factor ; Large radius , in m. Here, the real magnetic field is given by an approximate model with a circular magnetic surface and a fixed safety factor, expressed as follows: ; in, It represents the distance from the same principal axis to a specific point in space (such as a point in a plasma); and denote the toroidal basis vector and the polar basis vector respectively, For circular direction, is polar; is the coordinate perpendicular to the principal axis, describing the position of the plasma in the vertical direction; Without loss of generality, the tokamak region is selected from 0 to of In this area, 10,000 positions are randomly selected, which represent the initial moment when the particle enters the tokamak. In order to make the particle escape from the tokamak faster, the mass of the particle is set to , the charge is set to ,in and are the mass of hydrogen ions and the charge of electrons, respectively. The initial velocity of each particle is randomly distributed at an angle ranging from to ,in is the speed of light. Finally, the position, velocity, and running time of each particle as it escapes from the tokamak are recorded.

[0058] Next, the inversion results of the tokamak magnetic field are presented. In order to evaluate the accuracy of the solution, the solution of the method of the present invention is used to track the magnetic field. First, On the plane, 30 points are uniformly selected on a circle 0.2 meters away from the magnetic axis as the starting point of each magnetic field line. Then, each point is tracked by the solution of the method of the present invention until it reaches Flat. Still The last point reached by each magnetic field line is shown on the plane and compared with the theoretical solution on a circle 0.2 meters away from the magnetic axis. The comparison results are shown in Fig.12 As shown, Fig.13 for Fig.12 A local enlarged view of the position pointed by the middle arrow. In the figure, r is the length of the circle from the magnetic axis, R represents the radial coordinate measured outward from the tokamak symmetry axis (horizontal direction), and Z is the Z-axis coordinate.

[0059] from Fig.12 and Fig.13 The results show that the magnetic field lines solved by the present invention can form the magnetic surface structure of the tokamak. The points formed by the magnetic field lines on the plane are very close to the theoretical solution. This shows that the method has high accuracy and high reliability even when applied to the magnetic field of a three-dimensional tokamak.

[0060] In a certain electromagnetic field area, there are both electric and magnetic fields. Here, only the electric field network is constructed to test the effect of the electric field network. (in V / m) and the true magnetic field (unit is T) to simulate, through the simulated electromagnetic field to drive a certain initial speed (unit: m / s) particle motion, the original motion trajectory of the particle is as follows Fig.14 Then, the predicted electric field inverted by the method of the present invention and the original real magnetic field are used to drive the same particle to move again, and several time points are selected to obtain the position as shown in FIG. Fig.14 As shown by the circles in the figure, it can be seen from the figure that the trajectory points calculated based on the electromagnetic field reconstructed by the neural network are all located on the original motion trajectory, proving that the method of the present invention has high accuracy.

[0061] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.

Claims

1. A method for reconstructing electric and magnetic fields based on physical prediction and machine learning, characterized in that: The steps include: Step 1, injecting particles or electromagnetic waves into the electromagnetic field region, and measuring the initial state and final state of the particles or electromagnetic waves; Step 2: Preliminarily build the electric field network and magnetic field network structure based on the machine learning module; Step 3: Construct a physical prediction loss function based on the physical algorithm; Step 4: Based on the physical prediction loss function, the neural network is trained and optimized, and the trained neural network is the final required electric field network or magnetic field network; Step 5: Select any point in the electromagnetic field area and input the electric field network or magnetic field network to obtain the electric field strength or magnetic induction strength corresponding to the point.

2. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 1, characterized in that: In step 1, the initial state and final state of the particle or electromagnetic wave include the initial position and initial velocity of the particle or electromagnetic wave entering the field area, the final position and final velocity of the particle or electromagnetic wave leaving the field area, and the total time spent by the particle or electromagnetic wave moving in the field area; define step The initial position of a particle or electromagnetic wave entering the field is ;No. The initial velocity of a particle or electromagnetic wave entering the field is ;No. The final position of a particle or electromagnetic wave leaving the field is ;No. The final velocity of a particle or electromagnetic wave leaving the field is ;No. The total time it takes for a particle or electromagnetic wave to move in the field is .

3. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 2, characterized in that: In step 2, the machine learning module adopts a neural network structure; the dimensions of the electric field and the magnetic field are divided into two-dimensional and three-dimensional; In the process of building the two-dimensional electric field and magnetic field network, the input and output of the neural network are both two nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction strength at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave at the next time step calculated by the physical algorithm; the two input nodes correspond to the position components in the X-axis and Y-axis directions respectively; the two output nodes correspond to the electric field strength or magnetic induction strength in the X-axis and Y-axis directions respectively; In the construction of the three-dimensional electric field and magnetic field network, the input and output of the neural network are three nodes; the initial position of the particle or electromagnetic wave entering the field area measured in step 1 is used as the initial input of the neural network, and the neural network outputs the electric field strength or magnetic induction intensity at the corresponding position; in the subsequent iterative optimization process of the network, the input is the position of the particle or electromagnetic wave in the next time step calculated by the physical algorithm; the three input nodes correspond to the position components in the three directions of the X-axis, Y-axis and Z-axis respectively; the three output nodes correspond to the electric field strength or magnetic induction intensity in the three directions of the X-axis, Y-axis and Z-axis respectively.

4. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 3 is characterized in that: The specific process of step 3 is as follows: Step 3.1: Use the physical algorithm to construct the mapping. The physical algorithm specifically adopts the discrete form of the Boris algorithm, and the formula is: ; ; in, For the The position of a particle or electromagnetic wave in each time step; For the The position of a particle or electromagnetic wave in each time step; is the time step; For the The speed of a particle or electromagnetic wave in a time step; For the The speed of a particle or electromagnetic wave in a time step; is the charge of the particle; is the mass of the particle; express The electric field strength at express The magnetic induction intensity at is the speed of light; Step 3.2: Divide into several discrete time steps and define the index number of the time step , the total number of time steps is ; The time step length of each time step The calculation formula is: ; Based on the Boris algorithm, each time step is iterated. When it iterates to the last time step, the predicted final state of the particle or electromagnetic wave leaving the field is obtained. The predicted final state includes the predicted position and predicted speed. The specific iterative process is: First, at the initial iteration, the time step ; At this time The initial position of a particle or electromagnetic wave and initial velocity are the initial position and initial velocity of entering the field, namely and ; Substitute into Boris algorithm to solve and get the next position and speed; and Substituting into the Boris algorithm, we get the following system of equations: ; ; Solve the above equations to get the position of the particle or electromagnetic wave at the first time step and speed ; express The electric field strength at express The magnetic induction intensity at Then, the time step is increased by 1, that is, ; Continue to substitute the Boris algorithm to solve; for the time step, the previous step has solved the The position of a particle or electromagnetic wave in time steps and speed , then The position of a particle or electromagnetic wave in time steps and speed Solving the following system of equations yields: ; ; in, express The electric field strength at express The magnetic induction intensity at Iterate until , this is the last time step, ; Substitute the position and velocity of the second-to-last time step into the Boris algorithm to obtain the The predicted final position of a particle or electromagnetic wave and prediction speed ; Step 3.3: Finally, construct the physical prediction loss function based on the predicted position and predicted speed : ; in, is the total number of particles or electromagnetic waves; , For different parameters; is the divergence operator; is the magnetic field network; is the constraint term that limits the magnetic field divergence to 0.

5. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 4, characterized in that: In step 4, when training the neural network, an optimizer is used for training; a learning rate is set; at the same time, a gradient descent method is used to reduce the value of the physical prediction loss function; the total number of training rounds is pre-set, and the training is stopped when the number of training rounds reaches a preset value. At this time, the training is completed and the required electric field network or magnetic field network is obtained.

6. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 5, characterized in that: The specific process of step 5 is as follows: In the two-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity ; , They are the position components in the X-axis and Y-axis directions respectively; , are the electric field strengths in the X-axis and Y-axis directions respectively; , are the magnetic induction intensities in the X-axis and Y-axis directions respectively; In the three-dimensional electromagnetic field region, the position coordinates in the electromagnetic field region are Input the electric field network or magnetic field network at a point and output the electric field intensity corresponding to the point or magnetic induction intensity ; , and They are the position components in the three directions of X-axis, Y-axis and Z-axis respectively; , , are the electric field strengths in the three directions of X-axis, Y-axis and Z-axis respectively; , , They are the magnetic induction intensities in the three directions of X-axis, Y-axis and Z-axis respectively.

Citation Information

Patent Citations

  • Electromagnetic field prediction method based on physical enhanced neural network

    CN116384244A

  • Flow field prediction method based on transfer learning and discrete physical information neural network

    CN117057265A

  • Electromagnetic field modeling method, system and equipment based on mechanism data fusion and medium

    CN117350152A

  • Electromagnetic field calculation method, device and equipment based on physical constraint neural network

    CN117436330A

  • Object number hybrid drive inversion method based on ground-air electromagnetism

    CN118330759A