Specific feature engineering is performed for each block in the chain to generate new features for model training.
2.4.1. Calibration of
Calibration of the
data is crucial in obtaining more accurate predictions in solar power generation. The article [
9] highlights that the technique should focus on fitting the magnitude and offset of the NWP data using Equation (
1), where
is the calibrated forecast,
a and
b are constants to find, and
f is the original unadjusted forecast:
This process can be carried out using the MSE or MAE functions, thus improving the accuracy of global irradiance forecasts. It should be noted that for this process, optimizing by using RMSE or MSE is indistinct in that both functions already converge to the same minimum point, but the latter is used since it offers advantages in terms of the number of calculations to be carried out [
24]. From this point forward, we will refer to the optimized calibration with MAE and MSE as
and
, respectively. And the most accurate GHI forecast between the values
and its calibration (by MAE and MSE) will be called
.
2.4.3. Physical Transposition Models
Irradiance transposition is key in solar power prediction [
23] since it determines the solar irradiance that falls on the inclined surfaces of the panels or plane of array (POA). According to [
35], the model from [
36] is efficient for the transposition process, and although we do not have data to validate its accuracy, it is included due to its high performance in [
21]. By applying the transposition model, we obtain the components defined in Equation (
3) and for this investigation, this set of variables is called Ipoa. By convention, when these variables are derived from NWP, they are called
. Same for LMD and ‘Best’. If we use the subscript GTI, we will be referring to
:
where we have the following:
: Total irradiance on the plane of array.
: Direct normal irradiance component incident on the plane of the array.
: Diffuse irradiance component from the sky incident on the plane of the array.
: Diffuse irradiance component reflected from the ground incident on the plane of the array.
As there are no measurements in POA, the values will fulfill this function, and the sets and will be used as characteristics for training the chain model.
2.4.4. Model Architecture
Photovoltaic power prediction represents an intrinsic challenge that requires the conversion of various sequential variables into power forecasts. Due to the superior performance of the Transformer architecture [
22], and LSTM [
20], elements of this architecture have been incorporated as the basis for our proposal.
Based on the Transformer encoder from [
37], our model simplifies the conventional structure by removing the positional coding and adding a linear layer with the same number of neurons as the number of input features. The model was chosen for its simplicity and the promising preliminary results obtained at the beginning of the research. This adaptation seeks to maintain computational efficiency without sacrificing performance in photovoltaic forecasts. In our design, the Transformer block acts as an encoder or feature generator, see
Figure 3.
The yellow block represents the Linear Layer that processes input features. The purple block corresponds to the Attention mechanism, which focuses on the most relevant parts of the input sequence. The red blocks denote Layer Normalization (Layer Norm), stabilising the learning process by normalizing inputs. Finally, the green section represents the Feed Forward Network (FFN) with a ReLU activation function, providing non-linear transformations to the data.
The output is fed into a bidirectional LSTM connected to an attention layer and a two-layer feed-forward network, followed by a linear layer of four neurons; the architecture is represented in
Figure 4. The components of the model are colour-coded as follows: The blue block represents the Bi-LSTM layer, which processes the sequence in both temporal directions. The purple block represents the attention mechanism, highlighting the most relevant time steps. The green blocks indicate the feed-forward network with a ReLU activation, responsible for further transformation of the input data. Finally, the yellow blocks correspond to the output linear layer with ReLU activation, producing the forecasted power values.
This configuration is especially suitable for forecasting power production in the next hour and is fully illustrated in
Figure 5.
A crucial element in our proposal is the attention mechanism, which allows us to discern which parts of the input have the greatest relevance for the forecast. This mechanism is illustrated in
Figure 6.
2.4.5. Deep Chain Model
Our approach to deep chain models replaces each block in the physical chain with a Transformer Bi-LSTM model. Our proposed model works with the flow described by the following steps:
First, from the inputs of GHI, besides the exogenous variables related primarily to solar positioning, once data go through a statistical calibration, they pass through the first instance of the Transformer Bi-LSTM architecture that we call the (DGM). The output from that first instance is a more accurate GHI forecast value, and it is called . At the same time, we use from the inputs of GHI the LMD version of this quantity, . Thus, a concatenation between the data and besides the exogenous variables is performed, creating a new vector that we call . These exogenous variables are described in greater detail in the following paragraphs.
Then, , besides another variable like the exogenous variables -again-, passes through a decomposition model to obtain, from the GHI quantity, the best DHI values for forecasting. Now, we occupy a second instance of the Transformer Bi-LSTM model, which is used to learn the underlying physics of the decomposition process. This second instance is called the Deep Decomposition Model (DDC). At last, the result of the use of this second instance of the model is concatenated with the original data to form a new vector that we call . For future convenience, we define another new vector, called , as the concatenation between and .
To take into account the tilt angle of the solar panels, both global irradiance and diffuse irradiance from have to go through a transposition method. Once the transposition over those irradiances is complete, the result of this process is the Global Tilted Irradiance (GTI) calculated by the third instance from the Transformer Bi-LSTM architecture, which we call the Deep Transposition Model (DTM). Then, those values are concatenated with the . This new concatenation creates a new vector called .
Finally, using a concatenation between all the previous variables, and again beside the exogenous variables, and using a direct transformation method through a final instance from the Transformer Bi-LSTM architecture that we call the Deep Power Model (DPM), we perform the final power photovoltaic forecasting.
Figure 7 represents the proposed model. The green boxes denote the input models responsible for processing different irradiance and meteorological variables (GHI, DHI, GTI, Power). The orange boxes represent the concatenation of the previous hour’s measurements with the forecasted hour. The red boxes highlight the deep learning models that transform these inputs into more accurate predictions. The blue dashed lines represent the input-output framework, guiding the data through the stages and feeding the output from one model as input to the next.
Although there are more complex approaches in the literature, our objective is to evaluate the effectiveness of the proposed architecture in a simplified context. Each model is trained independently, and specific data from the photovoltaic plant are integrated to improve forecast accuracy, exploring two methodologies: one direct and the other based on the proposed chain model.
The quality of the predictive model largely depends on the preparation and selection of data variables. The
PVLIB library is used to extract active hours of solar irradiation, applying the Solar Position Algorithm (SPA) [
38]. Anomalies are detected and corrected by cubic spline interpolation. We define abnormal data as zero power values when GHI is greater than 15 W/m
2.
To structure the time series, key parameters are established: window size
timestamp is initially set somewhat arbitrarily, serving as a starting point to facilitate data handling. Forecast horizon
timestamp is chosen to align and compare with the methodologies used in the referenced papers [
21,
22]: number of input variables
, amount of input metadata
, and number of previous chain blocks
. It should be remembered that each timestamp is equivalent to 15 min, so considering 4 timestamps would correspond to one hour. These parameters are consolidated into the input vector with length
N given by Equation (
4) and illustrated in
Figure 8 and
Figure 9:
The green boxes represent the various inputs and exogenous variables used in the forecasting model, including Local Measurement Data (LMD), Metadata, Numerical Weather Prediction (NWP), and exogenous factors such as solar position. The blue boxes indicate the outputs of the model’s prediction results. The timeline marked from min to min shows the temporal framework, where data is used for both historical input and future prediction targets.
The selection of variables depends on their significance for forecasting the horizontal irradiance, the plane of the array, and the generation of photovoltaic power. We have chosen to incorporate the exogenous variables and across all proposed models, as they provide a comprehensive description of solar movement throughout the day. It is crucial to understand that the angle denotes the inclination between a point in the sky and the vertical over a specific location, while the angle is the measure between a point on the horizontal plane and a fixed reference, usually geographic North. These variables are obtained using the SPA algorithm. Additionally, metadata such as the inclination angle of the solar panel are included to improve the accuracy of the model.
Table 6 summarizes all these variables, which are tailored according to the specific segment of the prediction chain.
Stations 0, 1, 2, 3, 4, 5, and 8 are chosen for the formation and evaluation of the blocks of the model chain, as well as the calibration of the variable
. This selection is based on previous studies to facilitate comparisons with [
21,
22].
The measurements of each station are sorted chronologically. Three days are assigned for training, one for validation and one for testing, for each block of five days. This distribution guarantees a climatic balance in the evaluations and is consistent with previous studies [
22]. The final sizes of the datasets are 55,280, 18,216, and 18,206 for training, testing, and validation, respectively.
To evaluate the effectiveness of this methodological proposal, a set of metrics commonly adopted in research on photovoltaic power generation forecasts is used: these are specifically MAE, RMSE, and
. Finally, the implementation is performed on a system with an Intel i7, 16 GB of RAM and an NVIDIA GTX1660-TI GPU. Python (v3.10) and PyTorch (v2.0) [
39] are used as the framework with a batch size of 1000. The Adam optimizer is adopted with an initial learning rate of 0.01 and a learning rate scheduler that reduces it by a factor of 0.10 every 80 epochs. After 120 training epochs, satisfactory convergence is achieved without overfitting. The loss function L1Loss (MAE) is chosen, given its suitability for predictive tasks. The training takes approximately 10 min.