Daily Prediction Model of Photovoltaic Power Generation Using a Hybrid Architecture of Recurrent Neural Networks and Shallow Neural Networks

. In recent years, photovoltaic energy has become one of the most implemented electricity generation options to help reduce environmental pollution su ﬀ ered by the planet. Accuracy in this photovoltaic energy forecasting is essential to increase the amount of renewable energy that can be introduced to existing electrical grid systems. The objective of this work is based on developing various computational models capable of making short-term forecasting about the generation of photovoltaic energy that is generated in a solar plant. For the implementation of these models, a hybrid architecture based on recurrent neural networks (RNN) with long short-term memory (LSTM) or gated recurrent units (GRU) structure, combined with shallow arti ﬁ cial neural networks (ANN) with multilayer perceptron (MLP) structure, is established. RNN models have a particular con ﬁ guration that makes them e ﬃ cient for processing ordered data in time series. The results of this work have been obtained through controlled experiments with di ﬀ erent con ﬁ gurations of its hyperparameters for hybrid RNN-ANN models. From these, the three models with the best performance are selected, and after a comparative analysis between them, the forecasting of photovoltaic energy production for the next few hours can be determined with a determination coe ﬃ cient of 0.97 and root mean square error (RMSE) of 0.17. It is concluded that the proposed and implemented models are functional and capable of predicting with a high level of accuracy the photovoltaic energy production of the solar plant, based on historical data on photovoltaic energy production.


Introduction
At present, the consequences of environmental pollution on our planet, generated by the different productive activities, show a scenery that affects various ecosystems, including human being. This is mainly due to the use of mineral coal and diesel for the generation of electricity, with the energy sector being the main emitter of carbon dioxide (CO 2 ) into the atmosphere [1]. To address this situation, optimization in the use of nonrenewable energy sources and greater use of natural resources in the electricity generation process are required. Photovoltaic technology has been one of the most used renewable energy solutions, which seeks to meet the demand for electricity while reducing the amount of CO 2 emissions into the atmosphere [2].
With the growing development of information technologies and the digital transformation of companies and organizations, large volumes of data are generated through the various activities carried out by humans. This brings with it a high demand for processing such data. Solar plants are not exempt from this situation: however, many of these solar plants do not reuse the data they generate, for example, in the implementation of a short-term forecasting system for electricity production or another application. A forecasting tool can support electricity operators in balancing electricity consumption and generation, and thus conserve or avoid wasting the electrical energy produced by the solar plant. This type of tool can also be used to anticipate and forecast cases of shortage, which in turn allows for ensuring that there is sufficient energy capacity to cover the requirements of electricity consumption.
Forecasting the production of photovoltaic energy is not an easy task since this production is largely dependent on weather factors, depending on where the solar plant installations are located. It has been shown that the climate as an external factor has a great influence on the behavior and operation of systems in the energy sector, specifically in the area of photovoltaic technology, so the use of environmental data has become a complement important for the analysis of electrical data. However, in addition to weather factors, it is necessary to consider internal factors of the elements that make up the photovoltaic modules, such as the battery panel and its own temperature and installation angle, among other factors [3].
There are several research works oriented to the task of photovoltaic energy forecasting; each of these investigations has its own particularities, which vary between its input variables, models used, and data set, among others. From the study of the research papers reviewed, it follows that the most used and promising techniques in photovoltaic energy forecasting are ANN, specifically those that constitute a RNN configuration. The RNNs have positioned themselves as the most used techniques in problems dealing with time series, where weather data are integrated [4].
Additionally, it was found in the research papers reviewed that even when hybrid models are used for the forecasting of photovoltaic energy, these are not sufficient and generally use a combination of a statistical approach with time series techniques such as regression along with machine learning techniques such as RNNs. In other cases, the combination of physical models with RNN models has been found directly. The gap that this work tries to cover is the predictive efficiency of RNN models with a hybrid structure of layers with deep neurons together with layers with superficial neurons, in addition, to test various metrics at the same time for the evaluation of the performance of these models.
In this context, the objective of this work is focused on obtaining ANN-based models for the forecasting of photovoltaic energy generation of a solar plant with a good level of accuracy. Several configurations of predictive models are implemented using historical records of photovoltaic energy production as input. For this, a base hybrid architecture is designed, which combines a first hidden layer with an LSTM or GRU structure and a second hidden layer with an MLP structure. Subsequently, these models are validated and subjected to various adjustments and controlled experiments to find those with greater forecast capacity.
The innovation and main contribution of the solution proposed in this work lies in the design and implementation of a hybrid architecture of deep RNNs, combined with superficial ANNs for the generation of forecast models. Given their generality, both for the configuration of their hyperparameters and of the models in general, they can be reused for various use cases, not only for the forecast of photovoltaic energy but for all types of predictive requirements, where they are used with ordered data in time series and the RNN technique.
Important differentiation factors of this work in relation to the existing ones are, on the one hand, the generation of different models considering only one variable as input to the model, which corresponds to the amount of energy active exported (EAE) generated by the solar plant, as well as the use of various configurations for hyperparameters of the model hybrid RNN-ANN, and a robust number of evaluation metrics to measure the performance of these models. And on the other hand, the volume of real data used for the generation, training, and validation of these models, which covers a full year with more than 100,000 EAE production records at one-hour intervals, was clearly one of the factors that contributed to the achievement of good forecast performance in the models obtained.
Another differentiating contribution is the flexible and simple computational tool, built to generate these forecast models based on the proposed hybrid architecture. In the implementation of this tool, the Python language, the Ten-sorFlow framework, and the Keras application programming interfaces (API) were used. The encapsulation and generalization of the hyperparameters required in the generation of the forecast models, as well as the data set that is used as input, allow the tool, for each model, to generate and store in separate files the graphs of the forecast, loss, and spread functions. In addition, it delivers the results obtained in all the metrics applied to measure the performance of the model.
The results obtained through the three models finally selected achieve the forecast of the weekly production of photovoltaic energy with good accuracy, of which the model with the best overall performance in all metrics is selected since it presents a RMSE of 0.1747, mean square error (MSE) of 0.0305, mean absolute error (MAE) of 0.0780, the correlation coefficient of 0.9867, and coefficient of determination of 0.9708. Even so, the three models have positive behavior and performance to make the forecasts.

Conceptual Framework
One of the main concepts considered in this research work corresponds to photovoltaic energy. This energy is the result of transforming solar radiation into electricity. The transformation process has a physical principle based on the photoelectric effect, also known as the photovoltaic effect. Solar energy seeks to take advantage of sunlight through a set of electrical, electronic, and mechanical components that are part of a photovoltaic system or installation to produce electrical energy [5].
Specifically, the photovoltaic effect occurs when a photovoltaic cell converts sunlight into electricity. Light is a type of electromagnetic radiation that is made up of particles called photons. When photons from sunlight hit the photovoltaic cell, they can be reflected, absorbed, or passed through. Only the absorbed photons are the ones that contribute to generating electricity since they transfer energy to the atoms. This energy causes the external electrons of the atoms to detach and become part of an orderly movement of these particles, which corresponds to the electric current [6]. 2 International Journal of Photoenergy Another important concept in this work is ANN, which are computational models inspired by the operation of a neural network in the human brain, where neurons are the basic unit of these models. Each neuron performs a specific function depending on the inputs it receives and the weights assigned to each one of them. These algorithms respond to a hierarchy, in which each layer of higher neurons learns and becomes more complex than the previous one. ANN models become more complex as the number of layers in their implementation increases.
Highly complex ANNs give way to what is currently known as deep learning. These types of models are qualified as supervised since they seek to forecast the behavior of an attribute according to prior learning based on a set of known data and are applied to both classification and regression problems [7]. Commonly, variable behavior forecasts in a given period are treated and represented by time series. It should be noted that a time series is defined as a collection of observations of a variable collected sequentially in time [8].
The RNN is among the most used ANN architectures to address the analysis of data arranged in time series. Unlike classic ANNs, RNNs process sequential data efficiently, taking previous outputs as inputs that allow them to process long sequences of data, element by element. An RNN has activation feedback that incorporates short-term memory. A state layer is updated not only with external input from the network but also with the activation of previous propagation [9].
The structure of an RNN is made up of repetitive loops that are found in the hidden layers, which give the network the memory capacity. Each hidden layer feeds back into itself a number of times before moving on to the next layer. The feedback obtained at each stage is modified by a set of weights to allow automatic adaptation of learning as a function of time [10].
A simple RNN (simple recurrent neural network, SRNN) is one of the architectures that are basically made up of a set of common ANNs connected in a recurrent manner. The output of one ANN is the input of the next, so each unit has two inputs and two outputs. Inputs are the current data and the state of the previous unit, while outputs are the forecasting and the current state that pass to the next unit [11]. These networks have the limitation of having a short-term memory because as the sequence becomes longer, the first elements of the said sequence have less weight. For this reason, different modifications have been made to this type of network in the search for long-term memory [10].
Due to the fact that SRNNs do not present a good treatment of long-term memory, new structures such as LSTM arise. This structure was developed in [12], and today it is one of the most popular in the RNN context. Each LSTM unit is made up of a combination of hidden units. SRNNs allow the implementation of gates that control a memory cell. Such cell provides the ability to retain information without modification for long periods, allowing it to build a longterm dependency.
Another remarkable architecture among RNNs corresponds to the GRU, which is inspired by the LSTM and was developed in 2014 [13]. Its purpose is to make each unit adaptively capture dependencies on different time scales. In the case of GRU, its cell is also based on gates that function as control units; however, it does not require a memory cell like LSTM. According to the GRU configuration, its output is based on a linear interpolation between the hidden state of the previous neuron and the current state. The results offered by the GRU architectures are similar to those produced by the LSTM, but with less memory requirement [14].
There is another architecture variant called bidirectional RNN (bidirectional recurrent neural networks, BiRNN), proposed in [15]. BiRNNs consist of adding hidden layers that process the information in the opposite direction to the conventional layer to treat the information in a more flexible way in which two layers of the network and their different directions stand out. Each input value targets two ANN units, one belonging to the layer moving forward and one belonging to the layer moving backward. With both outputs of each unit, the output of an instant is formed.
When implementing an RNN model, parameters that comprise the configuration of the model and on which its performance and accuracy depend must be considered. These parameters include the division of the data set for training and/or testing, the number of hidden layers and neurons, the activation function (linear or non-linear), the loss function, the optimizers, the batch size, and the number of epochs, among others. In addition, in order to measure the performance of techniques that use regression algorithms such as RNN, it is common to use statistical metrics such as RMSE, MSE, MAE, Mean Absolute Percentage Error (MAPE), and others somewhat more complex such as the Bayesian and Akaike information criteria [16].
The selection of the metrics to use is closely related to the type of problem being addressed. That is, the way to evaluate a model depends on whether its objective is oriented to a classification or forecasting task. The MSE is simple and useful when there are unexpected values since it is sensitive to these values, whereas the MAE is more convenient when outliers are expected. Furthermore, the MAPE is used when a weighted analysis of the MAE is desired, and when it is desired to work with a lower error rate, the RMSE, which corresponds to the square root of the MSE, is used. These metrics are calculated at each epoch of the model training stage; in this way, the learning behavior can be determined, and its level of accuracy can be evaluated when faced with new input values.
Another effective method to evaluate a model is to compare its output with the expected value, for data not used in training. For this, the Pearson correlation coefficient is used in the first instance. With this coefficient, the degree of the linear relationship between two quantitative and continuous variables can be measured. The correlation coefficient r is basically a dichotomous function, and in its equation, the numerator is represented by the covariance that exists between the outputs of the model and the real value of the variable, and the denominator is the product of the standard deviation of actual values and estimated values. The value of r can be in a range between -1 and 1, and the closer the value of r is to the extreme values, the greater the existing 3 International Journal of Photoenergy correlation. For cases where r < 0, the relationship between the variables is inverse.
The metric that is also used in this type of case is the coefficient of determination, which corresponds to the square of the correlation coefficient, so its values are in the interval between 0 and 1, and it is represented as r 2 . It should be noted that while the correlation coefficient measures the degree of association between variables, the determination coefficient measures the proportion of variation between these variables [16].

Related Works
There are several works related to the application of ANN models in the forecasting of photovoltaic energy, which present different variants of implementation. The work of AlKandari and Ahmad [3] raises the problem of making a forecast of photovoltaic energy generation from a set of weather variables such as solar radiation, temperature, and precipitation, along with wind speed and direction. They expose different algorithms and techniques to define the most suitable one for the forecast of solar energy. As a solution, the authors provide a way to assemble different algorithms based on ANN models and the results of designed experiments.
Sharma [17] describes a data analysis work for the purpose of forecasting energy values. It highlights the need for correct data preprocessing with different tasks in the first stage of the methodology that is developed. It proposes the delivery of long-, medium-, and short-term forecasts. Different types of ANN model implementations are presented as previous solutions to similar problems.
Yesilbudak et al. [18] describe an extensive bibliographic review of methodologies for data analysis processes in the generation of electricity for solar plants. They present the process of extracting knowledge from databases in a general way. This article shows a table with different investigations, which are referenced and indicate the input data used in each work as well as the model used in the forecasting stage; many of these researches are based on the ANN technique.
In the research of Harrou et al. [19], a model to forecast photovoltaic energy generation based on RNN is presented, specifically with LSTM. For this, they use previous records of photovoltaic energy production arranged in 24-hour segments. The authors expose the configuration of the model used as well as the performance during the training, where they obtained good results. In future work, they point out the incorporation of weather variables into the model in order to obtain better results.
In the work of De et al. [20], several models based on RNN with LSTM configuration are presented to forecast photovoltaic energy production with limited data sets, since they only have one month of data records taken at a frequency of 15 minutes. The authors justify each of the configurations of the models based on the different parameters of the ANNs. As a result, they present models that are capable of predicting the production of photovoltaic energy, which include meteorological and electrical variables as input.
Chen et al. [21] analyze the effects of different weather factors that affect the generation of photovoltaic energy as well as the degree of impact in different periods. In addition, and according to the characteristics of the radiation records, a simple method of radiation classification coordinates is proposed to select similar time series. Based on the characteristics of the time series in the photovoltaic power records, the data set of a similar period, including power output data and multivariate meteorological factors, is reconstructed as the training data set. Then, an RNN model with LSTM is applied as the proposed learning network, which is tested on two independent photovoltaic systems and achieves better results than four other comparison models.
Sharadga et al. [22] compare different forecasting models on time series for the forecasting of photovoltaic output power. Both statistical and artificial intelligence-based methods are included. The statistical models used belong to the category of persistence models, which include autoregressive moving average (ARMA), autoregressive integrated moving average (ARIMA), and seasonal autoregressive integrated moving average (SARIMA). In addition, they consider six different types of RNN models: bidirectional longshort-term memory (BiLSTM), LSTM, c-median fuzzy clustering, layer RNN, MLP, and forward RNN.
The work of Seera et al. [23] presents a methodology to analyze the performance of photovoltaic modules based on spectral irradiances using a genetic algorithm (GA). This is done considering that, despite having the same solar irradiation, the variation in the energy conversion efficiency of each photovoltaic module can be meaningful in different locations. As a case study, they selected twelve types of commercial photovoltaic modules and three locations in Malaysia. The proposed methodology simulates in-situ energy conversion efficiencies and annual energy yields for commercial photovoltaic modules, providing local spectral radiations and photovoltaic specifications.
Chong et al. [24] propose a methodology to calculate the energy conversion efficiency of organic photovoltaic cells based on indoor measurement with a solar simulator, the measured local solar spectrum, and using both optical and electrical factors. For this purpose, as a case study, they capture local solar spectra through the collection and accumulation of random data throughout the year from 08 : 00 a.m. to 18 : 00 p.m. in Malaysia. This analysis can provide guidance on the selection of appropriate organic materials for solar cells that may perform best in a particular location to optimize investment.
Zhao and Kok [25] combine a metaheuristic technique called the electrostatic discharge algorithm (ESDA) with an ANN to forecast the electrical energy output of a combined cycle energy plant using historical electrical production records. The performance of this hybrid ESDA-ANN model is compared with several conventionally trained ANNs to investigate its effect. By considering the influence of ambient temperature, exhaust vacuum, atmospheric pressure, and relative humidity, electrical energy is forecasted through a 4 × 9 × 1 network. Among conventional trainers, Levenberg-Marquardt emerged as the more promising. However, the proposed ESDA-ANN hybrid model 4 International Journal of Photoenergy outperformed this algorithm in both the training and testing phases. The article by An et al. [26] describes a probabilistic ensemble forecast model to improve the range of predictive accuracy during nonsteady periods of photovoltaic energy in a solar plant. This model combines the modules of data preprocessing, discrimination of nonstationary periods, feature extraction, deterministic forecasting, uncertainty forecasting, and optimization. In the deterministic point forecast module, a stacking LSTM-ANN model is used for point forecasts. In the uncertainty interval forecast module, a Bayesian neural network for probabilistic forecasts is introduced. In the optimization integration module, an optimization algorithm called nondominated classification genetic algorithm II is applied to integrate and optimize the results of the point and the probabilistic forecast. The proposed model is tested using two photovoltaic outputs and measured meteorological data from a grid-connected photovoltaic system. The results show that the proposed model outperforms conventional forecasting methods for predicting short-term photovoltaic energy production and associated uncertainties.
Mallal et al. in [27], explore an approach based on a temperature forecast for the realistic analysis of the performance of a photovoltaic system. Unlike the general methods, the change in module temperature due to the change in solar radiation has been considered to obtain realistic and accurate performance evaluation results under mismatch conditions. Module temperature is forecasted by a linear equation that accounts for the effects of ambient temperature, wind speed, and irradiance. An optimized technique for modeling photovoltaic panels has been implemented. This technique is applied to different configurations of photovoltaic panels for performance analysis, achieving better results with comparative works.
In the work of Jaber et al. [28], a forecast model is described to compare the performance of six different photovoltaic modules using ANNs, which corresponds to a generalized regression neural network (GRNN). As inputs to the model, the following were used: cell temperature, irradiance, fill factor, maximum power, short-circuit current (ISC), open-circuit voltage (VOC), and the product of these last two variables (VOC and ISC). 37144 records were collected for 247 curves, four of the six photovoltaic modules under different environmental test conditions in Malaysia (solar radiation and ambient temperature). Their results demonstrated a high accuracy of the model in forecasting the performance of the six photovoltaic modules.
Diouf et al. [29] analyze the operating temperature of photovoltaic modules as a critical factor that affects their performance. They propose relevant models for the forecast of this operating temperature using ambient temperature and solar irradiance data based on real measurements taken in a tropical region. For each climatic condition, categorized according to irradiance and temperature levels, the temperatures of the photovoltaic modules were obtained using the proposed approach that is compared with the corresponding value measured experimentally. The results show that the models they propose have better performance through the mean square error metric, being lower than other models developed by other authors for all weather conditions. The work of Bevilacqua et al. [30] analyzes the effect caused by solar radiation on the temperature of photovoltaic panels because only a part is converted directly into electricity and the rest is converted into heat that increases the temperature of the layers in the photovoltaic module. They propose a one-dimensional transient thermal model of photovoltaic modules, which calculates the temperature distribution throughout the thickness of the panel, for which a finite difference method was used, and with this, it is possible to forecast the production of electricity in operational climatic conditions. The results obtained highlighted that the temperature and forecast energy were not perfectly aligned, where a good accuracy in the temperature values did not necessarily correspond to the same level of accuracy in the output energy. The model was seasonally validated by comparison with one-year experimental data at the University of Calabria in Italy, and excellent agreement between forecasted and measured temperatures and energy outputs was demonstrated by statistical parameters.
Zhang et al. [31] investigate the influence of different factors that affect the forecast of photovoltaic energy. For this, they establish a conventional ANN forecast model and a small-wave ANN forecast model. They analyze the effects and correlations of atmospheric temperature, relative humidity, and wind speed on the energy generation forecast of polysilicon cells and amorphous silicon cells. The results of experiments show that atmospheric temperature has the strongest correlation with the energy output of polysilicon cells, followed by wind speed and finally relative humidity. Relative humidity has the strongest correlation with the power output of amorphous silicon batteries, followed by atmospheric temperature, and finally wind speed. They manage to determine that when the most relevant data is used as input for the forecast, the training error of the network is smaller and the execution time is faster.
A very novel and current work is proposed by Yan et. al [32], using advances in photovoltaic energy generation and fifth generation (5G) technologies, seek to reduce energy consumption based on accurate forecasts of photovoltaic energy requirements from connected 5G base stations. They claim that multiple 5G base stations can be connected to form a network based on the use of power routers, laying the basis for an internet of energy. In order to provide an effective strategy to reduce the power consumption and carbon emissions of 5G base stations, they propose a photovoltaic energy forecast model that combines an improved search algorithm with an extreme machine learning technique called ISSA-ELM for a 5G power routing base station. The advantage of this model is that it can access and manage various distributed power sources from 5G base stations through an energy router, which can adapt to varied weather conditions to improve their performance and provide administrators with more accurate reference data than other similar forecast models.
He et al. [33] propose a forecast model for photovoltaic energy generation based on an RNN model with a BiLSTM structure. Environmental factors that affect energy 5 International Journal of Photoenergy generation are selected through the Pearson coefficient and then the design and implementation of the proposed model are detailed. The model is then evaluated through a set of real data collected from a photovoltaic energy plant in China. The experimental results showed that the forecast error of the proposed model was low and its fit accuracy was better than models based on support vector regression (SVR), decision tree, random forest, and LSTM.
The research carried out by Zhang et al. in [34] addresses accurately predicting a load of wind energy and photovoltaic production for which they propose a hybrid method that combines the empirical wave transform to decompose wind energy and its load, together with the iForest technique and the C-mean fuzzy clustering algorithm for processing photovoltaic data. Each component of wind energy is forecasted by the enhanced random forest technique, which is also used to forecast photovoltaic energy. The experimental results of this work show that the proposed wind load and energy method has higher forecast accuracy and effectiveness. On the other hand, the volatility and randomness of photovoltaics are more apparent than those of charging. They use three different levels of evaluation indicators to evaluate the level of the forecast, from more aspects to accurately predicting load, wind, and photovoltaic. At the same time, the results of long-term indicators and key period indicators provide guidance for the safe operation and dispatch of the electrical network.
In the paper by Chen and Chang [35], a photovoltaic energy forecast method based on Pearson's coefficient is proposed to remove irrelevant features. They use an RNN with an LSTM structure to fit the photovoltaic energy forecast curve. The method uses Pearson's coefficients to analyze the influence of external conditions on the variation of photovoltaic energy, and the model is validated through test cases. Their results show that the intensity of solar radiation, temperature, and humidity influence factors play a decisive role in the variation of photovoltaic power. LSTM is compared with the algorithms of conventional ANN, a radial basis function, and time series ANN, showing the proposed method better performances.
Konstantinou et al. [36] evaluate a deep RNN for the forecast of photovoltaic energy production for 1.5 hours ahead, using historical production records of a Cyprus photovoltaic plant as input. Once the model was defined and trained, the performance of the model was evaluated qualitatively using graphical tools and quantitatively by calculating the root mean square error (RMSE) and applying the crossvalidation method. Their results showed that the proposed model can forecast well with a fairly good RMSE, but when applying cross-validation, the mean of the resulting RMSE values drops considerably.
Son and Jung in [37] explain multivariate numerical models that were generated by combining the weather variables of solar radiation, sunlight, humidity, temperature, cloud cover, and wind speed to develop an efficient energy management system. The performance of the models was compared by applying a modified version of the traditional RNN approach with an LSTM structure. His experimental results indicate six meteorological factors that influence the forecast of solar energy regardless of the season, and these are from greater to lesser importance: solar radiation, sunlight, wind speed, temperature, cloudiness, and humidity. Humidity. Models are scored on their adequacy to provide medium-and long-term solar energy forecasts, with the proposed modified LSTM demonstrating better performance than the traditional LSTM.
Cervera et al. [38] present a model that allows forecasting the energy generated in the photovoltaic installations of a solar plant up to 3 hours in advance using deep RNN in a Bayesian structure optimized by a genetic algorithm. It must be considered that each input of the forecast model is a time series, so it is necessary to analyze the seasonality and trend of each input variable. This model can be applied in different types of systems powered by photovoltaic energy; however, for the case study, it was applied to photovoltaic pumping systems where the high variability of solar irradiation and the high irrigation requirements of crops for food production require a precise calculation for the management of the system.
The work of Mukilan et al. [39] develop a forecast of the solar potential through photovoltaic panels from the roofs using the restricted Boltzmann machine as a machine learning method. The simulation results show that the proposed method achieves a higher rate of forecast accuracy than other compared methods.
The article by Niccolai et al. [40] analyzes the forecast accuracy of three hybrid models that integrate physical elements of the system with ANNs. The first model combines ANNs with the output of the five-parameter physical model of a photovoltaic module where the parameters are obtained from a data file. In the second model, the parameters are obtained from a matching procedure with historical data and an evolutionary algorithm called social network optimization. The third model uses clear-sky irradiance as input for the ANN. These three hybrid models are compared with two physical approaches and a simple forecast based on basic ANN. The results show that the application of hybrid models is very effective in achieving good forecast results.
The work of Hu et al. [41] proposes a model based on the adversary generative grid for point and probabilistic forecasts, which apply to the aging calendar of useful batteries in applications where energy is stored. The ability of this model to learn arbitrarily complex distributions has allowed it to approximate all possible joint distributions in an arbitrary way. The interesting thing about this proposal is that it combines physical aspects with the predictive treatment for a case study such as the aging of the battery calendar, since by considering the electrochemical knowledge as the guidelines to design the model, a satisfactory consistency is maintained between the knowledge and data, which significantly improves its forecast capacity.
Tianyu et al. in [42] propose the use of the indicator of gradient descent (IGD) to efficiently train the RNNs, which allows for differentiating the metrics and loss functions used. In addition, the BiLSTM structure is adopted to capture the periodicity of renewable energy generation (diurnal and seasonal patterns) and the residual technique to improve the training efficiency of this BiLSTM model. Finally, they 6 International Journal of Photoenergy develop a deep quantile forecast network based on IGD and deep residual BiLSTM for wind and solar quantile forecasting. Practical experiments in four cases demonstrate its effectiveness and efficiency, where this hybrid model has achieved the lowest average ratio deviations (below 1.7%) and the highest skill scores.
Research by Liu et al. [43] proposes an interpretable machine learning framework that can effectively forecast the manufacturing properties of a product. The case study they use is batteries, and they explain the dynamic effects as well as the interactions of manufacturing parameters. This could also be considered when generating hybrid forecast models, which include physical elements of batteries such as photovoltaic energy storage capacity, which can be forecast in relation to the generation of this energy. This interpretable machinelearning framework is easy for analysts to adopt without the need for specific knowledge of the battery manufacturing mechanism. The proposal considers a set of manufacturing data, particularly for coating, collected from a real battery manufacturing chain to evaluate this framework. The results demonstrate that three types of battery characteristics, including cell capacity, gravimetric capacity, and volumetric capacity, can be accurately predicted with r 2 over 0.98 at the early stage of manufacturing. The framework developed makes the data-driven model more interpretable and opens a promising avenue to quantify the interactions of physical parameters such as those for battery manufacturing and to explain how variations in these parameters affect their final properties for battery storage for photovoltaic energy.
Finally, Liu et al. [44] propose a classification framework based on the random forest technique to effectively quantify the importance of and correlations between battery manufacturing characteristics and their effects on the electrode property classification. For this, they use out-of-thebag forecasts, Gini changes, and a forecast measure of association. The manufacturing data contains three intermediate characteristics in the mixing stage and one parameter from the battery coating stage, which is analyzed by the classification framework. The experimental results of this work demonstrate that the proposed classification framework not only achieves a reliable classification of electrode properties but also leads to effective quantification of both the importance of manufacturing characteristics and correlations.
The literature review presented in this section allowed us to observe several aspects related to forecast models of photovoltaic energy production, the existing research gap in this area, determine the potential contribution of our study, and also establish the differentiation of the work. This study began by analyzing the literature review given in [18], which describes current trends in the use of methodologies and techniques used to generate predictive models.
From the previous research analyzed, it can be deduced that there is a large number of works that have developed forecasts of photovoltaic energy production ( [3,17,19]), many of which use RNN techniques with LSTM structure ( [20,21,33,36,37,38,42]). Although there are works that combine RNN techniques with statistical methods, such as ARMA, ARIMA, SAR-IMA, and Pearson's coefficients, among others ( [22,26,35]), in most cases, they do not use a large volume of data for model training and validation. In addition, few works were found that address this type of prediction through hybrid methods ( [34,40]).
All these predictive models are always applied accompanied by metrics to evaluate their performance. The most used metrics are MSE, MAE, MAPE, RMSE, Akaike information criterion (AIC), and Bayesian information criterion (BIC).
From the above, it is concluded that the research works found can be classified into three groups. First, those that use statistical approaches (regressions, Bayesian networks, time series with ARIMA, or ARMA). Second, those works that use machine learning techniques (ANN, RNN, SVM, and GA). Thirdly, those works that propose the use of hybrid approaches (statistical methods+machine learning +physical models).
Some investigations propose methodologies to analyze the performance of photovoltaic modules and the efficiency of energy conversion with organic photovoltaic cells ( [23,24]). In addition, works were found that combine metaheuristic techniques with machine learning techniques [25], seek to reduce energy consumption based on accurate forecasts of photovoltaic energy requirements using 5G technology [32], and develop forecasts of solar potential through rooftop photovoltaic panels using the constrained Boltzmann machine [39].
Additionally, research works dedicated to studying the effects of meteorological conditions on the internal components of photovoltaic modules were found, which can also affect the performance of forecast models of photovoltaic energy production ( [27][28][29][30][31]). In this same direction, other works point to physical aspects of the manufacture of batteries for photovoltaic energy storage, pointing out its importance to be considered in hybrid models and thus improving forecasting capabilities. A new topic with great potential is the use of interpretable machine learning tools that can benefit renewable energy generation forecasting ( [41,43,44]).
It follows that there are many factors that affect the generation of photovoltaic energy, which can be classified into two groups: external factors generally associated with the environment (environment and weather), and internal factors that are related to the composition of the photovoltaic modules and the solar plant.
Among the meteorological or external factors that fundamentally affect the generation of photovoltaic energy, the following can be considered: the intensity of solar radiation, ambient temperature, and relative humidity.
In the case of internal factors, specifically the photovoltaic modules or panels and the elements that compose them (silicon cells), they can be directly affected by the solar radiation they absorb, increasing the temperature inside the layers of these panels. Since not all radiation is converted into photovoltaic energy, it is important to take into account the quality of its components. Another internal factor to take into account is the type of batteries, the area they occupy, and the installation angle of the battery panel.
Both external and internal factors are strongly coupled to form a multivariate and nonlinear relationship that affects 7 International Journal of Photoenergy the power output of the photovoltaic cells and, therefore, can impact the forecast of photovoltaic energy production.
As a conclusion of this literature review, some weaknesses in the reviewed works and research gaps have been identified, which in turn become research gaps that this work can address, such as (i) In general, previous research uses RNN techniques that are trends or recommended by other authors, and few works explore the possibility of generating predictive models with hybrid methods. This clearly creates an interesting research gap to address (ii) Most of the works analyzed do not use a large volume of data in the process of generating predictive models (iii) Another research gap identified is related to the possibility of incorporating into the predictive models of photovoltaic energy production not only variables from historical records of EAE production and weather variables but also considering variables associated with physical aspects of the component's internals of photovoltaic panels, both due to their type and quality (silicon or organic), as well as the radiation that can affect these components. Another physical component to consider may be the state of the batteries, among other components (iv) If all the elements that affect photovoltaic energy generation are considered as inputs for the forecast models, the complexity of the model can increase and would allow to improve its forecast capacity From the weaknesses and research gaps detected in this literature review, the problem of generating accurate forecast models that use alternative and innovative models is identified.
This work mainly addresses the development and validation of a base hybrid architecture to generate predictive models of photovoltaic energy production by combining RNN of recurrent structures with ANN of shallow structures. In addition, it uses only one input variable (EAE) of historical records of one year of production at a solar plant, which represents a large volume of data which, in turn, allows to guarantee a good level of training and testing of the models. The latter is also a differentiating element compared to most of the research analyzed.

4.1.
Origin of the Data. The sample data set for this research work is provided by the company Solar Brothers SPA and corresponds to the Valle Solar Oeste photovoltaic plant, located 12 kilometers from the center of the city of Copiapó in the Atacama region of Chile. The data contains records for one year, from 2019 to 2020, approximately equivalent to more than 100,000 records.
The dimensions of the data are made up of the electrical variable EAE in KWh and the weather variables: temperature-compensated irradiation in W/m 2 , ambient temperature in°C, wind speed in km/h, and wind angle in degrees. These data are accompanied by a timeline made  The photovoltaic plant has meteorological stations within the perimeter of its facilities, and due to this, the data provided has several columns of the same variable. It covers an area of 30.2 hectares with an ideal maximum capacity of 11.5 megawatts (MW). Its photovoltaic modules correspond to a 325 W polycrystalline silicon plate, which has horizontal solar trackers on one axis. The solar plant comes into operation in February 2019, as can be seen in Figure 1, through air photography taken of its facilities, it contains a large network of photovoltaic modules.

Data Preparation.
As indicated above, the data comes from two generating sources, so it is important to point out that the frequency of records of electrical and weather variables is not the same. The measurement frequency of the EAE is per hour, while the rest of the weather variables come in measurements every 5 minutes and are separated into files that contain the information referring to each of the months of measurements.
In the raw data, the variables related to date and time come in two columns, which are replaced by one that gathers all the information in a single column. Within the weather variables to be manipulated, only solar radiation presents difficulties in the range of values. This occurs mainly when some pyranometers (solar radiation sensors) show negative values in the absence of solar radiation when they really should be zero. To solve this problem, all negative solar radiation records are replaced by the value zero.
In relation to the electrical variable, only the EAE is available which represents the daily electrical production measured in KWh. The records of this variable do not present missing values. A problem detected in the EAE records is outliers, particularly negative numbers, as shown in the graph in Figure 2, which is highlighted with a red circle. These negative numbers are not correct in a graph of this type, and it is inferred that the measurement instrument used to capture the record of this variable can cause this anomaly.
To solve this problem, the negative numbers are replaced by their absolute value, taking into account that at the points where these anomalies occur, their module agrees with the expected values of the measurement. These types of graphs were generated during the data preparation process as part of a preliminary exploratory analysis using the Python programming language.
Another problem found in the records of the EAE variable is the extreme values. To solve these cases, an analysis is performed to identify the threshold limit of the values. Considering that the maximum power obtained in the photovoltaic plant is around 9 MW, a threshold of 10 MW is established. As these cases are rare, the values that exceed 10 MW are replaced by the value referring to the first value belonging to the 0.99 quantiles of the records of the EAE variable. The graph in Figure 3 shows two cases of extreme values found in the data, both highlighted with a red ellipse.
The data preparation stage is carried out following the flowchart presented in Figure 4, a process that is implemented with the Python programming language. First, because the raw data is separated by months and in different files, this process is done by iterating each file.
Then, for each file, the preprocessing tasks corresponding to each variable, explained in the previous paragraphs, are carried out: unify date and time, set negative numbers of the radiation variable to zero, and correct negative numbers and extremes of the EAE variable. Once all of the above, the processed data is added to a single table that accumulates all the data of the work period, ordered chronologically.

Work Limitations.
This research work has limitations, on the one hand, having only one variable as input for the generation of forecast models, and that corresponds to EAE production data generated by the solar plant through its system of photovoltaic panels.
And on the other hand, do not include physical and internal aspects of the photovoltaic panels such as the state of these panels, their level of calibration, the capacity of the   International Journal of Photoenergy batteries used for storage and manufacturing characteristics, measurement noises, and shifting of sensors that can affect daily forecast performance, among other factors such as measurements of weather variables.

Base Architecture.
Since the objective of this work is to generate models to forecast the weekly production of EAE from historical records of this variable, at the beginning of this research, experiments were carried out with models based on an architecture of a hidden layer composed of recurrent neurons, obtaining satisfactory but improvable results.
In the search for better performance from these models, new experiments are carried out that compare two types of models. The first type of model maintains a hidden layer with recurrent neurons of the LSTM and GRU structures. To the second type of model, a second hidden layer with surface neurons of MLP structure is added, thus obtaining 4 models, 2 of them of the first type and 2 of the second type, the latter corresponding to hybrid RNN-RNA models.
For these experiments, 5,136 records of the total data set were used, of these 80% were used for training and 20% for validation. Each of these 4 models is configured with 100 epochs, batch size of 40, the first hidden layer with 60 neurons (LSTM or GRU structure), and for models of the second type, the second hidden layer with 30 neurons of MLP structure. The optimizer used in the models is the Adam and Huber loss function.   The performances of hybrid models of the second type are compared with those of trend RNN models for LSTM and GRU structures, which are used and recommended by several authors [9,10,12,[17][18][19][20][21][22] and which are based on RNN units. With a hidden layer and of the order of 200 neurons. Table 1 shows the results of the metrics applied to the 4 models, and it can be observed, in general, that the 2 preliminary hybrid models obtain a better performance in all the metrics applied.
(Corr. coeff.: correlation coefficient; Det. coeff.: determination coefficient) Furthermore, between the models of the first type based only on LSTM and GRU structures, there is no great difference in relation to the correlation and determination coefficients. However, in performance metrics (MSE, RMSE, and MAE), these models are outperformed by the proposed preliminary hybrid model, which contains LSTM structure neurons in the first layer and MLP structure neurons in the second layer.
Due to the above, it was decided to generate new models based on the hybrid architecture that combines deep RNN structures with superficial ANN structures, since it was possible to verify that they allow adjusting the RNN models and improving their performance. Figure 5 shows the graphical representation of this base architecture, which is composed of two hidden layers: the first layer is formed by neurons with LSTM or GRU structure, and the second layer formed by neurons with MLP structure.
In order to achieve a better performance of the hybrid RNN-ANN models, the hyperparameters must be adjusted based on their characteristics, for example, the number of neurons that make up the hidden layers, the number of batches, and the activation function, so that it is necessary to carry out exhaustive work in the search for the best combination of parameters.

Tool for Model Generation.
Because there are many combinations that can be achieved between the hyperparameters to generate RNN-ANN hybrid models, a tool is developed using the Python programming language, the TensorFlow framework, and the Keras API. This tool allows the modification of the hyperparameters in an agile and simple way, and in this way, to be able to generate models with a certain configuration. Figure 6 shows the general structure of the developed tool. It uses two files as input, the first with the data set prepared for the analysis and the second file with the values of the hyperparameters to generate the model. The tool applies

11
International Journal of Photoenergy the transformations and aggregations to the data, builds the model, and trains it, as well as validates it and evaluates its performance. As output, the tool provides, in separate files, the model with its resulting graphs (forecast, loss function, and dispersion), and the results of the metrics applied to measure its performance.
The hyperparameters that are considered for the configuration of the models are the size of the input series, output size, percentage of the division of the data set (for training and validation), type of recurrent cells, number of recurrent neurons (first hidden layer), number of conventional neurons (second hidden layer), data batch size, number of epochs, activation functions, loss function, learning rate, optimizer, and performance metrics.

Metrics for Model Assessment.
It is important to point out that the selection of metrics to evaluate the models is directly related to the type of problem, whether it is classification or regression. As this work seeks to perform regressions, the metrics used to measure the performance of the models can be the MAE and the MSE, which can also be used as a loss function.
The MSE metric is simple and useful when there are unexpected values since it is sensitive to these types of values. On the other hand, the MAE is more convenient when outliers are expected. In addition, the MAPE is also used when a weighted analysis of the MAE and the RMSE, which is nothing more than the square root of the MSE, is desired, particularly if it is desired to work with lower error rates. The metrics are calculated at each stage of the model training process, and in this way its learning behavior can be determined and the level of accuracy can be evaluated when faced with new input values.
Another effective method to evaluate a model is to compare its output with the expected value for data not used in training. For this, the Pearson correlation coefficient is used in the first instance. With this coefficient, the degree of the linear relationship between two quantitative and continuous variables can be measured. The correlation coefficient r is basically a fraction, where the numerator is represented by the covariance that exists between the outputs of the model and the real value of the variable, and the denominator is the product of the standard deviation of the actual values and the estimated values. The value of r can be in a range between -1 and 1. The closer the value of r is to the extreme values, the greater the existing correlation. For cases where r < 0, the relationship between the variables is inverse.
Finally, another metric that is also used to evaluate this type of regression model is the determination coefficient, which corresponds to the square of the correlation coefficient, so its values are in the interval between 0 and 1, and it is represented as r 2 . It should be noted that while the correlation coefficient measures the degree of association between variables, the determination coefficient measures the proportion of variation between these variables.

Exploratory Data Analysis.
Once the data preparation stage is finished, another exploratory analysis is carried out, this time to observe how these data behave and the variables are related over time, which substantially helps in the configuration of the models. For this, a set of graphs is generated that allows one to visualize and compare this behavior. As can be seen in Figure 7, the records of all the variables available for this work are graphically presented.
The similarity between the EAE and radiation (IRRAD) curves can be observed, validating the strong relationship between these variables. In addition, the temperature (TEMP) and wind speed (WS1) curves correspond to the  As a complement to the previous graph, it can be seen in the box and whisker diagram presented in Figure 8, where each box represents the production in KWh of the EAE in each hour of the day, that the highest production is achieved in the time slot between 11 : 00 and 16 : 00 hours of the day, precisely when there is more sunlight and possibly more radiation. The center line of each box in this plot represents the median of the values, while the borders represent the lower and upper quartiles. Points outside the whiskers represent outliers.
This diagram confirms the relationship that the higher the radiation, the higher the production of photovoltaic energy. During the hours of sunrise and sunset, the production of EAE presents a greater dispersion, which can present disturbances for the models that seek to forecast this variable.

Results and Discussion
Many features can be considered to obtain forecast models based on a hybrid RNN-ANN architecture. This research work seeks to obtain models to predict the production of photovoltaic energy from historical EAE records, with a good level of precision, for which the related works reviewed and described in Section 3 are taken as references, regarding the machine learning techniques used as well as the evaluation metrics to measure the performance of the models.

Model Configuration.
It should be considered that, as defined in the base architecture of this work, the models that are implemented contain recurrent or deep neurons (RNN) in the first hidden layer, and the second hidden layer is formed by superficial neurons (ANN).
The incidence of each of the hyperparameters necessary for the generation of RNN models is analyzed separately through different experiments in order to obtain an appropriate configuration that allows for achieving better the model's performance.
For example, the effect of the number of neurons in the models, for which simulations are carried out by changing only this hyperparameter. Table 2 shows the results of the metrics obtained in the tests, where the number of recurrent neurons varies between 50 and 200.
It can be seen that the results in the metrics are similar for all models. This shows that sometimes a high number of neurons does not affect the improvement of model results. Likewise, it can be observed that the best determination coefficient is presented by the model with 60 neurons, taking this as one of the ideal numbers for the case study.
A second example, since this work deals with the time series of the hyperparameter, the input series size becomes important. To define the appropriate input series size, tests are performed where the initial size of the input sequence is half a day, that is, 12 hours since each element of the series represents one hour of measurement. The rest of the tests are done by increasing the size of the input stream by 12 hours. Table 3 shows the results of these tests and indicates that the models with an input series size between 24 and 48 elements are the ones that obtain the best results in the metrics.
Similarly, tests are performed to properly determine the other hyperparameters, such as data set split, activation function, loss function, and optimizer.
To fulfill the objective of the research, sequences of EAE historical records are used to forecast the weekly production of photovoltaic energy in the solar plant. Taking into account the hyperparameters established in Table 4, for each of the experiments carried out, models that meet, in a balanced way, the best options for these hyperparameters are selected.
In this way, three models are obtained, as shown in Table 5. However, the selected model's results are better, where the base architecture is used by adding a second layer with MLP structure and conventional neurons. The second layer that is added to the basis of the architecture attempts to adjust the performance of the generated models.
Another aspect to consider is that, in relation to the results presented in Table 5, and with reference to the hyperparameters established in Table 4 for each analyzed model, it is observed that the number of recurrent neurons is correlated with obtaining better performance values in the evaluated   13 International Journal of Photoenergy metrics, that is, the higher the number of neurons, the better performance the models can achieve.
It can be seen in Figure 9 that for the three selected models, the behavior of the loss function is similar and after 20 epochs they begin to adjust, showing irregularities only in the testing process but maintaining a low loss (less than 0.03). However, in the last epochs, the model 3 has less performance loss than the other two models.
It is confirmed through the forecast graph shown in Figure 10 that model 3 (in red) has a better approximation to the real curve (in blue). If only the results of the metrics given in Table 3 are observed, model 2 is the one with the best performance in all these metrics, although with a slight difference with respect to model 3.
However, when analyzing the behavior of the models in their entirety and considering what is observed in the graphs of Figures 9 and 10, model 3 is the one that is projected to have the best predictive performance. Finally, the choice between one model and another depends on the priority you want to give to the hyperparameters.
6.2. Analysis of the Obtained Models. The models show accurate results and good performance evaluation metrics. These results use a sequence of the EAE variable to forecast the next element in the sequence and thus making a shortterm forecast with an hourly frequency presenting few errors and differences in some time intervals.
It is important to take into account that the forecast achieved with these models does not consider the variables and meteorological conditions, forecasts that may have errors when unexpected meteorological events are generated.
The forecast for each hour of the day can be added to analyze the daily forecast. In this way, the models obtained in this work have a high potential and a very precise forecast. Figure 11 shows the fortnightly forecasts of model 3 for a given period. It can be seen how the biweekly forecast of the RNN-ANN model is even more accurate than the weekly forecast, although they tend to always remain below the real curve.
Another complementary analysis of the results of this work corresponds to the dispersion obtained between the EAE production data forecast by model 3 and the actual data in the complete period. Figure 12 presents this dispersion graph, where a low dispersion can be observed in the center, with a slight dispersion at the ends.
Combining the analysis of the graphs in Figures 11 and  12, it can be deduced that the selected model 3 has great potential to forecast the production of EAE, considering the possibility of adding meteorological data as well as increasing the number of data records, both for the training and validation of these models.
It can be deduced from the results obtained through the different experiments carried out in this research work that increasing the volume of data, both for the training and validation of the models, allows to guarantee a substantial improvement in the performance of the forecast models.
In the preliminary experiments, several models were discarded until the three models finally selected were obtained, and it can be seen from Table 5 that these models have little difference in performance in the metrics applied.
Another aspect that would ensure better performance of these proposed models is to include additional variables in the input, such as weather measurements (temperature, radiation, relative humidity, etc.), characteristics of the photovoltaic panels and their components (silicon cells, type of panel, internal temperature, etc.), manufacturing characteristics of batteries for storing the energy generated (coating, capacity, etc.), and measurement and shift noises from sensors, among other variables.

Conclusions and Future Work
As indicated at the beginning of this article, photovoltaic energy is currently one of the most widely used renewable energy technologies to reduce polluting emissions. Therefore, developing advanced forecast models is one of the most efficient ways to accelerate the use of clean energy, meet the demand for electrical energy, and, at the same time, contribute to caring for the environment of our planet.
In this line of argument, the work seeks to contribute to the efficiency of renewable energies, particularly in the precision of the forecast of photovoltaic energy production in solar plants.
For this, in the first place, an exhaustive bibliographical study was carried out on research works that point to this dimension. As a result of this study, it was possible to determine the currently most used techniques and metrics for the generation of forecast models applied in the production of photovoltaic energy.
Three groups of techniques were identified: statistical approaches (regressions, Bayesian networks, and time series with ARIMA or ARMA), machine learning techniques (ANN, RNN, SVM, and AG), and hybrid approaches (statistical methods+machine learning+physical models).
Of all these techniques, the most used corresponds to the RNN, followed by the ANN. The RNNs stand out for their capabilities in efficient management for the processing of data ordered in time series.
Additionally, the tendency to generate hybrid models incorporating physical aspects related to the composition of photovoltaic modules is confirmed.
Regarding the metrics to evaluate the performance of these models, the most used are MSE, MAE, RMSE, MAPE, AIC, and BIC.
Secondly, considering the conclusions of the previous study, a hybrid RNN-ANN architecture is proposed and developed to generate forecast models with two hidden layers, which combine recurrent neurons with LSTM or GRU structure in the first layer and shallow neurons with MLP structure in the second layer.
For the implementation of this proposal, a computational tool is built using the Python programming language, the TensorFlow framework, and the Keras API, which executes the phases of data preparation, RNN-ANN hybrid architecture, generation, and validation of the models. The main characteristic of this tool is its simplicity and flexibility, which allow the encapsulation and generalization of the hyperparameters required in the generation of the forecast models.
The data set used for the training and validation of the models corresponds to records of one year of photovoltaic energy production with intervals of one hour and ordered in time series. The volume of real data used in this work also makes a big difference with respect to the works reviewed.
Third, different controlled experiments were carried out, which allowed generating a set of preliminary models that were adjusted until finding and selecting three models with the best performance in the applied metrics. These practical experiments have verified the superiority of the models gen-erated through the RNN-ANN hybrid architecture in terms of forecast performance over state-of-the-art models, as recommended in the literature and empirically compared in Table 5.
Summarizing the main findings and contributions of this work, these are the following: (i) Through the bibliographical study developed, it was possible to detect that there are no works that use RNNs that combine recurrent neurons with superficial neurons, generating a research gap in relation to hybrid models for forecasting. For this reason, the development and validation of the proposal of a hybrid RNN-ANN architecture opens an interesting line of research with potential for improvement in the generation of models with greater precision in their forecasts, mainly using data ordered in time series (ii) Another contribution of this research work is the development and availability of a tool that, given its generality both for data preparation and in the configuration of hyperparameters to generate models, can be reused in various use cases, not only to forecast the production of photovoltaic energy but for all types of predictive requirements, where they are used in time series (iii) Regarding the results obtained, the models generated under this RNN-ANN hybrid architecture are capable of predicting the production of photovoltaic energy from a solar plant for the next few hours using only historical production records. They do this with a high level of precision, as can be seen from the results in the metrics in Table 5 (iv) These forecast models are functional and have been validated using real data with different weather circumstances. Specifically, the selected model with the best performance is capable of forecasting the production of photovoltaic energy in the next few hours with a correlation coefficient of 0.98, coefficient of determination of 0.97, MSE of 0.03, MAE of 0.07, and RMSE of 0.17 (v) It can be deduced that the results of this work can be useful for solar plants and their electricity operators, since through the forecasts provided by the models, they can support efficient planning and thus achieve a balance between the capacity of generation and consumption of photovoltaic energy (vi) Finally, it is concluded that improving the accuracy of photovoltaic energy forecast models is essential to increase the amount of this type of energy and thus be able to contribute significantly to existing electrical systems As future work, it is considered to explore additional aspects that provide improvements to the forecast models of photovoltaic energy production, such as International Journal of Photoenergy