In a grid-connected photovoltaic system, forecasting is a necessary and critical step. Solar Power is very nonlinear; this article develops and analyses building integrated photovoltaic (BIPV) forecasting algorithms for different timeframes, such as an hour, a day, and a week ahead, to manage grid operation effectively. However, a model built for a certain time scale may improve performance at that time scale but cannot be utilized to make predictions at other time scales. Here, we demonstrate how to use the multitask learning algorithm to create a multitime scale model for solar BIPV forecasting. Effective resource distribution across several tasks is shown. The suggested multitask learning approach is implemented using LSTM neural networks and evaluated over a range of horizons. We employed a modified version of the Chicken Swarm Optimizer (CSO) that takes the best features of the CSO and the GWO algorithms and merges them into one efficient approach to estimate the hyperparameters of the proposed LSTM model. The proposed approach consistently outperformed state-of-the-art single-timescale forecasting algorithms across all time scales.

1. Introduction

As the world’s population and economy expand, so does the world’s need for Power, driving up global energy consumption. Meanwhile, as fossil fuels become scarcer and carbon emission regulations become more stringent, the development of renewable power production methods is critical [1]. Solar energy may be converted into electricity using the Photovoltaic Effect (PV), one of the emerging technologies harnessing solar energy. The performance prediction of the renewable energy system varies concerning the environmental parameters [2]. There are various methods employed to predict the output power of the PV system, like numerical and Artificial intelligence. The ecological parameters are predicted using the numerical weather prediction (NWP), sky images, geographical location, solar radiation incidence angle, and the photovoltaic Power’s conversion efficiency. The obtaining of NWP is relative and it takes a long time to gather the data; hence this type of prediction is mainly used for the ultrashort-term [35]. Nowadays the machine learning (ML) algorithm plays a vital role in the prediction of the renewable energy system. Regression, exponential smoothing, physical, artificial neural network (ANN), and support vector machine (SVM) are some of the methodologies used for renewable energy forecasts [68]. Time series data is adopted for many studies for short-term power prediction. However, the results of the ML are reported as not satisfactory. The satellite and sky images can be utilized to predict the performance of the ultrashort time. It is advantageous to apply ANN’s nonlinear processing abilities, which have produced excellent results and are extensively used [9]. The persistence and statistical methods are not suitable for the nonlinear data. ANN [10] and ANFIS [11] approaches have local minima, complicated structures, and overfitting issues. There are limitations on the ML algorithm to overcome that many researchers adopt the deep learning (DL) algorithm [12].

The DL algorithm has recently been used to estimate the PV system’s performance. Predicting PV power over many periods is made possible by a new hybrid technique that incorporates both the wavelet transform and deep convolutional neural network models [13, 14]. The proposed method creates the model using just photovoltaic power data, without considering other elements influencing the Power as input to the forecasting model. It is difficult to work with incomplete data sets when using this method since it depends on the full PV data series breakdown. An additional example [15] demonstrates how the deep learning strategy, based on long short-term memory (LSTM) networks, can anticipate the behavior of solar irradiance using data from weather forecasts made one day in advance. Physical theory and direct forecasting may be used to develop an indirect model connecting irradiance and PV power. However, many calculating formulas and complex methods are needed, and the accuracy of weather forecast data has a major influence on the prediction results of PV power. Moreover, problems in predicting solar irradiance will result directly from errors in hourly day-ahead weather prediction variables made by meteorological service organizations.

An LSTM time series prediction model with an evolutionary focus on focus is proposed in reference [16]. Time series characteristics may be given weights in the attention mechanism based on discrete time intervals by the traditional LSTM method’s attention dispersion. LSTM forecasting, which is based only on outcomes, can only recover so much information. A VAE-based LSTM model has shown a lower testing RMSE value of 5.471 for short-term PV power output prediction utilizing multiple data sets than earlier machine learning techniques [17]. An algorithm based on an LSTM network is described [18] to anticipate power production the day ahead using data from local meteorological organizations. Outperforming BPNN, LR, and persistence methods by 18.34%, the testing data spanned half a year.

The proposed method also boasts a 42.9% RMSE skill advantage over other approaches on a one-year testing data set. DL has been used to forecast PV power generation on a daily and weekly basis by G Narvaez et al. According to the results, the proposed technique is 38% more effective than other approaches that rely on local adaption phenomena.

In reference. [19, 20], a deep learning model for PV power forecasting a day in advance is provided using a recurrent neural network (RNN) as the hidden layer. This model operates within the framework of partial daily pattern prediction (PDPP). One drawback of this method is that its prediction model is based on weather types that are not comparable, so although it may temporarily validate the influence of 1-step ahead, it cannot be used to generate forecasts for longer horizons. The focus of this method is on the various external elements that might affect the PV array’s output, rather than on the relevance of feature selection. If there is too much redundancy in the data or if the variables are constrained too tightly, the model will be of limited benefit. A few wrinkles remain in the present methods of predicting. The solar power time series is neither fixed, dynamic, nor periodic, therefore, traditional artificial intelligence systems cannot assess it. The second, existing input-output prediction patterns are only explored from a statistical analysis perspective, ignoring the influence of other linked components, or they need very high-quality data from numerous related variables, limiting their practical usefulness [21, 22].

The photovoltaic time series exhibits complicated nonlinearity between univariate time steps and key factors over a variety of prediction horizons. To overcome these obstacles and provide precise day-ahead hourly PV power forecasts, this research proposes the following technique: current studies have shown that LSTM is proficient at extracting temporal characteristics, and that attention processes are useful for avoiding distractions. To enhance the accuracy of our forecasts, we created a model based on a combination of long- and short-term temporal neural network predictions. As a means to enhance the model’s feature selection, the hybrid algorithm is used.

2. Theoretical Background

2.1. LSTM Deep Learning Model

Recurrent neural networks are learning mechanisms that use activation functions applied to inputs and prior network states to calculate new states in a recursive manner (RNNs). The RNN stands for its unique ability to approximate nonlinear dynamics by making significant mappings from input to output sequences. It differs from conventional feedforward neural networks with its feedback memory units where the previous history of network output is stored to perform effective decision-making. The RNN is trained with the input data to create the anticipated result using gradient-based techniques throughout the process of prediction. The algorithm’s cost function aims to minimize the MSE of the network’s performance by reducing the error between the original and predicted samples.

The typical RNN vanishing gradient issue is solved by the LSTM architecture, a recurrent neural network. There are switches to coordinate when to read, write, and store data in the gates throughout the training process, which helps keep data flowing smoothly. The input, output, and forget gates work together to preserve signal flow across the many levels of the deep LSTM architecture shown in Figure 1.

where is output of single LSTM shell.

2.2. Chicken Swarm Optimization (CSO) Algorithm

The hierarchical behaviour of chicks inspires swarm optimization, and the result is the Chicken Swarm Optimization Method. Many chickens and chicks are found in every group in this algorithm; the rooster is the only one in every group. The swarm’s fitness value determines that the hierarchy of the swarms is established. When it comes to learning, the chickens use their prior experiences rather than experimentation. When communicating with the rest of the flock, the hens make unique noises, with the dominant hen standing close to the rooster while the submissive chickens stay further away. They demand a fight if any other members of the group cross their territory, and they have been known to take food from other groups’ boundaries. Chickens’ positions will be determined by their mother’s place in the flock.

2.3. Grey Wolf Optimizer (GWO) Algorithm

To frame the algorithm, the Grey Wolf Optimizer was designed based on wolf hunting behavior, hierarchy, and social hunting. There are four levels of authority in a wolf pack: pioneer wolves, alpha wolves, omega wolves, and subordinate wolves. The alpha wolf is the most powerful wolf in the pack and controls the rest. The alpha wolf’s next-in-command, the beta wolf, will assist the alpha in making decisions and organizing the gathering. To round out this group is a group of wolves known as omega wolves, considered the group’s most vulnerable members. They are often not allowed to feed or be overpowered by the other dominant members. The only wolves who do not fit into either of the different hierarchies are the delta wolves, which the omega wolves mostly rule. For social hunting, the whole community is very well coordinated. The prey encircling process may be mathematically stated as follows [2325]:

3. Materials and Method

3.1. Dataset Description

The experimental results of the BIPV system are used for this study is taken from the reference [2628]. The site is located in the semiarid climatic condition of the south Indian part, located in the Tamilnadu in the geographical coordinates of 9.1727°N, 77.8715°E. The grid-connected BIPV system experimental results are adopted for the prediction of the output power of the system. The methodology adopted in the study is presented in Figure 2. In this, the dataset is preprocessed, and outliers are removed. The various parameter features are optimized, such as solar radiation, ambient temperature, and wind velocity are selected. The datasets are further classified as the testing data and training data. The entire data is segregated into 75% training and 25% testing data, as presented in Figure 3. During training, we use five-fold cross-validation to ensure that our results are reliable. Each of the three data stores—hourly, daily, and weekly—is divided into five distinct categories. When training, four folds are used, but when testing, just one is used. Each training fold is used to teach a single unit, while the testing folds—hourly, daily, and weekly—are run independently. During the training phase, each group is prepared to deal with the absence of data via the more traditional mechanism of resource sharing. Model output is a linear combination of all LSTM components.

3.2. Methodology
3.2.1. Proposed Forecasting Method

It is possible to use single-stage forecasting for a specific period, but it cannot be used for multitime-scale prediction. Moreover, sharing multiple time scale data is valid on an excellent forecasting resource. These are the main reasons why a new technique for performing multitime scale anticipating models is offered. BIPV forecasting models are designed to predict BIPV Power production across a range of time scales using the available data. Since data used for short-term forecasting cannot be used for long-term forecasting, each task’s duration depends on the availability of irradiance data. It is conceivable to meet several forecasting needs in this chapter using the hourly irradiance data; however, this cannot be done in a single-stage model due to the lack of data. The hourly irradiance data used in this study was used to make two forecast assignments, one for each hour and one for each day, as shown in Figure 4.

4. Results and Discussion

The proposed Deep learning LSTM prediction model receives its input data after being modified using min-max normalisation. This simulation is performed in MATLAB R2021b on a 2.27 GHz Intel Core 2 Duo with 2 GB of RAM. In order to provide real-time experimental data for the experimental validation, the output power of the building’s integrated photovoltaic system is monitored over the course of a year. Conditions are determined by the sun’s height, ambient air temperature, and wind speed. Global irradiance on the inclined plane (array plane) (W/m2) is used to represent the assumed values. The proposed musicale wind speed forecasting has enhanced resource sharing capabilities and can predict wind speeds across three different time scales (hourly, daily, and weekly). A deep learning LSTM model is offered as the predictor, and its network parameters, such as the weight and bias coefficients, are optimised with the help of the proposed hybrid CWO-GWO optimization procedure. When the MSE between observed and predicted values in the fitness function converges to 10-5, the model is said to have reached convergence. The data set is comprised of hourly, daily, and weekly records. The model’s output layer is made up of a linear combination of the projected data from each LSTM unit using a softmax activation function, after the development of three LSTM models and the training of three distinct dataset repositories. Through trial and error guided by the thumb rule, we find that 4, 3, and 5 hidden layers are optimal for each LSTM layer after 25 iterations. The model is validated at each stage of the training and testing processes to ensure accuracy. There will always be the same amount of hidden levels, and hence hidden neurons. This model does not suffer from the difficulties of overfitting or underfitting.

By analyzing the model’s reaction to training on an hourly dataset and then applying the model to daily and weekly predictions, we can verify that the suggested model is effective. In Figures 57, we see how the hourly, daily, and weekly forecasts compare to the actual data set. In addition, displays the results of contrasting the model’s performance when used for predicting on a single time scale with that when used for multiple time scales. If you want hourly, daily, or weekly forecasts, for example, you’ll need to train your model on data acquired at those respective frequencies.

4.1. CSO Algorithm

Optimization of the LSTM’s model parameters by the CSO method is shown in (Figures 57). The classic LSTM model performs worse on the CSO-LSTM metric. In multitime scale forecasting, the MSE value for CSO-hourly LSTM is 3% lower than that for traditional LSTM. When compared to the standard LSTM, this one performs 13 percentage points higher on MAPE and 4 percentage points better on DA. CSO-LSTM outperforms the DA by 12%, MAPE by 19%, and DA by 24% when used to hourly time scale forecasting. The proposed CSO-LSTM has improved day-ahead forecasting by 7% in MSE, 8% in MAPE, and 11% in DA. The MSE, MAPE, and DA for predicting at the individual time scale are currently 9.75%, 21%, and 24.2%, respectively. Multitime scale forecasts with MAPE and DA of 13% and 26%, respectively, improve the MSE for weekly solar radiation projections. There was a 34% increase in MSE scores, a 22% increase in MAPE scores, and a 12% increase in DA ratings.

4.2. GWO Algorithm

(Figures 57) shows how the GWO optimization strategy improved the LSTM model’s MSE, MAPE, and DA from the standard LSTM model for multiscale hourly forecasting by 25%, 34%, and 15.5%, respectively. Individual estimates of MSE, MAPE, and DA ranged from 32% to 9% to 5%. The MSE, MAPE, and DA all improved by more than 25% each day after including multitime scale forecasting. On a specific timeline, it constitutes 20.8% of DA, 21.2% of MAPE, and 29.3% of MSE. Compared to the classic model, the MSE for weekly time scale forecasting is 14.37 percent better, the MAPE is 30.79 percent, and the DA is 29.89 percent. Specifically, 33.2% of MSE, 13.2% of MAPE, and 0% of DA may be attributed to improved performance on the individual time scale.

4.3. Hybrid CSO-GWO Algorithm

(Figures 57) shows a considerable increase in performance metrics when the CSO and GWO LSTM models are combined. The multiscale model predicted 22% higher MSE, 33% better MAPE, and 30% better DA for hourly time scale forecasting. Individual forecasting had similar results, with an improved MSE of 37.7%, improved MAPE of 8%, and an improved DA of 14%. MSE: 40 improved MSE, 33.6% MAPE and 39.4% DA compared to traditional LSTM for daily forecasting. It has been shown that weekly forecasting improves metrics for individual forecasting by 37% better MSE, 26% better MAPE, and 29% better DAF than monthly forecasting. For predicting on a weekly time frame, the MSE is 26% better than typical LSTM, while the MAPE and DA are both higher by 16% and 47%, respectively. It improves upon the typical LSTM model for predicting at specific time scales by 39.71% in MSE, 26.1% in MAPE, and 23% in DA. After training the model on an hourly dataset, we verify its performance by looking at its response for daily and weekly prediction. Figures 57 show the mapping between the actual dataset and the anticipated results at the hourly, daily, and weekly levels. Table 1 also contrasts the model’s performance under the proposed multitime scale forecasting with the model’s performance under the assessment for individual time scale forecasting. In tests conducted on the ITSF training dataset, the suggested multitime scale model proved to be superior to traditional single-time-scale forecasting methods. It also demonstrated the potential for a significant improvement in the accuracy of predictions over many time scales when a training dataset is used. Compared to the LSTM approach and the LSTM model altered by the CSO and GWO independently, the performance of the recommended hybrid CSO-GWO based LSTM model has been better.

and are both quite close to 1, which indicates high levels of explainability. After that, we can see whether our suggested model is statistically enough for predicting solar irradiance. Based on the statistical score acquired, it is evident that the presented suggested hybrid CSO-GWO-LSTM model is not impacted by the stochastic components of the algorithm, and it is deemed to be statistically fit, as shown in Table 2.

The suggested model used the existing data set to handle a number of different time-scale forecasting situations. Current traditional models in the body of literature are not suited for making long-term forecasts using just short-term data. No attempt at seasonally-aware forecasting has been done in this model. According to the suggested solar and wind speed forecasting study, further research is needed to improve the accuracy of predictions throughout several seasons.

5. Conclusion

Forecasting is an essential part of any grid-connected solar system. In this paper, we explore the complex nonlinear dynamics of solar power and provide a comprehensive analysis of the underlying mechanisms. For efficient grid management, it is necessary to develop BIPV forecasting algorithms for various horizons, such as the next hour, the next day, and the next week. But a model developed for a certain time scale can only be used to enhance performance at that time scale; it cannot be used to generate predictions at other time scales. In this example, we show how the multitask learning algorithm may be used to develop a multitime scale model for solar BIPV prediction. This demonstrates efficient resource allocation across several activities. To test the efficacy of the proposed multitask learning strategy, LSTM neural networks are used. To estimate the hyperparameters of the proposed LSTM model, we used an improved version of the Chicken Swarm Optimizer (CSO) that combines the best parts of the CSO and the GWO algorithms into a single, powerful method. Across all time scales, the suggested method beat the best existing single-timescale forecasting algorithms.

Data Availability

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare that there is no conflict of interest regarding the publication of this article.