A Power Parameter Prediction Method Based on Improved Elman Neural Network

By improving the Elman neural network structure and combining improved particle swarm algorithm, dynamically adjusting the learning factor is solved, and the problem of insufficient prediction accuracy in the existing technology is achieved, and higher prediction accuracy and faster training speed are achieved.

CN114781752BActive Publication Date: 2025-06-27CHANGZHOU UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210549574.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-06-27
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

The existing Elman neural networks have insufficient accuracy in power load prediction, and the learning factor improvements of particle swarm algorithms are relatively few, resulting in slow network training.

Method used

By improving the Elman neural network structure, the second hidden layer is added, and the output of the previous moment and the input of the next moment are used as the input of the second hidden layer. At the same time, combined with the improved particle swarm algorithm, the learning factor is dynamically adjusted to improve the training accuracy of the network.

Benefits of technology

It improves the accuracy of power load prediction, reduces prediction errors, and enhances the dynamic performance and training speed of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781752B_ABST
    Figure CN114781752B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of Elman algorithms, and particularly to a power parameter prediction method based on an improved Elman neural network, including: improving the learning factor of the particle swarm optimization algorithm and applying it to the improved Elman network model, training the power load data through the improved Elman network model, establishing the improved Elman network model, and verifying it through a test set. Aiming at the accuracy problem of the Elman neural network in power load prediction, the present invention improves the power load prediction accuracy by improving the Elman neural network structure and combining it with the improved particle swarm optimization algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Elman algorithms, and particularly to a power parameter prediction method based on an improved Elman neural network. Background Art

[0002] In the safe operation of a power system, the prediction of power load is essential. Predictions can be divided into long-term prediction, short-term prediction, and ultra-short-term prediction. Short-term load prediction is an important part of the safety of the power system. The accuracy of short-term power load prediction has a significant impact on the safety of electricity use in daily life and has a huge impact on the safe and stable development of local economy. With the continuous application of various artificial intelligence algorithms in power load prediction, it is of great significance to improve the accuracy of power load prediction.

[0003] At present, for the photovoltaic power generation power prediction based on a double-layer Elman neural network proposed by Cao Yuqi et al., although the prediction accuracy can be improved, this improved method needs to use the data obtained from training as the input for training again, increasing the complexity of the operation.

[0004] For the comprehensive meteorological short-term load prediction of an improved Elman neural network proposed by Liu Rong et al. However, this method mainly improves the activation function, and there are problems such as slow network training speed. And the domestic and foreign research on the particle swarm algorithm mainly focuses on improving the inertia factor and other aspects in the particle swarm algorithm, and relatively few improvements are made to the learning factor. Summary of the Invention

[0005] Aiming at the deficiencies of the existing algorithms, the present invention aims at the accuracy problem of the Elman neural network in power load prediction. By improving the structure of the Elman neural network and combining it with an improved particle swarm optimization algorithm, the accuracy of power load prediction is improved.

[0006] The technical solution adopted by the present invention is: a power parameter prediction method based on an improved Elman neural network includes the following steps:

[0007] S1. Improve the learning factor of the particle swarm algorithm and apply it to the improved Elman network. Train the power load data through the improved Elman network, establish an improved Elman network model, and verify it through a test set.

[0008] Further, the improved Elman network model adds a second hidden layer on the basis of the traditional Elman neural network, and uses the output of the previous moment and the input of the next moment as the input of the second hidden layer. The output of the first hidden layer of the improved Elman network model is:

[0009] m1(k) = f[w1m c(k) + w4U(k - 1) + b1] (5)

[0010] The output of the first delay layer is:

[0011] m c (k) = m1(k - 1) (6)

[0012] The output of the second hidden layer is:

[0013] m2(k) = f[w3y c (k) + w2h c (k) + w5m1(k) + b2] (7)

[0014] The output of the second delay layer is:

[0015] h c (k) = m2(k - 1) (8)

[0016] The output of the third delay layer:

[0017] y c (k) = y(k - 1) (9)

[0018] The output of the third delay layer:

[0019] y(k) = g[w6m2(k) + b3] (10)

[0020] Where y(k) represents the output value of the output layer; m1(k) represents the output value of the first hidden layer, U(k - 1) represents the input of the input layer; m2(k) represents the output value of the second hidden layer; y c (k) represents the output of the third delay layer in the network; h c (k) represents the output of the second delay layer in the network; m c (k) represents the output of the first delay layer in the network; w1 is the weight from the first delay layer to the first hidden layer; w2 represents the weight from the second delay layer to the second hidden layer; w3 represents the weight from the output layer to the third delay layer; w4 represents the weight from the input layer to the first hidden layer; w5 represents the weight from the first hidden layer to the second hidden layer; w6 represents the weight from the second hidden layer to the output layer; b1, b2, and b3 are the thresholds of the first hidden layer, the second hidden layer, and the output layer respectively, f(*); g(*) generally uses a linear function to represent the activation function of the output layer.

[0021] Furthermore, the improved particle swarm algorithm is used to optimize the initial weights W and thresholds b of the improved Elman network. The error function in the improved Elman network is used as the fitness function in the improved particle swarm. The optimization ability of the improved particle algorithm is utilized to find the optimal values of the initial weights and thresholds, improving the accuracy and performance of the algorithm.

[0022] Furthermore, the learning factors of the improved particle swarm algorithm are such that the individual learning factor and the improved group learning factor of the particle swarm algorithm are adjusted from fixed values to exponentially dynamic values that change with the number of iterations.

[0023] The formulas for the individual learning factor and the improved group learning factor are as follows:

[0024] c1 = c max -(c max -c min )(1 / e -i / k )(13)

[0025] The improved group learning factor is:

[0026] c2 = c max -(c max -c min )(1 / e -i / k )(14)

[0027] Where i represents the current number of iterations, k represents the total number of iterations set, c max represents the maximum learning factor set, and c min represents the minimum learning factor set.

[0028] Advantages of the present invention:

[0029] By improving the learning factors in the particle swarm algorithm and optimizing the structure of the Elman neural network, a prediction model of the particle swarm optimized Elman neural network is established. By comparing the actual obtained values with the predicted values obtained by the algorithm, it is found that the improved prediction model is more excellent and the predicted data is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is the improved Elman neural network diagram of the present invention;

[0031] Figure 2 is the traditional Elman neural network diagram;

[0032] Figure 3 is the prediction diagram of the traditional Elman neural network by simulation;

[0033] Figure 4 is the prediction diagram of the improved Elman neural network by simulation;

[0034] Figure 5 It is a simulated prediction graph of an improved Elman neural network based on Pso;

[0035] Figure 6 It is a simulated prediction graph of an improved Elman neural network based on improved Pso. Specific implementation manner

[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner. Therefore, it only shows the components related to the present invention.

[0037] In this embodiment, the 24-hour power load data from November 1st to 29th in a certain city is collected as training data, and the 24-hour power load data on November 30th is used as test data;

[0038] First, use the traditional Elman neural network to predict the data, and calculate the relative error and average relative error between the prediction points and the observed values as the evaluation criteria of the algorithm. Among them, the relative error and average error formulas are as follows:

[0039]

[0040]

[0041] A power parameter prediction method based on an improved Elman neural network, comprising the following steps:

[0042] S1. By improving the learning factor of the particle swarm optimization algorithm and applying it to the improved Elman network model, train the power load data through the improved Elman network model, establish the improved Elman network model, and verify it through the test set.

[0043] Such as Figure 2 is a graph of a traditional Elman neural network. The Elman neural network adds a delay layer on the basis of the BP neural network, enabling the current neural network model to have a memory function and better adapt to the dynamic changes of data. The working process of the entire network:

[0044] The mathematical expression of the Elman neural network model:

[0045] m(k) = f[w1m c (k) + w2U(k - 1) + b1] (1)

[0046]

[0047] y(k) = g[w3m(k) + b2] (3)

[0048] In the formula, y(k) represents the output value of the output layer; m(k) represents the output value of the hidden layer, and U(k - 1) represents the input value of the input layer; w1 represents the weight value from the delay layer to the hidden layer in the neural network; w2 represents the weight value from the input layer to the hidden layer in the neural network; w3 represents the weight value from the hidden layer to the output layer in the neural network; where represents the gain, which is between [0, 1]; b1 and b2 are the thresholds of the hidden layer and the output layer respectively, and f(*) usually uses a non - linear function; g(*) usually uses a linear function.

[0049] The error function of the Elman neural network is given by the formula:

[0050] E=([y d (k)-y(k)] T [y d (k)-y(k)]) / 2 (4)

[0051] In the formula, E represents the error, y d (k) represents the measured value; y(k) represents the predicted value obtained through training;

[0052] The working principle of the Elman neural network uses the method of gradient descent. Using the principle of gradient descent, through continuous iteration, the weight values and thresholds in the network are updated to make the error reach the desired result.

[0053] Furthermore, as Figure 1 shown in the improved Elman neural network diagram, the mathematical space expression of the improved Elman neural network is as follows:

[0054] Output of the first hidden layer:

[0055] m1(k)=f[w1m c (k)+w4U(k - 1)+b1] (5)

[0056] Output of the first delay layer:

[0057] m c (k)=m1(k - 1) (6)

[0058] Output of the second hidden layer:

[0059] m2(k)=f[w3y c (k)+w2h c (k)+w5m1(k)+b2] (7)

[0060] Output of the second delay layer:

[0061] h c(k) = m2(k - 1) (8)

[0062] Output of the third delay layer:

[0063] y c (k) = y(k - 1) (9)

[0064] Output of the third delay layer:

[0065] y(k) = g[w6m2(k) + b3] (10)

[0066] Wherein, y(k) represents the output value of the output layer, m1(k) represents the output value of the first hidden layer, U(k - 1) represents the input of the input layer, m2(k) represents the output value of the second hidden layer, y c (k) represents the output of the third delay layer; h c (k) represents the output of the second delay layer; m c (k) represents the output of the first delay layer; w1 is the weight from the first delay layer to the first hidden layer; w2 represents the weight from the second delay layer to the second hidden layer in the neural network; w3 represents the weight from the output layer to the third delay layer in the neural network; w4 represents the weight from the input layer to the first hidden layer in the neural network; w5 represents the weight from the first hidden layer to the second hidden layer in the neural network; w6 represents the weight from the second hidden layer to the output layer; b1, b2 and b3 are the thresholds of the first hidden layer, the second hidden layer and the output layer respectively, f(*) usually uses a non - linear function; g(*) usually uses a linear function.

[0067] Furthermore, the particle swarm optimization (Pso) algorithm is used to optimize the initial weights and thresholds set in the neural network. The particle swarm optimization algorithm is an optimization algorithm proposed by J. Kennedy and R. C. Eberhart et al. at the end of the 20th century. This algorithm simulates the behavior of birds searching for food within a certain range. In this algorithm, each bird is regarded as a particle, which is used to represent a candidate solution to the problem. Each particle has three characteristics: velocity, position and fitness value. Assuming a population composed of N particles, the search space is S - dimensional. Each particle flies in this space at a certain speed. During each forward process of the particle, it will continuously update its own information; each piece of information is jointly determined by the individual extreme value and the global extreme value. Assuming the velocity of the i - th particle is v i = [v i1 , v i2 , v i3 ,.....v iS T , and the individual extreme value is p i = [p i1 , p i2 ​, p i3 ,..... p iS T , the overall optimal value is p g = [p g1 , p g2 , p g3 ,..... p gS T , the specific formula is:

[0068]

[0069]

[0070] In the formula, t represents the current iteration number, c1 and c2 are the individual learning factor and the swarm learning factor respectively; i = 1, 2,..., N; r1 and r2 are random numbers between [0, 1].

[0071] The particle swarm optimization algorithm is improved. There are certain deficiencies in the traditional particle swarm optimization algorithm during the optimization process. The algorithm is prone to problems such as slow convergence speed and premature convergence, which will lead to the problem of falling into local optimum during the process of finding the optimal solution. Therefore, it is necessary to improve the particle swarm optimization algorithm. In the present invention, by improving the individual learning factor and the swarm learning factor, the search accuracy of the algorithm is improved;

[0072] The improved individual learning factor is:

[0073] c1 = c max - (c max - c min )(1 / e -i / k )(13)

[0074] The improved swarm learning factor is:

[0075] c2 = c max - (c max - c min )(1 / e -i / k )(14)

[0076] Among them, i represents the current iteration number, k represents the total set iteration number, c max represents the set maximum learning factor, and c min represents the set minimum learning factor.

[0077] Such as Figure 3 is the prediction graph of the traditional Elman neural network. The 24-hour power load data on November 30th is predicted. The average relative error in the graph is 3.99%, and the maximum relative error reaches -10.38%. The average error and relative error of the prediction accuracy are relatively large;​​

[0078] As Figure 4 To improve the prediction graph of the Elman neural network, the power load data for 24 hours on November 30th was predicted. The improved Elman neural network adds a hidden layer on the basis of the Elman neural network and uses the output of the previous moment as the feedback input to enhance the dynamic performance of the network. The average absolute error obtained after improvement is 2.94%, and the maximum relative error is -8.4342%. Compared with the prediction average relative error and maximum relative error of the traditional Elman neural network, there is a certain reduction.

[0079] As Figure 5 For the prediction graph of the improved Elman neural network based on Pso, the individual learning factor and population learning factor used in the Pso algorithm are c1 = c2 = 1.49445, the number of iterations is 50, the population size is 30, the maximum inertia weight w max in the particle swarm = 0.9, the minimum inertia weight w min in the particle swarm = 0.4, the maximum speed v max of the particle = 0.5, the minimum speed v min of the particle = -0.5, the maximum marginal position X max = 1, the minimum marginal position X min = -1. The maximum relative error of the improved Elman neural network optimized by the Pso algorithm is -7.161%, and the average absolute error is 2.8%, showing a certain optimization effect.

[0080] As Figure 6 For the prediction graph of the improved Elman neural network based on the improved Pso, the parameter settings are as follows: c max = 1, c min = 0.5, the number of iterations is 50, the population size is 30, w max = 0.9, w min = 0.4; v max = 0.5, v min = -0.5, X max = 1, X min = -1. The maximum relative error after improvement is -7.2204%, and the average relative error is 2.27%. Although the maximum relative error has not been significantly improved, the average absolute error has been greatly improved.

[0081] Inspired by the ideal embodiments of the present invention described above, through the above description, relevant staff can make various changes and modifications without departing from the technical idea of the present invention. The technical scope of the present invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A power parameter prediction method based on an improved Elman neural network, characterized in that, Including the following steps: S1. Improve the learning factor of the particle swarm optimization algorithm and apply it to the improved Elman network. Train the power load data through the improved Elman network, establish an improved Elman network model, and verify it through a test set; Use the improved particle swarm optimization algorithm to optimize the initial weights W and thresholds b of the improved Elman network. Take the error function in the improved Elman network as the fitness function in the improved particle swarm, and use the optimization ability of the improved particle algorithm to find the optimal values of the initial weights W and thresholds b; The learning factor of the improved particle swarm optimization algorithm is to adjust the individual learning factor and the improved group learning factor of the particle swarm optimization algorithm from fixed values to exponentially dynamically changing values with the number of iterations; The formulas for the individual learning factor and the improved group learning factor are as follows: c1 = c max -(c max -c min )(1 / e -i / k )(13) The improved group learning factor is: c2 = c max -(c max -c min )(1 / e -i / k ) (14) Among them, i represents the current iteration number, k represents the total number of set iterations, and C max represents the set maximum learning factor, and c min represents the set minimum learning factor; The improved Elman network model adds a second hidden layer on the basis of the Elman neural network, and takes the output of the output layer at the previous moment and the output obtained from the first hidden layer at the next moment as the input of the second hidden layer. The output of the first hidden layer of the improved Elman network model is: m1(k) = f[w1m c (k) + w4U(k - 1) + b1] (5) The output of the first delay layer is: m c y(k) = m1(k - 1) (6) The output of the second hidden layer is: m2(k) = f[w3y c (k) + w2h c (k) + w5m1(k) + b2] (7) The output of the second delay layer is: h c (k) = m2(k - 1) (8) The output of the third delay layer: y c y(k) = y(k - 1) (9) The output of the output layer: y(k) = g[w6m2(k) + b3] (10) where y(k) represents the output value of the output layer; m1(k) represents the output value of the first hidden layer, U(k - 1) represents the input of the input layer; m2(k) represents the output value of the second hidden layer; y c (k) represents the output of the third delay layer; h c (k) represents the output of the second delay layer; m c (k) represents the output of the first delay layer; w1 represents the weight from the first delay layer to the first hidden layer; w2 represents the weight from the second delay layer to the second hidden layer in the network; w3 represents the weight from the output layer to the third delay layer in the network; w4 represents the weight from the input layer to the first hidden layer of the network; w5 represents the weight from the first hidden layer to the second hidden layer; w6 represents the weight from the second hidden layer to the output layer; b1, b2, and b3 are the thresholds of the first hidden layer, the second hidden layer, and the output layer respectively, f(*) uses a non - linear function; g(*) uses a linear function.

2. The power parameter prediction method based on the improved Elman neural network according to claim 1, wherein, The maximum learning factor c max = 1, and the minimum learning factor c min = 0.5.

Citation Information

Patent Citations

  • Photovoltaic power generation short-term power prediction method

    CN112330487A