A reactor magnetic field simulation method based on deep learning instead of finite element analysis
Through the reactor magnetic field simulation method based on deep learning, the problem of the finite element analysis method taking too long to calculate is solved, the reactor magnetic field is quickly predicted, and the prediction needs in high real-time scenarios are met.
Patent Information
- Application Number
- CN202110253268.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-05
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-03-05
AI Technical Summary
In the existing technology, the finite element analysis method takes too long to calculate in reactor magnetic field simulation and is difficult to meet the prediction requirements in high real-time scenarios, especially when a series reactor is short-circuited and causes a fire.
The reactor magnetic field simulation method based on deep learning is used to obtain the magnetic field data and basic parameters, divide the training and test data sets, perform preprocessing and model training, use the deep learning model for prediction, and finally perform back-processing to obtain the simulation results. Specific steps include data mean calculation, principal component analysis dimensionality reduction, neural network model construction and training, and accuracy evaluation of the K-fold cross-validation method.
The prediction speed of the deep learning model is significantly faster than that of finite element analysis. It can achieve real-time prediction of magnetic field data when a reactor short circuit causes a fire, meeting the needs of high real-time scenarios.
Smart Images

Figure CN112784499B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of magnetic field simulation methods, and in particular to a method for simulating the magnetic field of a reactor based on deep learning instead of finite element analysis. Background Art
[0002] Dry-type air-core reactors have the advantages of being dry and oil-free, simple in structure, easy to operate and maintain, high in insulation strength, high in mechanical strength, and high in reliability, and are therefore widely used in power systems.
[0003] Series reactors are widely used in power grid equipment, and the problem of fire caused by equipment failure cannot be ignored. Fire in series reactors is generally caused by short circuit. Short circuit causes a significant change in the magnetic field of the reactor. Therefore, the operating status of the reactor can be known by obtaining the change in the magnetic field of the reactor. This is one of the cores of the digital grid - the digitization of equipment. Not only the normal operating equipment is digitized, but also the status information is given in real time when the equipment fails.
[0004] The prior art generally adopts the method of installing a magnetic field sensor on each reactor, using the magnetic field sensor to monitor the magnetic field strength of the reactor, and using the finite element analysis method to analyze and compare the changes in the current magnetic field strength and the normal magnetic field data, so as to judge in advance whether the series reactor is short-circuited according to the changes in the magnetic field. Although the finite element analysis method has high accuracy, as the model complexity and problem difficulty increase, the calculation time of the finite element analysis method also gradually increases, and the speed of obtaining the simulation results of the magnetic field is slow. The fire caused by the short circuit of the series reactor occurs in an instant. When the finite element analysis method takes a long time to calculate, it will be difficult to meet the prediction requirements in such a high real-time scenario. Summary of the invention
[0005] The present application provides a method for simulating a reactor magnetic field based on deep learning to solve the problem of excessively long time consumption in the existing reactor magnetic field simulation using finite element analysis.
[0006] The technical solutions adopted in this application are as follows:
[0007] A reactor magnetic field simulation method based on deep learning instead of finite element analysis mainly includes the following steps:
[0008] Acquiring magnetic field data of the reactor and basic parameters of the reactor corresponding to the magnetic field data;
[0009] Dividing the magnetic field data into a training data set and a test data set;
[0010] Preprocessing the training data set to obtain eigenvector values and corresponding eigenvalues;
[0011] Using the basic parameters of the reactor corresponding to the training data set as input information and the feature vector value as output information, training a deep learning model;
[0012] Inputting the basic parameters of the reactor corresponding to the test data set into the deep learning model to obtain a test result;
[0013] The test result is subjected to an inverse processing operation to obtain a simulation result of the reactor magnetic field.
[0014] Furthermore, the data magnetic field includes reactor magnetic field data under different currents stored in finite element analysis software.
[0015] Further, the preprocessing includes: first calculating the mean of the training data set and performing a mean removal operation;
[0016] The principal component analysis method is then used to perform dimensionality reduction processing on the training data set to obtain three-dimensional eigenvector values and corresponding three-dimensional eigenvalues.
[0017] Furthermore, the basic parameters of the reactor include current, number of coil turns, conductor cross-sectional area, coil size, etc.
[0018] Furthermore, the deep learning model includes: at least one input layer, at least two hidden layers and at least one output layer, wherein the number of neurons in each input layer is the same as the number of input information, and the number of neurons in each output layer is the same as the number of eigenvalues.
[0019] Furthermore, training the deep learning model also includes selecting and setting the hidden layer parameters, selecting an activation function, selecting a method to reduce overfitting, and calculating a loss function.
[0020] Furthermore, the deep learning model is the optimal model obtained after precision evaluation using the K-fold cross-validation method.
[0021] Furthermore, the inverse processing operation includes: firstly using the three-dimensional feature vector to perform an inverse transformation on the test result, and then adding the mean value to obtain a simulation result of the reactor magnetic field.
[0022] An electronic device, comprising:
[0023] Processor and memory;
[0024] The storage stores computer-readable instructions, which, when executed by the processor, implement the reactor magnetic field simulation method based on deep learning instead of finite element analysis.
[0025] The beneficial effects of adopting the technical solution of this application are as follows:
[0026] The present application discloses a method for simulating the magnetic field of a reactor based on deep learning instead of finite element analysis, including obtaining the magnetic field data of the reactor and the basic parameters of the reactor corresponding to the magnetic field data; dividing the magnetic field data into a training data set and a test data set; preprocessing the training data set to obtain eigenvector values and corresponding eigenvalues; using the basic parameters of the reactor corresponding to the training data set as input and the eigenvector values as output to train the deep learning model; inputting the basic parameters of the reactor corresponding to the test data set into the deep learning model to obtain the test results; performing a reverse processing operation on the test results to obtain the simulation results of the reactor magnetic field. Compared with finite element analysis, the prediction speed of the deep learning model in the present application is significantly faster than that of finite element analysis, and can achieve the purpose of real-time prediction of magnetic field data in the scenario where the reactor short circuit causes fire and the magnetic field changes at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0028] Figure 1 A flowchart of a method for simulating a magnetic field of a reactor based on deep learning instead of finite element analysis provided in an embodiment of the present application;
[0029] Figure 2 A structural diagram of the deep learning model provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0031] See also Figure 1 , which is a flow chart of a method for simulating a magnetic field of a reactor based on deep learning instead of finite element analysis provided in an embodiment of the present application; see Figure 2 A structural diagram of the deep learning model provided in an embodiment of the present application.
[0032] Embodiment 1
[0033] The reactor magnetic field simulation method provided in this application based on deep learning instead of finite element analysis mainly includes the following steps:
[0034] Step 1: Obtain the magnetic field data of the reactor and the basic parameters of the reactor corresponding to the magnetic field data.
[0035] The data magnetic field includes the magnetic field data of the reactor under different currents stored in the finite element analysis software. The basic parameters of the reactor include current, number of coil turns, wire cross-sectional area, coil size, etc.
[0036] Step 2: Divide the magnetic field data into training data set and test data set.
[0037] Step 3: Preprocess the training data set to obtain the eigenvector value and the corresponding eigenvalue.
[0038] Preprocessing the training data set includes: first calculating the mean of the training data set, and then performing a mean removal operation to obtain the training data set after the mean removal. The mean removal preprocessing method can make the created deep learning neural network easier to converge.
[0039] Preprocessing the training data set also includes: using the principal component analysis method (PCA) to reduce the dimension of the training data set after removing the mean, and obtain the eigenvector value and the eigenvector. The number of dimensions of the eigenvector is the same as the number of eigenvalues in the training data set. The eigenvalue is a value selected from the training data set and contains 99% of the information in the training data set. For example, 3 eigenvalues are selected according to the importance of the features. These 3 eigenvalues can contain 99% of the information in the training data set. After the dimensionality reduction, what is obtained is a three-dimensional eigenvector value and a corresponding three-dimensional eigenvector.
[0040] Step 4: Use the basic parameters of the reactor corresponding to the training data set as input and the feature vector value as output to train the deep learning model.
[0041] The deep learning model includes an input layer, a hidden layer and an output layer, and the number of neurons in the input layer and the output layer is determined according to the number of basic parameters. The deep learning model established in the present application includes: at least one input layer, at least two hidden layers and at least one output layer, wherein the number of neurons in each input layer is at least 3, the number of neurons in each hidden layer is at least 4, and the number of neurons in each output layer is at least 3.
[0042] The hidden layer parameters, such as the number of hidden layers and the number of neurons in each hidden layer, can only be obtained after continuous experiments during the model training phase.
[0043] The basic parameters of the reactor corresponding to the training data set are used as input information and the three-dimensional eigenvector values are used as output information to train the deep learning model. The number of neurons in each input layer is the same as the number of basic parameters of the reactor as input information, and the number of neurons in each output layer is the same as the number of eigenvalues. The selection of eigenvalues is determined by the order of feature importance after PCA dimensionality reduction.
[0044] Training a deep learning model also involves selecting and setting hidden layer parameters, choosing activation functions, choosing methods to reduce overfitting, and calculating loss functions.
[0045] In order to obtain a more accurate generalization error, the K-fold cross-validation method is used to evaluate the accuracy of the model and select the optimal model. Specifically, first, the data set is divided into a training data set and a test data set, and then the training data set is divided into K unrelated subsets, one of which is used as the validation data, and the other K-1 data are used as the training data. When a model completes a complete experiment, K experimental results will be obtained. The average of these K experimental results is taken as the output of the model, and the model with the smallest mean absolute error (MAE) is selected as the optimal model.
[0046] Step 5: Input the basic parameters of the reactor (current value, number of coil turns, wire cross-sectional area, and coil size) corresponding to the test data set into the deep learning model to obtain the test results.
[0047] Step 6: Perform reverse processing on the test results to obtain the simulation results of the reactor's magnetic field.
[0048] The inverse processing operation includes: firstly using the feature vector obtained by the PCA dimensionality reduction in step 2 to perform an inverse transformation on the prediction result, and then adding the mean in step 2 to obtain the final magnetic field simulation prediction result.
[0049] Embodiment 2
[0050] The present application is described in detail below in conjunction with specific implementation methods.
[0051] This application uses a coil with 284.792 turns and a wire cross-sectional area of 12.464269mm 2 The reactor is taken as an example to illustrate, including the following steps:
[0052] Step 1: Obtain the magnetic field data of the reactor and the basic parameters of the reactor corresponding to the magnetic field data.
[0053] The reactor model to be analyzed was created in the finite element analysis software COMSOL. The reactor is a hollow cylinder with a total of 41 layers of coils and good symmetry, so one of its cross-sections can be selected. A total of 51 electromagnetic field finite element analysis data with current values ranging from 502.5485A to 1005.097A and an interval of approximately 10A were exported from the finite element analysis software. Each finite element analysis data consists of 91462 coordinates and electromagnetic field intensity values.
[0054] The number of coil turns of the reactor is 284.792 turns, and the cross-sectional area of the wire is 12.464269mm 2 .
[0055] Step 2: Divide the magnetic field data into training data set and test data set.
[0056] 40 pieces of data were selected from 51 electromagnetic field finite element analysis data as training data sets, and the remaining 11 pieces of data were selected as test data sets.
[0057] Step 3: Preprocess the training data set to obtain the eigenvector value and the corresponding eigenvalue.
[0058] First, the mean of 40 training data is obtained. In order to make the subsequent deep neural network converge more easily, the training data set is removed by the mean. Then the principal component analysis method (PCA) is used to reduce the dimension of the 40 training data after removing the mean. According to the importance, k eigenvalues that can retain 99% of the information are selected, where k=3, that is, the three-dimensional eigenvalues and corresponding three-dimensional eigenvectors of the data set are obtained. These three-dimensional eigenvectors constitute the projection matrix. The training data set after removing the mean is multiplied by the projection matrix to obtain the reduced-dimensional data. At this time, the data is 3-dimensional. Therefore, the 40 data in the training data set are changed from the original 91462 dimensions of each to the current 3 dimensions. At the same time, the three-dimensional eigenvectors obtained by dimensionality reduction are also used to restore the prediction results of the test data set.
[0059] Step 4: Train the deep learning model.
[0060] The current value, coil turns, and wire cross-sectional area of 40 training data are used as input. The three-dimensional feature values obtained by PCA dimensionality reduction are used as output to train the deep learning model.
[0061] The eigenvalues and the corresponding eigenvector values become three-dimensional after PCA dimensionality reduction, so the number of neurons in the output layer of the deep learning model in this embodiment is 3. Through multiple trainings, the hidden layer parameters are selected and set, the activation function is selected, the method of reducing overfitting is selected, and the loss function is calculated.
[0062] In order to obtain a more accurate generalization error, the K-fold cross-validation method is used to evaluate the accuracy of the model and select the optimal model.
[0063] Since the amount of data provided in the training data set in this embodiment is small, only 40 data, a four-fold cross validation method is used to evaluate the accuracy of the model: the 40 data are evenly divided into 4 groups of data sets, one of which is used as a validation group, and the remaining three groups are used as training groups. For the same model, each group of data sets is used as a validation set, a total of four groups of data, and four results are finally obtained. The mean of these four results is used as the output of the model. The model with the smallest mean absolute error is selected as the optimal model.
[0064] After evaluation, the optimal model is the deep learning model, and the results are shown in Table 1 below:
[0065] Table 1 Performance of deep learning replacing finite element analysis in the magnetic field of a single coil in the test set
[0066]
[0067] Among them, 3-4-4-3 represents that the input layer is one layer, and the number of neurons in the input layer is 3; the hidden layer is 2 layers, and the number of neurons in each layer of the hidden layer is 4; the output layer is 1 layer, and the number of neurons in each layer of the output layer is 3. Because the research object of this embodiment is a reactor, the deep learning model adopted is relatively simple. When different research objects are added later, a more complex and deeper model can be adopted for analysis, and the applicability of deep learning can be guaranteed.
[0068] Step 5: Input the current value, coil turns, wire cross-sectional area, and coil size of the 11 data in the test data set into the deep learning model to obtain the test results.
[0069] Step 6: Restore the results.
[0070] The test results are processed inversely to obtain the simulation results of the reactor's magnetic field.
[0071] The inverse processing operation includes: firstly using the feature vector obtained by the PCA dimensionality reduction in step 2 to perform an inverse transformation on the prediction result, and then adding the mean in step 2 to obtain the final magnetic field simulation prediction result.
[0072] After the deep learning model is obtained, it takes about 2ms to test the 11 test data sets. The floating point operation used in the present embodiment when training the model can also be improved in terms of time if fixed point operation is considered.
[0073] The mean absolute error of the test data set in Table 1 refers to the mean of the absolute error on each coordinate of the test data set. The mean absolute error ratio of the test data set refers to the mean of the mean absolute error ratio on each coordinate of the test data set. The mean absolute error of the test data set is very low, and the proportion of the mean absolute error of the test set is also very small. The mean value of the electromagnetic field strength of the test data set is 3.32×10 -4 It can be seen that the deep learning model is very effective in replacing finite element analysis for reactor magnetic field simulation.
[0074] This application uses deep learning to replace finite element analysis to simulate the magnetic field of the reactor. Compared with finite element analysis, the deep learning model only takes 2ms to predict 11 data, while the calculation method using finite element analysis takes several seconds. The prediction speed of the deep learning model is significantly faster than that of finite element analysis. It can achieve the purpose of real-time prediction of magnetic field data in the scenario where the reactor short circuit causes fire and the magnetic field changes at the same time.
[0075] Embodiment 3
[0076] An embodiment of the present application provides an electronic device, including a processor and a memory; the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above-mentioned inductor magnetic field simulation method based on deep learning instead of finite element analysis is implemented.
[0077] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.
Claims
1. A method for simulating a reactor magnetic field based on deep learning instead of finite element analysis, characterized in that: The main steps include: The magnetic field data of the reactor and the basic parameters of the reactor corresponding to the magnetic field data are obtained; the reactor is a hollow cylinder, including 41 layers of coils, and the magnetic field data of the reactor is obtained by selecting any cross section of the 41 layers of coils, deriving the current value from the finite element analysis software, the current value range is 502.5485A to 1005.097A, and using the finite element analysis data of 51 electromagnetic fields with an interval of 10A as the magnetic field data of the reactor; the number of coil turns of the reactor is 284.792 turns, and the cross-sectional area of the wire is 12.464269mm 2 ; The magnetic field data is divided into a training data set and a test data set; wherein 40 pieces of data are selected from 51 pieces of electromagnetic field finite element analysis data as the training data set, and the remaining 11 pieces of data are selected as the test data set; Preprocessing the training data set to obtain eigenvector values and corresponding eigenvalues; the preprocessing includes: first calculating the mean of the training data set and performing a mean removal operation; then using a principal component analysis method to perform dimensionality reduction processing on the training data set to obtain a three-dimensional eigenvector value and a corresponding three-dimensional eigenvalue; The reactor basic parameters corresponding to the training data set are used as input information and the eigenvector values are used as output information to train the deep learning model; the deep learning model includes: at least one input layer, at least two hidden layers and at least one output layer, wherein the number of neurons in each input layer is the same as the number of the input information, and the number of neurons in each output layer is the same as the number of the eigenvalues; training the deep learning model also includes selecting and setting hidden layer parameters, selecting activation functions, selecting methods to reduce overfitting and calculating loss functions; the deep learning model is the optimal model selected after precision evaluation using the K-fold cross-validation method; the optimal model adopts a 3-4-4-3 structure, wherein the input layer is 1 layer and the number of neurons in the input layer is 3; the hidden layer is 2 layers and the number of neurons in each hidden layer is 4; the output layer is 1 layer and the number of neurons in each output layer is 3; Inputting the basic parameters of the reactor corresponding to the test data set into the deep learning model to obtain a test result; The test result is subjected to an inverse processing operation to obtain a simulation result of the reactor magnetic field.
2. The method for simulating a reactor magnetic field based on deep learning instead of finite element analysis according to claim 1, characterized in that: The inverse processing operation includes: firstly using the three-dimensional feature vector to perform an inverse transformation on the test result, and then adding the mean value to obtain the simulation result of the reactor magnetic field.
3. An electronic device, characterized in that: include: Processor and memory; The storage stores computer-readable instructions, which, when executed by the processor, implement the method for simulating the magnetic field of a reactor based on deep learning instead of finite element analysis according to claim 1 or 2.
