Photovoltaic power generation prediction and optimization configuration model based on GPR and improved PSO algorithm

As the growing demand for energy as well as the strengthening of environmental awareness, photovoltaic power generation, as a clean and renewable energy source, has gradually attracted people's attention and attention. To facilitate the dispatching and planning of power system, this study uses historical data and meteorological data to build a photovoltaic power generation prediction and configuration optimization model on the ground of Gaussian process regression and improved particle swarm optimization algorithm. The simulation results show that the regression prediction curve of the Gaussian process regression prediction model is the closest to the real curve, and the prediction curve is stable and not easily disturbed by noise data. The Root-mean-square deviation and the average absolute proportional error of the model are small, and the disparity in the predicted value and the true value of the model is small; The integration of multi factor data has improved the accuracy of prediction data, and the regression prediction effect is good. The improved Particle swarm optimization algorithm could continuously enhance in the search for the optimal solution, and the Rate of convergence is fast. The Pareto solution can provide different solutions suitable for photovoltaic power generation optimization. Reasonable optimization configuration can effectively reduce active power line loss and voltage deviation, with the maximum reduction values reaching 132kW and 0.028, respectively. The research and design of predictive models and optimized configuration models can promote the formation of smart grids.


Introduction
As the growing absence of the traditional resource, the advancement of new energy (NE) has become one of the hot topics of global concern [1].Photovoltaic power (PPO) generation is a renewable energy generation method that utilizes photovoltaic cells to convert light energy into electricity, and is mainly composed of photovoltaic modules, inverters, racking and distribution systems.The solar photovoltaic industry occupies an important strategic position in the NE industry, and the energy structure occupies a relatively essential proportion.The extensive development of traditional resources has made environmental issues increasingly prominent; PPO generation belongs to renewable energy and is an essential way for diminishing greenhouse gas emissions in response to climate change; It possesses essential strategic meaning [2][3].China's energy industry structure is in the transition period, and wind energy, biomass energy, solar energy and Tidal power are the key points of energy utilization in the future.PPO stations are in line with the strategy and direction of China's energy industry advancement, meeting the goals of energy conservation, emission reduction, and sustainable development, and are conducive to adjusting the existing power grid (PG) structure in China.However, the volatility, intermittency, and randomness of PPO generation are more obvious, and large-scale integration of PPO into the PG will threaten the operation of the PG.To mitigate the impact of these factors on the PPO grid, it is essential for Z. Zhang et al.
forecasting the power generation of PPO [4].PPO generation prediction is a short-term prediction of PPO generation power on the ground of real-time operating data of PPO generation systems, as well as solar radiation, temperature, and weather historical data monitored by meteorological stations, to reasonably arrange the operation mode of the power generation system and prepare response measures in advance [5].PPO power generation forecasting plays an important role in the design of PPO power plants, power system operation, energy market trading and optimization of energy storage systems, which can improve the efficiency and economy of PV power generation systems and promote the sustainable development of renewable energy.Consequently, the prediction model of PPO generation needs to have high technical requirements to meet the continuous and secure operating of the PPO prediction (PP) system.To meet the demand of high technology, the research establishes the PPO generation prediction model on the ground of Gaussian process Regression (GPR), and then improves it by introducing adaptive constraints and genetic variation operation in Particle Swarm Optimization (PSO) algorithm and designs a reasonable allocation of PV power generation model.The research mainly contains two innovations, one GPR is combined with the characteristics of PV power generation system, this integrated model can predict the PV power more accurately and improve the reliability and stability of PV power generation system.Secondly, for the traditional PSO algorithm which is easy to fall into the local optimum problem, the global search capability is improved, which effectively solves the optimization problem of multi-objective, nonlinear and constraints of PV power system configuration.The contribution of the research mainly lies in enriching the theoretical study of PV power forecasting and providing new ideas and methods for the technical optimization of PSO algorithms.The model proposed in the study shows significant improvement in both the prediction accuracy of PV power and the optimization performance of system configuration.
The overall research consists of four.The first is a review of research on domestic PPO generation prediction models, which summarizes the research progress, technical novelties and shortcomings of PV power prediction models.The second proposes a PPO generation PP model and configuration optimization model on the ground of GPR and improved PSO, and describes the technical points and research ideas in the process of model design; The third conducted simulation testing experiments on the algorithm performance; The fourth summarizes the research results and describes the conclusions, significance and shortcomings of the study, and the model helps to solve the optimization problem of optimizing photovoltaic access and make sure the secure operating.The good performance of this coordination method has been verified through real data from PPO stations and electric vehicle charging stations [13].

Related works
Accurate prediction of photovoltaic (PV) power demand for renewable energy 5G base stations helps to reduce energy consumption.In order to cope with the power generation prediction under complex weather conditions, Yan M et al. improved the local optimal solution avoidance ability of the PV short-term prediction model based on a 5G base station with energy router by introducing an improved logistic distribution, Laplace distribution with inverse incomplete gamma function weight factor, and nonlinear mutation uptake strategy based on the sparrow search algorithm.The measured data verified the prediction accuracy of the method [14].The size of the PV system has a large impact on the PV power generation, and the accuracy of a single model for PV power generation prediction is poor.Song H et al. considered PV power generation prediction as a multi-task prediction and proposed a multi-task recurrent neural network framework.Compared with deep neural network model, this method is superior in prediction accuracy [15].Photovoltaic power generation to a certain extent crowds out the functional space of traditional synchronous generators and reduces the inertia of the grid itself.Facing the instability of the inertia support capacity of PV output power, Wang S et al. proposed an FM control strategy based on the dynamic characteristics of grid-side DC capacitance, and correlation analysis of different weather type data to predict PV power.Simulation is performed to analyze the system's ability to respond quickly to load changes under different control parameters.Experimental results show that the method can effectively improve the stability of the distribution network [16].In order to reduce the impact of distributed PV power fluctuations on grid operation, Yang X et al. designed a distributed PV power plant prediction model with spatio-temporal information based on the time dependence of power series and the spatial correlation of meteorological data.The joint genetic algorithm and natural gradient-enhanced long and short-term memory neural network were used for time-varying prediction, and spatial correlation prediction was carried out by κ correlation coefficient and 2D convolutional neural network.The advanced research methodology was finally verified by utilizing the PV cluster data in Hebei Province, China [17].Aiming at the insufficient generalization ability of the PV power prediction model, Chen G et al. proposed a time-dependent PV power prediction model combining variational mode decomposition and Bayesian regularized neural network by using mutual information analysis to select suitable meteorological sequences.The experimental results verified the accuracy of the method, and the prediction error was significantly reduced [18].
In summary, there has been some progress in the prediction model of PPO generation.However, most of the PV power prediction studies have focused on a single PV power plant without considering the impact of complex scenarios on power; at the same time, PV power is affected by several factors, including solar radiation, temperature, wind speed, etc. Existing prediction models mainly focus on the impact of a certain or a few factors, and there is still a research gap in prediction models for the combined effect of multiple factors.And research on simultaneously considering PPO generation prediction and optimizing PG configuration is still quite rare; This type of research achievement is meaningful for enhancing the stability of power generation and supply systems.Therefore, the study designed a PPO generation PP and configuration optimization model on the ground of GPR and improved PSO.

Design of photovoltaic power generation prediction and optimization configuration model on the ground of GPR and PSO algorithms
PPO generation is converting solar energy into electricity, which is an essential part of the energy supply process; To ensure the stability of PG supply, it is crucial for solving the issue of forecasting PPO generation.The size of solar radiation, temperature and weather change will affect the power generation.For this, the research designs the prediction model and optimal grid configuration model of PPO generation on the ground of GPR.

Design of photovoltaic power prediction model on the ground of Gaussian process regression
GPR is a machine learning (ML) method on the ground of Bayesian theory and other relevant theories; This method Z. Zhang et al.
uses training samples to train the model, selects the optimal model, and tests it, which is the process of ML to complete the prediction, as shown in Figure 1.GPR belongs to a Stochastic process.Each Finite set is subject to Multivariate normal distribution.The distribution of Gaussian process is the joint probability distribution (PB) of all random variables.The core idea of using GPR for forecasting is to fit the isolated things into a law.In the fitting process of nonlinear laws, the kernel function (KF) plays an important role [19].

Prediction
Training sample

New samples
Optimization model

Machine learning
Forecast results

Figure 1. Machine Learning Prediction Method
The essence of GPR is the learning of KF with probability significance; First, it assumes that the sample obeys the Prior probability of Gaussian process; Then it uses Bayesian theory to obtain the Conditional probability of the prediction point and complete the calculation of Posterior probability; Finally, the final prediction model is derived from the calculation of super parameters.The relevant details of GPR prediction model is showcased in Figure 2. In Figure 2, the blue points are known, the red and green curves indicate the curves connecting the known data, where red is the one with the highest likelihood, and the yellow part indicates the range of two standard deviations of the Gaussian distribution, which indicates that there are countless possibilities for the composition of the line segments in this region.The nonparametric, flexible, and scalable advantages of GPR make it widely applicable in fields such as finance, healthcare, and weather forecasting [20].
If there is a linear relation in the input and output of the model, the linear regression prediction model equation of Bayesian theory is shown in equation (1).In equation ( 1  According to the prior distribution, the Likelihood function of the observation sample can be obtained.On the ground of Bayesian theory and Gaussian distribution (GD), the PB of the WV can be calculated by using the maximum Posterior probability.The Posterior probability PB of the final WV is showcased in Formula (2).In equation ( 2 , ,..., , ,...,    ) ( ) ( ) T T n p y x X y p y x w p w X y dw The linear derivation of Gaussian process is mapped to high-dimensional space by function ( ) , and the model expression and prediction value after nonlinear transformation are obtained; According to the derivation of Bayesian theory, the PB expression of predicted values after mapping a nonlinear model to a high-dimensional space is shown in equation ( 4). ( T T n p y x X y p y x w p w X y dw After matrix transformation, it lets ( ) ( ) , ( ) , , , The definition formula of Gaussian process mean function and Covariance function satisfying Bayesian linear regression is shown in Formula (6), where ( ) For an input sample set without noise, the conditional posterior distribution of the predicted values is obtained as shown in equation (7).Among them, When there is noise, the definition of the regression model is , and the posterior distribution probability of the output predicted value is obtained, as shown in equation (8).
KF are used to measure the degree of similarity between different samples; In GPR, the main contribution of KF is to complete the transformation from nonlinear relationship to linear relationship.The Covariance function is the KF of GPR, and the KF affects the final established GPR model and the distribution of predicted values.In this research, the square index Covariance function is selected as the KF, and the definition formula is shown in Formula (9), where , exp 2 In the design of PPO generation prediction model, it first divides the influencing factor subspace used, establishes the Gaussian process prediction model for each subspace, and integrates to obtain the final model; The prediction process of GPR is shown in Figure 3.

Set hyperparameter initial value
Forecast results

Start Optimized hyperparameters
Training data

Figure 3. Prediction flow chart of Gaussian process regression
The super parameters in the KF determine the fitting effect of the nonlinear system and the prediction effect of the model; Improper selection of super parameters will lead to the invalidity of GPR, so the selection of super parameters is very important.In this study, the maximum likelihood estimation method is utilized for addressing the super parameter of GPR.The constructed Likelihood function is shown in Formula (10), and θ represents the super parameter in the KF.
( ) It uses the Conjugate gradient method to solve the super parameters after initialization, as showcased in equation (11).In equation (11), trace serves as the trace of the matrix.
The conversion of solar energy to electrical energy relies on PV modules to receive the sun's energy for energy conversion.Solar radiation refers to the energy of the sunlight irradiated on PV panels, and is affected by factors such as geographic location, time of day, and weather.In addition, PV cells decrease with the increase in temperature during the power generation process; humidity is related to dust, dirt and other pollutants on the surface of PV panels, and pollutants reduce the light transmission of PV panels, reducing the energy of the sunlight reaching the PV cells and lowering the efficiency of PV power generation.And the appropriate wind speed can help dissipate heat, maintain the reasonable temperature of the PV cell, and improve the power generation efficiency of the PV cell.For the GPR PPO generation prediction model, this study considers all the influencing factors.After determining the set of influencing factors, select the number of influencing factors as needed for subspace segmentation to obtain the combination and arrangement of different influencing factors; Each arrangement method is divided into subspaces of influencing factors.

Design of photovoltaic power generation system optimization configuration model on the ground of improved particle swarm optimization algorithm
When an independent PPO generation system is connected to the distribution system in a distributed generation system, the voltage distribution of the distribution system will be affected, and the circuit lines will also be damaged.The reasonable configuration of PPO generation in the PG system is crucial for ensuring the secure and reliable operation.
The total cost of PPO generation includes the initial investment cost and maintenance cost during use.The calculation process of cost and veterinary medicine is shown in equation (12); In equation (12), The current or power flows into the current through various components of the system and is distributed in various parts of the PG.The integration of PPO generation will affect the active line loss of the distribution system and change the power flow of the power system.This study considers photovoltaic as a node with known active and reactive power, and the power flow calculation process is shown in equation (13).In equation ( 13), loss f serves as the active line loss of the power system; N serves as the total distribution system lines; ( ) ( ) ) In addition, the integration of PPO generation will also possess an influence on the voltage deviation of nodes, and PPO generation will cause the voltage of nodes to increase, even exceeding the voltage limit.The functional formula for voltage deviation is shown in equation ( 14), where U ∆ represents active line loss; i U serves as the total number of lines; exp U serves as the conductivity between nodes i and j .exp 1 Incorporating the above three factors into the consideration of multi-objective optimization (MOO) in configuration, this study uses Pareto solutions to describe MOO problems [21].The definition of dominance relationship is that if there are two solutions 1  x and 2 x that meet ( ) ( ) x is considered to dominate 2 x .The Pareto solution is a non-dominated solution, and there is no other solution that dominates the existence of x * .In MOO problems, it is necessary to find as many Pareto solutions as possible [22].To achieve this goal, PSO is introduced.PSO algorithm is a kind of swarm intelligence algorithm, which is designed to simulate the natural birds' predatory behavior.During the entire process of bird search for food sources, the location of the food source is determined through mutual information transmission and collaboration, which is for finding the optimal solution (OS) for the issue.The algorithm diagram is shown in Figure 4 [ [23][24].The iteratively defined formula for particle position and velocity is showcased in equation ( 15 ( ) ( )

Grove Forest
The update of particle position is influenced by the particles themselves and other particles, and the communication methods between particles vary, forming a variety of particle swarm topological networks, as shown in Figure 5.The particles are interconnected, and the global Rate of convergence is fast.The speed of particle updates affects the position control of particles.If the particle updates too fast, there may be a particle position vector exceeding the search limit.The study used a reset method to solve this problem.When the particle exceeds the search space, the particle's position is randomly reset.The parameter selection of PSO is very important, which determines the initial performance of the algorithm.The Particle number, the maximum particle update speed, learning factor and inertia constant affect the particle distribution uniformity.In the study, the number of particles is selected according to the actual situation, and the particle speed is limited to 15%~20% of the search space to prevent the convergence of particle search from becoming poor and local convergence.The values of learning factors and inertia constants are taken on the ground of existing research experience.
To prevent local convergence of particles, adaptive constraint factors and genetic mutation operations are first introduced into PSO [25].The calculation of adaptive constraint factors is shown in equation ( 16 The adaptive operation controls the speed of the particles so that the algorithm performs a large search early in the iteration and reduces the search later in the iteration.

(
) The purpose of mutation operation is to increase the diversity of particles, and the perturbed particle position avoidance algorithm converges to the local OS.The relevant flow of the entire improved PSO model is illustrated in Figure 6; Finally, it will combine the improved PSO algorithm on the ground of Pareto solutions with MOO to solve MOO problems, and ultimately obtain the Pareto solution set.As can be seen from Fig. 6, the iterative process needs to constantly update the position and velocity of the particles, and the multi-objective optimization problem needs to use the dominance and non-dominance relationship to determine the goodness of different solutions, and therefore needs to be the computational fitness of the particles at the same time with the dominance relationship.The multi-objective algorithm needs to select the Pareto solution set among the different particle position solutions, and thus also needs to compare the solutions with each other to get the non-inferior solution reserve set.The role of the variation operator is to prevent the particles from falling into the local Pareto front.

Performance testing of photovoltaic power generation prediction and optimization configuration model on the ground of GPR and PSO algorithms
For testing the prediction model and optimized configuration model designed in the study, targeted simulation tests are designed for verifying the model, and the outcomes were analyzed and discussed.

Simulation Experiment Analysis of Photovoltaic Power Generation Power Prediction on the Ground of GPR
This study used detection data from a solar energy technology limited company and local meteorological bureau monitoring data as input data for analysis and normalized the feature vectors of the input data.First, it compared the prediction outcomes of the GPR prediction model built by the study with the real data curve and the regression prediction model on the ground of Lasso.The prediction curve is showcased in Figure 7.It is used for measuring the prediction of the model's power generation.The experiment outcomes are illustrated in Figure 8. Figure 8 showcases that the RMSE values of the ANN model and the Lasso regression prediction model are relatively high; This shows that there is a large disparity between the predicted value and the real value.The RMSE index of the ARMA model is markedly below the two models, but the numerical polyline volatility is large, and the data value is unstable.The RMSE value of the GPR model outperforms the other three models in both numerical and stability aspects.The data integration of multiple influencing factors reduces the disparity in real data and predicted data, making predictions more accurate.For the MASE index, the GPR still shows the optimal level and is at the lowest value; This demonstrates that the regression prediction effect is good, while the values of other models are significantly higher, and the volatility is too obvious.The prediction model used in the study possesses better prediction stability and accuracy compared to other existing prediction models.
Z. Zhang et al.

Simulation Experiment Analysis of Photovoltaic Optimization Configuration Model on the Ground of Improved PSO Algorithm
The multi-objective PSO algorithm is introduced into the MOO of distribution network connected with photovoltaic equipment for configuration.The research sets the population quantity to 150 and the maximum quantity of iterations to 100; The acceleration factor and maximum constraint factor are 1 and 2, respectively, the minimum constraint factor is set to 0.2, and the inertia weight value is 2. The optimization results of voltage deviation are shown in Figure 9, and the traditional PSO model and differential evolution model are compared respectively.Figure 9 shows that, relative to the traditional PSO model, the improved PSO model with mutation manipulation is still searching for the OS at the end of the iteration, while the traditional PSO model converges for the OS at the end of the iteration.The voltage deviation stability value is greater than 0.012, and there is no improvement of the OS.The differential evolutionary algorithm keeps searching for optimization in the iterative process.The convergence value and the improved PSO algorithm converge to the voltage deviation of about 0.011, but the rate of convergence of the OS is still lower than the improved PSO algorithm.It sets the maximum size of the Pareto solution set to 100, and the Pareto solution set results obtained from simulation experiments are showcased in Figure 10. Figure 10 showcases that the relationship between photovoltaic cost, grid loss, and voltage deviation is uniformly dispersed in the three-dimensional space of the Pareto solution set.When the input photovoltaic cost is higher, the grid loss and voltage deviation values are smaller.It selects several analysable schemes among the nodes in the distribution system, and the PPO generation configuration and node parameters is showcased in Table 1.Table 1 showcases that the active line loss without PPO generation is 204kW, and the voltage deviation is 0.049; The active line loss of the other three types of connected PPO generation is less than 204kW, a maximum reduction of 132kW; The voltage deviation has also decreased, with a maximum decrease of 0.028.

Photovoltaic power generation prediction and optimization configuration model based on GPR and improved PSO algorithm
Z. Zhang et al.The voltage distribution diagrams of various schemes are illustrated in Figure 11. Figure 11 showcases that the minimum voltage of the scheme without PPO generation is less than 0.92, which is lower than other schemes with PPO generation connected to the distribution network.This indicates that the MOO configuration model on the ground of improved PSO designed in the research can reasonably configure photovoltaic equipment, effectively reduce network losses and improve the quality of voltage.The Pareto method can be used to obtain different solutions suitable for PPO generation optimization.

Conclusion
To solve the balance and security problems of the power system, the research builds a PPO generation prediction and configuration optimization model on the ground of GPR and improved PSO algorithm.The simulation results show that the regression prediction curve of the GPR prediction model to the simulation data is the closest to the real curve; The prediction curve of the Lasso regression prediction model exhibits significant fluctuations, resulting in poor stability of the prediction results and susceptibility to interference from noisy data.There is a significant disparity in the predicted values of the ANN model and the Lasso regression prediction model and the true values, while the RMSE index stability of the ARMA model is poor.The RMSE and MASE indicators of the GPR model have better values and stability than the other three models.The integration of multiple factor data increases the accuracy of the predicted data, and the regression prediction effect is good.Relative to the traditional PSO model, the improved PSO model performs better in improving the OS, and its rate of convergence is faster than the differential Evolutionary algorithm.In the three-dimensional space of the Pareto solution set, the larger the photovoltaic cost, the smaller the grid loss and voltage deviation values.The Pareto method can be used to obtain different solutions suitable for PPO generation optimization.Reasonably integrating PPO generation into the distribution system can effectively reduce active line loss and voltage deviation, with the maximum reduction values reaching 132kW and 0.028, respectively.The PPO generation prediction model designed through research has good performance and comprehensive prediction performance.Reasonable configuration has improved the rationality of the distribution network.But research still needs to be more in line with the century for feasibility optimization.

Funding
The research is supported by: Research and demonstration of multifunctional scenic spots integrated energy service station based on off-grid photovoltaic power distribution technology.
Photovoltaic power generation prediction and optimization configuration model based on GPR and improved PSO algorithm

.
), ( ) f x serves as the function value; x denotes the input data; y serves as the observed value; w serves as the weight vector (WV) of the linear model; ε represents noise, The GPR model models the noise in the input data by introducing a noise model.A Gaussian distribution is utilized to describe the noise and it is taken into account in the training process of the model.This operation allows better adaptation to data with noise.

Figure 2 .
Figure 2. Schematic Diagram of Gaussian process Regression Prediction Model

)
Photovoltaic power generation prediction and optimization configuration model based on GPR and improved PSO algorithm

(
photovoltaic equipment, and pV P represents the purchased nodes i and j ; i θ , j θ represents the phase angle in nodes i and j .

Figure 4 .
Figure 4. Schematic diagram of Particle swarm optimization algorithm

r and 2 r
); In equation(15), w represents the inertia weight,1  c and 2 c represent the acceleration factors of individuals and populations, 1 represent random numbers, α represents the teacher constraint factor, and m represents the number of iterations.

Figure 5 .
Figure 5. Different Style Particle Swarm Topology Networks and minimum values of the constraint factors, while iter and iters represent the current and total iterations, respectively.

Figure 6 .
Figure 6.Algorithm flow of improved Particle swarm optimization model Figure 7 illustrated that the regression prediction curve of the GPR prediction model for the simulation data has a high coincidence with the real curve, and a high closeness to the real value.The prediction curve of Lasso regression prediction model fluctuates greatly.Although the prediction trend is close to the real data curve, the prediction data is disturbed greatly under the interference of data noise, and the prediction effect is worse than that of GPR.It compares the GPR prediction model with Lasso based regression prediction model, ANN model and time series model ARMA, and uses Root-mean-square deviation (RMSE) and Mean Absolute Scaled Error (MASE) as evaluation indicators of experimental results; RMSE can measure the difference between predicted and true values, RMSE represents the square root of the mean of the difference between the observed value and the predicted value, the smaller the RMSE.And the MASE index is not easily affected by data changes, the MASE can more accurately predict the model's truthfulness relative to the mean value model.The industry evaluation criteria for PV power generation forecast accuracy varies by region and specific needs, Figure 7 compares with actual power generation data, while Figure 8 selects the error calculation index for evaluation based on industry standards obtained from industry reports and expert consultation.RMSE focuses more on the difference between the predicted value and the true value, while the comparison of MASE with respect to the baseline model better reflects the model's relative strengths and weaknesses.The two indicators can comprehensively evaluate the overall accuracy and relative accuracy.

Figure 7 .Figure 8 .
Figure 7.Comparison of Prediction Curves of Different Models

Figure 11 .
Figure 11.Voltage distribution diagram for different schemes

Table 1 .
Typical Power Grid Configuration Scheme