Assessing the Techno-Economic Benefits of Flexible Demand Resources Scheduling for Renewable Energy–Based Smart Microgrid Planning

The need for innovative pathways for future zero-emission and sustainable power development has recently accelerated the uptake of variable renewable energy resources (VREs). However, integration of VREs such as photovoltaic and wind generators requires the right approaches to design and operational planning towards coping with the fluctuating outputs. This paper investigates the technical and economic prospects of scheduling flexible demand resources (FDRs) in optimal configuration planning of VRE-based microgrids. The proposed demand-side management (DSM) strategy considers short-term power generation forecast to efficiently schedule the FDRs ahead of time in order to minimize the gap between generation and load demand. The objective is to determine the optimal size of the battery energy storage, photovoltaic and wind systems at minimum total investment costs. Two simulation scenarios, without and with the consideration of DSM, were investigated. The random forest algorithm implemented on scikit-learn python environment is utilized for short-term power prediction, and mixed integer linear programming (MILP) on MATLAB® is used for optimum configuration optimization. From the simulation results obtained here, the application of FDR scheduling resulted in a significant cost saving of investment costs. Moreover, the proposed approach demonstrated the effectiveness of the FDR in minimizing the mismatch between the generation and load demand.


Introduction
The action plan for meeting the huge energy needs of developing countries includes the strategic design of small microgrids for areas that are not yet connected to the main grid due to technical and geographical limitations. Moreover, the global call for decarbonization of the current energy mix towards climate change mitigation has increased the call for a more sustainable energy supply system via renewable energy resources-based microgrid technologies [1]. A microgrid is a small power system consisting of a cluster of distributed energy generation resources, energy storage systems and aggregated loads that can operate in isolated mode or grid-connected mode for providing clean, reliable and affordable energy supply [2]. The technical aspect of the design of a microgrid's energy supply systems entails three interrelated aspects which include; the capacity sizing, time-based energy supply unit scheduling and point-to-point energy transaction strategy [3]. Most research activities on the MILP solver of MATLAB R and the energy resource data modelling and forecasting is achieved using Scikit-learn tools in Python. Figure 1 shows the proposed schematic view of the microgrid. The proposed system considers two types of renewable energy generation sources; wind and solar energy and the BESS. The BESS stores excess power generated during the times of over-generation and supply energy back into the grid during power shortage. An integrated energy management system is also incorporated to provide the coordinated short-term operation management of the BESS and the FDR. The system is coordinated such that the use of shiftable loads tries to minimize the gap that exists between the electricity generation profile and consumption. The FDR are activated to consume surplus generation and are deactivated during periods of shortages.

Photo-Voltaic System Model (PV)
The instantaneous generated power output, PV p (t) of a PV system in kW with respect to the received solar irradiance, R(t) in W/m 2 can be determined by using Equation (1): where η pv , expressed in percentage, is the PV module derating factor. The R stc is the solar irradiance and S pv is the rated capacity of the PV in kW under the standard test condition.

Wind Turbine Model
The instantaneous wind turbine generated power output depends on the speed of the wind at specified hub height. The power output of a WT can be described by using a piece-wise function described in Equation (2) as follows: where S wt is the rated power capacity of the WT, the w cin ,w r and w cot is the cut-in, rated and cut-out wind speed of the wind turbine, respectively.

Battery Energy Storage System (BESS)
Whenever the total generation from the WT and PV exceeds the load demand, the BESS will switch into the charging mode. On the other hand, whenever the load demand exceeds the total generation, the BESS switches into the discharging state. The BESS state of charge at any given time t depends on the difference between the system load and the sum of the total renewable generation with the previous state of charge as the reference. The charging power or discharging power, as the case may be, is determined by the difference between the instantaneous load and generation. Hence, the current BESS state of charge at any given time, t (hour) is given by: where SOC(t) and SOC(t − 1) is the state of charge of the BESS for the current and previous time period in KWh respectively, dh is the hourly rate of self-discharge, β ed and β ec is the discharging and charging efficiency of the BESS, respectively. The minimum (SOC min ) and maximum (SOC max ) state of charge of the BESS are a function of the optimal capacity size as expressed: where S b is the optimal capacity size of the BESS.

Demand-Side Management Strategy and Resource Forecasting
DSM programs are procedures that attempt to modify the energy demand of the power system in order to improve the overall system efficiencies. Appropriate implementation of DSM can provide the necessary operational flexibility by transferring the FDR from one period to another. Figure 2 illustrates the proposed planning framework for the system without and with DSM strategy consideration (Case 1 and 2, respectively). The objective of the planning framework is to minimize the total investment costs of the microgrid. The FDR planning is included as DSM strategy to implement effective scheduling scheme for the shiftable load demands. The FDR is activated to minimize the gap between generated power and load demand in the most cost-effective way based on sufficient system conditions. The scheduling of the FDR takes into consideration the difference between the forecasted total generation and the load demand by using the random forest prediction model. System constraints considered in the optimization comprise of both the capacity size limitation of the components (BESS, PV and WT) and the operational constraints of the BESS such as charging/discharging power, BESS state of charge, load demand and power supply balance, DSM and shiftable load capacity constraints.

Flexible Demand Resources Modeling
The scheduling of the FDR can be implemented in such a way that they are actuated to consume the surplus power during the period of in excess power generation and deactivated during periods of low power generation. The flexible demand resources (FDR) considered include, but not limited to, the heating and cooling loads, water pumping, washing machines, etc. The new load demands PL (t) for any given time t after FDR scheduling is equal to the initial load demand PL(t) plus or minus the shifted FDR capacity (SD(t)), depending on the system load and generation balance dynamics per time. where The potential deferrable load capacity is taken to be 10% of the initial load demand as shown in the above Equation (7), and the total quantity of energy consumed before and after implementation of the FDR schedule is constrained to be equal.
where T is the total number of time steps in the scheduling horizon.

Wind and Solar Forecasting
The strong correlation between the received ground-level solar irradiance, and the generated output power of the PV system provides the flexibly to utilize the predictions of solar irradiance in estimating the output power of the PV in smart grid applications [22]. The same approach is also adopted in predicting the wind power output based on the wind speed forecasts. Therefore, solar irradiance and wind speed prediction are also equally crucial to the implementation of energy management in the smart grid [23]. The wind and solar power forecasting model implemented in this study considered the following input parameters; wind speed, solar irradiance, humidity, temperature, pressure and wind direction.
The model fitting or training of data-driven forecasting model is achieved by establishing underlying patterns among historical input variables [24]. Thus, its success relies heavily on appropriate input parameters selection, and the data pre-possessing. The candidate input data set for the model consists of a number of variables such as humidity, wind speed, pressure, solar irradiance, temperature, etc. A data-driven framework is based on the standard methodology of data science, and the main stages are as outlined; data pre-processing, model training, validation and final deployment. Data pre-processing might integrate all or some of these standard techniques: transformation, integration, normalization, cleaning etc. The subsequent process includes modeling, performance evaluation, and final deployment [25]. The schematic forecasting framework adopted in this study is shown in Figure 3.

Random Forest Regression
Random Forest (RF) is a bagging ensembled-based machine learning algorithm combining several single models of classification and regression trees. The classical decision tree has a shortcoming of over-fitting the training data and variance tending to be high. Thus, the superior advantage of RF over other machine learning algorithms is adopted. The randomization methodology in the RF algorithm reduces the high model's variance considerably [26]. The training of each decision tree is based on randomly selected attributes and randomly selected bootstrap samples from the training dataset [27,28].

Random Forest Algorithm
Algorithm 1 outlines the pseudo-code procedure of the random forest algorithm.

Algorithm 1: Random forest pseudo-code
Prerequisite: Training data set M, n forest trees and P traits (Temperature, wind speed, solar Irradiance .etc.) 1. Growing n forest trees.

For
Select a random sample m(i) from training set M. with replacement.

4.
Grow a tree without pruning.
Best split: Evaluate the gain of split-attribute for m(i) samples. 7. End For 8.
Provided a new data set y: 9.
Predict the new data by averaging the predictions of each individual n forest trees by averaging 10. End: Terminate the algorithm For a training data set M, we extract a random sample S i with replacement, where i indexes the i-th bootstrap sample. Based on the decision-tree algorithm, we grow n trees for each bootstrap sample without pruning. For each tree, a restrained randomly selected data set attribute p is selected. p equals the number of split-attributes randomly selected out of all possible split attributes P: p ∈ P. The bounded selected attribute n is a subset of N and is always very small compared to P; p << P. This superior property of the RF algorithm gives its fast speed trait and over-fitting elimination attribute. The outcome of the prediction is calculated by finding the averaging of the individual predictions of each tree.

Forecasting Error Metrics
The prediction results of the forecasting models are evaluated using the mean absolute error (MAE) [29], root means squire error (RMSE) and the r 2 metrics [30]. r 2 is a statistical performances metric that gives a measure of the closeness between the actual and predicted data. Its values range from 0 to 1 and validate the appropriateness of model selection. A value of 1 is an indication of a perfect fit model, while a value of 0 is a suggestion of the unsuitability of the selected model.
2. RMSE 3. r 2 whereŷ(i) is the values of the predicted data, the y(i) andȳ represent the actual and the mean of the input data respectively.

Sizing Optimization
The objective of the optimum component sizing is to minimize the Net Present Value (NPV) of the total investment costs (TIC). The investments cost entails the capital costs, operation and maintenance and the replacement costs of PV, WT and BESS. The optimization decision variables are optimum component sizing of PV, WT and the BESS.

Objective Function
where the subscript (x) represents the x th component of the microgrid and S x denotes the optimum capacity size of the PV, WT, and BESS, respectively. The (C x ) is the initial capital investment costs for installation, procurement, and commissioning of PV, WT and BESS. The (O&M x ), (RP x ) and (RV x ) represents the net present value of the operation and maintenance costs, replacement costs and the salvage value, respectively. The net present value of each cost components can be determined by using the equation: where C y is the net cash flow to the project for each considered period of individual cost components, i.e., operation and maintenance costs (O&M x ), replacement costs and the salvage value for all system components. y is the time index, i.e., one year, Y is the project lifetime (25 years), and r is the discount rate.

Constraints
• Power balance constraint without FDR implementation: The total power generated should satisfy the energy demand at any given time.
where PL is the load demand, P ds b (t) and P ch b (t) is the BESS discharging and charging power.
• Power balance constraint with the consideration of the FDR rescheduling program can be expressed as: • BESS constraints: the energy stored in the BESS must be bounded within the minimum (SOC min ) and the maximum state of charge (SOC max ) limit.
• BESS maximum charging and discharging power is bounded by the maximum charging (P ch__max b ) and discharging power capacity (P ds__max b ).
• Charging and discharging of the BESS cannot occur simultaneously.
where U ch b (t) and U ds b (t) are the integer variables denoting the charging and discharging operation state of the BESS, respectively.

Simulation Parameters, Data Description and Case Study
The simulation system parameters for BESS, WT and PV are as summarized in Table 1. The hourly historical meteorological for the considered site was obtained from meteoblue [31] and NASA database for the year 2017 to 2019. The proposed approach in this study adopted an isolated microgrid in the Marsabit county of Kenya as a case study to evaluate and demonstrate the techno-economic gains of the proposed system flexibility management techniques. In order to demonstrate the efficiency of the proposed model, two simulation scenarios were considered as outlined below: • Case 1: Capacity optimization without DSM strategy. • Case 2: Capacity optimization considering FDR scheduling as DSM strategy.

Simulation Results and Discussion
Based on the objective function and system constraints, as described in the formulations in Sections 2-4, mixed integer linear programming (MILP) is adopted as the optimization algorithm. The sizing optimization results for microgrid component size for two cases are presented in Table 2. Table 3 illustrate detailed investment costs per component and total system cost comparison for cases without and with DSM strategy consideration. For the two system configurations, the total energy consumed is considered to be equal. This implies that the application of the FDR scheduling scheme only impact the energy consumption pattern but doesn't affect the total amount of the energy demanded by the end-users throughout the scheduling period.

Optimum Configuration without DSM Strategy
As observed from Case 1 simulation results, the optimal system configuration obtained consists of 1196 kW, 2054 kW and 7150 kWh (with power converter capacity of 960 kW) component size of the PV, WT and the BESS, respectively. The minimum total investment costs for case 1 optimal system configuration is US $15,247,276.77 consisting of individual components costs for PV, WT and BESS as summarized in Table 2. Due to the variability of the renewable energy sources generation, the mismatch gap between the generation and load demand profiles tends to increase. With the incorporation of the BESS, an optimal configuration of PV-WT-BESS manages to meet the system load demand reliably. Figure 4 depicts the aggregated renewable power generation, BESS power and the load demand profiles without the consideration of the DSM strategy. As it can be observed, whenever the total generation surpasses the load demand, the surplus power is used to charge the BESS. In the event of deficit power generation, the BESS discharges to compensate the mismatch between the generation and load demand. Figure 5 and Figure 6 show the charging and discharging dynamics and the state of charge of the BESS, respectively, for case 1 optimal configuration. However, in this case, the optimal capacity of the BESS is relatively large, and thus, the total system costs are relatively expensive. Thus, the inclusion of the DSM strategy is essential.

Optimum Configuration Considering DSM Strategy and Resource Forecasting
The time-ahead resource forecasts obtained using RF model are used to implement the FDR scheduling based on the anticipated mismatch between the generation and load demand. The forecasting results based on MAE, RMSE and r 2 performance metrics for wind speed, solar irradiances, wind and solar photovoltaic power are as summarized in Table 4. As can be seen, the performance of the random forest forecasting algorithm depends on the selected size of the estimators. The number of estimators n represents the numbers of decision trees selected and grown at random with replacement during the training phase of the model. As it can be seen from the simulation results, the n values selected determines the accuracy of the RF forecasting model. As it can be observed, the best performances are obtained when the decision tree is set to 800 for the case of wind speed and wind power prediction. This is confirmed by the least error values indicated by the MAE and RMSE error metric values for wind speed and wind power forecast results. The appropriateness of the model and parameter estimation selection are validated by the highest value of the r 2 metric. Figure 7 shows a graphical comparison of the actual versus the predicted wind speed using the RF forecasting model. For the case of solar irradiance and PV power prediction, an estimator of n = 80 yields the best forecasting results. Figure 8 shows a graphical comparison of the actual versus the predicted solar irradiance using the RF forecasting model.  From the Case 2 simulation results, the minimum total investment cost is US $13,355,165.67 with an optimum size of the PV, WT and BESS equal to 1401 kW, 1866 kW and 5200 kWh (with power converter capacity of 820 kW), respectively. Figure 9 illustrates the aggregated generated power from renewable energy sources, BESS discharging power and the load demand profiles. Figure 10 and Figure 11 show the charging and discharging power and the SOC of the BESS for case 2, respectively.

Techno-Economic Optimal System Configuration Comparison and Analysis
The application of the FDR scheduling program has demonstrated to have several techno-economic benefit to the optimum configuration planning of the microgrid system. As can be seen in Figure 9, the FDR rescheduling tends to shift the load demand from low generation periods to peak-generation periods. This DSM strategy attempts to minimize the gap between the generation profile and the load demand and thus decrease the system component capacities of the WT and BESS. The FDR shifting programs time shifts the flexible energy demands from deficit generation to surplus generation periods resulting in percentage cost proportion of the BESS to the total investment cost of 41.32% without DSM and 34.31% with DSM. The resultant system configuration with DSM resulted in a significant cost saving in the investment costs of about 12.41% with respect to the case 1 (without DSM). This investment cost saving is due to the ability of the DSM strategy to reduce the gap between generation and demand for most of the considered time instance. Its worth noting that the increase in PV capacity and decrease in WT optimal system configuration is due to costs per kW difference between the two technologies, PV system is relatively cheaper per kW compared to WT generation technology.

Conclusions
In this work, the incorporation of the DSM strategy for effective optimal configuration is presented as a transition pathway towards accelerating uptake and management of variable renewable energy sources for smart microgrid. The system model considered in this work consists of the PV, WT and BESS without and with FDR scheduling. Due to the variability of the renewable energy sources, the mismatch between the generation and load demand profiles tends to increase. Thus, FDR scheduling technique that attempts to minimize the instantaneous mismatch between the load demand and generation profiles is proposed towards reducing the overall system planning cost. The effectiveness of the proposed methodology was investigated and verified on a real Kenyan microgrid. The Kenyan microgrid was used as case study to demonstrate the proposed methodology and techniques due to the accessibility of the required data. However, the research parameter and simulation are obtained from general specification in existing literature. Hence, the procedure can be replicated anywhere in the world for any given smart energy hub or systems.
The objective is to determine the optimum size of the battery energy storage, photovoltaic and wind systems at minimum total investment costs. The results of short-term power generation forecasts are utilized to improve and effectively schedule the FDRs. Two simulation scenarios, without and with the consideration of DSM, were compared. From the simulation results obtained, the application of FDR scheduling resulted in a significant cost saving of about 12.41% of the investment costs. The FDR shifting programs time-shifted the flexible energy demands from deficit generation periods to surplus generation periods, thus; resulting in credible system component size reduction. Moreover, the proposed approach demonstrated the effectiveness of the FDR in minimizing the mismatch between the generation and load demand. Hence, this paper has shown the potential cost-benefit of FDRs scheduling DSM strategy consideration for effective optimal component sizing for current and future VRE-based smart microgrid developments.

Acknowledgments:
The authors wish to acknowledge the Japan international cooperation agency (JICA) for the support provided in the form of African business education (ABE) scholarship to the main author towards the success of this research work. The authors also wish to appreciate the effort of Hannington Gochi of REA, Kenya office for supplying the principal data needed for this project.

Conflicts of Interest:
The authors declare no conflict of interest.