Energy Management Scheduling for Microgrids in the Virtual Power Plant System Using Artificial Neural Networks

This study uses an artificial neural network (ANN) as an intelligent controller for the management and scheduling of a number of microgrids (MGs) in virtual power plants (VPP). Two ANN-based scheduling control approaches are presented: the ANN-based backtracking search algorithm (ANN-BBSA) and ANN-based binary practical swarm optimization (ANN-BPSO) algorithm. Both algorithms provide the optimal schedule for every distribution generation (DG) to limit fuel consumption, reduce CO2 emission, and increase the system efficiency towards smart and economic VPP operation as well as grid decarbonization. Different test scenarios are executed to evaluate the controllers’ robustness and performance under changing system conditions. The test cases are different load curves to evaluate the ANN’s performance on untrained data. The untrained and trained load models used are real-load parameter data recorders in northern parts of Malaysia. The test results are analyzed to investigate the performance of these controllers under varying power system conditions. Additionally, a comparative study is performed to compare their performances with other solutions available in the literature based on several parameters. Results show the superiority of the ANN-based controllers in terms of cost reduction and efficiency.


Introduction
Over recent years, there has been a sharp growth in both energy consumption and population, whereas the conventional energy source price is increasing and its availability is dwindling [1]. Global warming and greenhouse emissions are the main harmful results of fossil fuel consumption and their impact can hardly be irreversible [2,3]. Therefore, attention is being paid to other alternative sources such as nuclear and renewable energy sources to reduce the generation using combustible fuels [4][5][6]. In this regard, many governments encourage distributed generation connections (DG) based on the distribution level. Nowadays, DGs are the main core of microgrids (MGs), which have received great attention and developed rapidly. Especially regarding grid-connectedness, these resources can be integrated into the MG system for the best operation and management [7,8]. The MG could manage, aggregate, and deploy DGs, for the most part when a grid is disconnected. Alternative aggregator choice dependent on smart grid upgrades is the concept of a virtual power plant (VPP) [9][10][11].
In this context, the integration and coordination of DGs in MGs could be undertaken by upgrading VPP to supply power quality and add value to the power system networks.

Modeling of the Microgrids and VPP System
The VPP system concludes an IEEE 14-bus system with five identical MGs, as shown in Figure 1; each MG has 5 DGs. Each MG supplies 10 MW to the chosen bus bar and the bus capacity can cover the supplies to avoid tripping during the stand-alone mode of operation. The grid is connected to two main generators at Bus1 and Bus8, and both total supplies are 200 MW to the entire system through the substation transformer of 33 kV to 11 kV at 50 Hz. The system includes 5 MGs distributed in some bus bars. The IEEE standard system 1547 states that multiple MG systems are better than a single MG, boosting operation characteristics and making the network both more stable and reliable [31,32]. Table 1 represents the active and reactive maximum loading power for each bus bar in MW for the VPP system. Table 2 shows the MG details, while each MG involves the number of DGs, numbers, and source types of DG.   The modeled system was tested for 24 h in hourly intervals on real loading data curves for the two intelligent schedule controllers. Each hour shift change, the schedule controllers attempted to cover the loading demand by considering all the inputs variables at that specific hour to select the best binary output, with the necessary DGs and neglecting the others. The controller's accuracy and wise decision through the optimization process are comprised of 11 loads placed at buses 2, 3, 4, 5, 6, 9 10, 11, 12, 13, and 14. In contrast, all loads in this system are based on a scaled load's curves, as shown in Figure 2. For the optimization process, refer to [24]. The adaptive ANN-based BBSA and ANN-based BPSO are designed for optimal energy scheduling by utilizing BSA and PSO optimization algorithms to find the optimal parameters for ANN individually based on reducing the mean absolute error (MAE). The optimal net obtained from both algorithms was tested on the same load curves in Figure 2; refer to [33,34].

ANN Algorithm Training
The adopted ANN algorithm is based on the feed-forward neural network type and the Levenberg-Marquardt training algorithm. The training was done in the Matlab toolbox. The hidden layers of sigmoid nodes ended with an output layer. The multiple layers of nods with non-linear transfer functions allowed the network to learn non-linear relationships between input and output vectors. The sigmoid activation function was used In conclusion, all 25 DG sources in the VPP system received the optimal scheduling by switching ON or OFF based on the optimization in the first place and then on ANN prediction techniques. The outcomes must demonstrate the effectiveness of the methods by obtaining the optimal scheduling that minimizes the power to decrease consumption emissions and maximize profits.

ANN Algorithm Training
The adopted ANN algorithm is based on the feed-forward neural network type and the Levenberg-Marquardt training algorithm. The training was done in the Matlab toolbox. The hidden layers of sigmoid nodes ended with an output layer. The multiple layers of nods with non-linear transfer functions allowed the network to learn non-linear relationships between input and output vectors. The sigmoid activation function was used for hidden layers and output nodes considering the probability of anything exists only between the range of 0 and 1. In this study, the ANN architecture included two hidden layers, each with the number of nodes selected by optimization algorithms as well as by the learning rate optimum value (refer to [33,34]), and the input and output layers were six and twenty-five, respectively. Table 3 represents ANN setup parameters for ANN-BBSA and ANN-BPSO algorithms. The ANN training strategy is based on the BBSA best schedule controller; refer to [24]. The ANN training executed on the ANN setup parameters obtained was used for ANN-BSA and ANN-PSO separately. The run was done for 4000 epochs and Figure 3 shows the ANN training flow charts. The training process counted one hundred percentages of the input and output data on the loading conditions, as depicted in Figure 2. The function is to create the final intelligent masterpiece, specifically ANN Net, once for BBSA and BPSO individually [35]. The outcomes of this training are an ANN intelligent controller net that can make the best decisions for energy management regarding power demand and supply for the VPP system. The ANN-based controllers rely on the BBSA schedule controller [24]. (1,25) . . . . . . . . .
The controller input parameters are represented in Table 4; the parameters represent the ANN inputs. The limitations that govern the search space were inherently given by the BBSA optimization algorithm, which produces the BBSA schedule controller. Additionally, the output parameters are represented in Table 5, including a binary schedule in which the X-axis represents the time per hour, e.g., h = 1,2,3 . . . . . . ,24, and the Y-axis represents DG's switch status, e.g., S = 1,2,3 . . . . . . ,25, which is represented in the abovementioned Equations (1) and (2).

Trained loading data results
The algorithm was tested several times by changing the number of epochs every time. Both algorithms tried the same conditions on the input and output data obtained from the optimization (optimal schedule controller) [24]. Table 6 represents a comparison between both algorithms with change epochs by one thousand every time up to 4000 epochs. The comparison was in terms of regression, MES performance, gradent, Mu, and training execution time. As noted, the results from ANN-BBSA are better in all the training sessions. Yet, the ANN-BPSO also showed the optimal solution but with less performance and more time. This can prove that optimizing the ANN parameters before training is very effective in saving time and effort.    Regarding the optimal enhanced ANN net called ANN-BBSA or ANN-BPSO, the MATLAB Simulink block diagram of the neural network net schedule controller is shown in Figure 4. It involved six inputs and 25 binary outputs on an hourly basis to manage the distributed generations throughout the virtual power plant system. The net block is generated after the training is completed using Equations (3) and (4). The controller input based on the BBSA best schedule (t) and the controller output based on the BBSA best schedule (P) using the feed-forward neural network (new f f ) and Levenberg-Marquardt algorithm (trainlm) were used [36,37].

Trained loading data results
The algorithm was tested several times by changing the number of epochs every time. Both algorithms tried the same conditions on the input and output data obtained from the optimization (optimal schedule controller) [24]. Table 6 represents a comparison between both algorithms with change epochs by one thousand every time up to 4000 epochs. The

Trained loading data results
The algorithm was tested several times by changing the number of epochs every time. Both algorithms tried the same conditions on the input and output data obtained from the optimization (optimal schedule controller) [24]. Table 6 represents a comparison between both algorithms with change epochs by one thousand every time up to 4000 epochs. The comparison was in terms of regression, MES performance, gradent, Mu, and training execution time. As noted, the results from ANN-BBSA are better in all the training sessions. Yet, the ANN-BPSO also showed the optimal solution but with less performance and more time. This can prove that optimizing the ANN parameters before training is very effective in saving time and effort.

Artificial Neural Network-Based BBSA Results
ANN executes the BSA optimization technique to create a trial population that includes two crossovers and mutation operatives. BSA rules search for the best value of the populations in the search space. Therefore, it is proven that BSA is one of the most powerful optimization algorithms. The binary BSA algorithm has done a good job of optimizing the VPP system to optimize energy management demand and supplies to reduce the cost and emission based on the power saving. The BSA takes a further step in enhancing the ANN by searching optimal parameters of the algorithm towards the best values for the learning rate and neurons numbers in hidden layers to boost the performance of ANN by predicting the best status regarding ON/OFF of the 25 DGs. This enhancement allows the BSA to select the number of trial populations to minimize error and time wasted. Consequently, a lesser objective function value is accomplished by choosing the optimal population sizes to enhance the performance of ANN for the duration of the training and testing.
ANN was trained and has learned 100% of the VPP system data of the BBSA best schedule as input data, while the testing data was conducted on another loading data condition. These testing data are in similar ranges to the training data in terms of the peak power and time, as well as every bus limitation in the VPP system data. ANN testing on untrained data will be further discussed in the next sections. Figure 5 shows regression coefficient R of the ANN-BBSA after training and testing on VPP system data loading conditions. Furthermore, the training performance of the ANN-BBSA is shown in Figure 6 and represents the optimization results of ANN-based optimization algorithms for the ANN-BSA, as well as represents the ANN-PSO to tune the optimal values of the ANN. The regression coefficient is related to the prediction performance of the ANN-BBSA.
It is noted that the value of the regression coefficient represents unity for ANN after 4000 epochs have been applied. The best training performance of the mean square error (MSE) was 7.5956 × 10 −11 , which is excellent for the optimal prediction of the ANN-BBSA performance. Overall, the regression coefficient results and performance validate the accuracy of the ANN-BBSA. Table 7 shows the active power in MW for all buses in the 14-bus VPP system when using ANN-BBSA. Table 8 shows the total power generated in MW for each MGs when using the ANN-BBSA schedule controller for 24 h.  It is noted that the value of the regression coefficient represents unity for ANN after 4000 epochs have been applied. The best training performance of the mean square error (MSE) was 7.5956 × 10 −11 , which is excellent for the optimal prediction of the ANN-BBSA performance. Overall, the regression coefficient results and performance validate the accuracy of the ANN-BBSA. Table 7 shows the active power in MW for all buses in the 14bus VPP system when using ANN-BBSA. Table 8 shows the total power generated in MW for each MGs when using the ANN-BBSA schedule controller for 24 h.   It is noted that the value of the regression coefficient represents unity for ANN after 4000 epochs have been applied. The best training performance of the mean square error (MSE) was 7.5956 × 10 −11 , which is excellent for the optimal prediction of the ANN-BBSA performance. Overall, the regression coefficient results and performance validate the accuracy of the ANN-BBSA. Table 7 shows the active power in MW for all buses in the 14bus VPP system when using ANN-BBSA. Table 8 shows the total power generated in MW for each MGs when using the ANN-BBSA schedule controller for 24 h.

Artificial Neural Network-Based BPSO Results
The PSO used a velocity vector to update each particle's current swarm position. Based on a population of individuals' social behavior, each particle's position updated and adapted to its location. The PSO algorithm enriched the ANN to search for the optimal values of the "learning rate" and "number of neurons in hidden layers" to boost the ANN predicting performance [38]. The ANN-based PSO was executed to try many random searches in the search space to minimize the error. Then, the lowest objective function values were accomplished by choosing the population's optimal values to satisfy the tuned parameters to improve the ANN's performance during training and testing on the VPP system data using the best schedule as the output data. The entire VPP system data obtained from the best schedule (input and output) data for the training process counted in one hundred percentages of the inputs and outputs data on the same loading conditions. In comparison, the testing data considered used different load conditions, which will be further discussed in the next section. Figure 7 shows a regression for ANN-BPSO in training and testing. The performance for ANN-BPSO is shown in Figure 8. VPP system data using the best schedule as the output data. The entire VPP system data obtained from the best schedule (input and output) data for the training process counted in one hundred percentages of the inputs and outputs data on the same loading conditions. In comparison, the testing data considered used different load conditions, which will be further discussed in the next section. Figure 7 shows a regression for ANN-BPSO in training and testing. The performance for ANN-BPSO is shown in Figure 8. The ANN-BPSO regression coefficient represents unity and predicts the performance of the best training performance mean square error, which was 7.3295 × 10 −7 , to obtain the optimal prediction of the ANN-BPSO performance. It is noted that the value of the regression coefficient was 1 for the ANN. However, ANN-BBSA was still better in the training performance and with the training time of (2:24:52), with 2981 epochs, which is 67.15% better in terms of time-saving and higher performance than ANN-BPSO, which had a time of (7:21:36) with 4000 epochs. Table 9 shows the active power in MW for all buses in the 14-bus VPP system when using ANN-BPSO. Table 10 shows the total power generated in MW for each MGs when using the ANN-BPSO schedule controller for 24 h.  The ANN-BPSO regression coefficient represents unity and predicts the performance of the best training performance mean square error, which was 7.3295 × 10 −7 , to obtain the optimal prediction of the ANN-BPSO performance. It is noted that the value of the regression coefficient was 1 for the ANN. However, ANN-BBSA was still better in the training performance and with the training time of (2:24:52), with 2981 epochs, which is 67.15% better in terms of time-saving and higher performance than ANN-BPSO, which had a time of (7:21:36) with 4000 epochs. Table 9 shows the active power in MW for all buses in the 14-bus VPP system when using ANN-BPSO. Table 10 shows the total power generated in MW for each MGs when using the ANN-BPSO schedule controller for 24 h. The ANN-BPSO regression coefficient represents unity and predicts the performance of the best training performance mean square error, which was 7.3295 × 10 −7 , to obtain the optimal prediction of the ANN-BPSO performance. It is noted that the value of the regression coefficient was 1 for the ANN. However, ANN-BBSA was still better in the training performance and with the training time of (2:24:52), with 2981 epochs, which is 67.15% better in terms of time-saving and higher performance than ANN-BPSO, which had a time of (7:21:36) with 4000 epochs. Table 9 shows the active power in MW for all buses in the 14-bus VPP system when using ANN-BPSO. Table 10 shows the total power generated in MW for each MGs when using the ANN-BPSO schedule controller for 24 h.  Overall, the regression coefficient results and performance validate the ANN-BBSA and ANN-BPSO, and predict both algorithms' optimal ON/OFF status for the VPP components and resources. The total power saved in one day was 1.84115 MW and the ANN-BBSA to ANN-BPSO are compared based on loads curves, as shown in Figure 2. One MG and one bus are chosen for this discussion; although all the MGs are identical, each MG operates based on the controller decision, availability, and demand. The MG1 at Bus5 is taken as an example to show the performance of both algorithms. Each DG represents renewable or non-renewable micro-sources that are numbered as in Table 2. All DGs operated better based on their availability and capacity. For example, DG2 represents solar power, which functions during the daytime and is off during the night. The MG1 is the total of the five DGs and its total power generated was 109.1 MW in ANN-BBSA and 97.85 MW in the case of ANN-BPSO. However, the total load demand at bus5 was 24.94 MW, which can explain the support of the MG1 in supplying and sharing more available power to the local loads and to the system to reduce the grid power. Figure 9 shows MG1 at bus 5 using the ANN-BBSA and ANN-BPSO. The obtained neural net is used for solving energy management problems in the virtual power plant system based on ANN setting data. and ANN-BPSO, and predict both algorithms' optimal ON/OFF status for the VPP components and resources. The total power saved in one day was 1.84115 MW and the ANN-BBSA to ANN-BPSO are compared based on loads curves, as shown in Figure 2. One MG and one bus are chosen for this discussion; although all the MGs are identical, each MG operates based on the controller decision, availability, and demand. The MG1 at Bus5 is taken as an example to show the performance of both algorithms. Each DG represents renewable or non-renewable micro-sources that are numbered as in Table 2. All DGs operated better based on their availability and capacity. For example, DG2 represents solar power, which functions during the daytime and is off during the night. The MG1 is the total of the five DGs and its total power generated was 109.1 MW in ANN-BBSA and 97.85 MW in the case of ANN-BPSO. However, the total load demand at bus5 was 24.94 MW, which can explain the support of the MG1 in supplying and sharing more available power to the local loads and to the system to reduce the grid power. Figure 9 shows MG1 at bus 5 using the ANN-BBSA and ANN-BPSO. The obtained neural net is used for solving energy management problems in the virtual power plant system based on ANN setting data. Figure 9. Training data results using the ANN-BBSA and ANN-BPSO tested in the microgrid at bus 5.

Main Results and Discussion
ANNs are computational algorithms loosely based on the human biological nervous system, which model statistical data. An ANN contains a set of processing elements called neurons that are interrelated components. These neuron structures act as a harmonious rhythm to solve certain complex problems. ANNs can be used in places where detecting trends and extracting patterns are excessively difficult to determine by humans or other computer-related programs. The current cutting-edge technology in deep-learning and ANNs focuses highly on their ability to model and interpret complex data, as well as to scale through optimization and parallelization.

Main Results and Discussion
ANNs are computational algorithms loosely based on the human biological nervous system, which model statistical data. An ANN contains a set of processing elements called neurons that are interrelated components. These neuron structures act as a harmonious rhythm to solve certain complex problems. ANNs can be used in places where detecting trends and extracting patterns are excessively difficult to determine by humans or other computer-related programs. The current cutting-edge technology in deep-learning and ANNs focuses highly on their ability to model and interpret complex data, as well as to scale through optimization and parallelization.
Optimization problems often require good optimization methods to minimize or maximize certain objective functions. Sometimes, problems need to be optimized nonlinearly or polynomially, which cannot be surely resolved and needs an approximation. In that situation, heuristics must be used, which can resolve these problem types. This study implements an ANN for objective function approximation [39]. The objective function is approximated by a non-linear regression used to determine an optimization problem [39].
The new objective functions derived should be polynomial to calculate the optimization problem's solution, training performance, and regressions for the ANN. This case study discusses a fair compression based on different optimization techniques to find the best parameters to serve the system in the best way. These techniques may exclude huge trial and error time in the training and may find the best parameters required without using smaller Nets to save valuable time during the training and testing. Any of the optimization algorithms used could provide better results than manual parameter-tuning. Yet, some techniques could find the best fitness faster and more efficiently compared to each other. However, after testing the hybrid intelligent ANN net's controller on 100% of the original trained data and observing that both the scheduling controller and artificial intelligent controller are identical, testing the controller on untrained data is essential [25,34]. The test has been done for validation and to test the controller's robustness. However, in this test, the entire loads were replaced in both case scenarios. Each case had different loading conditions in each bus bar in the VPP system. The system ran twice in each scenario, first for ANN-BBSA and the second for ANN-BBSA, and a comparison in MG1 at bus 5 was conducted.
A fair comparison of MG1 in bus 5 of the 14-bus IEEE test for virtual power plants utilizing the optimized ANN net based on hourly binary patterns for managing each DG in the VPP system was conducted. The binary (ANN-BPSO) and binary (ANN-BBSA) controller had a binary output of 0 or 1 to switch each DG ON or OFF based on the inputs. The results show that the algorithms could save a huge amount of power. Yet, all energy saving was done by sharing new distributed resources to inject power into the loads instead of supplying power from the utility grid. Both optimized nets operated excellently. However, The ANN-BBSA net was better than the ANN-BPSO based on their objectives, as the total power for the 24 h of the ANN-BBSA net was 1182.5 MW in comparison to 1184.3 MW for ANN-BPSO. The entire load modeling for the testing and training data involved was a real-load parameter data recorder located in northern parts of Malaysia. The test case scenarios for the untrained loading data results are divided into two scenarios.

Case Scenario: Test 1
This scenario used the hybrid ANN net controller on another day's load curve for 24 h. This test aimed to check the controller's ability and behavior to address changing loading conditions or untrained load curves. This test included new loads for each bus bar in eleven buses in the VPP system, as depicted in Figure 10.
approximated by a non-linear regression used to determine an optimization problem [39].
The new objective functions derived should be polynomial to calculate the optimization problem's solution, training performance, and regressions for the ANN. This case study discusses a fair compression based on different optimization techniques to find the best parameters to serve the system in the best way. These techniques may exclude huge trial and error time in the training and may find the best parameters required without using smaller Nets to save valuable time during the training and testing. Any of the optimization algorithms used could provide better results than manual parameter-tuning. Yet, some techniques could find the best fitness faster and more efficiently compared to each other. However, after testing the hybrid intelligent ANN net's controller on 100% of the original trained data and observing that both the scheduling controller and artificial intelligent controller are identical, testing the controller on untrained data is essential [25,34]. The test has been done for validation and to test the controller's robustness. However, in this test, the entire loads were replaced in both case scenarios. Each case had different loading conditions in each bus bar in the VPP system. The system ran twice in each scenario, first for ANN-BBSA and the second for ANN-BBSA, and a comparison in MG1 at bus 5 was conducted.
A fair comparison of MG1 in bus 5 of the 14-bus IEEE test for virtual power plants utilizing the optimized ANN net based on hourly binary patterns for managing each DG in the VPP system was conducted. The binary (ANN-BPSO) and binary (ANN-BBSA) controller had a binary output of 0 or 1 to switch each DG ON or OFF based on the inputs. The results show that the algorithms could save a huge amount of power. Yet, all energy saving was done by sharing new distributed resources to inject power into the loads instead of supplying power from the utility grid. Both optimized nets operated excellently. However, The ANN-BBSA net was better than the ANN-BPSO based on their objectives, as the total power for the 24 h of the ANN-BBSA net was 1182.5 MW in comparison to 1184.3 MW for ANN-BPSO. The entire load modeling for the testing and training data involved was a real-load parameter data recorder located in northern parts of Malaysia. The test case scenarios for the untrained loading data results are divided into two scenarios.

Case Scenario: Test 1
This scenario used the hybrid ANN net controller on another day's load curve for 24 h. This test aimed to check the controller's ability and behavior to address changing loading conditions or untrained load curves. This test included new loads for each bus bar in eleven buses in the VPP system, as depicted in Figure 10. . Figure 10. Case 1: testing loads for VPP system, including the IEEE 14-bus test system.
Both proposed net controllers of ANN-BBSA and ANN-BPSO were applied to this test scenario load case individually. The load curves were real loads used as replacements for the originally trained loads. Figure 11 shows test scenario Test-1 of ANN-BBSA and ANN-BPSO for DGs to predict the best binary pattern to provide the necessary power for MG1 at bus bar 5. Figure 11 shows ANN-BBSA presented in red, while ANN-BPSO is Both proposed net controllers of ANN-BBSA and ANN-BPSO were applied to this test scenario load case individually. The load curves were real loads used as replacements for the originally trained loads. Figure 11 shows test scenario Test-1 of ANN-BBSA and ANN-BPSO for DGs to predict the best binary pattern to provide the necessary power for MG1 at bus bar 5. Figure 11 shows ANN-BBSA presented in red, while ANN-BPSO is presented in blue. However, ANN-BBSA acted slightly well and could inject more power to supply to the loads than ANN-BPSO. As noted, in this scenario, the diesel generator worked almost all day in both controllers, apart from a few minutes at 1 AM, while PV had the perfect cut-off time based on the availability of the real solar irradiance reading. The wind turbine started supplying power in the morning in both controllers and in the OFF/ON switch based on the ANN controller decision and real-wind speed. SOFC supplied power to the grid continually in ANN-BBSA and ANN-BBSA, and the storage system supplied to the grid after 8 AM for ANN-BBSA, while maintaining charge and in the standby mode ANN-BPSO algorithm.

Case Scenario: Test 2
In this case scenario, new load curve conditions were applied for 24 h to test the ANN controller behavior for ANN-BBSA and ANN-BBSA. In this scenario, the load curve variations of each bus were limited in the range of power demand as stated in the training loads, as in Figure 2. This test aimed to check the controller's ability and success in addressing other load variations. Each bus bar load was updated with active and reactive load demand as included for the VPP system, as depicted in Figure 12 showing the scenario Test-2 for ANN-BBSA and ANN-BPSO. Figure 13 shows ANN-BBSA presented in red, while ANN-BPSO is presented in blue. In this case, ANN-BBSA also acted slightly better and saved more power compared to ANN-BPSO. However, the diesel generator continually supplied power in both controller cases compared to the training data. The PV system and wind turbine supplied enough management power based on the ANN controller decision as well as on the availability of solar irradiance and real-wind speed. SOFC supplied power for ANN-BPSO more than ANN-BBSA. In ANN-BBSA and ANN-BPSO, the storage system supply scattered for ANN-BBSA. MG1 represents the total MG power supplied to the VPP system, with an average of 3.79 MW. MG1 is the total MG power supplied to the VPP system with an average of 4.62 MW. Generally, the ANN-based controllers acted somehow similar to a regular schedule controller, with some differences noted. For example, some DGs continually supplied power while others did not supply power during the 24 h. We also noticed a transition time and normally, in all cases, power was supplied or discontinued on an hourly basis. However, the ANN transitions were sometimes not hourly, which is surprisingly a very strong example of negligence regarding the transition time. Considering the ANN transitions could save more power when some renewable source became available, it could connect directly at any time. The obtained results prove that the ANN controller works perfectly and could act seriously with any load within the same range and set-up limitations.

Case Scenario: Test 2
In this case scenario, new load curve conditions were applied for 24 h to test the ANN controller behavior for ANN-BBSA and ANN-BBSA. In this scenario, the load curve variations of each bus were limited in the range of power demand as stated in the training loads, as in Figure 2. This test aimed to check the controller's ability and success in addressing other load variations. Each bus bar load was updated with active and reactive load demand as included for the VPP system, as depicted in Figure 12 showing the scenario Test-2 for ANN-BBSA and ANN-BPSO. Figure 13 shows ANN-BBSA presented in red, while ANN-BPSO is presented in blue. In this case, ANN-BBSA also acted slightly better and saved more power compared to ANN-BPSO. However, the diesel generator continually supplied power in both controller cases compared to the training data. The PV system and wind turbine supplied enough management power based on the ANN controller decision as well as on the availability of solar irradiance and real-wind speed. SOFC supplied power for ANN-BPSO more than ANN-BBSA. In ANN-BBSA and ANN-BPSO, the storage system supply scattered for ANN-BBSA. MG1 represents the total MG power supplied to the VPP system, with an average of 3.79 MW.    Figure 13. Test 2 testing data results using ANN-BBSA and ANN-BPSO in the microgrid at bus 5.
All the power saved was considered by sharing new distributed resources to i power into the loads as an alternative to supplying power from the utility grid. How the optimized ANN nets operated excellently. Yet, some trained nets could be better the others based on their objectives. The total power for the 24 h of the ANN-BBSA was 1182.5 MW compared to the next optimized net of 1211.3 MW. The improved A nets were tested on their ability to manage distributed energy resources; the results s that the VPPs saved a reasonable amount of supplied power in the case study for the test scenarios. Several important and targeted recommendations are addressed for po saving, emission reduction, and cost-saving. The developed ANN-based optimiz method shows good results in the general comparison. However, from a deeper per tive, apart from the net complexity represented in the proposed algorithms, the number of inputs and outputs show the robustness of these optimizers and the enorm benefits of time-saving. The proposed algorithms have been compared with other niques of saving MWs of power, of reducing the emission of greenhouse effects, an saving more cost-effective capital. The developed methods triumph over the comp other approaches. Table 11 presents an analysis of the developed algorithms and pares them to other methods.  All the power saved was considered by sharing new distributed resources to inject power into the loads as an alternative to supplying power from the utility grid. However, the optimized ANN nets operated excellently. Yet, some trained nets could be better than the others based on their objectives. The total power for the 24 h of the ANN-BBSA net was 1182.5 MW compared to the next optimized net of 1211.3 MW. The improved ANN nets were tested on their ability to manage distributed energy resources; the results show that the VPPs saved a reasonable amount of supplied power in the case study for the two test scenarios. Several important and targeted recommendations are addressed for powersaving, emission reduction, and cost-saving. The developed ANN-based optimization method shows good results in the general comparison. However, from a deeper perspective, apart from the net complexity represented in the proposed algorithms, the large number of inputs and outputs show the robustness of these optimizers and the enormous benefits of time-saving. The proposed algorithms have been compared with other techniques of saving MWs of power, of reducing the emission of greenhouse effects, and of saving more cost-effective capital. The developed methods triumph over the compared other approaches. Table 11 presents an analysis of the developed algorithms and compares them to other methods.

Conclusions
The developed controllers reduce the shortcomings of current controllers in integrating DGs in a VPP system. The binary outputs of the optimization techniques are used to predict the DGs' optimal ON/OFF status. The data sets for training and testing the ANN have been described. The ANN-based optimal scheduling controller's main contribution is controlling and coordinating the power supply and demand for all MGs. In the ANN training algorithm, the regression coefficient values for both ANN-based training represented unity. The ANN-BBSA scores better in performance than ANN-BPSO in training and saves a great amount of time. The results showed that the ANN-based net schedule controllers decrease the utility power consumption by saving more power. The ANN-BBSA schedule controller has an energy-saving of 40.46% compared to the 40% of ANN-BPSO. The developed ANN-based controllers effectively reduce cost and emission through saving power compared to other studies available in the literature. The cost and emission reduction for the ANN-BBSA achieved 40.9% and 39.97%, and ANN-BPSO reached 39.9% and 35.03%, respectively. Furthermore, comparing the trained and untrained test scenarios demonstrates that the ANN-BBSA provides a competitive, intelligent schedule controller that performs faster and more accurately than the ANN-BPSO in scheduling, management, and power-saving. Both algorithms provide an optimal schedule for every DG to limit fuel consumption, reduce CO2 emission, and increase the system efficiency towards smart and economic VPP operations as well as grid decarbonization.