An Innovative Metaheuristic Strategy for Solar Energy Management Through a Neural Framework

Proper management of solar energy, as an effective renewable source, is of high importance toward sustainable energy harvesting. This paper offers a novel sophisticated method for predicting solar irradiance (SIr) from environmental conditions. To this end, an efficient metaheuristic technique, namely electromagnetic field optimization (EFO) is employed for optimizing a neural network. This algorithm quickly mines a publicly available dataset for nonlinearly tuning the network parameters. To suggest an optimal configuration, five influential parameters of the EFO (i.e., NPop, R_rate, Ps_rate, P_field, and N_field) are optimized by an extensive trial and error practice. Analyzing the results showed that the proposed model can learn the SIr pattern and predict it for unseen conditions with high accuracy. Furthermore, it provided about 10% and 16% higher accuracy compared to two benchmark optimizers, namely shuffled complex evolution and shuffled frog leaping algorithm. Hence, the EFO-supervised neural network can be a promising tool for the early prediction of SIr in practice. The findings of this research may shed light on the use of advanced intelligent models for efficient energy development.

They reported the superiority of the nftool as it could nicely predict the desired parameter for many locations.
Meenal and Selvakumar [98] studied and demonstrated the accuracy of a popular machine learning called support vector machine (SVM) for solar radiation modeling. This method, when implemented with an optimal dataset, outperformed the ANN and empirical approaches for this purpose. Mohammadi, et al. [99] performed a feature analysis using another well-known processor, namely adaptive neuro-fuzzy inference system (ANFIS) for global solar radiation modeling. Quej, et al. [100] compared the potential of ANN, SVM, and ANFIS for simulating daily solar radiation.
Concerning the respective average correlations of 0.652, 0.689, and 0.645 obtained for the best models, the SVM emerged as the most reliable predictor.
Metaheuristic algorithms have paved the way for more powerful forecasting models that are basically using the skeleton of conventional tools like ANN and ANFIS. These algorithms have been popularly used for renewable energy analysis [101] like wind energy [102], and more particularly, the SE-related simulations [103,104]. In such methodologies (i.e., metaheuristic-based hybrids) optimal parameters are provided for the basic predictive method to avoid issues like local minima [105].
Abedinia, et al. [106] designed a forecast engine based on a metaheuristic optimizer called shark smell optimization combined with ANN for approximating solar power. Due to the better performance of this model in comparison with conventional predictors like conventional ANN, RBFNN, GRNN, and their wavelet versions (normalized root mean square errors (RMSEs) around 11 vs. those above 14), they introduced it as a capable engine. Galván, et al. [107] benefitted from a multiobjective particle swarm optimization (PSO) technique for optimizing the intervals of the SE modeling. They built a non-linear method using ANN and their findings revealed the high applicability of the PSO optimizer for the mentioned objective. Likewise, Halabi, et al. [108] could effectively use this algorithm coupled with an ANFIS system for monthly solar radiation approximation. Vaisakh and Jayabarathi [109] suggested a hybrid of two methods, namely deer hunting optimization algorithm and grey wolf optimization for tuning the structure of various ANNs applied to SIr forecast. Their results showed a promising improvement attained by the proposed optimizer. Louzazni, et al. [110] showed the competency of firefly algorithm for analyzing the parameters of the photovoltaic system under different conditions. Compared to previously-used metaheuristic techniques, the firefly algorithm achieved reliable and valid results in tuning the photovoltaic parameters. The efficiency of the PSO and genetic algorithm for a similar objective was frog leaping algorithm (SFLA) are considered as benchmark methods to comparatively validate the efficiency of the EFO.

Data provision
For predicting the SIr, a publicly available dataset (provided by NASA and available on https://www.kaggle.com/dronio/SolarEnergy) is used in this work. Prior to this study, this data has been used for validating the performance of different developed models [116,117]. The SIr plays the role of the target parameter to be predicted with the inputs of temperature (T), barometric pressure (BP), humidity (H), wind direction (WD), and wind speed (WS).
The used dataset contains 32686 rows of meteorological records obtained from the HI-SEAS weather station. With around 5 minutes intervals, the records belong to the time between 23:55:26 29 September 2016 to 00:00:02 1 December 2016. Figure 2 shows the variation of the SIr over one day (29 September 2016 taken as an instance). As expected, peak values are observed the midday. Moreover, Figure 3 depicts the relationship between the SIr and each input factor in the form of scatter charts for the whole data.   In artificial intelligence implementation, it is well-established that machines use a part (the majority) of instances for learning the existing input-target pattern. They then apply this pattern to the remaining instances for evaluating the prediction ability. For this study, the dataset (i.e., 32686 instances) is randomly divided into two groups with 26149 and 6537 instances (80% and 20% of the whole) to generate the training and testing dataset, respectively.

The EFO
Abedinpourshotorban, et al. [118] developed a physics-based optimization strategy and named it electromagnetic field optimization. Many scholars have benefited from this method for a wide range of problems [119,120]. It is a population-based technique in which each individual is represented by an electromagnetic particle (EMP). The EMPs are distinguished by different polarities.
The attraction-repulsion rule is used to improve the solution by changing the position of the EMPs.
The steps of the EFO can be explained as follows: Step 1: A set of EMPs are randomly generated and the fitness of each one is calculated. The particles are then sorted based on these fitnesses. Each particle is made of N_var electromagnets (tantamount to the number of the problem variables).
Step 2: This is dedicating to dividing the EMP population into three filed groups with negative, positive, and neutral polarities. The positive field group comprises the best-fitted individuals tunable by a so-called parameter "P_field", the negative field group comprises the worst-fitted individuals tunable by a so-called parameter "N_field", and the rest lie in the third group.
Step 3: Each repetition of the algorithm generates a new EMP. Once this EMP is better-fitted than the weakest one, it is considered as a part of the population and confiscates the position of weakest EMP. Figure 4 shows the generation process and determining the polarity of the new member. In this process, for j = 1 → N_var, an electromagnet belonging to the neutral field group is chosen.
Next, a random value is considered and compared to a parameter called Ps_rate which indicates the probability of choosing electromagnets of the created EMP from the positive field. Equation 1 is used for the situation random value < Ps_rate, otherwise, Equation 2 expresses the generation process.
where PF and NF symbolize positive and negative fields, GR gives the golden ratio, is the random value inside [0, 1], Similar to the EFO, two separate ANNs are supervised by the benchmark algorithms to explore and predict the SIr. The performance of these three methods is compared in the following sections to return an optimal metaheuristic-based methodology for this purpose.

Accuracy assessment measures
The accuracy of SIr prediction is reported by well-known indices as follows: Given = − , the error of prediction for a total of N instances is calculated by the RMSE and mean absolute error (MAE) indices. According to Equations 3 and 4, RMSE gives a rooted value of the averaged squared Errors, while the MAE releases an average of the absolute Error values.
where ̅̅̅̅ symbolizes the average of the SIr values.

Optimization and training
A 5 × 45 × 1 MLP neural network (indicating 5 nodes in the input layer, 45 nodes in the middle layer, and 1 node in the output layer) is used to connect the SIr to its input factors. Due to a large number of data, this network is a complex system that is supposed to be supervised by the EFO algorithm. The main role of the EFO is to adjust the MLP internal parameters so that the SIr pattern is optimally established.
After creating the EFO-MLP hybrid, it is trained by mining the training group. Since A similar strategy was executed for the benchmark models (i.e., SCE-MLP and SFLA-MLP). Table 2 denotes the values assigned to the used algorithms. As is seen, the SCE and SFLA are implemented with 1000 iterations.

Testing results
As explained in section 2, the second part of the dataset plays the role of unseen environmental conditions. The models use this data to evaluate their testing ability. In this regard, the SIr is forecasted for the testing instances and these values are compared with the expected values. Since the model does not perform any analysis on these instances, it has to use the previously captured knowledge. Accordingly, the goodness of the results reflects the prediction capability of the intended model.
Considering formula (section 4.1), Figure 6  Moreover, from a graphical point of view, the histogram charts in Figure 6 show that the small

EFO vs. SCE and SFLA
It was stated that this research pursues a novel time-efficient methodology for analyzing the SIr.
The EFO was presented as the pivotal method, while the SCE and SFLA acted as benchmark algorithms. Earlier sections showed the competency of all three supervised models. Hence, this section validates the performance of the EFO versus the SCE and SFLA.
For both training and testing groups, the error indicators showed a lower error of prediction, and at the same time, the R index manifested a higher correlation for the EFO-trained model. Table 3 gives the accuracy improvements when the SCE and SFLA are replaced with the EFO. As is seen, in the case of EFO vs. SCE, the RMSE and MAE fall by nearly 10 and 18% in both phases, respectively. Also, a 4% enhancement resulted for the R index. As for EFO vs. SFLA, the changes are more tangible.
The RMSE and MAE of both phases degrade by around 16 and 33%, respectively. The R index indicated a 7% better correlation, too.

Conclusions
This research was dedicated to finding a fast yet reliable solution for predicting solar irradiance.
Since this parameter is affected by different factors, the problem is a non-linear complex one.
Therefore, a potent metaheuristic strategy called electromagnetic field optimization was considered