A method for reconstructing electric and magnetic fields based on physical prediction and machine learning

Through a neural network method based on physical prediction and machine learning, the particle information and electromagnetic wave information are used to reconstruct electric fields and magnetic fields, and the problem of dependence on field distribution in the prior art is solved, and efficient and accurate reconstruction of complex electric fields and magnetic fields is achieved.

CN119808601BActive Publication Date: 2025-06-24SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing electric and magnetic field measurement methods rely on prior assumptions about field distribution and are difficult to achieve accurate reconstruction in complex or extreme environments.

Method used

Using a method based on physical prediction and machine learning, the neural network uses particle information and electromagnetic wave information to reconstruct electric and magnetic fields without making assumptions about the form of field distribution.

Benefits of technology

It realizes efficient and accurate reconstruction of complex electric and magnetic fields, and is suitable for deep space exploration, nuclear fusion device monitoring and other fields, overcoming the limitations of traditional methods in extreme environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808601B_ABST
    Figure CN119808601B_ABST
Patent Text Reader

Abstract

The present invention discloses an electric field and magnetic field reconstruction method based on physical prediction and machine learning, belonging to the technical field of electric field and magnetic field measurement, and 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 building the electric field network and magnetic field network structures based on the machine learning module; Step 3, constructing a physical prediction loss function based on the physical algorithm; Step 4, training and optimizing the neural network based on the physical prediction loss function, and the trained neural network is the final required electric field network or magnetic field network; Step 5, selecting any point in the electromagnetic field region and inputting it into the electric field network or magnetic field network, and the corresponding electric field strength or magnetic induction intensity at this point can be obtained. The present invention does not rely on prior knowledge and assumptions of the field distribution, and can effectively utilize particle information and electromagnetic wave information for the reconstruction of complex electric fields and magnetic fields.
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 particularly relates to a method for reconstructing electric field and magnetic field based on physical prediction and machine learning. Background Art

[0002] The measurement of electric field and magnetic field is a basic means to study electromagnetic phenomena and electromagnetic interactions, which can help researchers deeply explore the distribution of magnetic field and its influence on substances, and thus is of great significance in engineering. In engineering applications, the measurement of electric field and magnetic field can optimize the magnetic flux density distribution and improve the energy efficiency of transformers; in the medical field, the measurement of electric field and magnetic field is the core technology for obtaining high-resolution images, and in other fields, the measurement of electric field and magnetic field also plays an indispensable role. Therefore, it is crucial to accurately measure the electric field and magnetic field.

[0003] The difficulty in measuring the distribution of electric field and magnetic field lies in that direct measurement methods are usually challenging, so indirect measurement methods are usually adopted. Due to engineering limitations (such as too high temperature to use probes; narrow space where detectors cannot be placed, etc.), or the detector cannot reach the electromagnetic field position (such as in deep space exploration scenarios), it is impossible to place probes or detectors in the electromagnetic field area for direct in-situ measurement. Therefore, active indirect measurement means are commonly used, that is, radio frequency waves or charged particles are injected into the electromagnetic field area, and then their states before and after entering the electromagnetic field area are recorded, and the distribution information of the electric field and magnetic field in this area is reconstructed through the state changes before and after entering the electromagnetic field area.

[0004] In recent years, machine learning algorithms have opened up a field of high-performance, high-accuracy, and high-robustness numerical prediction and data enhancement based on data. Remarkable achievements have been made in fields such as time series analysis and machine translation. It analyzes a large amount of data to find 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 machine SVM, clustering algorithm, and random forest. Machine learning is not affected by the existence of analytical solutions in optimization problems. It takes gradient descent or information entropy optimization as the core and focuses on seeking the global optimal solution of the numerical solution. At the same time, its main algorithms all contain non-linear modules, which endow it with extremely strong non-linear prediction ability. In the field of physics, machine learning algorithms can rely on these non-linear capabilities to learn high-dimensional features in the data, making accurate prediction possible.

[0005] In the field of electric and magnetic field measurement, existing methods usually reconstruct the electric and magnetic field distributions through iterative calculations based on the assumed properties of the electric and magnetic field distributions. Since this method uses computational iteration, it consumes a large amount of time and computational resources. At the same time, a certain understanding of the electric and magnetic field distributions and reasonable assumptions are required before reconstruction. If there is a lack of understanding of the electric and magnetic field distributions in the measured area or the assumptions about the field distributions are incorrect, the reconstruction effect will be particularly poor. Therefore, there is an urgent need to develop a general, efficient, and accurate method for reconstructing electric and magnetic fields that does not rely on prior knowledge and assumptions about the field distributions. Summary of the Invention

[0006] 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 utilized 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 distributions, so it is very suitable for reconstructing complex electric and magnetic fields.

[0007] The technical solution of the present invention is as follows:

[0008] A method for reconstructing electric and magnetic fields based on physical prediction and machine learning, comprising the following steps:

[0009] Step 1: Inject particles or electromagnetic waves into the electromagnetic field region, and measure the initial state and final state of the particles or electromagnetic waves;

[0010] Step 2: Based on the machine learning module, preliminarily build the structures of the electric field network and the magnetic field network;

[0011] Step 3: Construct a physical prediction loss function based on physical algorithms;

[0012] Step 4: Train and optimize the neural network based on the physical prediction loss function. The trained neural network is the final required electric field network or magnetic field network;

[0013] Step 5: Select any point within the electromagnetic field region and input it into the electric field network or the magnetic field network, and the corresponding electric field strength or magnetic induction intensity at this point can be obtained.

[0014] Further, in the above step 1, 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 taken for the particles or electromagnetic waves to move in the field region; define the initial position of the th particle or electromagnetic wave entering the field region as ; the initial velocity of the th particle or electromagnetic wave entering the field region as ; the final position of the th particle or electromagnetic wave leaving the field region as ; The final velocity of the -th particle or electromagnetic wave leaving the field region is ; The total time taken for the -th particle or electromagnetic wave to move in the field region is .

[0015] Furthermore, in step 2, the machine learning module adopts a neural network structure; the dimensions of the electric field and magnetic field are two-dimensional and three-dimensional;

[0016] During the construction of the two-dimensional electric field and magnetic field network, both the input and output of the neural network are two nodes; the initial position of the particle or electromagnetic wave entering the field region 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; during the iterative optimization process of the subsequent network, the input is the position of the particle or electromagnetic wave at the next time step calculated using a physical algorithm; the two input nodes respectively correspond to the position components in the X-axis and Y-axis directions; the two output nodes respectively correspond to the electric field strength or magnetic induction intensity in the X-axis and Y-axis directions;

[0017] During the construction of the three-dimensional electric field and magnetic field network, both the input and output of the neural network are three nodes; the initial position of the particle or electromagnetic wave entering the field region 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; during the iterative optimization process of the subsequent network, the input is the position of the particle or electromagnetic wave at the next time step calculated using a physical algorithm; the three input nodes respectively correspond to the position components in the X-axis, Y-axis, and Z-axis directions; the three output nodes respectively correspond to the electric field strength or magnetic induction intensity in the X-axis, Y-axis, and Z-axis directions.

[0018] Furthermore, the specific process of step 3 is as follows:

[0019] Step 3.1: Use a physical algorithm to construct a mapping. The physical algorithm specifically adopts the discrete form of the Boris algorithm, and the formula is:

[0020] ;

[0021] ;

[0022] where is the position of the -th time step particle or electromagnetic wave; is the position of the -th time step particle or electromagnetic wave; is the time step size; is the velocity of the -th time step particle or electromagnetic wave; is the velocity of a particle or electromagnetic wave at the th time step; is the charge of the particle; is the mass of the particle; denotes the electric field strength at denotes the magnetic induction intensity at is the speed of light;

[0023] Step 3.2: Divide into several discrete time steps, define the index number of the time step, and the total number of time steps is ; the time step size of each time step is calculated by the formula:

[0024] ;

[0025] Based on the Boris algorithm, iterate for each time step. When iterating to the last time step, the predicted final state of the particle or electromagnetic wave leaving the field area is obtained, and the predicted final state includes the predicted position and predicted velocity; the specific iteration process is as follows:

[0026] First, at the initial iteration, the time step ; at this time, the initial position and initial velocity of the th particle or electromagnetic wave are the initial position and initial velocity entering the field area, that is, and ; substitute into the Boris algorithm for solution to obtain the next position and velocity; substitute and into the Boris algorithm to obtain the following equations:

[0027] ;

[0028] ;

[0029] Solve the above equations to obtain the position and velocity of the particle or electromagnetic wave at the 1st time step; denotes the electric field strength at denotes the magnetic induction intensity at

[0030] Then, increment the time step by 1, that is, ; continue to substitute into the Boris algorithm for solution; for the th time step, the previous step has solved to obtain the The position of a particle or electromagnetic wave at a time step and velocity , then the position of the particle or electromagnetic wave at the and velocity at the th time step are obtained by solving the following system of equations:

[0031] ;

[0032] ;

[0033] wherein, represents the electric field strength at; represents the magnetic induction intensity at;

[0034] Iterate successively until , at this time it is the last time step, ; Substitute the position and velocity at the penultimate time step into the Boris algorithm to solve for the final predicted position of the th particle or electromagnetic wave and the predicted velocity ;

[0035] Step 3.3, Finally, construct a physical prediction loss function based on the predicted position and predicted velocity :

[0036] ;

[0037] wherein, is the total number of particles or electromagnetic waves; , are different parameters; is the divergence operator; is the magnetic field network; is the constraint term that restricts the magnetic field divergence to 0.

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

[0039] Furthermore, the specific process of step 5 is as follows:

[0040] In the two-dimensional electromagnetic field region, input the point with the position coordinates in the electromagnetic field region into the electric field network or magnetic field network, and output the corresponding electric field strength or magnetic induction intensity ; and are the position components in the two directions of the X-axis and the Y-axis respectively; and are the electric field strengths in the two directions of the X-axis and the Y-axis respectively; and are the magnetic flux densities in the two directions of the X-axis and the Y-axis respectively;

[0041] In a three-dimensional electromagnetic field region, a point with the position coordinates of in the electromagnetic field region is input into an electric field network or a magnetic field network, and the corresponding electric field strength or magnetic flux density is output; and and are the position components in the three directions of the X-axis, the Y-axis and the Z-axis respectively; and and are the electric field strengths in the three directions of the X-axis, the Y-axis and the Z-axis respectively; and and are the magnetic flux densities in the three directions of the X-axis, the Y-axis and the Z-axis respectively.

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

[0043] 1. Breakthrough in non-dependence and generality; break through the strong dependence of traditional methods on the prior assumptions of the electric field and magnetic field distributions, autonomously extract the high-dimensional features of the field distributions through a neural network, without presetting the mathematical model of the field distributions, and can effectively reconstruct the electric field and magnetic field structures of any complex shape, having a breakthrough application value in unknown field distribution scenarios such as deep space exploration and plasma devices.

[0044] 2. Enhanced adaptability to complex environments; achieve non-contact field reconstruction through particle trajectory inversion, and can break through the technical bottlenecks where traditional probes cannot be deployed under extreme environments such as high temperature (>1500 °C), strong radiation (>10^4 Gy / h), and microscale (<100 μm cavity), forming an irreplaceable advantage in fields such as nuclear fusion device monitoring and microelectromechanical system detection.

[0045] 3. Fusion of interpretability technologies; innovatively design a loss function based on physical prediction, while maintaining the prediction accuracy of the neural network, output an interpretable reconstruction result that conforms to the physical constraints of the electric field and magnetic field (such as the divergence of the magnetic field is 0), and effectively meet the strict requirements for reliability in the engineering field. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flowchart of the electric field and magnetic field reconstruction method based on physical prediction and machine learning of the present invention.

[0047] Figure 2 Flow chart for constructing a loss function based on physical prediction for the present invention.

[0048] Figure 3 True magnetic field in the experiment of the present invention Schematic diagram.

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

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

[0051] Figure 6 Another true magnetic field in the experiment of the present invention Schematic diagram.

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

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

[0054] Figure 9 Another true magnetic field in the experiment of the present invention Schematic diagram.

[0055] Figure 10 In the experiment of the present invention for Figure 9 Schematic diagram of the predicted magnetic field reconstructed by using the method of the present invention.

[0056] Figure 11 In the experiment of the present invention Figure 9 and Figure 10 Schematic diagram of the relative error between.

[0057] Figure 12 Schematic diagram of the Tokamak magnetic field obtained by using the method of the present invention in the experiment of the present invention.

[0058] Figure 13 In the experiment of the present invention Figure 12 Partial enlarged view of the position pointed by the arrow in.

[0059] Figure 14 Schematic diagram of the construction of the electric field network in the experiment of the present invention. Detailed implementation manners

[0060] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments:

[0061] As Figure 1 shown, a method for reconstructing electric and magnetic fields based on physical prediction and machine learning includes the following steps:

[0062] Step 1: Inject a large number of particles or electromagnetic waves into the electromagnetic field region, measure the initial and final states of the particles or electromagnetic waves, and create a data set; wherein, the initial and final states 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 taken for the particles or electromagnetic waves to move in the field region. Define the initial position of the th particle or electromagnetic wave entering the field region as ; the initial velocity of the th particle or electromagnetic wave entering the field region as ; the final position of the th particle or electromagnetic wave leaving the field region as ; the final velocity of the th particle or electromagnetic wave leaving the field region as ; the total time taken for the th particle or electromagnetic wave to move in the field region as .

[0063] Step 2: Based on the machine learning module, preliminarily build the structures of the electric field network and the magnetic field network.

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

[0065] Divergence is the physical constraint when constructing the magnetic field. Specifically, when constructing the magnetic field, it is necessary to ensure that the divergence of the magnetic field is 0. During the construction process, verify whether the current divergence is 0 through derivative and divergence formulas. If the divergence is not restricted to 0 in the magnetic field network, a constraint term needs to be added to the loss function to ensure that its divergence is 0.

[0066] The electromagnetic field is the general term for the unified body of the intrinsically related and interdependent electric and magnetic fields. Under specific circumstances, a time-varying electric field generates a magnetic field, and a time-varying magnetic field generates an electric field.

[0067] The dimensions of the electric and magnetic fields are divided into two-dimensional and three-dimensional;

[0068] In the process of building a two-dimensional electric and magnetic field network, both the input and output of the neural network are 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 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 at the next time step calculated using a physical algorithm; the two input nodes respectively correspond to the position components in the X-axis and Y-axis directions; the two output nodes respectively correspond to the electric field strength or magnetic induction intensity in the X-axis and Y-axis directions.

[0069] In the construction of a three-dimensional electric and magnetic field network, both 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 at the next time step calculated using a physical algorithm; the three input nodes respectively correspond to the position components in the X-axis, Y-axis, and Z-axis directions; the three output nodes respectively correspond to the electric field strength or magnetic induction intensity in the X-axis, Y-axis, and Z-axis directions.

[0070] The activation function of the neural network can use activation functions such as ReLU, LeakyReLU, and Tanh.

[0071] 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 intermediate layers are selected, and the number of their nodes is 16, 32, and 64 in sequence according to the numerical propagation order; the number of nodes in the final output layer is 3. All activation functions use ReLU.

[0072] Step 3: Construct a physical prediction loss function based on a physical algorithm; the input variables of the loss function include the initial state and the 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 as follows:

[0073] Step 3.1: First, use a physical algorithm to construct a mapping. The physical algorithms described here include but are not limited to the Boris algorithm, volume-preserving algorithm, and symplectic algorithm. For example, use the discrete form of the Boris algorithm to construct a mapping, and the discrete form of the Boris algorithm is:

[0074] ;

[0075] ;

[0076] Among them, is the position of the particle or electromagnetic wave at the th time step; is the position of the particle or electromagnetic wave at the th time step; is the time step size; is the th time step velocity of the particle or electromagnetic wave; is the th time step velocity of the particle or electromagnetic wave; is the electric charge of the particle; is the mass of the particle; represents the electric field strength predicted by the electric field network at ; represents the magnetic induction intensity predicted by the magnetic field network at ; is the speed of light;

[0077] Step 3.2: Since it is impossible to calculate the absolutely continuous motion state throughout the entire motion process, it is necessary to select an appropriate number of time steps to approximate the actual motion state as much as possible. Therefore, is divided into several discrete time steps, and the index number of the time step is defined as , and the total number of time steps is ; the time step size of each time step is calculated by the formula:

[0078] ;

[0079] Based on physical algorithms (such as the Boris algorithm), each time step is iterated. When the iteration reaches the last time step, the predicted final state of the particle or electromagnetic wave leaving the field area is obtained. The predicted final state includes the predicted position and the predicted velocity; the specific iteration process is as follows:

[0080] First, at the initial iteration, the time step ; at this time, the initial position and the initial velocity of the th particle or electromagnetic wave are the initial position and the initial velocity entering the field area, that is, and ; substituting into the Boris algorithm for solution, the next position and velocity can be obtained. Substituting and into the Boris algorithm gives the following equations:

[0081] ;

[0082] ;

[0083] Solve the above equations to obtain the position of the particles or electromagnetic waves at the first time step and velocity ; denote the electric field strength at; denote the magnetic induction intensity at;

[0084] Then, increment the time step by 1, i.e., ; continue to substitute into the Boris algorithm for solution; for the th time step, the position of the particles or electromagnetic waves at the previous time step has been solved as the th time step and velocity , then the position of the particles or electromagnetic waves at the th time step and velocity can be solved from the following equations:

[0085] ;

[0086] ;

[0087] wherein, denote the electric field strength at; denote the magnetic induction intensity at;

[0088] Iterate sequentially until , at this time it is the last time step, ; substitute the position and velocity of the penultimate time step into the Boris algorithm to solve for the final predicted position of the particles or electromagnetic waves and predicted velocity .

[0089] Step 3.3, Finally, construct a physical prediction loss function based on the predicted position and predicted velocity :

[0090] ;

[0091] wherein, is the total number of particles or electromagnetic waves; , are different parameters. In the present invention, when training the magnetic field network, set , ; is the divergence operator; is the magnetic field network; The constraint term that restricts the magnetic field divergence to 0. When training the electric field network, set , , at this time, there is no need to restrict the divergence of the electric field network, so is 0.

[0092] This loss function formula represents the distance between the predicted final state of the particle and the true final state, incorporating physical information. When decreases, it means that the prediction of the neural network is closer to the actual value, and then the neural network will represent the actual electric field or magnetic field better.

[0093] Step 4: Train and optimize the neural network based on the physical prediction loss function. The trained neural network is the final required electric field network or magnetic field network. When training the neural network, use a specified optimizer, such as using optimizers like Adam, AdamW, SGD, etc. to train the neural network. The learning rate is set to 2e-4. At the same time, use the gradient descent method to reduce the value of the physical prediction loss function. Preset the total number of training epochs. When the number of training epochs reaches the preset value, stop training. At this time, the training is completed, and the required electric field network or magnetic field network is obtained.

[0094] Step 5: Select any point within the electromagnetic field region and input it into the electric field network or magnetic field network, and the corresponding electric field strength or magnetic induction intensity at that point can be obtained. The specific process is as follows:

[0095] In the two-dimensional electromagnetic field region, input the point with position coordinates within the electromagnetic field region into the electric field network or magnetic field network, and output the corresponding electric field strength or magnetic induction intensity . , are the position components in the two directions of the X-axis and Y-axis respectively; , are the electric field strengths in the two directions of the X-axis and Y-axis respectively; , are the magnetic induction intensities in the two directions of the X-axis and Y-axis respectively.

[0096] In the three-dimensional electromagnetic field region, input the point with position coordinates within the electromagnetic field region into the electric field network or magnetic field network, and output the corresponding electric field strength or magnetic induction intensity . , and are the position components in the three directions of the X-axis, Y-axis, and Z-axis respectively; , , are the electric field strengths in the three directions of the X-axis, Y-axis, and Z-axis respectively; , , are the magnetic induction intensities in the three directions of the X-axis, Y-axis, and Z-axis respectively.

[0097] To prove the feasibility and superiority of the present invention, the following experiments are given.

[0098] In the experiment, the above method is used to perform inverse reconstruction on a certain two-dimensional magnetic field, and the accuracy of the method is evaluated. The following are three examples of two-dimensional magnetic field measurements, each example including the true magnetic field, the predicted magnetic field, and the relative error between them . The relative error is defined as follows:

[0099] ;

[0100] where is the predicted magnetic field; is the true magnetic field; is the position coordinate, , are the X-axis coordinate and Y-axis coordinate respectively, with the unit of m;

[0101] Figure 3 is the schematic diagram of the true magnetic field ; Figure 4 is for Figure 3 the schematic diagram of the predicted magnetic field reconstructed by using the method of the present invention; Figure 5 is for Figure 3 and Figure 4 the relative error between them. It can be obtained from Figure 5 that the maximum relative error is 4%.

[0102] Figure 6 is the schematic diagram of another true magnetic field ; Figure 7 is for Figure 6 the schematic diagram of the predicted magnetic field reconstructed by using the method of the present invention; Figure 8 is for Figure 6 and Figure 7 the relative error between them. It can be obtained from Figure 8 that the maximum relative error is 4%.

[0103] Figure 9 is the schematic diagram of another true magnetic field ; Figure 10 is for Figure 9 the schematic diagram of the predicted magnetic field reconstructed by using the method of the present invention; Figure 11 is for Figure 9 and Figure 10 the relative error between them. It can be obtained from Figure 11 that the maximum relative error is 20%.

[0104] It should be noted that Figure 11 has a relatively large relative error, which can be attributed to the significant difference between the maximum and minimum values of the magnetic field. In addition Figure 9 and Figure 10 the values in the lower left corner are very small. Therefore, the relative error is mainly large in this area. Nevertheless, these measurement results are still considered acceptable

[0105] Next, three key indicators, namely the mean squared error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity (SSIM), are used to test the above results. MSE is used to measure the average difference between the true magnetic field and the predicted magnetic field, indicating 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, providing a comprehensive evaluation of the similarity between matrices. The magnetic field region (X-axis range from 1 to 2 meters, Y-axis range from -1 to 0 meters) is divided into a 1000×1000 grid, and the true magnetic field and the predicted magnetic field are obtained at each grid point and normalized. Finally, two matrices of size 1000×1000 are obtained, representing the true magnetic field and the predicted magnetic field respectively. The MSE between the true magnetic field and the predicted magnetic field matrices is calculated according to the following formula

[0106] ;

[0107] where represents the true magnetic field at grid point while represents the corresponding predicted magnetic field; 、 represent different grid indices. This formula calculates the mean squared error between the true magnetic field and the predicted magnetic field point by point. The value range of MSE is 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. Through the above formula, the MSEs of the above three cases are calculated to be 0.0003, 0.0003, and 0.0001 respectively

[0108] PSNR is defined as

[0109] ;

[0110] where 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 squared error. The value range of PSNR is from 0 to positive infinity, with the unit of decibel (dB). It represents the noise level of the signal, and thus the similarity between the prediction 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 reciprocal of PSNR measures the average relative error. Generally, when the PSNR value exceeds 30 dB, the difference between the prediction matrix and the true matrix is almost imperceptible.

[0111] Through the above formula, the PSNR values of the above three cases can be calculated as 80.84 dB, 80.62 dB, and 88.49 dB respectively.

[0112] SSIM is calculated according to the following formula:

[0113] ;

[0114] where, and are two different variables used to stabilize the denominator, is a constant representing the dynamic range of the reference matrix, and are default values, represents the average value of the elements of; represents the average value of the elements of; is the variance of the elements of, is the variance of the elements of, represents and the covariance between. The value range of SSIM is from -1 to 1. When SSIM is close to 1, the two matrices become similar and the result performs well. Through the above formula, the SSIM values of the above three cases can be calculated as 0.9987, 0.9961, and 0.9845 respectively.

[0115] The above results can be summarized in Table 1 below:

[0116] Table 1 Experimental results of three magnetic field cases

[0117] .

[0118] 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 function relationship, the relative error remains within 5%. In addition, through the evaluation of three key indicators: mean square error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity (SSIM), the reliability of the method of the present invention is demonstrated.

[0119] The following presents a set of experiments on three-dimensional magnetic fields.

[0120] In this part, the method of the present invention is applied to a three-dimensional Tokamak magnetic field. The basic parameters of the Tokamak are set as follows: the magnetic field at the magnetic axis , in units of T; the safety factor ; the major radius , in units of m. Here, the true magnetic field is given by an approximate model with a circular magnetic surface and a fixed safety factor, and the expression is as follows:

[0121] ;

[0122] where represents the distance from the same main axis to a specific spatial point (such as a point in the plasma); and represent the toroidal basis vector and the poloidal basis vector respectively, is toroidal, is poloidal; is the coordinate perpendicular to the main axis, describing the position of the plasma in the vertical direction;

[0123] For generality, the Tokamak region is selected from 0 to in the direction. 10,000 positions are randomly selected within this region, and these positions represent the initial moments when particles enter the Tokamak. To enable the particles to escape from the Tokamak faster, the mass of the particles is set to , and the charge is set to , where and are the mass of the hydrogen ion and the charge of the electron respectively. The initial velocity of each particle has a random angular distribution, and its magnitude ranges from to , where is the speed of light. Finally, the position, velocity, and running time of each particle when it escapes from the Tokamak are recorded.

[0124] Next, the inversion results of the Tokamak magnetic field are presented. To evaluate the accuracy of the solution, the solution of the method of the present invention is used to trace the magnetic field. First, at On a plane, 30 points are evenly selected on a circle 0.2 meters away from the magnetic axis as the starting points of each magnetic field line. Then, each point is traced through the solution of the method of the present invention until it reaches the plane. The last point reached by each magnetic field line is also shown on the plane and compared with the theoretical solution on the circle 0.2 meters away from the magnetic axis. The comparison results are as Figure 12 shown, Figure 13 which is Figure 12 a partial enlarged view of the position indicated by the arrow in. In the figure, r is the length of the circumference 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.

[0125] From Figure 12 and Figure 13 the results, it can be seen that the magnetic field lines solved by the present invention can form the magnetic surface structure of the Tokamak. In addition, on the plane, the points formed by the magnetic field lines are very close to the theoretical solution. This indicates that the method has high accuracy and high reliability even when applied to the three-dimensional Tokamak magnetic field.

[0126] In a certain electromagnetic field region, there are both an electric field and a magnetic field. Here, only the electric field network is constructed to test the effect of the electric field network. For the real electric field (unit: V / m) and the real magnetic field (unit: T) are simulated. The motion of a particle with an initial velocity of (unit: m / s) is driven by the simulated electromagnetic field. The original motion trajectory of the particle is as Figure 14 shown by the curve in. Then, the same particle is driven again by the predicted electric field inverted by using the method of the present invention and the original real magnetic field. By selecting several time points, the obtained positions are as Figure 14 shown by the circles in. 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 the high accuracy of the method of the present invention.

[0127] 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 those skilled in the art within the scope of the essence 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; 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 both 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 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 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 strength in the three directions of the X-axis, Y-axis and Z-axis respectively; Step 3: Construct a physical prediction loss function based on the physical algorithm; the specific process is as follows: Step 3.1, construct the mapping using a physical algorithm, where the physical algorithm specifically uses a discrete form of the Boris algorithm; 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 ; Iterate each time step based on the Boris algorithm, and obtain the predicted final state of the particle or electromagnetic wave leaving the field area when it iterates to the last time step. The predicted final state includes the predicted position and predicted speed. Step 3.3, finally, construct the physical prediction loss function based on the predicted position and predicted speed; 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 3.1, the formula 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; express The electric field strength at express Magnetic induction intensity at is the speed of light; In step 3.2, the time step length of each time step The calculation formula is: ; The specific iteration 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 ; In step 3.3, the physical prediction loss function The formula is: ; 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.

4. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 3 is 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.

5. The electric field and magnetic field reconstruction method based on physical prediction and machine learning according to claim 4, 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

  • Physical information neural network electromagnetic field calculation method based on finite difference

    CN118332879A

  • Device and method for electromagnetic field simulation

    US20200193227A1