A data-driven based magnetic core loss prediction method, computer program product
By constructing a data-driven method for predicting magnetic core loss, combining a modified empirical compensation model and a machine learning model, and optimizing weight parameters using neural networks and genetic algorithms, the accuracy problem of magnetic core loss prediction was solved, achieving higher prediction accuracy and applicability.
Patent Information
- Application Number
- CN202411705668.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In existing technologies, core loss prediction is difficult and cannot be made with high accuracy. Especially under non-sinusoidal excitation conditions, the fitting coefficient of the Steinmetz equation model is significantly affected by temperature and magnetic material factors, and there is a lack of widely applicable and highly accurate prediction models.
A data-driven method for predicting magnetic core loss is constructed. By combining a modified empirical compensation model and a machine learning prediction model, the compensation value of the prediction result is obtained through neural network training, and the weight parameters are iteratively optimized through a genetic algorithm to finally calculate the predicted value of magnetic core loss.
It significantly reduces the mean square error between the predicted results and the actual losses, improves the accuracy and applicability of core loss prediction, and adapts to different operating conditions.
Smart Images

Figure CN119646482B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a magnetic core loss prediction method in electrical equipment or high-frequency converter, and particularly relates to a magnetic core loss prediction method based on data driving and a computer program product. BACKGROUND
[0002] Magnetic elements are important elements in many mechanical devices, which have great influence on the volume and efficiency of the devices. At high frequency, the loss of magnetic elements accounts for a large proportion of the whole machine. However, due to the complex characteristics of high-frequency magnetic materials and the influence of multiple factors, it is difficult to give specific values of the magnetic core loss. At present, the traditional Steinmetz empirical equation is still widely used. However, since the excitation of magnetic elements in converters and devices is a rectangular wave with a duty cycle change, many scholars have proposed Steinmetz equation correction models such as GSE and iGSE to analyze the magnetic core loss under non-sinusoidal excitation conditions. Although the current method can better predict the magnetic core loss under certain conditions, the fitting coefficients in the equation model are significantly affected by temperature, magnetic materials and other factors. At present, there is still a lack of widely applicable and high-precision prediction models. SUMMARY
[0003] The purpose of the present application is to solve the technical problems of difficulty in predicting the magnetic core loss in the prior art and inability to make high-precision prediction, and to provide a magnetic core loss prediction method based on data driving and a computer program product, which greatly reduces the mean square error between the prediction result and the actual loss.
[0004] To achieve the above purpose, the technical scheme adopted by the present application is as follows:
[0005] A magnetic core loss prediction method based on data driving, characterized in that it comprises the following steps:
[0006] Step S1, constructing an empirical compensation model after correction of the magnetic core loss and a machine learning prediction model;
[0007] Step S2, collecting the magnetic core parameters as feature input, obtaining the prediction result P MSE by the empirical compensation model after correction, and obtaining the prediction result P ML by the machine learning prediction model;
[0008] Step S3, constructing a neural network, training the two prediction results obtained in step S2 through the constructed neural network, obtaining the compensation value C MSE of the prediction result P MSE and the compensation value C ML of the prediction result P ML ;
[0009] Step S4, compensating the prediction results P MSE and PML and compensation value C MSE and C ML respectively adapt the weight parameters, and obtain the final weight parameters through genetic algorithm iteration;
[0010] Step S5, the prediction result P MSE and P ML and compensation value C MSE and C ML , combined with the weight parameters, to calculate the prediction value of the core loss.
[0011] Further, the step S1 of constructing the corrected empirical compensation model is specifically:
[0012] According to the basic structure of Steinmetz equation, the optimized temperature factor (k0+k1T+k2T 2 ) is added to obtain the prediction result P MSE , and the formula is as follows:
[0013]
[0014] Wherein, T is the working temperature, f is the frequency, B max is the peak value of the magnetic flux density of the excitation waveform in one cycle; k0, k1, k2, α, β, e are all fitting parameters.
[0015] Further, in the step S1, the machine learning prediction model is constructed, and the construction is specifically:
[0016] Step B.1, extract the features of the core loss, and use grid search to find the parameters through the random forest regression model; the random forest regression model includes a plurality of decision trees, each decision tree is used for predicting the core loss, and the output of the random forest is the average value of the prediction results of the plurality of trees;
[0017] Step B.2, assuming that there are M trees in the random forest, and the prediction result of each tree is P tree,i , then the final prediction value of the random forest is the prediction result P ML :
[0018]
[0019] Further, the step S3 is specifically:
[0020] Step 3.1) constructing a neural network; the input vector X of the neural network includes temperature, material category, frequency, excitation waveform, error between model prediction value and true value to be searched;
[0021] Step 3.2) divide the vector X into two input data sets, which are:
[0022] XMSE : temperature, material category, frequency, excitation waveform, MSE model prediction value P MSE error with true value;
[0023] X ML : temperature, material category, frequency, excitation waveform, ML model prediction value P ML error with true value;
[0024] Two input data sets are respectively input into the neural network for training;
[0025] Step 3.3) Output the compensation value C according to the following formula MSE and C ML :
[0026] C1 = σ (W1X + b1)
[0027] C2 = σ (W2C1 + b2
[0028] C3 = σ (W3C2 + b3
[0029] C = W4C3 + b4
[0030] Wherein C1, C2, C3 are the outputs of each layer of the neural network, W1, W2, W3 are the weight matrices of each layer of the neural network; b1, b2, b3 are the bias vectors of each layer of the neural network, σ is the activation function, W4 is the weight for calculating the final compensation value, b4 is the bias vector for calculating the final compensation value; C is the final output of the neural network, that is, the compensation value C MSE or C ML .
[0031] Further, the step S4 is specifically:
[0032] Step S4.1, the prediction results P MSE and P ML and the compensation values C MSE and C ML are respectively adapted to the weight parameters α1, α2, β1, β2;
[0033] Wherein: P MSE is the prediction result of the corrected empirical compensation model, and α1 is the weight thereof;
[0034] P ML is the prediction result of the machine learning model, and α2 is the weight thereof;
[0035] C MSE is the error compensation term of the corrected empirical model, and β1 is the weight thereof;
[0036] C ML is the compensation term of the machine learning model, and β2 is the weight thereof;
[0037] Step S4.2, the weight parameters a1, a2, b1, b2 in the combined model are optimized by genetic algorithm, specifically:
[0038] S4.2.1, individual representation: each individual is a parameter combination [a1, a2, b1, b2], and satisfies:
[0039] a1+a2=1, b1+b2=1
[0040] S4.2.2, fitness function Fitness: the fitness of the individual is calculated by mean square error MSE:
[0041]
[0042] Where n is the number of samples, i is the sample index, P true,i is the true value of the ith sample, P pred,i is the predicted value of the ith sample.
[0043] S4.2.3, select the next generation of individuals by tournament selection; define two individuals I1 and I2, and select the individual with higher fitness to enter the next generation;
[0044] For two individuals I1=[a1, a2, b1, b2] and I2=[a'1, a'2, b'1, b'2], a new individual is generated after crossover; the parameters of the new individual are mutated:
[0045]
[0046] Where random noise is a random noise following a normal distribution; a1, a2 are the parameters before mutation, a1 mut , a2 mut are the parameters after mutation update;
[0047] Through multiple iterations, until the optimal a1, a2, b1, b2 are found to minimize the fitness function MSE, and finally output a set of weight parameters a1, a2, b1, b2.
[0048] Further, the step S5 is specifically:
[0049] The predicted values P MSE and P ML and the compensation values C MSE and C ML are combined with their weight parameters to calculate the predicted value P of the core loss by:
[0050] P=a1×P MSE + a2×P ML +CMSE ×β1+C ML ×β2。
[0051] A computer program product comprising a computer program, characterized in that the program, when executed by a processor, implements the steps of the data-driven magnetic core loss prediction method according to any one of claims 1 to 6.
[0052] Compared with the prior art, the present application has the beneficial technical effects as follows:
[0053] A data-driven magnetic core loss prediction method and computer program product are proposed herein, which combines the prediction results of the modified empirical compensation model and the prediction results of the machine learning prediction model, and analyzes the influence of different working conditions (i.e., working condition characteristics) on the prediction error and results, obtains compensation terms for the two prediction results through a neural network model, each prediction result and compensation term is provided with a weight, and finally the magnetic core loss prediction value of the model is organized by the two prediction results, compensation terms and their corresponding weights, and finally the optimal parameters are found through genetic algorithm iteration, so that the model performance is better. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 The implementation principle diagram of the data-driven magnetic core loss prediction method of the present application;
[0055] Figure 2 The comparison diagram of the prediction value and the true value of the prediction model of the present application. DETAILED DESCRIPTION
[0056] The present application will be described in detail below in conjunction with the drawings and specific embodiments. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application, and are not intended to limit the protection scope of the present application. A data-driven magnetic core loss prediction method, characterized by comprising the following steps:
[0057] As shown in Figure 1 The present application proposes a data-driven magnetic core loss prediction method, which constructs a data-driven machine learning and empirical model fusion magnetic core loss prediction model (Data-driven Machine learning and Modified Steinmetz-Equation, DMMSE):
[0058] P=α1×P MSE +α2×P ML +C MSE ×β1+C ML ×β2
[0059] Wherein:
[0060] P MSE is the prediction result of the empirical model, and a1 is its weight;
[0061] P ML is the prediction result of the machine learning model, and a2 is its weight;
[0062] C MSE is the error compensation term of the modified empirical model, and b1 is its weight;
[0063] C ML is the compensation term of the machine learning model, and b2 is its weight.
[0064] The prediction model mainly consists of two parts: the modified empirical compensation model and the machine learning prediction model:
[0065] 1) Modified Empirical Compensation Model:
[0066] The Steinmetz equation (SE) is one of the most famous empirical calculation models for magnetic core loss. Under sinusoidal excitation (excitation refers to the generation of a magnetic field by passing current through the coil of a magnetic component), the formula for calculating magnetic core loss is as follows:
[0067]
[0068] where P is the magnetic core loss; f is the frequency; B m is the peak value of magnetic flux density; k1, g1, g2, g3 are coefficients fitted according to experimental data, generally 1 < g1 < 3, 2 < g2 < 3. This equation is mainly designed for sinusoidal waveforms; for different types of working conditions (working conditions refer to different working environments of magnetic materials, including temperature, frequency, excitation waveform, etc.) and changes in working temperature of magnetic core materials, the SE equation will cause a large error, which brings many inconveniences and complexities in actual engineering applications.
[0069] However, in actual situations, the magnetic core loss is greatly affected by temperature. The electrical conductivity of most materials is closely related to temperature, so different temperatures will cause different magnetic core losses. In order to introduce the influence of temperature on magnetic core loss, while keeping the basic structure of the Steinmetz equation unchanged, an optimized temperature factor (k0+k1t+k2T 2 ) is added, and the formula is as follows:
[0070]
[0071] In the formula after adding the temperature factor, the linear term makes the model adaptable to most working temperatures, and since the performance of the material usually changes nonlinearly at high temperatures, adding the quadratic term can capture the change in core loss at high temperatures, effectively reducing the error caused by high-order temperature effects. The corrected equation can better fit the core loss in actual situations, helping the model to be more stable throughout the temperature range.
[0072] 2) Machine learning prediction model:
[0073] Based on a large amount of experimental data, this paper extracts features related to core loss, including temperature, material category, frequency, etc. as features, and uses a random forest regression model and grid search to find the optimal parameters. The random forest regression model is an ensemble model composed of multiple decision trees. Each decision tree is used to predict core loss, and the output of the random forest is the average of the prediction results of multiple trees. Assuming there are M trees in the forest, the prediction result of each tree is P tree,i , then the final prediction value of the random forest is:
[0074]
[0075] Specific implementation method:
[0076] 1. Calculate the prediction value of the empirical compensation model:
[0077] First, collect relevant data in actual work or experiments, including working temperature (T), frequency (F), material category (m_class), excitation waveform (label), and the peak value of the excitation waveform's magnetic flux density within one cycle B max , the extracted data is used as the input of the empirical model and the feature input of the machine learning model. First, calculate the prediction value of the corrected empirical model:
[0078]
[0079] Where k0, k1, k2, α, β, e are parameters that can be fitted, and the values are not unique. Different values may affect the performance of the model. Here is a set of reference values:
[0080] {1.005764-0.0125140.0000702.4848631.5172820.000011}
[0081] Substituting the formula gives the prediction value P MSE of the corrected empirical model.
[0082] 2. Calculate the prediction value of the machine learning prediction model:
[0083] The basic principle of random forest is as follows: random forest is composed of multiple decision trees, each decision tree makes prediction independently, and then the final prediction result is obtained by taking the average or voting:
[0084]
[0085] There are four parameters involved:
[0086] n_estimators: the number of trees in the random forest. This parameter controls the complexity of the model, and more trees usually mean better model performance, but will increase the computational overhead.
[0087] max_depth: the maximum depth of the tree. It determines the depth of each decision tree, and larger depth may lead to overfitting of the model.
[0088] min_samples_split: the minimum number of samples required to split an internal node. Larger values usually help prevent overfitting.
[0089] min_samples_leaf: the minimum number of samples required in a leaf node. This parameter can prevent the leaf node from being too small, reducing the risk of overfitting.
[0090] Different parameter values will affect the performance of the model, and a set of reference parameters is as follows:
[0091] {'max_depth':30,'min_samples_leaf':1,'min_samples_split':2,'n_estimators':300}
[0092] 3、Calculate the model prediction compensation term:
[0093] The error between the two model prediction values and the true value, including temperature T, frequency f, material class mclass, excitation waveform label, is input as a feature, and the error compensation term C MSE , C ML is finally obtained through the neural network.
[0094] Here, a neural network model is constructed to calculate the compensation values C MSE and C ML : Take a 3-layer neural network as an example:
[0095] The calculation of C MSE and C ML is completed by two neural networks respectively, rather than one network outputting two compensation values at the same time. The input vector X contains temperature, material class, frequency, excitation waveform, model prediction error and true error, which is the input of the neural network.
[0096] But X needs to be distinguished into two input datasets:
[0097] X MSE : temperature, material category, frequency, excitation waveform, error signature of MSE model prediction vs. true value (corresponding to corrected empirical compensation model prediction and error).
[0098] X ML : temperature, material category, frequency, excitation waveform, error signature of ML model prediction vs. true value (corresponding to machine learning model prediction and error).
[0099] Two neural networks separately calculate C MSE and C ML , similar structure but different input features.
[0100] For C MSE : input X MSE , output is C MSE .
[0101] For C ML : input X ML , output is C ML .
[0102] C1 = σ(W1X + b1)
[0103] C2 = σ(W2C1 + b2)
[0104] C3 = σ(W3C2 + b3)
[0105] C = W4C3 + b4
[0106] If C is unfolded:
[0107] C MSE = W 4,MSE ·σ(W 3,MSE ·σ(W 2,MSE ·σ(W 1,MSE ·X MSE +b 1,MSE )+b 2,MSE )+b 3,MSE )+b 4,MSE ;
[0108] C ML = W 4,ML ·σ(W 3,ML ·σ(W 2,ML ·σ(W 1,ML ·X ML +b 1,ML )+b 2,ML )+b 3,ML)+b 4,ML ;
[0109] W i and b i are the weight matrix and bias vector of each layer respectively, σ is the activation function, C1, C2, C3 are the output of each layer of the neural network respectively, C is the final output, i.e. C MSE and C ML . (All other parameters are derived from the neural network training, which is also a model for calculating the compensation term).
[0110] 4. Calculate the model prediction value and the compensation term weight: the method of the present application optimizes the weight parameters α1, α2, β1, β2 in the combined model by genetic algorithm. The main steps of genetic algorithm include selection, crossover, mutation, and finally the optimal parameters are obtained through the fitness function (mean square error).
[0111] 1) Individual representation: each individual is a parameter combination [α1, α2, β1, β2], and satisfies:
[0112] α1+α2=1,β1+β2=1
[0113] 2) Fitness function: the fitness of the individual is calculated by the mean square error (MSE):
[0114]
[0115] where n is the number of samples, i is the sample index, P true,i is the true value of the i-th sample, P pred,i is the prediction value of the i-th sample.
[0116] 3) Selection: select the next generation of individuals by tournament selection (Tournament Selection). Suppose two individuals I1 and I2 are selected, then the individual with higher fitness is selected into the next generation.
[0117] 4) Crossover (Crossover): for two individuals I1 = [α1, α2, β1, β2] and I2 = [α'1, α'2, β'1, β'2], the new individual after crossover is:
[0118]
[0119] 5) Mutation (Mutation): make a small change to the parameters of the individual. For example, mutate α1:
[0120]
[0121] Where random noise is random noise that follows a normal distribution, and α1 and α2 are the parameters before mutation, α1 mut α2 mut These represent the parameters after the mutation update. Here, we only use α1 and α2 as examples, and β1 and β2 are similar.
[0122] 6) Iteration: Through multiple iterations (e.g., 10,000 generations), until the optimal α1, α2, β1, β2 are found, which minimizes the fitness function (MSE).
[0123] The final output will be a set of weights α1, α2, β1, β2. Different combinations of weights affect the performance of the model. This paper provides a set of reference weights: {0.863872 0.136128 0.475502 0.524498}.
[0124] like Figure 2 As shown, the final combined model's predicted value is compared with the actual value. The mean squared error of this result is 1506394858.1676683, while the lowest mean squared error predicted by the previous empirical model and machine learning model is 16374042041104. The combined model in this experiment reduced the mean squared error by 131009345.9427317 compared with the previous experiments, thus verifying the performance of the prediction model of the present invention.
[0125] The data-driven core loss prediction method of the present invention can also be formed into a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the data-driven core loss prediction method.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present invention.
Claims
1. A data-driven based magnetic core loss prediction method, characterized in that: The method comprises the following steps: Step S1, constructing an empirical compensation model corrected for core loss and a machine learning prediction model; The construction of the corrected empirical compensation model is specifically: According to the basic structure of Steinmetz equation, the optimized temperature factor (k0+k1T+k2T 2 ) is added to obtain the prediction result P MSE , and the formula is as follows: where T is the operating temperature, f is the frequency, B max is the peak value of the magnetic flux density of the excitation waveform within one period; k0, k1, k2, a, b, e are all fitting parameters; The construction of the machine learning prediction model is specifically: Step B.1, extracting the features of the core loss, and finding the parameters by using grid search through a random forest regression model; the random forest regression model comprises a plurality of decision trees, each of which is used for predicting the core loss, and the output of the random forest is the average of the prediction results of the plurality of trees; Step B.2, assuming there are M trees in the random forest, the prediction result of each tree is P tree,i The final prediction value of the random forest is the prediction result P ML : Step S2, collect the magnetic core parameters as characteristic input, and obtain the prediction result P through the revised empirical compensation model MAE , obtain the prediction result P through the machine learning prediction model ML ; Step S3, constructing a neural network, training the two prediction results obtained in step S2 through the constructed neural network respectively to obtain a prediction result P MSE a compensation value C MSE of the prediction result P ML a compensation value C ML of the prediction result P Step S4, the prediction result P MSE and P ML and the compensation value C MSE and C ML respectively adapt the weight parameters, and obtain the final weight parameters through genetic algorithm iteration; Step S5, the prediction result P MSE and P ML and the compensation value C MSE and C ML , combined with the weight parameters, to calculate the predicted value of the core loss.
2. The data-driven based core loss prediction method of claim 1, wherein: The step S3 is specifically: Step 3.1) constructing a neural network; the input vector X of the neural network comprises temperature, material category, frequency, excitation waveform, error between model prediction value and true value, and features to be searched; Step 3.2) dividing the vector X into two input data sets, which are: X MSE : temperature, material class, frequency, excitation waveform, MSE model prediction value P MSE error from true value; X ML : temperature, material class, frequency, excitation waveform, ML model prediction P ML Error from true value; The two input data sets are respectively input into the neural network for training; Step 3.3) Output the compensation value C according to the following formula MSE and C ML : C1=σ(W1X+b1) C2=σ(W2C1+b2) C3=σ(W3C2+b3) C=W4C3+b4 Wherein C1, C2, C3 are the output of each layer of the neural network respectively, W1, W2, W3 are the weight matrix of each layer of the neural network respectively; b1, b2, b3 are the bias vector of each layer of the neural network, σ is the activation function, W4 is the weight for calculating the final compensation value, b4 is the bias vector for calculating the final compensation value; C is the final output of the neural network, that is, the compensation value C MSE or C ML .
3. The data-driven based core loss prediction method of claim 1, wherein: The step S4 is specifically: Step S4.1, adapting the prediction result P MSE and P ML and the compensation value C MSE and C ML to the weight parameters α1, α2, β1, β2, respectively; where: P MSE is the prediction result of the revised empirical compensation model, and a1is the weight of the revised empirical compensation model. P ML for a prediction result of a machine learning model, and a2 is a weight thereof; C MSE For the error compensation term of the modified empirical model, β1 is the weight thereof; C ML β2 is the weight of the compensation term for the machine learning model. Step S4.2, optimizing the weight parameters a1, a2, b1, b2 in the combined model by a genetic algorithm, specifically: S4.2.1, individual representation: each individual is a parameter combination [a1, a2, b1, b2], and satisfies: α1+α2=1,β1+β2=1 S4.2.2, fitness function Fitness: the fitness of the individual is calculated by mean square error MSE: where n is the number of samples, i is the sample index, P true,i is the true value of the ith sample, P pred,i is the predicted value of the ith sample; S4.2.3, selecting the next generation of individuals by tournament selection; define two individuals I1 and I2, and select the individual with higher fitness to enter the next generation; For two individuals I1=[a1, a2, b1, b2] and I2=[a'1, a'2, b'1, b'2], a new individual is generated after crossover; the parameters of the new individual are mutated: where random noise is random noise obeying normal distribution; a1, a2 are parameters before variation, a1 mut , a2 mut are parameters after variation update; Through multiple iterations, until the optimal a1, a2, b1, b2 are found to make the fitness function MSE minimum, and finally a set of weight parameters a1, a2, b1, b2 are output.
4. The data-driven based core loss prediction method of claim 3, wherein: The step S5 is specifically: The predicted value P is calculated by the following equation: MSE and P ML and the compensation value C MSE and C ML , in combination with their weight parameters, by the following equation: P = a1 x P MSE + a2 x P ML + C MSE x b1 + C ML x b2.
5. A computer program product comprising a computer program, characterized in that: When the program is executed by the processor, the steps of the data-driven core loss prediction method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Calculation method of core loss of high frequency transformer
CN109101673A
Power cable loss and core temperature prediction method
CN110135019A