1. Introduction
Worldwide as well as in Poland, the number of photovoltaic installations is increasing year by year. This fact can be attributed mainly to two reasons: rising energy costs and attempts to combat climate change. A photovoltaic system allows a certain degree of independence from rising energy prices. In order to make the best use of its possibilities, the aim should be to maximize the degree of utilization of the energy produced. An important element in this case is the ability to predict energy production in the future [
1].
Energy production from renewable energy sources (RESs), especially photovoltaic panels, is heavily reliant on weather conditions and solar irradiance [
2]. Key factors include global horizontal solar irradiance, diffuse horizontal solar irradiance, temperature, wind speed and direction, humidity, precipitation, and hours of sunshine [
3,
4].
1.1. Challenges That Come with Changes to New Power Systems
Fluctuations in this production must be continuously compensated for by conventional sources using regulation reserves or, in the future, through energy storage facilities [
5,
6]. Short-term variations in RES energy production due to sudden weather changes can pose significant risks to the stability of the energy system [
7]. Consequently, as the proportion of renewable energy in the overall energy mix grows, accurate short-term production forecasting and real-time optimization become increasingly vital [
8,
9].
Renewable energy sources are connected to the power grid using power electronic converters [
10,
11]. Replacing conventional generators reduces the inertia of the power grid [
12]. The inclusion of a large number of RESs creates difficulties with frequency stability [
13], which is a major problem in their development [
14,
15]. Improving the stability of the power system can also be achieved by using a virtual synchronous generator that minimizes the frequency fluctuations [
12,
16,
17]. Battery energy storage systems (BESSs) can be used to simulate the inertia response of synchronous generators [
12,
18].
1.2. Artificial Intelligence Algorithms in Energy Forecasting
The utilization of artificial neural networks for predicting power generation in photovoltaic systems has gained immense popularity. Various types of neural networks, fuzzy logic, and machine learning algorithms are employed, with the selection contingent on factors such as the forecast horizon, the accessibility of diverse historical data, and forecasts derived from numerical weather prediction. Among these techniques, the multilayer perceptron (MLP) neural network stands out as the most commonly employed approach for forecasting energy production and power in photovoltaic systems. Three categories of methods are used in power forecasting for photovoltaic systems: statistical methods, physical methods, and methods using artificial intelligence [
19,
20]. Ehsan, Simon, and Venkateswaran proposed a multi-layer perceptron-based artificial neural network (ANN) model for power generation prediction [
21]. AlShafeey and Csáki’s work analyzed ANN and MR PV power forecasting performance over structural, time series, and hybrid input data methods [
22]. The high relative variability of irradiance conditions makes network learning less reliable [
23]. The article “One day ahead forecasting of energy generation in photovoltaic systems” presents the influence of selected weather factors on the accuracy of forecasts and the results of a study of the influence of the model structure (in the form of an MLP neural network) on the forecast accuracy [
24]. It should also be taken into account that the accuracy of forecasts largely depends on the selection of explanatory data [
25].
Many types of neural networks are used in forecasting, e.g., radial basis function (RBF) neural networks [
19] or recurrent neural networks (RNNs) [
26]. In addition, the support vector machine (SVM) algorithm [
19,
27], linear regression [
28], or probabilistic models [
29] are used in forecasting. The use of fuzzy logic in PV energy prognosis also has a strong rationale, as evidenced by publications [
30]. Hybrid methods involve the fusion of multiple distinct techniques, strategically combined to leverage the strengths of each approach and overcome the limitations of individual models. By integrating diverse models with unique features, these methods aim to amplify the forecast performance significantly. The synergy achieved through this blending process enables more accurate and robust predictions, empowering decision-makers in various fields to make well-informed choices based on reliable forecasts [
31,
32]. The research shows that it should not be expected that a method for predicting photovoltaic power can obtain the same results regardless of the meteorological conditions at the location where it is applied [
33,
34]. Forecasts for the next 24 h are used in energy market transactions. Even small improvements in their quality translate into greater system security and savings for the economy [
35]. Recently, algorithms based on deep learning such as long short-term memory (LSTM) [
36] or convolutional neural networks [
37] have also been used for energy forecasting over different time horizons.
The main objectives of the research are as follows:
Development and comparison of forecasting models using MLP and Elman networks for monocrystalline and amorphous panels;
Development of year-round, semi-annual, and seasonal models and their comparison;
Comparison of the accuracy of forecasting models for forecasted and measured solar irradiance;
Algorithm for the selection of weather factors to obtain the best forecasting models;
Development of a complex global forecasting model for a photovoltaic system with simultaneous DC and AC energy forecasting.
The remainder of this article is organized as follows:
Section 2 describes the dataset and methods.
Section 3 presents neural networks in electricity production forecasting and experimental results.
Section 4 contains a discussion.
Section 5 describes complex forecasting models for photovoltaic systems.
Section 6 includes comparisons with the state of the art.
Section 7 presents limitations.
Section 8 provides conclusions drawn from the study.
2. Data and Methods
2.1. Acquisition of a Dataset for Network Learning
The dataset for the produced energy came from two photovoltaic systems installed at the Rzeszów University of Technology. The initial setup comprised three monocrystalline modules, collectively covering an area of 2.16 m2 and boasting a power capacity of 330 Wp. These modules were seamlessly linked to an inverter. Skillfully mounted on a sturdy frame, they maintained a fixed inclination of 30° relative to the horizon. The second installation consisted of modules made of amorphous silicon and the same model of inverter. The measurement system included voltage, current, and power measurements. Solar irradiance was measured using a Kipp & Zonnen CMP21 pyranometer. All parameters were meticulously measured at 10 s intervals and skillfully averaged to obtain precise 1 min values. The daily DC and AC energy production and insolation with respect to 1 m2 of module area were then calculated from these. The measurements were carried out between 1 November 2013 and 31 October 2014. As AC energy production is influenced by additional factors depending on the design of the plant itself, such as the type of inverter used, DC energy was chosen as the predictor variable to represent the output of the neural networks.
Historical weather data for the aforementioned time period were downloaded using the Visual Crossing weather API, resulting in the following set of daily parameters:
2.2. Comparison of Correlation
To thoroughly examine the impact of weather data on the forecasting models’ accuracy, a meticulous factor-by-factor analysis was conducted, specifically focusing on their influence on DC power production. For this purpose, a linear correlation was calculated. The analysis was carried out separately for monocrystalline and amorphous modules.
Table 1 shows the calculated linear correlations between individual weather parameters and DC power production by monocrystalline and amorphous modules.
The correlation values for both the monocrystalline and amorphous panels of the individual weather factors did not differ significantly. The highest correlation was between the energy produced and the insolation directly measured at the photovoltaic installation. However, this parameter should be considered historically. Weather parameters obtained from weather stations using API had lower correlations.
Strong positive correlations were obtained for the parameters: the solar irradiance, maximum temperature, mean temperature, and visibility. Strong negative correlations were obtained for the parameters determining the humidity and cloud cover. Weak positive correlations were detected for the dew point and atmospheric pressure, while weak negative correlations were found for the parameters’ precipitation time, wind speed, and precipitation amount. The influence of the predicted solar irradiance is shown in
Figure 1, for the monocrystalline and amorphous panels. The influence of the measured direct solar irradiance on the DC energy of the monocrystalline and amorphous panels is shown in
Figure 2.
The amount of energy production generated from the amorphous panels was almost half that of the monocrystalline panels. The characteristics of the amorphous panels in the form of the correlation of individual weather factors or insolation with respect to the amount of energy generated were similar to such characteristics in the monocrystalline panels, but these were not differences in just the scale of energy production. Although they were similar, they were slightly different, and these differences can be observed by comparing the correlation graphs in
Figure 1 and
Figure 2.
Models for the monocrystalline and amorphous photovoltaic modules were developed separately because monocrystalline and amorphous modules have different energy characteristics.
3. Neural Network Learning for Electricity Production Forecasting
This stage involves teaching the year-round, half-yearly (October–March and April–September), and seasonal (winter, spring, summer, and autumn) models. For this purpose, datasets were created, divided according to the above ranges. These data were loaded and then randomly divided into a learning set (85% of the data) and a testing set (15%). The test data should be representative, so it was checked that the average of the test data did not deviate significantly from the average of the teaching data (by more than 10%). This condition was met. The total dataset contained 362 records (362 two days of the entire year). The split between the learning and testing data was as follows: annual model, teaching/testing data, 308/54 days, respectively; semi-annual models, data, 154/27 days; and seasonal models, data, 78/14 days.
The learning and testing data were normalized to the range [0,1] according to Equation (1):
where
x is the dataset, min is the smallest value from the set
x, and max is the largest value from the set
x.
MLP and Elman-type networks with two hidden layers were used for the study. The number of neurons in each layer was selected by wide simulation. The selection of weather factors and the selection of neurons in the two hidden layers were carried out in three loops of the algorithm for the four basic weather factors with the highest correlation values (i.e., the maximum temperature, humidity, cloud cover, and predicted solar irradiance). The algorithm for determining the optimal structure of each model was as follows:
Add four base weather factor to current weather factors;
For each weather_factor in available_weather_factors;
Add new weather factor to the current weather factors
For num_neurons = 6 to 30:
Set the number of neurons in the first hidden layer to num_neurons_1;
For num_neurons = 2 to number_of_neurons_in_first_hidden_layer;
Set the number of neurons in the second hidden layer to num_neurons_2;
Train the model with the current weather factors as and set number of neurons;
Save the trained model;
If the conditions are not fulfilled go to Step 2;
If the conditions are fulfilled go to Step 8;
Load all the saved models;
Among all models choose the best model;
The algorithm for determining the optimal architecture of each model is also shown in Algorithm 1 as pseudo-code.
Algorithm 1. Pseudo-code for determining the optimal architecture of models |
L01: | CWF [1–4] ← basic weather factors | Add maximum temperature, humidity, cloud cover and solar irradiance; CWF—array of current weather factors |
L02: | For n = 5, 6, ..., N do L03–L07 | Loop for adding new weather factorN—number of available weather factors |
L03: | CWF[n] ← new weather factor | Adding new weather factor |
L04: | For i = 6, 7, ..., 30 do L05 | Loop for increasing neurons in the first hidden layer |
L05: | For j = 2, 3, …, i do L06–L07 | Loop for increasing neurons in the second hidden layer |
L06: | Training of the neural network | Learning of the neural network |
L07: | Save trained network | Saving trained model (neural network) |
L08: | Among all saved models choose the best model | Choosing the best model |
For MLP networks, the Broyden–Fletcher–Goldfarb–Shanno (BFGS) learning algorithm was adopted [
38], whereas for Elman networks, the resilient backpropagation (RPROP) algorithm [
38] was utilized. In both cases, the objective function to be minimized was the sum squared error (SSE).
The predictive models were designed using the NeuroLab library, which contains many neural network algorithms in Python.
The simulations were performed on the learning and test data, and its correctness was then verified by the mean absolute percentage error and mean absolute error.
The mean absolute percentage error (
MAPE) is given by the formula [
23]
The mean absolute error (
MEA) is given by [
23]
where
n is the size of the dataset,
di is the actual value of the predicted variable, and
yi is the predicted value.
3.1. MLP Networks
A feed-forward network MLP consists of neurons arranged in layers with a single direction of signal flow and inter-layer connections only between successive layers. The input signals are fed into the input layer of neurons, whose outputs are the source signals for the next layer. The signal of the output layer depends on the network’s matrix of weights, offsets, activation function, and vector of output signals. A feed-forward two-layers MLP neural network is described in
Figure 3:
In the output layer of the network, the output of the
j-th neuron is defined by Equation (4) [
38]:
where
xi(
t) is the input to the
i-th neuron,
yj(
t) is the output of the
j-th neuron,
wki(1) and
wjk(2) are the weights in the individual layers,
bk(1) and
bj(2) are the biases of neurons in successive layers, and
t is the input data sample.
3.2. Elman Networks
The Elman network is a partially recurrent network. It has a similar structure to that of the MLP network. The difference in its structure is the existence of an additional context layer. This layer draws a signal from the outputs of the individual neurons of the first hidden layer. This signal is then stored and is used as an additional input by the neurons in the first hidden layer to form the entire input signal together with the inputs of the network. It thus has feedback between the first hidden layer and the input layer (
Figure 4).
Elman networks, also referred to as simple recurrent networks (SRN), are a class of neural networks known for their ability to capture temporal dependencies in sequential data. They consist of a single-layer architecture with n inputs and m hidden layer neurons. Each hidden layer neuron is equipped with a corresponding delay context layer node, allowing the network to maintain a memory of past inputs and update its internal state during the learning process.
In the Elman network, part of the signals in the input vector come from the feedback feeding the output layer signals to the input of the network. This vector can be written as [
39]
In the time step
t, the computation of the output vector can be achieved using the following equations:
The complete input weight matrix expresses the relationship between the input layer, the hidden layer, and the context layer:
The output of the complete input vector
x(
t) is mathematically expressed as [
39]
where
x is—the input vector,
h is—the hidden layer vector,
y is the output vector,
Wh,
i is the external input weight matrix,
Wh,
c is the context weight matrix,
Wo,
h is the output weight matrix, and
f is the activation function.
The learning process consists in the implementation of a learning algorithm that modifies weights in all neurons of the neural network, in such a way as to properly map the input data into the output data. When implementing the learning process, it is important to find a global minimum that guarantees the best fit of the network parameters to the task being solved, avoiding the pitfalls of local minima.
3.3. Monocrystalline Silicon Panels
The learning process was documented by plotting the SSE error values at each epoch and by plotting the comparison of the actual DC power production data on consecutive days from the learning and test sets with those predicted by the network, after the learning process.
Figure 5 shows the course of the SSE error during the network learning process—the year-round MLP model for the monocrystalline panels. The amount of daily energy produced and forecasted for the learning data (year-round model) is shown in
Figure 6. The PV energy for the testing data (year-round MLP model) is shown in
Figure 7. The results of learning of the summer model using the Elman network are shown in
Figure 8,
Figure 9 and
Figure 10.
The architecture of all models (MLP and Elman networks), the best models, is noted in
Table 2. An example network structure written as “model name”, MLP: 7-10-5-1 means that the model used seven inputs (seven learning factors), it had 10 neurons in the first hidden layer and 5 neurons in the second hidden layer, and one was the number of outputs of the network.
Table 2 also indicates which weather factors were used (as the symbol “×”).
Table 3 shows the
MAPEs of models predicting the daily DC power production by monocrystalline panels for the predicted solar irradiance, and the
MAPEs are shown in
Table 4.
The
MAPEs in
Table 3 for the learner and test data differ by less or significantly less than 10 percent, which means that the division of the dataset into a learner and a test set was correct. The
MAPEs for the different types of periods varied significantly, which was entirely reasonable given the climate and geographic location of the PV system. The MAEs shown in
Table 4 are proportional to the magnitudes of the
MAPEs and also to the maximum energy generated in each season. Thus, the
MAEs for the winter model are smaller than those for the summer model, despite the fact that the
MAPEs in the summer model were significantly smaller than those in the winter model. The reason for this was that the summer model operated on the maximum values of the energy produced, while in the winter model, the energy quantities were typically 10 times smaller than those in the summer model.
The best prediction models obtained (the architecture, number of neurons, and set of weather factors) for the silicon monocrystalline panels were subjected to a re-learning process replacing the predicted values of solar irradiance with values directly measured at the PV installation. The
MAPEs of models predicting the daily DC power production by monocrystalline panels using directly measured solar irradiance are shown in
Table 5, and the
MAEs are shown in
Table 6.
The
MAPEs in
Table 5 for the learning and test data differ by less than 10 percent in both the MLP and Elman models, which means the correct optimization of the parameters of the neural models. The
MAPE values (with one exception) were less than 10 percent, and for different types of periods they varied significantly, which was perfectly reasonable. The only one deviating from the mean was the winter Elman model, in which the
MAPEs were larger than 10 percent. Such dissimilarity may have been caused by inconsistent initial values of the model’s parameters.
The
MAEs in
Table 6 have relatively small values in comparison with the maximum value of energy production, which is 730 (Wh/m
2). The values of the MAEs in the MLP and Elman models were similar to each other for the respective (periods) models.
Learning and testing times for predictive models for monocrystalline panels are given in
Table 7. In the case of predictive models developed for amorphous panels, learning and testing times were similar to those for monocrystalline panels.
The measured times for learning and testing predictive models refer to calculations performed on a computer with a 64-bit operating system, an Intel(R) Core(TM) i7-4702MQ processor, a CPU @2.20 GHz, and the number of CPU cores being four.
The learning time of the MLP network was quite short and in the worst case was less than 11 (s). The learning time for models built on the Elman network was usually 2–3 times longer than that for models built on the MLP network. The longest learning time (about 29 (s)) occurred in the year-round model. The learning times of the individual models were usually proportional to the number of neurons in the hidden layers. There were some anomalies here, such as significantly longer learning times for the spring MLP model compared with the summer or autumn models. This was due to the characteristics of the neural network learning algorithm used. The testing times were short, ranging from 18 (ms) to 107 (ms) in both types of models.
3.4. Amorphous Silicon Panels
The architecture of all models (MLP and Elman networks), the best models obtained for amorphous PV panels, is noted in
Table 8.
The learning results of the best models obtained for predicted solar irradiance are given in
Table 9. The
MAEs of the forecasting models for the amorphous panels in the case of predicted solar irradiance are shown in
Table 10.
In the amorphous panel models, the
MAPE values (see
Table 9) were similar to those of the monocrystalline panel models. The
MAPE values of the MLP models were in the range of 6.123% to 14.85%, while those of the Elman models were in the range of 7.018% to 14.25%. Thus, the error values of both types of neural models were close to each other. No major anomalies were noted in the results obtained, both for the test and the learning data.
The
MAE values of model predictions for amorphous panels in
Table 10 were about twice as low as such errors for the monocrystalline panels. The
MAE values for the learning and test data did not usually differ from each other by more than 10–15%. However, in the April–September and spring Elman models, the
MAEs for the learning and test data differed from each other by more than 20 percent. The smallest values were found in the autumn MLP model, and the largest were found in Elman’s April–September model.
Models with the same architecture were learned by swapping only one of the input parameters: the predicted solar irradiance taken from the weather API, with the solar irradiance measured directly. The
MAPE values of predictions for such models are shown in
Table 11, and the
MAEs are shown in
Table 12.
The
MAPEs of model predictions for amorphous panels in the case of direct measurement of solar irradiance shown in
Table 11 do not show anomalies. They were quite low in models for warm months (spring, summer, and April–September) in both types of MLP and Elman models and slightly larger for cold months. The smallest
MAPE values were found in the spring MLP (3.505−2.867%) and April–September Elman (3.413−3.078%) models. Only in the winter Elman model were the
MAPEs greater than 10%.
The
MAE prediction errors in the case of direct measured solar irradiance as shown in
Table 12 have small values in all models. The differences between the
MAE values for the learning and test sets are small, indicating the correct tuning of model parameters in the learning process and the correct division of the data into a learning set and a test set. The smallest MAE values occurred in the spring MLP (2.38–2.49 (Wh/m
2)) and winter MLP (2.84–2.90 (Wh/m
2)) models.
An in-depth analysis of the obtained results will be presented in Chapter 4, Discussion.
4. Discussion
The results obtained and their comparison showed that there were significant differences in forecast quality between the models. The smallest errors were achieved for models forecasting energy in the summer and spring months, while the largest errors were achieved in the winter and autumn months. The large percentage errors of the autumn and winter models were mainly due to the small values of the energy produced by the panels during this period. A small absolute difference between the predicted energy production and the actual energy production can result in a significant percentage error. In such cases, a problem arises regarding the issue of acquiring weather data directly affecting the photovoltaic panels. Data from weather stations can only approximate these values.
By replacing the models’ predicted solar irradiance in the learning process with values from their direct measurements at the PV site, the MAPEs were significantly reduced in all types of models. Most errors dropped to values below 10%, with the exception of only one model (winter Elman). This proved the great role of acquiring accurate weather values affecting the PV plant in the forecasting process. However, we could not use these models in the application, as we were not able to forecast future direct insolation values. Neural models forecasting energy generated by the amorphous panels also showed significant differences in the forecast accuracy between models. The smallest forecast errors were found in models forecasting energy in the summer months, while the largest errors were found for energy forecasts in the winter months.
Figure 11 shows a comparison of the
MAPEs calculated for the test set of all the models created (MLP and Elman networks), which were developed as part of the study using forecast solar irradiance.
Figure 12 shows the
MAPE forecast errors of all models obtained using directly measured irradiance.
Comparing the prediction errors in
Figure 11, it can be observed that half of the models performed better (smaller errors) for monocrystalline panels, and the other half performed better for amorphous panels. In all types of models learned using directly measured solar irradiance, the forecast errors were significantly reduced. Most errors fell to values below 10%, the exception being again only one model (winter Elman), for which the forecast error is about 11–13%. The smallest error values were achieved for models designed for summer forecasts, where forecast errors were around 2–3%. The highest error values occurred in the model for forecasts in the winter months and year-round (including winter months).
Comparing the prediction errors in
Figure 12, it can be noted that the vast majority of models performed better (smaller errors) for the monocrystalline panels than for the amorphous panels. Only in two cases was the opposite true. The model using the MLP networks slightly more accurately predicted energy than the Elman-type model for monocrystalline panels. The situation was different for amorphous panels, where the Elman-type networks were slightly more accurate in their predictions than the MLP networks.
The MAEs allowed direct estimation of the energy prediction errors of the individual models in each period. While the MAPE percentage errors of the monocrystalline and amorphous panels were similar in the respective models, the MAEs of the models for the amorphous panels were much lower than in the monocrystalline panel models. The reason for the smaller the MAE errors of amorphous panels is their lower energy efficiency, as amorphous panels generated almost twice as little energy per unit area than monocrystalline panels.
The MAEs were characterized by a large scatter across forecast periods. The smallest value of the MAE energy forecast error occurred in the autumn (MLP) model, an error of 3.61 (Wh/m2), for the monocrystalline panels. In the case of the amorphous panels, the smallest DC energy forecast error, equal to 2.49 (Wh/m2), was generated by the spring (MLP) model.
5. Complex Forecasting Models for Photovoltaic System
Modeling complex systems presents significant challenges as traditional mathematical methods often struggle to capture their intricacies. To tackle this, a common approach involves decomposing the complex system into simpler objects. These individual components can then be modeled independently using various methods, without considering their interconnectedness within the complex system. In contrast to local modeling, global modeling takes into account the entire system and aims to determine parameters for a single model that are optimal for the system as a whole. While this approach may not be individually optimal for each element, it provides a more comprehensive representation of the system’s behavior [
40,
41]. This distinctive characteristic of global modeling allows for the development of a more accurate representation of the complex system compared with the decomposition method. In conclusion, the adoption of neural networks for global modeling offers a promising avenue to overcome the challenges of modeling complex systems, resulting in more robust and comprehensive representations of their behavior than traditional decomposition methods [
42]. We can consider the photovoltaic system shown in
Figure 13 as a complex system.
The first part of the system generates DC energy (EDC), depending on the value of solar irradiance and weather conditions. The second part of the system (i.e., the inverter) converts DC energy into AC energy (EAC), which can be considered as the output of the whole system. Such a system can be modeled in two ways by a neural network as a system for forecasting both DC and AC energy simultaneously.
The simple model refers to the indivisible components of a photovoltaic system. The simple model is the basic component of the complex model. In our case, i.e., in the complex forecasting model, there was a cascade connection of two simple models. The first simple model was the PV panel model, and the second simple model was the inverter model, which was a nonlinear object. In our research, the simple models were neural networks (MLPs).
So, using MLP neural networks, a global model was built (see
Figure 14), consisting of two simple models connected in cascade. The task of the global model was to predict the DC and AC energy production simultaneously. To determine the optimal parameters of the global model, a special learning algorithm was necessary to use. This algorithm made it possible to determine the optimal parameters of the global model, while optimizing the parameters of simple models to some extent.
Furthermore, the developed global model could be seamlessly converted into a more intricate complex local model, comprising a combination of two distinct local models. The parameters of these local models were independently determined using conventional MLP neural network learning methods.
The output
of the first simple model is mathematically defined as
The output
is an input to the second simple model. The formula that describes the output
of the second simple model is
where
u(1) is the input of a complex system and model,
w(1) is the weights of the first models,
w(2) is the weights of the second simple models, and
f1 and
f2 are the activation functions of particular models.
The formulation of the global quality criterion hinges upon the divergence observed between the outputs of the
r-th simple model
and the outputs of the
r-th simple systems
; in the case where
r = 2, it is
where
K is the sample count,
y(r) is the output of the
r-th simple system, and
βr is a weighting factor taking values between 0 and 1 (in this work accepted
β1 =
β2 = 0.5).
The effective determination of the global model parameters involved minimizing the global quality criterion (13). The forecasting models were developed in two variants: one for year-round predictions and another specifically tailored for seasonal summer forecasts. The process of selecting the optimal structure of the forecasting model was conducted by analyzing the number of weather factors included in the neural network’s input. Additionally, preliminary simulations with varying numbers of hidden layers were performed to arrive at the most suitable model architecture. The global models had the following network structure: year-round model 8-9-3-1-5-3-1 (eight weather factors as inputs, nine neurons in the first hidden layer, three neurons in the second hidden layer, one neuron in third hidden layer, five neurons in the fourth hidden layer, three neurons in fifth hidden layer, and one neuron in the sixth layer (the output layer) (see
Figure 14); the summer model was 8-7-3-1-5-3-1. Hidden layers 1, 2, 4, and 5 used hyperbolic tangents as the activation function, and in layers 3 and 6 the activation function was linear. The local type models were created by dividing the global model into two parts, according to
Figure 14. The global and local type models were learned with
Complex Rprop [
43] and
Rprop [
38] algorithms, according to the model type. The number of learning and testing data in the complex models was identical in the models in
Section 4. The complex models were simulated in the Matlab language and environment, due to the
Complex Rprop algorithm.
The
MAPE values of the predictions for the complex models are shown in
Table 13, and the
MAEs are shown in
Table 14.
Table 15 shows the learning and testing time for complex models.
The
MAPEs of the forecasts in the (global and local) seasonal (summer) models were smaller than those in the year-round models, as in the simple models (see
Table 5 and
Table 13). The
MAPEs of the DC energy forecasts were smaller in the local models. The AC energy (output energy) forecast errors were smaller in the global models than in the local models. The obtained results supported the thesis that global models can achieve more precise predictions of the final energy of the system than using local models, which more accurately model the individual parts of the complex system.
In complex models of the local type, the
MAPEs of the DC energy forecasts were similar to the models described in
Section 4. In the global type models, the
MAPEs of the DC energy in the year-round model were lower than those in the corresponding model in
Section 4, but in the summer model they were slightly higher than in the corresponding model (see
Table 5). The
MAPEs of the AC energy were lower than the error models in [
24] as well as being smaller than the
MAPEs of the DC energy in the complex models.
The smallest values of MAE energy forecast errors occurred in the year-round global model; the error of EDC was 6.54 (Wh/m2), and EAC was 5.95 (Wh/m2).
6. Comparison with the State of the Art
To evaluate the performance of the proposed approach, we used the MAPE metrics, which are used often for assessing the quality of predictive models. The MAPE metric allows an objective assessment of the quality of models predicting both the size of the PV system’s output and the velocity of the produced energy. Models developed for a year-round or nearly year-round dataset, forecasting with a horizon of one day ahead (in fact, 24 h ahead), were selected for the comparison.
Dolara et al. [
31], for the day ahead forecasting activity of the power production by photovoltaic plants, proposed a new hybrid method called the physical hybridized artificial neural network (PHANN), which combined an artificial neural network (ANN) with an analytical physical model: the Clear Sky solar Radiation Model (CSRM). Additionally, they compared the new hybrid method with a standard ANN method. Regarding the prediction of hourly production with respect to 24 h, a weighted mean absolute error (
WMAE%), which has a similar meaning to the
MAPE metric, was used as one of the metrics to evaluate the quality of the models in predicting one day ahead of the generated power. The installed capacity of the PV system was 264 (kWp). The learning set contained 120 days, and the test set contained 30 days.
Theocharides et al. [
44] presented a unified methodology for hourly averaged day-ahead photovoltaic power forecasts, based on data-driven machine learning techniques and statistical post-processing. The proposed forecasting methodology framework comprised a data quality stage, data-driven power output artificial neural networks, a weather clustering assessment (K-means clustering), and post-processing output optimization (linear regressive correction method). The installed capacity of the PV system was 1.175 (kWp), with five poly-crystalline silicon PV modules. An optimal year-round ANN model was developed for predicting the system power one day ahead. The
MAPE metric was used to assess the quality of the model.
Li et al. [
45] evaluated and compared two common methods, artificial neural networks (ANNs) and support vector regression (SVR), for predicting the energy production from a solar photovoltaic (PV) system 24 h ahead. A hierarchical approach was proposed based on the machine learning algorithms. The accuracies of the models were determined using metrics as mean absolute error (
MAE), root mean square error (RMSE), and mean percentage error (MPE). The forecasting models were developed for a 6 MW peak solar power plant. Year-round models have been developed to forecast the amount of DC energy generated by the PV system.
Table 16 shows the
MAPE values of our MLP-type models for monocrystalline panels and selected modeling methods of forecasting models by other authors, for models forecasting one day ahead.
The results obtained were very satisfactory, if we took into account the results of other authors. The MLP models developed on the basis of measured insolation were somewhat more accurate than models of other authors or methods. Moreover, the quality of the MLP models developed on the basis of predicted insolation was comparable to that of models by other authors and even surpassed the two other methods (studies). It should be borne in mind that when comparing the results presented in
Table 16, their values were influenced by different locations of PV systems, different power output of the systems, 24 h vs. all-day approaches, the power vs. energy forecast, and many other differences.
7. Limitations
Neural networks, often need a large amount of data for effective generalization and accurate prediction. Collecting quality, comprehensive, and representative training data can be a challenge, especially for local-level forecasting. In addition, neural networks can have difficulty generalizing effectively to new weather conditions or unexpected events, such as sudden cloud cover or extreme weather changes. This limited generalization ability can affect the reliability of short-term forecasts. Models using neural networks can be prone to over-fitting, which can lead to inaccurate forecasts. A problem in neural models is estimating the forecast uncertainty. For energy forecasting, estimating the uncertainty is important for decision-making and risk assessment, but this is difficult to achieve with standard neural network architectures.
Another limitation is that finding the optimal set of hyperparameters (learning speed, network architecture, and others) can be time-consuming and require many experiments. A certain limitation is the quality and availability of data. The accuracy of neural network-based forecasts strongly depends on the quality and availability of data, such as measurements of solar radiation, temperature, or historical energy production. Missing or inaccurate data can lead to suboptimal forecasts. Models using neural networks can be sensitive to changes in the distribution of input data. Small changes in the input data, such as changes in the locations of sensors or measuring devices, can affect model performance.
8. Conclusions
As part of the research work, the authors performed an analysis of monocrystalline and amorphous panel energy production data and weather data, calculating the correlations between weather factors and energy produced. A list of explanatory factors was developed. Multiple neural network learning processes were carried out with appropriately prepared input data, and the selection of the type and structure of the network and the learning parameters was performed using the simulation method. Twenty-eight forecasting models were built, which could be divided according to the forecasting period (year-round, semi-annual, and seasonal), according to the type of network used (MLP or Elman) and according to the type of photovoltaic modules whose energy production was forecast (monocrystalline or amorphous). The accuracy of the model predictions for the amorphous panels was similar to the accuracy of the model predictions for the monocrystalline panels. The forecast errors for the models developed with the actual insolation forecast were compared, which tells the story of the real conditions with the models developed on the basis of the direct measured solar irradiance (historical values). Due to the very high correlation of insolation with energy production, models with measures of insolation generated “historical forecasts” with a small error. However, models with predicted insolation could be practical models because they generated “real” energy forecasts but with a slightly larger error.
The smallest values of DC energy forecast errors were achieved for the models (MLP) designed for summer forecasts. The percentage forecast errors were 1.95% using directly measured solar irradiance and 5.57% using predicted solar irradiance. The complex model for summer forecasted the AC energy with an error of 1.86%. The MAPE of the DC energy forecast in the year-round model (MLP) was 3.42% (using directly measured solar irradiance) for monocrystalline panels and 12.5% using the predicted solar irradiance for amorphous panels. The MAPEs of DC and AC energy predictions in the year-round global complex model were 3.067% and 3.186%, respectively (for the case of monocrystalline panels, test data, directly measured solar irradiance).
The obtained results of the forecast errors showed that their magnitude depended more on the accuracy of forecasts of the weather conditions than on the type of forecasting model used or the type of PV panels. In order to obtain such, it was first necessary to provide accurate forecasts of weather conditions. The photovoltaic system is a fairly simple system, but advantages can be seen in its modeling by the global model in forecasting tasks. Thus, the usefulness of global modeling is well justified.
Research on forecasting the energy output of PV panels is critical for optimizing renewable energy utilization, integrating solar power into existing grids, reducing costs, and making informed decisions in the energy sector. It plays a key role in advancing sustainable energy practices and transitioning to a cleaner, more resilient energy future.
The next stage of the research is to integrate the developed energy prediction models of PV systems into a model of a small smart grid, where research on optimizing the use of energy from renewable sources will be conducted.