# Photovoltaic Power Generation Forecasting Using a Novel Hybrid Intelligent Model in Smart Grid

Authors: Alexandre Teplaira Boum; Vinny Junior Foba Kakeu; Camille Franklin Mbey; Felix Ghislain Yem Souhe
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

The exponential growth of electrical demand and the integration of renewable energy sources (RES) brought new challenges in the traditional grid about energy quality. The transition from traditional grid to smart grid is the best solution which provides necessary tools and information and communication technologies (ICT) for service enhancement. In this study, variation of energy demand and some factors of atmospheric change are considered to forecast production of photovoltaic energy that can be adapted for evolution of consumption in smart grid. The contribution of this study concerns a novel optimized hybrid intelligent model made of the artificial neural network (ANN), support vector machine (SVM), and particle swarm optimization (PSO) implemented for long term photovoltaic (PV) power generation forecasting based on real data of consumption and climate factors of the city of Douala in Cameroon. The accuracy of this model is evaluated using the coefficients such as the mean square error (MSE), root mean square error (RMSE), mean absolute percentage error (MAPE), mean absolute error (MAE), and regression coefficient (R). Using this novel hybrid technique, the MSE, RMSE, MAPE, MAE, andR are 14.9721, 3.8693, 3.32%, 0.867, and 0.9984, respectively. These obtained results show that the novel hybrid model outperforms other models in the literature and can be helpful for future renewable energy requirements. However, the convergence speed of the proposed approach can be affected due to the random variability of available data.


---

## Body

## 1. Introduction

Nowadays, much of the world’s electricity production depends on fossil fuel sources such as coal, gas, oil, and fuel [1]. The combustion of these materials causes environmental damage with the emission of carbon dioxide into the atmosphere [2]. The interest is therefore to have a reliable, intelligent, sufficient, robust, safe, efficient, and climate-clean electricity grid [3]. To this end, special and important attention has been paid to renewable energies which provide green electrical energy without emission of toxic gas to the atmosphere [4]. Distributed renewable energy generations have become emerging technologies with rising of renewable energies and the support provided by governments [5]. However, renewable energies such as solar energy and wind power show significant limits because of the perpetual variability of climate. In addition, the distribution of this energy is inadequate with the current network, these renewable energies produce variations and fluctuations which lead to instability of the network, and this is the main challenge when integrating renewable energy resources [6]. The technology of the current infrastructures existing in the network does not allow a correct integration of these renewable energies because of the requirements which they imply. It is therefore necessary to carry out a substantial planning with methods of investigation in the field to have the parameters of availability and compatibility of these renewable energies on the distribution network [7].With the increasing penetration of renewable energies, major improvements and modifications must be made to the existing power electrical grid to ensure good accommodation with these intermittent resources [8]. Considering these requirements, it is vital to migrate to a smart grid using communication systems, a large network of sensors, and also an intelligent management system [9, 10]. So, with these assets, the electricity network will obtain a self-healing capacity, a correct integration of renewable energies, and a consequent efficiency [11, 12]. To face these new requirements in the grid, some countries have embarked on the transition to the smart grid technologies [13, 14]. The main objective of a smart grid is to increase energy efficiency, minimize energy demand, and reduce energy production costs [15]. It also ensures a stable system that cannot be affected by network failures [16]. The renewable energy sources that can be used are solar, hydraulic, geothermal, or biomass energies [17]. The smart grid can improve and facilitate operations on the network, allowing management of consumption data using smart meters [18]. In addition, network security is perfectly ensured with the smart grid privacy system. The integration of renewable energies is also ensured by the smart grid for a clean grid and green energy [19].It is known that renewable energy sources bring enormous benefits to the electrical grid. However, they lead to major challenges in the structure of the smart electrical grid. Considering that these renewable sources depend on the climate, it is therefore necessary to forecast the power energy generation in order to maintain the stability of the network and ensure efficient management of production and the power produced by other energy sources [20].The real world faces different levels of variability in renewable energy sources due to intermittent weather conditions. These uncertain energy sources can affect the forecasting of energy generation. In the literature, authors worked on methods which take into account these source intermittences and provide a better time series forecast of the power generation in the network [21, 22]. Author [23] reviewed the techniques of machine learning (ML) for the integration and forecasting of renewable energy sources. The main problem is to properly integrate renewable energy sources into the smart grid; it is therefore necessary to predict the amount of power that will be generated in the future. Knowing that the energy storage of solar panels is expensive, efficient management of this energy is necessary. This work offered different strategies for this power generation forecasting. Author [24] also reviewed deep learning (DL) for renewable energy forecasting. In addition, author [25] proposed a model of the uncertainties of renewable energy sources for the study of smart grid vulnerability. This model was applied to identify the dynamic uncertainties of renewable energy sources in order to reveal their characteristics in the frequency domain. This approach has been validated on an IEEE 300 bus network to assess the impacts of these uncertainties on power flow.Some methods of probabilistic nature using historical data to define the density probability function to characterize the uncertainties of renewable energy sources have been proposed in [26]. Authors [27] studied the problem of energy management with various renewable energy sources. The resolution of this problem is done through the algorithm which simultaneously optimizes the load and the energy discharge in the storage units. Authors [28] explored forecasting of short-term generation of photovoltaic plants in a smart grid. In this article, some climatic factors are proposed to forecast the photovoltaic power generation using real-time data from solar plants located in Konya, Turkey. The authors used artificial neural networks (ANNs) implemented on MATLAB to forecast this photovoltaic generation. The artificial neural network algorithms such as Levenberg–Marquardt and Bayesian regularization are used to compare the forecasting results. In order to increase accuracy, authors [29] combined neural networks with a wavelet method. To perfectly ameliorate the forecasting accuracy, authors [30] also combined the machine learning technique with the neural networks.Another technique of combining the neural network with an analogous ensemble method has been proposed in [31]. Authors [32] proposed a site-specific prediction model for photovoltaic power generation using climate parameters. In this study, authors used machine learning techniques as multiple regression techniques and least-square support vector machine (LSSVM). In the same time, authors [33] explored an intelligent predictor for 6 hours ahead solar power prediction. A combination method has been proposed in [34]. In this study, the authors proposed a combination of spatial modelling with neural networks. These combined methods unfortunately do not show great accuracy in forecasting results, and this can turn out to be a major drawback in renewable energy forecasting.Authors [35] adopted a forecasting of photovoltaic solar energy for energy management in a smart grid. Since forecasting accuracy is vital for the safety and operation of the smart grid, this article reviewed theoretical forecasting methodologies for solar photovoltaic resources. In addition, applications of photovoltaic power generation forecasting are also detailed in this study. Hybrid artificial intelligence methods using neural networks are also presented in [36]. In fact, some approaches depend on forecasting levels to satisfy forecasting requirements [37]. Similarly, optimization algorithms and artificial intelligence techniques are used for forecasting photovoltaic generation in the smart grid [38]. However, optimizing these parameters does not ensure a significant improvement in accuracy as it negatively affects key assumptions of the neural algorithm.Others works have also been proposed for the management, simulation, control, and modelling of renewable energy sources based on artificial intelligence and time series forecasting [39–41]. In the same way, authors [42] applied the Markov model using the hidden optimized algorithm for short-term prediction of photovoltaic power. In another work, authors [43] implemented the multidirectional search optimization algorithm for the tracking of photovoltaic energy systems. Obviously, these methods are very limited when the database is large and complex. Authors [44] developed a multihead convolutional neural network (CNN) in efficient renewable power sources for energy forecasting with the energy storage system. In addition, authors [45] proposed the adaptive neuro fuzzy inference system (ANFIS) based model to forecast solar energy under different weather conditions such as clear sky, hazy sky, and cloudy sky. This work is also proposed for smart grid applications in short-term forecasting of photovoltaic power.In [46], a robust artificial intelligence (AI) algorithm is applied for power density prediction with wind power plant installation. In this study, the effects of the wind speed, the wind direction, the temperature, the damp, and the pressure on power density could be modelled. The obtained results show that the applied method is superior to traditional AI-based techniques. Authors [47] proposed a day ahead and 1 h ahead mean photovoltaic (PV) output power forecasting model based on the extreme learning machine (ELM) approach. Therefore, the developed model is trained and tested using power output of the photovoltaic system and other meteorological parameters recorded in three grid-connected PV system installed on a roof-top of PEARL Laboratory in University of Malaya, Malaysia. The performance of the proposed model is proven using statistical error indicators such as the root mean square error (RMSE), mean absolute percentage error (MAPE), mean absolute bias error (MABE), and coefficient of determination (R2). The comparison of results showed that the ELM model gives higher accuracy and less computational time in daily and hourly PV output power forecasting.Moreover, authors [48] investigated the prediction of monthly and weekly wind power density of four different locations in Malaysia using the ANFIS model, the ANFIS-PSO model, the ANFIS-GA model, and the ANFIS-DE model. Author used statistical parameters such as the mean absolute bias error (MABE), mean absolute percentage error (MAPE), root mean square error (RMSE), and coefficient of determination (R2) to evaluate the performance of the proposed hybrid ANFIS models. Authors [49] developed statistical and neural network-based approaches to predict hourly wind speed data of the subsequent year. For this purpose, authors used a set of recent wind speed measurement samples from two meteorological stations in Malaysia. The obtained results by the proposed approach are rather promising in view of the very small mean absolute error (MAE). In addition, authors [50] used a new hybrid swarm technique to forecast the energy output of a real wind farm located in Binaloud, Iran. This hybrid method is made of ant colony optimization (ACO) and particle swarm optimization (PSO) which are two swarm intelligence meta-heuristic techniques. The obtained results show the effectiveness of the hybrid forecasting model with a faster convergence profile and a MAPE of 3.513%.In this study, the authors proposed a novel hybrid intelligent model using the artificial neural network (ANN) and the support vector machine (SVM) in order to predict the energy production of solar panels considering climatic factors and the regular consumption of customers in order to adapt this power generation to consumption with the aim of ensuring a permanent supply of energy to consumers. Moreover, particle swarm optimization (PSO) was used in order to select suitable and optimal parameters for the SVM and ANN models. To our knowledge, this method has never been done in the past because its effectiveness is proven and applicable to any type of data, even climatic, economic, social, or environmental.The structure of this study is presented as follows: Section2 gives the materials and the methods used in this study including the ANN model, SVM model, and PSO algorithm for the forecasting. In Section 3, an implementation of this model is proposed to forecast photovoltaic power generation and obtain the accuracy results; moreover, the discussion of these results helps to show the effectiveness of new model. Section 4 concludes this study and presents directions for the work in the future.


## 2. Materials and Methods

### 2.1. Materials

#### 2.1.1. Data Collected

First, to build the neural network approach, it is necessary to collect the data that will allow the model to be trained and give it enough information to increase its predictive capacity and its analytical intelligence. The data used as input for the neural network comes from the agency for the control and supervision of consumption and power generation of photovoltaic solar panel installed in the city of Douala in Cameroon. Table1 shows the input dataset for a 5 years period used for forecasting photovoltaic power generation.Table 1
Dataset.
MonthTemperature (Celsius degree)Solar irradiance (kWh/m2)Wind speed (m/s)Humidity (%)Load (MWh)0123154.2567.7536.293.10222173.2572.2538.593.6032215466.253495.80426184.7572.2537.4101.80524184.2571.2534.497.30624210.2574.7539104.5072618169.7536.4105.1082517672.537.899.609251917438.1100.91023198.2573.542.199.61126186.2574.538.5101.512272167639.4103.61332180.569.538.41021430205.2571.2539.4104.11535187.7569.540.5101.31635162.756636.499.11734195.757138.9101.91832209.257142.1107.61928183.7567.7538106.82033211.7573.540106.221281796839.1103.32228200.569.7541.3111.42331140.2568.2533.9862432148.757035.586.72528151.2567.7534.590.22627159.2571.535.789.62734131.567.536.288.6283114867.538.897.42927133.2564.7536.493.53029160.756936.797.4313218273.7538.7100.53229160.2571.2537.393.5332716871.2538.1933431218.57139.8111.73531247.2573.542.11173632191.756538.4118.53735202.257038.5106.53830196.7568.2542.1105.63936363.1572.2551.2136.240302036740.2114.84135262.7568.7543.2128.3423420529.536.610643372177037.3113.3443921271.541.5106.64539125.256831.585.14633164.2573.2535.796.64740133.567.533.688.24839148.571.2534.689.84935135.7568.532.892.35037127.566.753483.45137158.2572.2534.990.25230139.256934.389.25331137.2567.7536.589.75439152.7573.535.193.35532136.2567.537.887.656341987239.9107.65738181.56839.11005832201.2569.540.5111.55934202.570.7540.5115.46040179.7565.7538.4104.8The variation of these parameters allows forecasting the photovoltaic generation for a long period. Considering these factors, it is possible to forecast the power generation of solar panel in a city to satisfy the electrical demand.


#### 2.1.2. MATLAB

The software used in this study is MATLAB (Matrix laboratory). It is used to process information automatically through analysis algorithms. In addition, MATLAB also ensures the implementation of the artificial intelligence and deep learning methods in order to more efficiently analyze the data implemented in the system. In this study, the version of MATLAB used is MATLAB R2020b 64 bit. This is one of the most recent versions of this software to optimize calculations. In this study, we implemented our forecasting through neural network adjustment application, support vector machine, and PSO algorithm in MATLAB.


#### 2.1.3. Computer

The simulations of this work were done on a DELL computer with following characteristics: core i5, 3.1 GHz processor, 8 GB RAM, Windows 10/64 bits.


### 2.2. Methods

In this study, an ANN model with SVM and PSO was used as a tool for forecasting solar generation in the city of Douala. Therefore, this model accurately modelled the nonlinear behavior of climate change data and variations of energy demand. Real-time data used include solar irradiance, temperature, humidity, wind speed, and load consumption which are the best input parameters to predict solar generation.In this model, solar irradiance represents the solar power in an area, and its expression is kw/m2. Temperature is the heat degree of the climate, humidity is the cold degree of climate, and wind speed represents the velocity of wind of the locality. Load consumption concerns the consumption of consumers in the city. The data are collected for the 5 years period from January 2016 to December 2020 in the city of Douala in Cameroon. The challenge is to predict the solar power generation to supply consumers with the aim to avoid any outages. This work can forecast the solar generation using a hybrid machine learning method made of the ANN, SVM, and PSO algorithm. The flowchart of the proposed method is described in Figure 1.Figure 1
Flowchart of the proposed hybrid intelligent method.In Figure1, the proposed model consists to initialize the collected data in the machine learning system made of the hybrid model with the neural network and support vector machine. Knowing that the dataset comprises information of climate change and load consumption, the training of the neural network can be done with effectiveness. The continuous step of training, testing, and validation is done in the memory of the neural network for global implementation of the hybrid method. The simultaneous working of these algorithms allows obtaining forecasting results depending from the training data in the dataset. A first forecasting test is done with the aim to evaluate the effectiveness of the computational algorithms. The technique can then calculate the error and evaluate the reliability of the forecasting. When the error is high, a particle swarm optimization algorithm is trained to update the forecasting results. The work is validated when the desired results with high precision is obtained.


#### 2.2.1. Artificial Neural Network

The structure of the multilayer artificial neural network (ANN) model is shown in Figure2.Figure 2
Structure of the multilayer ANN model.Considering the input data, the hidden layers, and the weight, the obtained output data is presented in the following equation:(1)y=f∑i=1nxiwi,where xi is the input data, wi is the weight, and y is the output data of the artificial neural network.The following equation gives the sigmoid function as the activation function of the ANN model.(2)fx=11+e−x.The ANN model implemented in this study is structured through several successive stages ranging from data collection to model validation. Figure3 shows the flowchart of the operation of the ANN model proposed in this study.Figure 3
Functional flowchart of the ANN model.This model makes it possible to forecast power generation of renewable energy sources through a succession of stages. First, the ANN model needs to collect data. These data come from the supervision and control center of photovoltaic generation in the city of Douala. Second, the model starts data preprocessing to check the input dataset. This step directly follows data collection and allows regularization and standardization of the data collected. The third step is to design and build the neural network through an architecture consisting of neurons, input layers, hidden layers, output layers, activation functions, and learning algorithms. Fourth, the model should start training of the collected data. This step adjusts the input data to converge on the desired target by changing the weights. This step also makes it possible to properly choose the learning algorithms of the ANN model. Finally, the testing data step validates the learning of the neural network. The activation function trains the neural network based on the input data to produce a base associated with the target outputs. Once the neural network has adjusted the data, it forms a generalization through a relationship between the inputs and the outputs and can be used to generate the outputs for which the inputs have not been trained. The data training is done through the training of Levenberg–Marquardt. The number of hidden neurons is 100 neurons which is a significant number of neurons for data accuracy.


#### 2.2.2. Support Vector Machine

The support vector machine (SVM) was developed by Vladimir Vapnik in the years 80 using statistical tools, optimization, and neural network. The SVM is a powerful deep learning method used for supervised classification and linear regression applications. In this work, SVM is used for prediction of solar power generation. Also, the support vector machine can effectively label data using a separating hyper plane as it is described in Figure4.Figure 4
Support vector machine.The support vector machine is based on hyperplane which can separate the training data between two subgroups (+1 and −1). Among all planes of separation between two classes, there is an optimal space plane and the maximal element training for machine learning generalization.The negative and positive hyper planes are given in the following equations.(3)wTxpos+w0=+1,(4)wTxneg+w0=+1.Then, the subtracting the two previous equations gives the following equation.(5)wTxpos−xnegw=2w.The purpose of the SVM is to optimize the margin between positive and negative hyperplanes. Using the kernel method, it is possible to transform the original features into space with higher dimension. The separation is done by linear hyperplanes as shown in Figure4.The SVM performance can be optimized by selecting tuning parameters as theC parameter which is the regularization parameter and gamma parameter. We obtain a small margin hyperplane by using a higher value of C with the aim to classify correctly the training data. Then, larger margin is obtained with smaller value of C parameter, so it will permit misclassification points in training data. In the same time, the gamma parameter is used for the RBF kernel. If the gamma is higher, the hyperplane boundary is tighter. A large gamma parameter leads to higher bias and lower variance.The flowchart of the SVM model is presented in Figure5.Figure 5
Flowchart of the SVM model.First, the data are collected from the electrical agency and climate agency. Then, data preprocessing presents the technique of data mining used for preprocessing of information. Feature extraction consists to extract the essential parameter as temperature and solar irradiance. The optimization of the SVM parameter consists to estimate the accuracy of learning the SVM model by adjusting the error. The training of SVM allows building the SVM model using the optimization of parameters by the number of sample. The training of the model permits to train the inputs data as they can converge to targets. The development of SVM classifier consists to define the training values allowing forecasting the future variables. It can illustrate the learning and training of SVM for optimization of parameter, the development of SVM classifier, the test, and the validation of the SVM model.The final data processing describes the development of algorithm which can choose and select the suitable forecasting of the SVM classifier.


#### 2.2.3. Particle Swarm Optimization

The particle swarm optimization (PSO) is a computational technique developed by Kennedy and Eberhart in 1995. The PSO is based on social behavior of birds. The concept of swarm used in PSO consists of collective behavior of particles in their environment. A number of particles are used to initialize the PSO algorithm; then, each particle can move to converge toward the best potential region with best solutions. Each particle detains a memory function and adjusts its path using the experiences of other particles.Each particle can follow the path based onPbest and Gbest which are, respectively, the best particular position and the best global position of the swarm. They also have two vectors, Xi and Vi, respectively, the position vector and the velocity vector of particle.The following equation gives the velocity vector of the PSO.(6)Vit+1=Vit+c1r1Pbest−X1t+c2r2Gbest−Xit.A random solution can initialize the PSO algorithm for optimal solution by updating the particle position as presented in the following equation.(7)Xit+1=Xit+Vit+1,where c1 and c2 are the social coefficients, r1 is the random number generated in a loop from 0 to 1, Xit+1 is the next position of particle, and Xit is the previous position of particle.Figure6 shows the flowchart of the PSO algorithm.Figure 6
Flowchart of the PSO algorithm.The algorithm starts with the initialization of position vectorXi and velocity vector Vi of particle. Then, the algorithm determines the best particular position Pbest and the best global position Gbest of the swarm. At the end, the algorithm verifies the value of solution; if the value is the best solution, it validates the solution. If it is not the best solution, the algorithm must update Xi and Vi to restart the work.


#### 2.2.4. Evaluation Metrics

The model performance acceptability criteria depend on error factors such as the mean square error (MSE) in equation (8), the root mean square error (RMSE) in equation (9), the mean absolute percentage error (MAPE) in equation (10), and the mean absolute error (MAE) in equation (11). Moreover, in equation (12), the error gives the difference between the forecast and the real data. In addition, the correlation coefficient (R) in equation (13) also makes it possible to show the precision of the model during the forecast. Greater is the R, better is the forecasting.(8)MSE=1n∑i=1ny^i−yi2,(9)RMSE=1n∑i=1ny^i−yi2,(10)MAPE=1n∑i=1ny^i−yiyi∗100%,(11)MAE=1n∑i=1ny^i−yi,(12)Error=∑i=1ny^i−yi,(13)R=1−∑i=1ny^i−yi2∑i=1ny^i−yi2,where y^i is the predicted value, yi is the real value, and n is the sample size.The RMSE defined in equation (9) is a measure of differences between actual values and forecasted values using the model. The RMSE also represents the standard deviation between predicted values and real values. Moreover, the RMSE can be a good measure of precision, but only compare predicting errors of different models for a particular variable and not between all variables. Then, we also used MAPE and MAE defined, respectively, in equations (10) and (11) to evaluate and compare different model performances.


## 2.1. Materials

### 2.1.1. Data Collected

First, to build the neural network approach, it is necessary to collect the data that will allow the model to be trained and give it enough information to increase its predictive capacity and its analytical intelligence. The data used as input for the neural network comes from the agency for the control and supervision of consumption and power generation of photovoltaic solar panel installed in the city of Douala in Cameroon. Table1 shows the input dataset for a 5 years period used for forecasting photovoltaic power generation.Table 1
Dataset.
MonthTemperature (Celsius degree)Solar irradiance (kWh/m2)Wind speed (m/s)Humidity (%)Load (MWh)0123154.2567.7536.293.10222173.2572.2538.593.6032215466.253495.80426184.7572.2537.4101.80524184.2571.2534.497.30624210.2574.7539104.5072618169.7536.4105.1082517672.537.899.609251917438.1100.91023198.2573.542.199.61126186.2574.538.5101.512272167639.4103.61332180.569.538.41021430205.2571.2539.4104.11535187.7569.540.5101.31635162.756636.499.11734195.757138.9101.91832209.257142.1107.61928183.7567.7538106.82033211.7573.540106.221281796839.1103.32228200.569.7541.3111.42331140.2568.2533.9862432148.757035.586.72528151.2567.7534.590.22627159.2571.535.789.62734131.567.536.288.6283114867.538.897.42927133.2564.7536.493.53029160.756936.797.4313218273.7538.7100.53229160.2571.2537.393.5332716871.2538.1933431218.57139.8111.73531247.2573.542.11173632191.756538.4118.53735202.257038.5106.53830196.7568.2542.1105.63936363.1572.2551.2136.240302036740.2114.84135262.7568.7543.2128.3423420529.536.610643372177037.3113.3443921271.541.5106.64539125.256831.585.14633164.2573.2535.796.64740133.567.533.688.24839148.571.2534.689.84935135.7568.532.892.35037127.566.753483.45137158.2572.2534.990.25230139.256934.389.25331137.2567.7536.589.75439152.7573.535.193.35532136.2567.537.887.656341987239.9107.65738181.56839.11005832201.2569.540.5111.55934202.570.7540.5115.46040179.7565.7538.4104.8The variation of these parameters allows forecasting the photovoltaic generation for a long period. Considering these factors, it is possible to forecast the power generation of solar panel in a city to satisfy the electrical demand.


### 2.1.2. MATLAB

The software used in this study is MATLAB (Matrix laboratory). It is used to process information automatically through analysis algorithms. In addition, MATLAB also ensures the implementation of the artificial intelligence and deep learning methods in order to more efficiently analyze the data implemented in the system. In this study, the version of MATLAB used is MATLAB R2020b 64 bit. This is one of the most recent versions of this software to optimize calculations. In this study, we implemented our forecasting through neural network adjustment application, support vector machine, and PSO algorithm in MATLAB.


### 2.1.3. Computer

The simulations of this work were done on a DELL computer with following characteristics: core i5, 3.1 GHz processor, 8 GB RAM, Windows 10/64 bits.


## 2.1.1. Data Collected

First, to build the neural network approach, it is necessary to collect the data that will allow the model to be trained and give it enough information to increase its predictive capacity and its analytical intelligence. The data used as input for the neural network comes from the agency for the control and supervision of consumption and power generation of photovoltaic solar panel installed in the city of Douala in Cameroon. Table1 shows the input dataset for a 5 years period used for forecasting photovoltaic power generation.Table 1
Dataset.
MonthTemperature (Celsius degree)Solar irradiance (kWh/m2)Wind speed (m/s)Humidity (%)Load (MWh)0123154.2567.7536.293.10222173.2572.2538.593.6032215466.253495.80426184.7572.2537.4101.80524184.2571.2534.497.30624210.2574.7539104.5072618169.7536.4105.1082517672.537.899.609251917438.1100.91023198.2573.542.199.61126186.2574.538.5101.512272167639.4103.61332180.569.538.41021430205.2571.2539.4104.11535187.7569.540.5101.31635162.756636.499.11734195.757138.9101.91832209.257142.1107.61928183.7567.7538106.82033211.7573.540106.221281796839.1103.32228200.569.7541.3111.42331140.2568.2533.9862432148.757035.586.72528151.2567.7534.590.22627159.2571.535.789.62734131.567.536.288.6283114867.538.897.42927133.2564.7536.493.53029160.756936.797.4313218273.7538.7100.53229160.2571.2537.393.5332716871.2538.1933431218.57139.8111.73531247.2573.542.11173632191.756538.4118.53735202.257038.5106.53830196.7568.2542.1105.63936363.1572.2551.2136.240302036740.2114.84135262.7568.7543.2128.3423420529.536.610643372177037.3113.3443921271.541.5106.64539125.256831.585.14633164.2573.2535.796.64740133.567.533.688.24839148.571.2534.689.84935135.7568.532.892.35037127.566.753483.45137158.2572.2534.990.25230139.256934.389.25331137.2567.7536.589.75439152.7573.535.193.35532136.2567.537.887.656341987239.9107.65738181.56839.11005832201.2569.540.5111.55934202.570.7540.5115.46040179.7565.7538.4104.8The variation of these parameters allows forecasting the photovoltaic generation for a long period. Considering these factors, it is possible to forecast the power generation of solar panel in a city to satisfy the electrical demand.


## 2.1.2. MATLAB

The software used in this study is MATLAB (Matrix laboratory). It is used to process information automatically through analysis algorithms. In addition, MATLAB also ensures the implementation of the artificial intelligence and deep learning methods in order to more efficiently analyze the data implemented in the system. In this study, the version of MATLAB used is MATLAB R2020b 64 bit. This is one of the most recent versions of this software to optimize calculations. In this study, we implemented our forecasting through neural network adjustment application, support vector machine, and PSO algorithm in MATLAB.


## 2.1.3. Computer

The simulations of this work were done on a DELL computer with following characteristics: core i5, 3.1 GHz processor, 8 GB RAM, Windows 10/64 bits.


## 2.2. Methods

In this study, an ANN model with SVM and PSO was used as a tool for forecasting solar generation in the city of Douala. Therefore, this model accurately modelled the nonlinear behavior of climate change data and variations of energy demand. Real-time data used include solar irradiance, temperature, humidity, wind speed, and load consumption which are the best input parameters to predict solar generation.In this model, solar irradiance represents the solar power in an area, and its expression is kw/m2. Temperature is the heat degree of the climate, humidity is the cold degree of climate, and wind speed represents the velocity of wind of the locality. Load consumption concerns the consumption of consumers in the city. The data are collected for the 5 years period from January 2016 to December 2020 in the city of Douala in Cameroon. The challenge is to predict the solar power generation to supply consumers with the aim to avoid any outages. This work can forecast the solar generation using a hybrid machine learning method made of the ANN, SVM, and PSO algorithm. The flowchart of the proposed method is described in Figure 1.Figure 1
Flowchart of the proposed hybrid intelligent method.In Figure1, the proposed model consists to initialize the collected data in the machine learning system made of the hybrid model with the neural network and support vector machine. Knowing that the dataset comprises information of climate change and load consumption, the training of the neural network can be done with effectiveness. The continuous step of training, testing, and validation is done in the memory of the neural network for global implementation of the hybrid method. The simultaneous working of these algorithms allows obtaining forecasting results depending from the training data in the dataset. A first forecasting test is done with the aim to evaluate the effectiveness of the computational algorithms. The technique can then calculate the error and evaluate the reliability of the forecasting. When the error is high, a particle swarm optimization algorithm is trained to update the forecasting results. The work is validated when the desired results with high precision is obtained.


### 2.2.1. Artificial Neural Network

The structure of the multilayer artificial neural network (ANN) model is shown in Figure2.Figure 2
Structure of the multilayer ANN model.Considering the input data, the hidden layers, and the weight, the obtained output data is presented in the following equation:(1)y=f∑i=1nxiwi,where xi is the input data, wi is the weight, and y is the output data of the artificial neural network.The following equation gives the sigmoid function as the activation function of the ANN model.(2)fx=11+e−x.The ANN model implemented in this study is structured through several successive stages ranging from data collection to model validation. Figure3 shows the flowchart of the operation of the ANN model proposed in this study.Figure 3
Functional flowchart of the ANN model.This model makes it possible to forecast power generation of renewable energy sources through a succession of stages. First, the ANN model needs to collect data. These data come from the supervision and control center of photovoltaic generation in the city of Douala. Second, the model starts data preprocessing to check the input dataset. This step directly follows data collection and allows regularization and standardization of the data collected. The third step is to design and build the neural network through an architecture consisting of neurons, input layers, hidden layers, output layers, activation functions, and learning algorithms. Fourth, the model should start training of the collected data. This step adjusts the input data to converge on the desired target by changing the weights. This step also makes it possible to properly choose the learning algorithms of the ANN model. Finally, the testing data step validates the learning of the neural network. The activation function trains the neural network based on the input data to produce a base associated with the target outputs. Once the neural network has adjusted the data, it forms a generalization through a relationship between the inputs and the outputs and can be used to generate the outputs for which the inputs have not been trained. The data training is done through the training of Levenberg–Marquardt. The number of hidden neurons is 100 neurons which is a significant number of neurons for data accuracy.


### 2.2.2. Support Vector Machine

The support vector machine (SVM) was developed by Vladimir Vapnik in the years 80 using statistical tools, optimization, and neural network. The SVM is a powerful deep learning method used for supervised classification and linear regression applications. In this work, SVM is used for prediction of solar power generation. Also, the support vector machine can effectively label data using a separating hyper plane as it is described in Figure4.Figure 4
Support vector machine.The support vector machine is based on hyperplane which can separate the training data between two subgroups (+1 and −1). Among all planes of separation between two classes, there is an optimal space plane and the maximal element training for machine learning generalization.The negative and positive hyper planes are given in the following equations.(3)wTxpos+w0=+1,(4)wTxneg+w0=+1.Then, the subtracting the two previous equations gives the following equation.(5)wTxpos−xnegw=2w.The purpose of the SVM is to optimize the margin between positive and negative hyperplanes. Using the kernel method, it is possible to transform the original features into space with higher dimension. The separation is done by linear hyperplanes as shown in Figure4.The SVM performance can be optimized by selecting tuning parameters as theC parameter which is the regularization parameter and gamma parameter. We obtain a small margin hyperplane by using a higher value of C with the aim to classify correctly the training data. Then, larger margin is obtained with smaller value of C parameter, so it will permit misclassification points in training data. In the same time, the gamma parameter is used for the RBF kernel. If the gamma is higher, the hyperplane boundary is tighter. A large gamma parameter leads to higher bias and lower variance.The flowchart of the SVM model is presented in Figure5.Figure 5
Flowchart of the SVM model.First, the data are collected from the electrical agency and climate agency. Then, data preprocessing presents the technique of data mining used for preprocessing of information. Feature extraction consists to extract the essential parameter as temperature and solar irradiance. The optimization of the SVM parameter consists to estimate the accuracy of learning the SVM model by adjusting the error. The training of SVM allows building the SVM model using the optimization of parameters by the number of sample. The training of the model permits to train the inputs data as they can converge to targets. The development of SVM classifier consists to define the training values allowing forecasting the future variables. It can illustrate the learning and training of SVM for optimization of parameter, the development of SVM classifier, the test, and the validation of the SVM model.The final data processing describes the development of algorithm which can choose and select the suitable forecasting of the SVM classifier.


### 2.2.3. Particle Swarm Optimization

The particle swarm optimization (PSO) is a computational technique developed by Kennedy and Eberhart in 1995. The PSO is based on social behavior of birds. The concept of swarm used in PSO consists of collective behavior of particles in their environment. A number of particles are used to initialize the PSO algorithm; then, each particle can move to converge toward the best potential region with best solutions. Each particle detains a memory function and adjusts its path using the experiences of other particles.Each particle can follow the path based onPbest and Gbest which are, respectively, the best particular position and the best global position of the swarm. They also have two vectors, Xi and Vi, respectively, the position vector and the velocity vector of particle.The following equation gives the velocity vector of the PSO.(6)Vit+1=Vit+c1r1Pbest−X1t+c2r2Gbest−Xit.A random solution can initialize the PSO algorithm for optimal solution by updating the particle position as presented in the following equation.(7)Xit+1=Xit+Vit+1,where c1 and c2 are the social coefficients, r1 is the random number generated in a loop from 0 to 1, Xit+1 is the next position of particle, and Xit is the previous position of particle.Figure6 shows the flowchart of the PSO algorithm.Figure 6
Flowchart of the PSO algorithm.The algorithm starts with the initialization of position vectorXi and velocity vector Vi of particle. Then, the algorithm determines the best particular position Pbest and the best global position Gbest of the swarm. At the end, the algorithm verifies the value of solution; if the value is the best solution, it validates the solution. If it is not the best solution, the algorithm must update Xi and Vi to restart the work.


### 2.2.4. Evaluation Metrics

The model performance acceptability criteria depend on error factors such as the mean square error (MSE) in equation (8), the root mean square error (RMSE) in equation (9), the mean absolute percentage error (MAPE) in equation (10), and the mean absolute error (MAE) in equation (11). Moreover, in equation (12), the error gives the difference between the forecast and the real data. In addition, the correlation coefficient (R) in equation (13) also makes it possible to show the precision of the model during the forecast. Greater is the R, better is the forecasting.(8)MSE=1n∑i=1ny^i−yi2,(9)RMSE=1n∑i=1ny^i−yi2,(10)MAPE=1n∑i=1ny^i−yiyi∗100%,(11)MAE=1n∑i=1ny^i−yi,(12)Error=∑i=1ny^i−yi,(13)R=1−∑i=1ny^i−yi2∑i=1ny^i−yi2,where y^i is the predicted value, yi is the real value, and n is the sample size.The RMSE defined in equation (9) is a measure of differences between actual values and forecasted values using the model. The RMSE also represents the standard deviation between predicted values and real values. Moreover, the RMSE can be a good measure of precision, but only compare predicting errors of different models for a particular variable and not between all variables. Then, we also used MAPE and MAE defined, respectively, in equations (10) and (11) to evaluate and compare different model performances.


## 2.2.1. Artificial Neural Network

The structure of the multilayer artificial neural network (ANN) model is shown in Figure2.Figure 2
Structure of the multilayer ANN model.Considering the input data, the hidden layers, and the weight, the obtained output data is presented in the following equation:(1)y=f∑i=1nxiwi,where xi is the input data, wi is the weight, and y is the output data of the artificial neural network.The following equation gives the sigmoid function as the activation function of the ANN model.(2)fx=11+e−x.The ANN model implemented in this study is structured through several successive stages ranging from data collection to model validation. Figure3 shows the flowchart of the operation of the ANN model proposed in this study.Figure 3
Functional flowchart of the ANN model.This model makes it possible to forecast power generation of renewable energy sources through a succession of stages. First, the ANN model needs to collect data. These data come from the supervision and control center of photovoltaic generation in the city of Douala. Second, the model starts data preprocessing to check the input dataset. This step directly follows data collection and allows regularization and standardization of the data collected. The third step is to design and build the neural network through an architecture consisting of neurons, input layers, hidden layers, output layers, activation functions, and learning algorithms. Fourth, the model should start training of the collected data. This step adjusts the input data to converge on the desired target by changing the weights. This step also makes it possible to properly choose the learning algorithms of the ANN model. Finally, the testing data step validates the learning of the neural network. The activation function trains the neural network based on the input data to produce a base associated with the target outputs. Once the neural network has adjusted the data, it forms a generalization through a relationship between the inputs and the outputs and can be used to generate the outputs for which the inputs have not been trained. The data training is done through the training of Levenberg–Marquardt. The number of hidden neurons is 100 neurons which is a significant number of neurons for data accuracy.


## 2.2.2. Support Vector Machine

The support vector machine (SVM) was developed by Vladimir Vapnik in the years 80 using statistical tools, optimization, and neural network. The SVM is a powerful deep learning method used for supervised classification and linear regression applications. In this work, SVM is used for prediction of solar power generation. Also, the support vector machine can effectively label data using a separating hyper plane as it is described in Figure4.Figure 4
Support vector machine.The support vector machine is based on hyperplane which can separate the training data between two subgroups (+1 and −1). Among all planes of separation between two classes, there is an optimal space plane and the maximal element training for machine learning generalization.The negative and positive hyper planes are given in the following equations.(3)wTxpos+w0=+1,(4)wTxneg+w0=+1.Then, the subtracting the two previous equations gives the following equation.(5)wTxpos−xnegw=2w.The purpose of the SVM is to optimize the margin between positive and negative hyperplanes. Using the kernel method, it is possible to transform the original features into space with higher dimension. The separation is done by linear hyperplanes as shown in Figure4.The SVM performance can be optimized by selecting tuning parameters as theC parameter which is the regularization parameter and gamma parameter. We obtain a small margin hyperplane by using a higher value of C with the aim to classify correctly the training data. Then, larger margin is obtained with smaller value of C parameter, so it will permit misclassification points in training data. In the same time, the gamma parameter is used for the RBF kernel. If the gamma is higher, the hyperplane boundary is tighter. A large gamma parameter leads to higher bias and lower variance.The flowchart of the SVM model is presented in Figure5.Figure 5
Flowchart of the SVM model.First, the data are collected from the electrical agency and climate agency. Then, data preprocessing presents the technique of data mining used for preprocessing of information. Feature extraction consists to extract the essential parameter as temperature and solar irradiance. The optimization of the SVM parameter consists to estimate the accuracy of learning the SVM model by adjusting the error. The training of SVM allows building the SVM model using the optimization of parameters by the number of sample. The training of the model permits to train the inputs data as they can converge to targets. The development of SVM classifier consists to define the training values allowing forecasting the future variables. It can illustrate the learning and training of SVM for optimization of parameter, the development of SVM classifier, the test, and the validation of the SVM model.The final data processing describes the development of algorithm which can choose and select the suitable forecasting of the SVM classifier.


## 2.2.3. Particle Swarm Optimization

The particle swarm optimization (PSO) is a computational technique developed by Kennedy and Eberhart in 1995. The PSO is based on social behavior of birds. The concept of swarm used in PSO consists of collective behavior of particles in their environment. A number of particles are used to initialize the PSO algorithm; then, each particle can move to converge toward the best potential region with best solutions. Each particle detains a memory function and adjusts its path using the experiences of other particles.Each particle can follow the path based onPbest and Gbest which are, respectively, the best particular position and the best global position of the swarm. They also have two vectors, Xi and Vi, respectively, the position vector and the velocity vector of particle.The following equation gives the velocity vector of the PSO.(6)Vit+1=Vit+c1r1Pbest−X1t+c2r2Gbest−Xit.A random solution can initialize the PSO algorithm for optimal solution by updating the particle position as presented in the following equation.(7)Xit+1=Xit+Vit+1,where c1 and c2 are the social coefficients, r1 is the random number generated in a loop from 0 to 1, Xit+1 is the next position of particle, and Xit is the previous position of particle.Figure6 shows the flowchart of the PSO algorithm.Figure 6
Flowchart of the PSO algorithm.The algorithm starts with the initialization of position vectorXi and velocity vector Vi of particle. Then, the algorithm determines the best particular position Pbest and the best global position Gbest of the swarm. At the end, the algorithm verifies the value of solution; if the value is the best solution, it validates the solution. If it is not the best solution, the algorithm must update Xi and Vi to restart the work.


## 2.2.4. Evaluation Metrics

The model performance acceptability criteria depend on error factors such as the mean square error (MSE) in equation (8), the root mean square error (RMSE) in equation (9), the mean absolute percentage error (MAPE) in equation (10), and the mean absolute error (MAE) in equation (11). Moreover, in equation (12), the error gives the difference between the forecast and the real data. In addition, the correlation coefficient (R) in equation (13) also makes it possible to show the precision of the model during the forecast. Greater is the R, better is the forecasting.(8)MSE=1n∑i=1ny^i−yi2,(9)RMSE=1n∑i=1ny^i−yi2,(10)MAPE=1n∑i=1ny^i−yiyi∗100%,(11)MAE=1n∑i=1ny^i−yi,(12)Error=∑i=1ny^i−yi,(13)R=1−∑i=1ny^i−yi2∑i=1ny^i−yi2,where y^i is the predicted value, yi is the real value, and n is the sample size.The RMSE defined in equation (9) is a measure of differences between actual values and forecasted values using the model. The RMSE also represents the standard deviation between predicted values and real values. Moreover, the RMSE can be a good measure of precision, but only compare predicting errors of different models for a particular variable and not between all variables. Then, we also used MAPE and MAE defined, respectively, in equations (10) and (11) to evaluate and compare different model performances.


## 3. Results and Discussion

Figure7 presents photovoltaic power generation data over last 5 years (September 2016–December 2020) in the city of Douala. Figures 8–10, respectively, give the forecasting using the ANN model, the ANN-SVM model, and the ANN-SVM-PSO model.Figure 7
Photovoltaic power generation data.Figure 8
Forecasting using the ANN model.Figure 9
Forecasting using the ANN-SVM model.Figure 10
Forecasting using the ANN-SVM-PSO model.In Figure8, the ANN model gives good prediction of photovoltaic generating considering weather conditions and constraints. The prediction almost follows the real data for the prediction period. It can also be seen that the error is low during this period, but it can reach high value for certain month.In Figure9, the ANN-SVM model can forecast the power generation using the climatic factors. Moreover, this model gives a better result than the single ANN model during the prediction horizon because it can consider more individual parameters for the prediction process. It can also be observed that the error is to better minimize and that allows to validate this model for the power generation forecasting.Considering the inputs data such as temperature, humidity, solar irradiance, load, and wind speed, they proposed a novel predictor using a novel hybrid ANN-SVM-PSO model. The implementation of the hybrid ANN-SVM-PSO model using MATLAB helps to obtain the results of the performance of the model based on the input data consisting of irradiance, wind speed, temperature, humidity, and load. Using these input data, the model gives us the forecasting of photovoltaic power generation through neural network adjustment.In Figure10, the ANN-SVM-PSO model forecasts the power generation, and this result is better than all previous models implemented in this study. The forecasting perfectly follows the real data which explain the effectiveness of the proposed model. Moreover, the forecasting error is greatly minimizing. The proposed model is effective for this time series solar power prediction considering any factors in the environments.In Figure10, the analysis of the behavior between the actual output data and the forecasting output data show that the value of the correlation coefficient (R) is close to 1 which means that the forecast data and the actual data are very close. The real data are obtained from the monitoring center of the city of Douala and the forecasted data are obtained from the simulation algorithm of MATLAB. The actual photovoltaic power generation and the forecast photovoltaic power generation considering all the environmental factors and the model have been implemented over 5 years which means 60 months.In Figure11, we present the comparison of forecasting values for models implemented in this study.Figure 11
Result of forecasting models.It can be seen that the hybrid intelligent ANN-SVM-PSO model gives better results of forecasting with a low error compared with the previous models. In Figure11, the forecast power generation using the ANN-SVM-PSO model is closer to actual generation. These results are verified using the correlation coefficient which is close to 1. These forecasting results are satisfactory and verify the accuracy of obtained results.Depending on climate change, the solar generation will access 35 MWh in the next months. The increase of input values with strong correlation can theoretically give low correlation with the forecasting level, but hybrid model based on historical sequences can improve the prediction using its own sequence of processing.A summary of the results of forecast models from our study is shown in Table2.Table 2
Forecast errors of forecasting models.
ModelMSERMSEMAPE (%)MAERANN45.21346.72407.6952.6650.9554ANN-SVM40.25876.34494.5241.2440.9714ANN-SVM-PSO14.97213.86933.320.8670.9984So, some comparison tests were carried out with the aim to validate the efficiency of our novel hybrid intelligent model. The experimental results using the MSE, RMSE, MAPE, MAE, andR allow evaluating the performance of the baseline models and the proposed model. The intelligent model of this study satisfies the requirements and has better results of forecasting considering precision and processing time. First, we have process with the ANN model; second, we used hybrid ANN-SVM model, and finally, we constructed an intelligent hybrid model ANN-SVM-PSO. Our combined method and the previous method have been compared to show the advantages of the proposed model. It can be observed that the proposed method gives better results with low errors compared with other models. In that case, performance of the ANN combined with the SVM and PSO algorithm is better than single ANN model and the hybrid ANN-SVM model.Moreover, a comparative study with the literature is shown in Table3.Table 3
Comparative study with literature.
ModelMSERMSEMAPE (%)MAERAuthorsANN model90.80789.529395.653.2540.8511[28]Artificial neural networks and an analog ensemble85.2369.232392.323.1220.8724[31]Wavelet transform model65.25858.078275.442.8550.9133[32]Genetic algorithm optimized hidden Markov model52.69827.635865.472.5440.9375[42]Multidirectional search optimization algorithm47.54426.895261.022.1420.9524[43]Multiheaded convolutional neural networks39.25156.265154.251.8570.9755[44]ANFIS model34.69345.890144.231.5660.9814[45]ELM model30.48365.521231.05—0.9824[47]ANFIS-PSO model17.22254.152526.171.3560.9857[48]Nonlinear autoregressive neural network———0.94—[49]The hybrid ACO and PSO model——3.513——[50]ANN-SVM-PSO model14.97213.86933.320.8670.9984WritersThe comparison of the results shows that this model is better than the models that exist in the literature. With respect to the results, most of the evaluation metric results of our model are higher than those of the baseline methods of the literature. Furthermore, clustering on datasets of the proposed method can significantly improve performance compared with traditional machine learning methods. Using the proposed model, the regression coefficient is better because the forecast generation is close to the actual generation.


## 4. Conclusion

The management of photovoltaic power generation is important because it is impacted by several parameters that can influence the power supply to consumers. In addition, forecasting is a vital operation for the management of energy generation systems, in particular photovoltaic generation. Many research studies have been done to increase the accuracy of renewable resources forecasting with multiple methods and solutions. This study presents a novel hybrid intelligent method for forecasting solar photovoltaic generation in the city of Douala which is affected by environmental influences such as solar irradiance, temperature, wind speed, and load consumption. The implemented model is based on the artificial neural network (ANN), the support vector machine (SVM), and the particle swarm optimization (PSO) algorithms. To verify the efficiency of this model, we used the MATLAB software for the forecast over a period of 5 years of generation of solar photovoltaic plants. Using a simple ANN model, the RMSE is 6.7240 andR is 0.9554. The combination of the ANN and SVM presents the RMSE and R as 6.3449 and 0.9714, respectively. In order to improve these results, we implement a novel hybrid intelligent ANN-SVM-PSO model. The new values of RMSE and R are 3.8693 and 0.9984, respectively. The results obtained in this study show the efficiency of this novel intelligent model compared to those in the literature because the forecast error factors are very low and the correlation coefficient is higher. At our knowledge, it is the first paper which can predict photovoltaic generation using a hybrid intelligent machine learning model.



---

*Source: 7495548-2022-10-06.xml*