Photovoltaic short-term power generation prediction method based on improved particle swarm neural network

By improving particle swarm algorithm and correlation coefficient analysis, the neural network parameters are optimized, and the problem of long training time and low accuracy of neural networks in photovoltaic power generation prediction is solved, and the rapid and accurate prediction of photovoltaic power generation is achieved, which improves prediction accuracy and model convergence speed.

CN114943360BActive Publication Date: 2025-01-17SHENYANG INST OF ENG
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210209461.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-04
Publication Date
2025-01-17
Estimated Expiration
2042-03-04

AI Technical Summary

Technical Problem

The existing neural networks have a long training time and low prediction accuracy in photovoltaic power generation prediction, and cannot provide real-time and accurate prediction data, which affects the safe and stable operation of the power grid.

Method used

The improved particle swarm algorithm is used to optimize the initial parameters of the neural network, combine the Pearson correlation coefficient method to analyze meteorological factors, build a neural network prediction model, and optimize the inertial weight, cognitive learning factors and social learning factors in the particle swarm algorithm to improve prediction Accuracy.

Benefits of technology

It realizes fast and accurate prediction of photovoltaic power generation, improves prediction accuracy, avoids particle swarms falling into local optimality, improves the convergence speed of the model, and provides better prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943360B_ABST
    Figure CN114943360B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting photovoltaic short-term power generation based on a neural network of an improved particle swarm. The method comprises the following contents: using the Pearson correlation coefficient method to perform correlation analysis on factors affecting photovoltaic power generation (light intensity, temperature, humidity, air pressure and PM10), selecting the main factors affecting photovoltaic power generation as neural network input; using an empirical method to determine the number of layers in the neural network prediction model and the number of neurons in the hidden layer; selecting the sum of the squares of the error between the output value of the prediction model and the actual value as the particle swarm fitness function, and based on the constructed fitness function, improving the inertia weight, cognitive learning factor and social learning factor in the particle swarm. The parameter results of the improved particle swarm optimization are used as the initial parameters of the neural network to predict the photovoltaic short-term power generation. The algorithm avoids falling into the local optimum and improves the convergence speed of the particle swarm in the process of optimizing the neural network parameters, and finally improves the prediction accuracy of short-term photovoltaic power generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of power generation prediction, and in particular relates to a method for predicting photovoltaic short-term power generation based on an improved particle swarm neural network. Background Art

[0002] The inherent disadvantages of intermittent and unpredictable photovoltaic power generation are bound to have an impact on the power grid and will restrict the development of the photovoltaic industry. In order to reduce the hazards of photovoltaic grid connection and ensure the safe and stable operation of the power grid. At present, many technologies are applied in the field of photovoltaic power generation prediction to ensure accurate scheduling basis for scheduling. The most typical prediction method is to use neural networks to train photovoltaic models. However, typical neural networks have disadvantages such as long training time and low prediction accuracy, which is not conducive to providing real-time prediction data. Therefore, considering the shortcomings of the model, the patent of this invention optimizes the internal parameters of the neural network, and the improved neural network model can quickly and accurately predict photovoltaic power generation. Summary of the invention

[0003] The present invention proposes a method for predicting photovoltaic short-term power generation based on a neural network using an improved particle swarm. Considering that photovoltaic power generation is affected by a variety of meteorological factors, the meteorological factors are analyzed using a correlation analysis method to extract the meteorological factors that mainly affect power generation. Based on this, a neural network prediction model is constructed. In addition, the improved particle swarm algorithm is used to optimize the initial parameters of the neural network, thereby improving the prediction accuracy.

[0004] A method for predicting photovoltaic short-term power generation based on an improved particle swarm neural network includes the following steps:

[0005] Step 1: Select meteorological data that affects photovoltaic power generation as input based on historical data, and process the historical data;

[0006] Step 2: Based on step 1, construct the number of layers of the neural network prediction model and the number of neurons in each layer;

[0007] Step 3: Use the improved particle swarm algorithm to optimize the initial weights in the God General Network to improve the prediction accuracy of the neural network; improve the weights, cognitive learning factors and social learning factors of the traditional particle swarm algorithm to form an improved particle swarm algorithm;

[0008] Step 4: Based on step 3, optimize the initial parameters of the neural network in step 2;

[0009] Step 5: Update the parameter results optimized in step 4 to the neural network to complete the optimization of the neural network.

[0010] Furthermore, the correlation of meteorological data is analyzed according to the Pearson correlation coefficient method of formula (1), wherein the meteorological data includes light intensity, temperature, humidity, air pressure, and PM10. Formula (1):

[0011]

[0012] In the formula, is the correlation coefficient, |λ xP The larger the value, the stronger the correlation between the meteorological factor data x affecting photovoltaic power generation and the photovoltaic power generation P, and the closer the connection.

[0013] The correlation between meteorological data and photovoltaic power generation is compared, and the meteorological factors that mainly affect power generation are selected as model data input.

[0014] Furthermore, constructing the number of layers of the neural network prediction model and the number of neurons in each layer includes: determining the number of neurons in the model input layer j, the number of neurons in the output layer is 1, that is, the photovoltaic prediction power; determining the number of hidden layers and the number of neurons in each hidden layer, where the number of hidden layers of the neural network is 1; the number of neurons in the hidden layer is Select Tanh function as the activation function.

[0015] Furthermore, the weight, cognitive learning factor and social learning factor of the traditional particle swarm algorithm are improved to form an improved particle swarm algorithm, including: improving the speed iteration formula in the particle swarm algorithm:

[0016] v k =wv k-1 +c1r1(p best,k-1 -x i,k-1 )+c2r2(g best,k-1 -x i,k-1 )

[0017] Where v is the velocity of the particle; w is the inertia weight, which affects the optimization ability; c1 is the cognitive learning factor; c2 is the social learning factor; p best is the optimal position of a single particle; g best is the optimal position of the group particles;

[0018] Furthermore, the following formula is used to improve the inertia weight w to improve the optimization ability of the neural network parameters:

[0019]

[0020] In the formula, w max is the maximum inertia weight, w min is the minimum inertia weight, m ​​is the current iteration number, mmax is the maximum number of iterations set, when m≤m max / 2, λ=0.5; when m≥m max / 2, λ=2.

[0021] Furthermore, the cognitive learning factor c1 is improved by the following formula:

[0022]

[0023] Furthermore, the social learning factor c2 is improved by the following formula:

[0024]

[0025] Furthermore, optimizing the neural network parameters includes: initializing the particle swarm and determining the fitness function fitness:

[0026] The number of particles in a particle group is l = j*q + q, and the number of particle groups is k;

[0027] The fitness function of the particle swarm selects the sum of squares of the error between the output value of the prediction model and the actual value.

[0028]

[0029] Where P r is the actual photovoltaic power generation.

[0030] Compared with the existing method, the beneficial effects of the present invention are:

[0031] This method uses the Pearson correlation coefficient method to analyze the neural network input, selects the meteorological factors that have a greater impact on photovoltaic power as the input of the neural network, and performs dimensionality reduction processing on the data. At the same time, the improved particle swarm algorithm is used in this application to optimize the neural network parameters, wherein the inertia weight, cognitive learning factor and social learning factor of the particle swarm are improved, which can prevent the particle swarm from falling into the local optimum when optimizing the neural network, and improve the convergence speed of the particle swarm algorithm, thereby better optimizing the neural network model and achieving the accuracy of photovoltaic prediction as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is the flow chart of the proposed algorithm;

[0033] Figure 2 This is the neural network structure diagram of the patent of this invention;

[0034] Figure 3 It is the prediction curve of the traditional neural network and the improved neural network;

[0035] Figure 4is the prediction error of the traditional neural network and the improved neural network. Specific implementation plan

[0036] The technical solutions in the embodiments of the present invention will be clearly and completely described below in combination with the drawings and embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0037] Step 1: Determine the input data for the neural network model

[0038] Step 1.1: Select meteorological data that affects photovoltaic power generation as input based on historical data. The present invention selects light intensity, temperature, humidity, air pressure and PM10 in the photovoltaic power station as input data. In the embodiment, the selected historical meteorology is meteorological factor data within 30 days, the time resolution is 1h, and the number of each type of meteorological collection data is 720, and this is used as the test set of the neural network.

[0039] Step 1.2: Analyze the correlation of meteorological data according to the Pearson correlation coefficient method. According to formula (1), the following correlation coefficient can be calculated:

[0040] Table 1: Correlation analysis of meteorological factors

[0041] Meteorological factors <![CDATA[Correlation coefficient λ xP > Light intensity 0.92 temperature 0.83 humidity -0.67 PM10 -0.69 Air pressure 0.2

[0042] Step 1.3: In this implementation, select |λ xP The meteorological data with |>0.65 are used as the input of the neural network model, namely light intensity, temperature, humidity and PM10.

[0043] Step 2: Build a prediction model

[0044] Step 2.1: According to the correlation data analyzed in step 1.3, determine that the number of neurons in the model input layer is 4 and the number of neurons in the output layer is 1, that is, the photovoltaic predicted power.

[0045] Step 2.2: Determine the activation function

[0046] In the present invention, the Tanh function is selected as the activation function

[0047]

[0048] Wherein, e is a constant, which is an irrational number.

[0049] Step 2.3: Determine the number of hidden layers and the number of neurons in each hidden layer:

[0050] In the present invention, the number of hidden layers of the neural network is 1; the number of neurons in the hidden layer is 3.

[0051] Step 3: Improve the PSO algorithm

[0052] Step 3.1: Improve the speed iteration formula

[0053] v k =wv k-1 +c1r1(p best,k-1 -x i,k-1 )+c2r2(g best,k-1 -x i,k-1 )

[0054] Where v is the velocity of the particle; w is the inertia weight, which affects the optimization ability; c1 is the cognitive learning factor; c2 is the social learning factor; p best is the optimal position of a single particle; g best is the optimal position of the group particles;

[0055] Step 3.2: Improve the inertia weight w

[0056] In the present invention, w is corrected to improve the optimization capability of the neural network parameters.

[0057]

[0058] Where m is the current iteration number, The maximum number of iterations of the particle swarm algorithm is m max =1000, when m≤m max / 2, λ=0.5; when m≥m max / 2, λ=2.

[0059] Step 3.3: Improve the cognitive learning factor c1

[0060]

[0061] Step 3.4: Improve the social learning factor c2

[0062]

[0063] Step 4: Optimize Neural Network Parameters

[0064] Step 4.1: Initialize the particle swarm

[0065] The number of particles in the particle group is 15, and the number of particle groups is k=50.

[0066] Step 4.2: Determine the fitness function fitness.

[0067] In the present invention, the fitness function of the particle swarm selects the sum of squares of the errors between the output value of the prediction model and the actual value.

[0068]

[0069] Where P r is the actual photovoltaic power generation.

[0070] Step 4.3: Based on the fitness function of step 4.2, optimize the initial parameters in the neural network; the optimization steps are as follows Figure 1 As shown, based on the initialized particle swarm in step 4.1, the fitness value of each particle is calculated according to the fitness function; the position of the particle is updated according to the improved speed iteration formula in step 3.1, and the position speed of the particle is updated; finally, the global optimal particle value is obtained.

[0071] Step 4.4: Update the optimal particle value to the neural network

[0072] Combined with steps 4.1-4.4, the initial parameters of the neural network are optimized, the optimized parameters are input into the neural network, and then the optimized model is used to predict the photovoltaic power generation.

[0073] Figure 3 The improved neural network predicts 96 (4 days) photovoltaic powers. As can be seen from the figure, the improved neural network model can effectively predict photovoltaic power; Figure 4 In order to improve the error rate of neural network and traditional neural network prediction, it can be seen from the figure that the improved neural network significantly improves the prediction accuracy; Table 2 shows the average error rate of traditional neural network and improved neural network.

[0074] Table 2. Average error rate

[0075]

Claims

1. A method for predicting photovoltaic short-term power generation based on an improved particle swarm neural network, characterized in that: The following steps are involved: Step 1: Select meteorological data that affects photovoltaic power generation as input based on historical data, and process the historical data; Step 2: Based on step 1, construct the number of layers of the neural network prediction model and the number of neurons in each layer; Step 3: Use the improved particle swarm algorithm to optimize the initial weights in the God General Network to improve the prediction accuracy of the neural network; improve the weights, cognitive learning factors and social learning factors of the traditional particle swarm algorithm to form an improved particle swarm algorithm; Step 4: Based on step 3, optimize the initial parameters of the neural network in step 2; Step 5: Update the parameter results optimized in step 4 to the neural network to complete the optimization of the neural network; The correlation of meteorological data is analyzed according to the Pearson correlation coefficient method of formula (1), wherein the meteorological data includes light intensity, temperature, humidity, air pressure, and PM10. Formula (1): In the formula, is the correlation coefficient, |λ xP The larger the value, the stronger the correlation between the meteorological factor data x affecting photovoltaic power generation and the photovoltaic power generation P, and the closer the connection. The correlation between meteorological data and photovoltaic power generation is compared, and the meteorological factors that mainly affect power generation are selected as model data input; The number of layers and the number of neurons in each layer of the neural network prediction model are constructed as follows: determining the number of neurons in the model input layer j, the number of neurons in the output layer is 1, that is, the photovoltaic prediction power; determining the number of hidden layers and the number of neurons in each hidden layer, where the number of hidden layers of the neural network is 1; the number of neurons in the hidden layer is Select Tanh function as the activation function; The improved particle swarm algorithm is formed by improving the weight, cognitive learning factor and social learning factor of the traditional particle swarm algorithm, including: improving the speed iteration formula in the particle swarm algorithm: v k =wv k-1 +c1r1(p best,k-1 -x i,k-1 )+c2r2(g best,k-1 -x i,k-1 ) Where v is the velocity of the particle; w is the inertia weight, which affects the optimization ability; c1 is the cognitive learning factor; c2 is the social learning factor; p best is the optimal position of a single particle; g best is the optimal position of the group particles; The following formula is used to improve the inertia weight w to improve the optimization ability of neural network parameters: In the formula, w max is the maximum inertia weight, w min is the minimum inertia weight, m ​​is the current iteration number, m max is the maximum number of iterations set, when m≤m xam / 2, λ=0.5; when m≥m xam / 2, λ=2; The cognitive learning factor c1 is improved by the following formula: The social learning factor c2 is improved by:

2. The method for predicting photovoltaic short-term power generation based on improved particle swarm neural network according to claim 1, characterized in that: Optimizing neural network parameters includes: initializing the particle swarm and determining the fitness function fitness: The number of particles in a particle group is l = j*q + q, and the number of particle groups is k; The fitness function of the particle swarm selects the sum of squares of the error between the output value of the prediction model and the actual value. Where P r is the actual photovoltaic power generation.

Citation Information

Patent Citations

  • Photovoltaic power generation short-term power prediction method

    CN112330487A

  • Short-term photovoltaic power prediction method based on VMD-IPSO-GRU

    CN112348271A