Integrated Multi-Criteria Planning for Resilient Renewable Energy-Based Microgrid Considering Advanced Demand Response and Uncertainty

: Weather-driven uncertainties and other extreme events, particularly with the increasing reliance on variable renewable energy (VRE), have made achieving a reliable microgrid operation increasingly challenging. This research proposes a comprehensive and integrated planning strategy for capacity sizing and operational planning, incorporating forecasting and demand response program (DRP) strategies to address microgrid operation under various conditions, accounting for uncertainties. The microgrid includes photovoltaic systems, wind turbines, and battery energy storage. Uncertainties in VREs and load ﬂuctuations are modeled using Monte Carlo simulations (MCSs), while forecasting is based on the long short-term memory (LSTM) model. To determine the best techno-economic planning approach, six cases are formulated and solved using a multi-objective particle swarm optimization with multi-criteria ranking for these three objectives: total lifecycle costs (TLCC), reliability criteria, and surplus VRE curtailment. Shortage/surplus adaptive pricing combined with variable peak critical peak pricing (SSAP VP-CPP) DRP is devised and compared with a time-of-use VP-CPP DRP in mitigating the impacts of both critical and non-critical events in the system. The simulation results show that the integrated planning, which combines LSTM forecasting with DRP strategies, achieved about 7% and 5% TLCC reductions for deterministic and stochastic approaches, respectively. The approach allowed optimal sizing and operation planning, improving the utilization of VREs and effectively managing uncertainty, resulting in the most cost-effective and robust VRE-based microgrid with enhanced resilience and reliability.


Introduction
The global movement toward nearly complete dependence on variable renewable energy sources (VREs), precisely wind and solar, has gained significant momentum as societies seek to tackle climate change and ensure a sustainable energy future.One crucial solution that has emerged to achieve resilient energy systems is the concept of self-sufficient community microgrids [1].These microgrids enable the decentralization of energy generation, storage, and consumption, explicitly focusing on utilizing VREs.Nevertheless, the inherent uncertainty and volatility of VREs pose significant challenges to ensuring reliable microgrid operations [2].While energy storage systems (ESSs) such as batteries [3], flywheels, and fuel cells [4] show promise and are prove to be beneficial in enhancing energy supply management and maintaining a stable balance between electricity supply and demand in microgrids, their practicality diminishes with increasing VRE penetration.
As the adoption of VREs becomes more widespread, there arises a need for substantial energy storage capacity to meet the growing demand.However, the cost of implementing battery energy storage systems (BESSs) remains prohibitive, making it impractical to rely solely on BESSs as a cost-effective solution for VRE-based microgrids [5].Furthermore, the non-dispatchable nature of VREs adds complexity and challenges to conventional planning techniques for microgrid operations and capacity sizing.Thus, a holistic approach is essential to successfully integrate multiple VREs and ensure operational resilience even during unfavorable events.This involves not exclusively relying on BESSs by intelligently incorporating short-term and long-term planning techniques [6].Microgrids can guarantee reliable operations by employing these integrated planning techniques while effectively injecting a significant portion of VREs into their energy systems.These planning methods encompass various strategies, including demand-side management (DSM), resource and load forecasting, etc.
Demand-side management (DSM) programs are strategically designed to modify consumers' electricity consumption behaviors, leveraging the flexibility of demand resources and aiming to achieve an economic load profile for utilities.DSM programs offer lower price incentives to consumers, encouraging them to adjust their electricity usage based on utility-preferred timing [7].The integration of intelligent DSM practices has led to numerous techno-economic benefits, such as reducing the cost of electricity for consumers, maximization of the operation of VREs generation units, minimization of the overall system's peak demand, etc. [8,9].Advancements in cyber-communication have further revolutionized DSM operations by enabling real-time monitoring and efficient control of consumer devices, aligning with the priorities and needs of power systems, thus contributing to remarkable progress in the overall VRE-based electricity market design.The increasing intelligence of power systems, where smart consumer devices and electricity infrastructure communicate seamlessly and respond to utility needs, has resulted in significant improvements in ensuring the reliability of microgrid systems with higher levels of VRE integration.The challenge of balancing varying VRE generation with fluctuating load patterns, which once hindered the widespread adoption of VREs, is now solvable.
DSM employs various strategic approaches, with demand response programs (DRPs) playing a crucial role in balancing real-time electricity demand and supply, ensuring reliable and efficient integration of VREs into microgrid systems.DRPs serve as strategies to achieve the most suitable and economically viable operating conditions, considering information about available supply capacity, load requirements, and energy market dynamics over time.Utility companies often offer incentives through customer-friendly tariff packages, such as flexible payment options and attractive prices for adjusted load demand patterns and resulting electricity consumption, to encourage specific changes in customers' electricity usage patterns.Implementing well-designed DRP schemes can lead to substantial cost savings in the planning and operation of electric grids or microgrids [10].DRP models can be categorized into two main types: price-based and incentive-based demand response models, encompassing various variations, such as critical peak pricing (CPP), real-time pricing (RTP), time of use (TOU), emergency demand response, and critical demand response, among others [11].
The benefits of efficient prediction strategies for optimizing VRE-based power systems have gained notable attention in recent research due to their promise to guarantee reliability and achieve result-based sustainable energy transition planning.Through proactive predictions and responses to changes in VREs, microgrids can achieve a well-balanced and dependable power supply, lessening the over-reliance on expensive ESSs and other backups.Similarly, VREs introduce inherent variability and uncertainty.This uncertainty significantly threatens the stability and efficiency of VRE-based systems.However, with accurate forecasting providing insight into extreme events for the microgrid, DRP strategies can be harnessed in advance to muster sufficient resources to mitigate critical stress in the system, which could otherwise lead to a cascading power failure.By accurately forecasting VRE variability and responding in real time to anticipated discrepancies in system supply and demand, microgrids can effectively handle the uncertainty associated with VREs.
The significance of integrated planning, including optimal sizing and operational planning, has been underscored in various studies.The authors of [12] emphasize the critical need for integrated sizing and operational planning to maximize VRE-based systems' efficiency, reliability, and robustness.These studies emphasize that the infrastructure may be over-or under-designed without optimal sizing, leading to resource waste or inadequate power supply.Additionally, microgrid operations could become unreliable without effective operational planning, including practical resource forecasting, leading to power fluctuations.Given the growing adoption of VREs into community mini-grids, VREgeneration variability and uncertainty have highlighted the need for integrated optimal planning to manage and mitigate these challenges.The existing literature shows that comprehensive and integrated planning studies remain insufficiently explored, underlining the need for advanced strategies to navigate the complex dynamics and uncertainties of VREs on a community microgrid's integrated capacity and operation.
Consequently, this study proposes a comprehensive approach to community microgrid planning, integrating demand response strategies, precise forecasting, and joint sizing and operation planning under uncertainty.These elements are crucial for managing the complexities and uncertainties of VRE-based microgrids.The proposed approach offers multiple benefits, such as improved resilience and reliability, enhanced VRE utilization, and better ride-through capabilities in extreme weather events.The specific contributions of this study are highlighted below:

•
A comprehensive and integrated method for planning community microgrids based on VREs is proposed and examined.This approach incorporates DRPs strategies, precise forecasting, and combined sizing and operational planning, all under uncertain conditions.

•
The techno-economic advantages of implementing a combined DRP approach, integrating DRP strategies based on shortage/surplus adaptive pricing (SSAP) alongside variable peak critical peak pricing (VP-CPP) DRPs, have been proposed and thoroughly investigated.These are compared with a combination of time of use (TOU) and VP-CPP strategies.These two ensemble DRP approaches have been demonstrated to provide a more robust and dynamic response, significantly enhancing the resilience and reliability of microgrids under severe conditions, such as extreme weather events, compared to traditional DRP strategies.

•
To ascertain the role of accurate forecasting in conjunction with SSAP VP-CPP DRP strategies, the LSTM approach has been investigated for VRE generation and load demand forecasting to enable optimal preparation and reduce the need for load curtailment or generation curtailment, thereby bolstering the resilience of microgrids against sudden power generation fluctuations.

•
To address the inherent variability and resulting uncertainty introduced by VREs and load variation, which could potentially undermine the reliability and operability of isolated community microgrids, Monte Carlo simulations have been employed to generate uncertainty scenarios.This ensures the robustness of the system against extreme weather fluctuations.
The rest of this paper is arranged as follows: Section 2 outlines the system configuration and mathematical modeling.A thorough explanation of the proposed integrated planning framework and demand response program models is provided in Section 3. Section 4 delves into the formulation of multi-objective optimization problems and simulation setup.Section 5 includes results, analysis, and discussions, while the conclusion of the work is presented in Section 6.

Wind Turbine (WT)
The power output of a WT system at a given time (t) is contingent on the instantaneous wind speed (u(t)) at the installed hub height.By using the piece-wise function outlined in Equation (2), the power generated (S w (t)) of the WT specific to a particular hub height and WT model can be computed as follows [8].
where S cp w signifies the rated capacity of the installed WT, whereas u co , u ci , and u r denote the cut-out, cut-in, and rated wind speeds, respectively.

Photovoltaic (PV)
The power output (S pv ) of a PV system is primarily influenced by factors such as solar irradiance (I I (t)), temperature (Temp(t), and derating factor (Λ pv ).Equation (2) illustrates the instantaneous power output of the PV system [13] S pv (t) = I I (t) where S cp pv denotes the installed PV's capacity, and α pv is the temperature coefficient.I stc , and Temp stc denote the solar irradiance and temperature under standard test conditions.

Battery Energy Storage System (BESS)
When the total power generated by the WT (S wt ) and PV (S pv ) surpasses the load demand (S L ), the BESS transitions into a charging state to absorb the surplus power.Conversely, it switches to a discharging state when the demand exceeds the total power generated to balance out the power deficit in the system.The difference between the total VRE generation and the load demand primarily dictates how much power can be stored or drained from the BESS at any moment [14].The power drawn from or sent to the BESS for discharging or charging, respectively, is contingent on the previous state of charge (SOC(t − 1)) and the constraints of the BESS system: the maximum (SOC max ) and minimum (SOC min ) SOC boundaries.The SOC status (SOC(t)) of the BESS at any specific time (t) and the BESS constraints are detailed in Equations ( 3) and (4), respectively.
where S cp b represents the BESS installed capacity, and SD b is the self-discharge of the BESS; η c b and η d b are the BESS's discharging and charging efficiencies as percentages; and (S ds b (t)) and (S ch b (t)) represent the discharging and charging power to and from the BESS at a time (t), respectively.

Proposed Integrated Planning Framework
The flowchart in Figure 2 shows the proposed planning framework for a VRE-based community microgrid considering uncertainty and various demand response mechanisms.A comprehensive planning framework is critical in capacity and operational decisionmaking for VRE-dependent systems to guarantee improved operational reliability and serviceability, particularly during prolonged unfavorable weather conditions.
Two operation strategies are devised to ensure the robust operational capability of the proposed system, namely normal non-critical and critical (emergency) operation modes.During non-critical periods, the operation of the BESS is well coordinated with the demand response strategies to maintain a steady power supply to the load demand by correcting power imbalances in the system during spans of acceptable levels of deficient or surplus VRE generation.
The system is considered to be in the optimal operation state when the generated power from VREs equals the power demand.The price of electricity remains constant, as determined in the preceding period, and the flexible resources (FDRs) stay unadjusted to maintain this state.Nevertheless, if the power generated by VREs exceeds the demand, or the demand exceeds generation, the utility activates a demand response program by providing incentives through price adjustments.This helps address the power mismatch by lowering or increasing electricity prices, encouraging consumers to utilize excess power, or addressing shortages in the system by rescheduling power consumption.If the surplus or the power shortage cannot be fully addressed by adjusting the DRP once the available FDRs have been exhausted, the BESS is initiated into operation.The price is optimally adjusted to keep the system within acceptable operation limits, guaranteeing optimal and normal operation.On the other hand, during harsh weather conditions in which a VRE-generating resource capability becomes extremely low, and the reliability of the systems is entirely dependent on energy storage for which the state of charge is noted to be critical, the system transitions into an emergency state.During such a critical state, VP-CPP DRP is initiated, and an extremely high electricity price is enforced to discourage the end-user from non-essential electricity usage and alleviate the system's stress, thereby guaranteeing a survival mechanism without collapsing into a state of total power outage.The uncertainty consideration of the VREs and the load demand guarantee that the system is designed to be robust and capable of managing variability and uncertainties of VRE resources with diverse operating characteristics.Coupling demand-side flexibility through demand price-response resources with the foreseen generation profile of VRE units using LSTM time-ahead resource forecasts guarantees improved and optimized performance for the community microgrid system overall.

Demand Response Programs, Load Modeling Concept, and Flexible Demand Resources
Demand response planning significantly impacts the allocation of resources and pricesetting within a power system.Integral to this process is load modeling, a concept that classifies loads into different categories: adjustable, non-adjustable, elastic, and inelastic.By understanding the adaptability and constraints of each load type, system operators can manage resources more efficiently, set prices with a higher degree of accuracy, and, consequently, optimize the performance of the power system.

Flexible Demand Resource Modeling and Economic Load Model
DRPs typically segregate electrical demand into elastic (S e L (t)) and inelastic (S i−e L (t)) loads.Elastic demand includes electrical loads, such as dishwashers and water pumps, where operation times can be rearranged from one period to another.Conversely, inelastic loads operate within fixed times (fixed operation and usage times).Such inelastic loads are further divided into adjustable S adj L (t) and non-adjustable S n−adj L (t) loads [15].Heating, ventilation, and air conditioning systems fall under adjustable inelastic loads.In contrast, hospital and other non-crucial loads are classified as critical S crt L (t) and non-critical S n−crt L (t) non-adjustable loads, respectively [16,17].Therefore, the overall system load S L (t) at any given time t can be represented as the sum of all types of electric loads as described below (5): where: It is essential to underscore that flexible demand resources (S f lx L (t)), as outlined in Equation ( 6), comprise both elastic and adjustable inelastic load demands.These FDRs are deemed responsive to price fluctuations defined by the adopted DRP, and participation is purely voluntary from the consumers' perspective.Meanwhile, Equation (7) elucidates the types of load demand that can be curtailed when the microgrid is in a state of emergency or criticality.

Price Elasticity of Demand
The price elasticity of demand (ψ pr(x,x) ) is a measure that reflects the connection between changes in the electricity demand and variations in the price of electricity [6,18].As detailed in Equations ( 8) and ( 9), any adjustment in the electricity price during periods x or y will lead to a proportional change in the electricity demand (δS L (x) or δS L (y)) in the corresponding x or y period, and vice versa.This means that the overall load pattern for entire periods (x, y ∈ T) is impacted by hourly fluctuations in electricity prices during both the xth and the yth periods.
where ψ pr(x,y) and ψ pr(x,x) are the multi-period and single-period price elasticities of the demand, respectively.E R pr is the reference price of electricity.

Combined Time-of-Use and Variable Peak Critical Peak Pricing (DRP)
TOU DR operates on a time-based pricing scheme, offering predetermined rates for different periods of the day, such as peak rates for peak system loading and off-peak rates for low-demand periods [19,20].The number and variations of the distinct pricing periods and tariff structure enforced are usually utility-specific based on the need for improving the overall system's efficiency.On the contrary, variable period CPP (VP-CPP) is a variant of critical peak pricing where the specific time, duration of the interval, and days on which the critical peak rates will be enforced are not specified or fixed in advance [21,22].Instead, critical peak pricing is determined based on the urgent need or state of the grid, such as during a loss of a generation unit, increased excess load on the system, or weather events [23,24].Furthermore, the customers are generally informed with little advance notification about the upcoming extreme rates.The implementation of a combination of the TOU and VP-CPP as proposed, with varying electricity rates during different periods, including peak, off-peak, valley, and critical peak periods, with the specific critical peak periods subject to an extreme system state is expressed in (11).The impact of the TOU-VP-CPP pricing scheme implementation, described in Equation (10), yields a responsive load model, as expressed in Equation (11).

Shortage/Suplus-Based Adaptive Pricing and Variable Peak Critical Peak Pricing DRP
The proposed SSAP VPP-CPP is an advancement of a time-based DRP with two modes of operation: critical and non-critical.During non-critical periods, the SSAP VPP-CPP DRP aims to offer dynamic electricity prices varying according to deviations between the expected electricity demand and total variable renewable energy (VRE) generation output; mismatch power is addressed by discharging or charging the BESS while priori-tizing rescheduling the available FDR in real time.Conversely, when the system is highly constrained, such as under severe weather conditions in which the capability of VREs to generate power diminishes significantly, and the system's reliability heavily relies on energy storage with a critical state of charge, an emergency arises (critical mode).In such a critical state, the VP-CPP DRP is activated, enforcing a considerably higher electricity price to discourage non-essential electricity consumption by end-users and alleviate stress on the system.This ensures that the microgrid has a sufficient survival mechanism to ride through a critical/stressed state without collapsing to a state of complete power outage.The adaptive pricing approach of SSAP CPP-VPP, elaborated on in Equation ( 12), provides enhanced flexibility and responsiveness to different microgrid states (whether in standard or critical periods); this yields a new and cost-effective load profile, as expressed in Equation ( 13): where

Point Forecasting Using LSTM and Uncertainty Modeling Using Monte Carlo Simulations
Uncertainty modeling of the VREs and the load demand of the system and accurately predicting their state hours in advance is crucial for efficient operation and resource capacity planning of a VRE-based community microgrid.

LSTM-Based Point Forecasting
This work employs the long short-term memory (LSTM) approach to predict next-hour load demand, solar irradiances, and wind speed point focus for each period for the entire scheduling horizon.LSTM is a distinct variation of RNN (recurrent neural network) with improved prediction capabilities [25].The distinctive gate mechanism employed in LSTM makes it robust to overcome the drawbacks of vanishing gradients during backpropagation through time compared to other deep learning techniques [26].This allows LSTM to retain long-term dependencies in sequential data, making it a powerful choice for sequence-tosequence modeling [27]; thus, it is selected in this study based on its outstanding capability in time series forecasting.
LSTM consists of a cell state and three gates: input, forget, and output [28].The cell state is a pathway for information modulated by the gates.The input gate (Equation ( 16)) determines what information is stored, the forget gate (Equation (15)) chooses what to retain or discard, and the output gate (Equation ( 18)) selects the data to be output based on the cell state [29,30].
where σ is the sigmoid function, and h t−1 is the output from the previous time step.
x t is the input for the current time step.b and W are the biases and weights for each gate, respectively.

Uncertainty Modeling with Monte Carlo
To ensure the robustness of the system designed with a guaranteed acceptable level of reliability, Monte Carlo simulations (MCSs) have been incorporated into the optimal capacity planning to account for the uncertainty of the VREs and the load demand.MCS methodology utilizes statistical sampling processes to generate random scenarios for stochastic parameters: solar irradiance [31], load demand, and wind speed that reflect their uncertainty [14].The MCS technique models uncertainties by sampling inputs and transforming them using probability distribution functions to generate scenarios [31,32].This strategy yields a finite number of possible scenarios for all stochastic parameters, enabling a thorough evaluation of system robustness under various conditions.

MOPSO Algorithm and TOPSIS Ranking Technique
This study employs a hybrid approach combining a MOPSO (multi-objective particle swarm optimization) and TOPSIS (technique for order preference by similarity to ideal solution) to solve and select the best optimal system configuration and operation approach for the community microgrid.Based on the non-dominated alternatives obtained from the MOPSO algorithm, TOPSIS ranks the non-dominated solutions and selects the best solution.

Multi-Objective Particle Swarm Optimization
A MOPSO is a technique inspired by natural swarm behaviors to solve discrete and continuous optimization problems [33].It focuses on identifying optimal objective function values using two solution points: local best Pbest i = (p i1 , p i2 , . . ., p id ) and global best Pbest g = gbest = (p g1 , p g2 , . . ., p gd ).The subsequent particle positions are updated as: where iter is the current iteration, and iter max denotes the total number of iterations.
The MOPSO approach, in this work, sorts non-dominated solutions for improved search accuracy within efficient, non-inferior, and admissible Pareto fronts; it is boosted further by a mutation operator identical to the NSGA II algorithm [34].For a multi-objective problem with n objective functions and m decision variables, the goal is to minimize: Here, g and h represent inequality and equality constraints, respectively.A point is Pareto optimal if: ∀i or for at least one i ∈ I:

Technique for Order Preference by Similarity to Ideal Solution
The core concept of TOPSIS is that the best optimal alternative should be closest to the positive-ideal solution and farthest from the negative-ideal solution [35,36].At both the application and theoretical levels, TOPSIS is a highly effectual technique for alternative evaluation in multi-criteria decision-making [37,38].The TOPSIS procedure is as follows [39]: Normalize the optimal alternative matrix (x p,q ).
where v p,q represents the normalized attribute values.Allocate weights (w q ) to each of the attributes and compute the weighted normalized matrix (E p,q ): E p,q = v p,q × w q (20) Determine the positive-ideal E + and negative-ideal E − solutions, respectively, as follows: Compute the Euclidean distances from both the negative-ideal B − p and positive-ideal B + p solutions: compute O p , which represents the relative closeness to the ideal solution.
Finally, alternative ranking based on the preference order is performed.

Multi-Objective Optimization Problems Formulation and Simulation Setup
The optimization process involves three techno-economic objective functions to determine the most cost-effective and efficient capacity configuration and operation planning for a community microgrid.The three objectives encompass the economic criterion, reliability requirements, and the management or curtailment of surplus VRE generation and/or load curtailment, all while considering uncertain operating conditions.

Objective 1-Total Life-Cycle Cost (TLCC) minimization (Economic criteria):
The first objective function is formulated as a total life-cycle cost (TLCC) minimization problem, as elaborated in Equation (26), which aims to optimize the net present value (NPV) of all costs associated with the system components incurred throughout the system's lifetime.The TLCC is composed of the investment costs (IC z ), annual operation and maintenance costs (O&M z ), replacement costs (RC z ), and salvage value (SV z ).
where in Equation ( 26), z is used as an index to identify each specific component within the system.The decision variables, denoted as C z , signify the most efficient capacities for the individual system components, namely PV (photovoltaic), ESS (energy storage system), and WT (wind turbine).The project lifetime and the yearly time step are denoted as N and n, respectively.The decision variables are the capacities of the WT, denoted as S cp w ; the photovoltaic panels (PV), denoted as S cp w ; and the BESS, denoted as (S cp w ).

2.
Objective 2-Deficiency of power supply probability (Reliability criteria): DPSP is the ratio of the total curtailed load demand (the unserved energy demands) (S curt L ) to the total load demand over an entire operation planning period (T).
This score reflects the extent to which the system relies on demand curtailment to balance power supply and demand.The lower the DPSP, the less the system relies on demand curtailment (unserved energy demands), and the more reliable the system [40,41].

3.
Objective 3-Loss of Produced Power Probability (LPPP): LPPP is the proportion of total curtailed power (wasted/unused) from VREs (S curt g ) to the total power that all the VRE sources could potentially generate (S g ) during the entire operation period (T).LPPP is a metric that signifies the likelihood of non-utilization of available variable renewable energy (VRE) due to factors such as BESS restrictions, demand-supply imbalances, or operational constraints [42].
A high LPPP indicates a substantial waste of potential renewable energy, signaling suboptimality in the power system's operation and design.

1.
Demand-generation power balance constraints: At any given time (t), the combined power from VREs and the BESS should meet the load demand, regardless of the DRP or uncertainty considerations: ) and charging power (S c,max b ) of the BESS, which are determined by the C-Rate of the BESS, which is the rate at which the BESS is being charged or discharged relative to its total capacity.

3.
FDR constraint: where (δS f lx,min L ) and (δS ) correspond to the minimum and maximum allowable capacities for an FDR, respectively, at any given time (t).

4.
Set electricity price limits: where (E drp,max pr ) and (E drp,min pr ) represent the maximum and minimum electricity price limits, respectively, at any given time (t).

Optimization Parameters, Case Study, and Simulation Cases
This research explores various strategies for capacity sizing and operational planning for a VRE-based community microgrid using MOPSO-TOPSIS in a Matlab environment.Central to these strategies are forecasting, DRPs, and uncertainty considerations.Monte Carlo simulations (MCSs) are employed to model the uncertainty of VREs and load variations.Load demand uncertainty is assumed to stem from two factors: the everyday fluctuations in load demand typically experienced in a power system and the potential uncertainties related to customer response to pricing volatility, among other factors due to the implementation of DRP strategies.The mean absolute error (MAE) error metrics are initially calculated based on the results of LSTM forecasting using Scikit-learn in Python.The resulting MAE is then used as a sufficient indicator of the level of uncertainty for each data point in time to quantify the uncertainty.The MCS then generates 50 scenarios within a specified percentage range of the MAE [43,44].This approach allows the simulation of various potential outcomes for the stochastic parameters within each period, thus facilitating a comprehensive evaluation of system robustness under various conditions.

Techno-Economic Parameter and Case Study
The proposed planning for a VRE-based community microgrid, aiming for a transition to 100% VREs, has been investigated and validated using a real case study of an isolated community microgrid in Kenya as a test benchmark.The existing microgrid system within the case study predominantly depends on diesel power generation.The techno-economic parameters, alongside the hourly load demand and climatic data for the Kenyan case within the geographical space of 2.3369 • N, 37.9904 • E are all drawn from the actual conditions of this specific area, as detailed in Table 1 [45][46][47].

Simulation Cases
In this paper, six distinct simulation cases are investigated, each representing a different approach for the optimal planning and capacity sizing of a community microgrid: • Case 1-Deterministic-based Planning (base case): This case focuses on capacity sizing and operation planning without considering DRP and forecasting.A flat reference pricing scheme is adopted in this case.The system incorporates SSAP DRP and employs forecasting for VREs and the load demand to devise a flexible and responsive microgrid system.While the pricing scheme is similar to that of Case 3, electricity prices for the upcoming hour are announced one hour in advance based on the forecasted power imbalances in the system.
These cases primarily vary in their considerations of uncertainty, DRP structure, and incorporation of forecasting into the planning process.

Demand Response Structure and Flexible Demand Capacity
For all of the DRP schemes considered, the permissible FDR capacity is set to allowable values of ±10% of the overall system load at any specified time t.The electricity tariff and pricing structure are derived from the current tariffs established by the Kenyan Energy Regulatory Commission [52].In this research, the reference electricity price E R pr is set to 15.80 US cents per kWh, which corresponds to the standard rate in the Kenyan electricity tariff setup.The elasticity of the demand, in relation to various system loadings, are detailed in Table 2.

Results, Analysis, and Discussions
The simulation results for the six cases were determined; each focused on optimal capacity and operation planning, with and without uncertainty, DRPs, and LSTM-based forecasting consideration.The MOPSO algorithm was employed in each case to determine optimal planning results.Several non-dominated optimal configurations for system components and their corresponding operational strategies were determined.The TOPSIS technique prioritized and determined the most favorable and techno-economic planning approach among the multiple optimal solutions (non-dominated).

LSTM-Based Point Forecasts for Wind Speed, Solar Irradiances, and Load Demand
The LSTM forecasting model was utilized for DRP implementation and Monte Carlobased scenario generation in Cases 4, 5, and 6.Figures 3-5, contrast the actual values with the LSTM-predicted values for solar irradiances, wind speed, and load demand.The MAEs for wind speed and associated WT power were 0.14 m/s and 23.81 kW, respectively.For solar irradiances and the PV power output, the MAEs were 19.97 w/m 2 and 21.07 kW, respectively, with the load demand forecast showing an MAE of 24.68 kW.Drawing upon forecast accuracy indicators, MAE metrics were applied to generate scenarios using MCSs for wind speed, solar irradiance, and load demand in Cases 4, 5, and 6.The scenarios were generated within a 25% range, a margin determined by the highest MAE observed in the load demand forecast.To provide a concise view, only 50 generated scenarios are depicted in Figures 6-8 for solar irradiances, wind speed, and load demand, respectively.The reliability of the LSTM forecasting model has proved effective for wind speed, solar irradiances, and load demand based on simulation results, as evidenced by the low MAE scores.Thus, the forecasting model was adopted in Cases 4, 5, and 6 to optimize the efficient use of VRE generation and mitigation of variability of VREs and the load demand.The LSTM model's precision is invaluable in enhancing the operational efficiency and generating uncertainty scenarios for a stochastic optimization using the MCS technique.
A comprehensive analysis and discussion of the results for all cases considered is as follows:

Case 1: Optimal System Component Capacities and Operation Planning without Considering Demand Response
Table 3 shows the optimal capacities of the microgrid's components and the TLCC against their corresponding reliability (DPSP) and VRE curtailment (LPPP) percentages for the first four best-ranked non-dominated solutions.Figure 9a shows the non-dominated optimal Pareto front in 3D for the three objectives considered.As neither the DRP nor forecasting is considered, the microgrid is optimized and operated in its fundamental form.This solution is considered the least efficient for all cases because it neither anticipates demand fluctuations nor optimizes planning based on varying VRE generation.Thus, this case is considered a classical planning approach to capacity sizing and operational planning, providing a baseline against which to compare more advanced techniques.In case 2, incorporating TOU-VP-CPP DRP into the simulation introduced a more robust approach to planning.Figure 9b presents the non-dominated optimal Pareto front in 3D for Case 2, considering the three conflicting objectives: DPSP, TLCC, and LPPP.Compared to Case 1, Case 2 reveals a substantial cost reduction of around 5%, from $10,377,384.53 to $10,314,687.15for the best-ranked results.This cost reduction, as shown in Table 3, is achieved without significantly impacting or compromising the system's reliability (the DPSP is approximately 0.5% for both Cases 1 and 2).Implementation of the TOU VP-CPP DRP pricing structure largely contributes to this cost-saving.By encouraging consumers to shift loads from high-priced to low-priced periods throughout the day, energyusage efficiency improves, potentially leading to further cost reductions.This impact is also evident in the decreased system component capacities, particularly the 12.7% reduction in BESS capacities for the best-ranked configuration, as compared to case 1.While the results based on VP-CPP application on top of TOU as a critical event mitigation strategy did not rank among the best, their role in averting total system collapse during periods of lower reliability and constrained generation is significant.However, this approach has a notable limitation.With its static pricing, the TOU VP-CPP DRP scheme lacked sensitivity to variations in VREs and demand.This lack of responsiveness and flexibility towards VREs hinders the system's overall adaptability, affecting its techno-economic performance.

Case 3: Optimal System Component Sizing and Operation Planning Considering SSAP VP-CPP DRP
In this case, capacity and operation planning are simulated and assessed, considering the SSAP VP-CPP DRP. Figure 9c presents the non-dominated optimal Pareto front in 3D for Case 3. As evidenced in Table 3, this case outperformed all other cases in terms of costs, with the lowest TLCC of $10,278,836.96and maximum reliability and a DPSP of 0.06% for the topranked result.Moreover, it demanded the minimal optimal component sizes, in particular, the BESS requirement of 3500 kWh, which is the minimum compared to Cases 1 and 2 (deterministic cases).The effectiveness of this case stems from its sensitivity to fluctuations in VREs and demand due to the superior feature of the advanced shortage/surplus-based adaptive pricing technique.This technique deploys dynamic and adaptive pricing to harness adequate FDR by adjusting electricity prices based on supply and demand balances.However, this approach is deterministic and does overlook the inherent uncertainty in load demand and VREs.

Case 4: Optimal System Component Capacities and Operation Planning Considering Uncertainty
This approach makes robust planning decisions by considering the inherent uncertainty in VRE output and the load demand based on MCS scenarios when determining optimal capacity sizing and operation planning.However, due to the introduction of these uncertainties, matching the VRE generation becomes challenging, necessitating larger component sizes for the PV, WT, and BESS.
As evident in Table 3, compared to all the planning cases, this configuration is the most expensive, with a TLCC of about $10,576,185.15for the best-ranked system and $11,157,231.69for the system with DPSP reliability set to the minimum.Similarly, this system has the highest VRE curtailment of about 10.31% of the total VRE-generated power compared to all cases investigated.Figure 9d presents the non-dominated optimal Pareto front in 3D for Case 4.
While this case delivers a highly robust decision framework, it does not incorporate predictive or responsive strategies.Its method for addressing uncertainties involves upscaling component capacities to increase reliability.However, this approach leads to the highest overall system cost compared to all of the scenarios.

Case 5: Optimal System Component Sizing and Operation Planning Considering LSTM-Based Forecasting, TOU VP-CPP DRP, and Uncertainty
This case closely resembles Case 2 but considers a stochastic optimization approach.Accounting for uncertainties makes planning decisions more robust, similar to Case 4. Combining TOU and VP-CPP pricing, the microgrid is designed to react proactively to unexpected power imbalances in critical and non-critical states, enhancing the overall reliability and efficiency.
Moreover, employing LSTM forecasting improves the accuracy of VREs output and load demand projections, resulting in a more cost-efficient design than Scenario 4. When comparing the best-ranked planning decisions in scenarios 1 and 4, there is an evident reduction in component sizes, which subsequently helps decrease the overall system cost.Figure 9e presents the non-dominated optimal Pareto front in 3D for Case 5.
An important point to note is that the LSTM forecasts enable the system to differentiate between overlooking critical and non-critical events.Such anticipatory capability allows for swift adjustments in pricing settings/decisions aligned with the TOU VP-CPP DRP model, further improving the power utilization strategy and overall efficiency.However, despite the aforementioned advantages of Case 5 over Case 1, 2, 3, and 4, this approach has a significant drawback.The utilization of LSTM forecasting remains under-exploited due to the predominance of non-dynamic pricing.The electricity pricing structure is still predominantly static due to the TOU VP-CPP DRP's TOU aspect.The resultant electricity price does not mirror the instantaneous variations in VREs and demand in the system.This non-responsiveness necessitates bigger system components and increases the system's cost compared to Case 2 as outlined in Table 3.This lack of agility and adaptability in response to VREs moderately diminishes the competitive edge of this planning approach.5.7.Case 6: Optimal System Component Sizing and Operation Planning Considering LSTM-Based Forecasting, SSAP VP-CPP DRP, and Uncertainty Case 6 presents a stochastic optimization approach combined with SSAP VP-CPP DRP and forecasting to devise an adaptable and resilient microgrid system that effectively addresses uncertainty.This design synergistically integrated the adaptive pricing strategy developed in Case 3 with the stochastic optimization under uncertainty inherent in Cases 4 and 5.According to the simulation results presented in Table 3, comparing the best-ranked techno-economic results, Case 6 excels over other cases in terms of costs (minimum TLCC) and optimized component sizes, especially the BESS, which stands as the most expensive component (the selected capacity of BESS in Case 6 is only 3200 kWh, while other cases have much bigger capacity sizes).
This system efficiently addresses uncertainties by coordinating precise forecasting and DRP techniques.By leveraging SSAP DRP and VRE forecasting, the microgrid swiftly responds to immediate supply-demand imbalances.The SSAP pricing strategically activates FDRs during VRE peak times and deactivates sufficient FDRs during periods of decreased VRE output.This approach reduces the reliance on the more expensive BESS solution, similar to the efficiencies observed in Case 3.
While the proactive management of uncertainties increases system robustness, evidenced by a notably low DPSP value of less than 0.04% in all the results tabulated in Table 3, indicating superior reliability, it also necessitates more significant system components (heftier investments), particularly PV and WT capacities.These increases render the system somewhat more expensive than Case 3.However, the robustness and adaptability devised in Case 6, especially during unforeseen critical states such as extreme weather conditions or power imbalances, indicates that the system performs exceptionally well, demonstrating superior reliability.
Though Case 3 may superficially seem economically advantageous, being cheaper in terms of its TLCC by approximately 4% for the best-ranked results and 1% for the scenario with the lowest DPSP (compared to Case 6), it is crucial to note that Case 3 follows a deterministic approach.In practical terms, scenario 6 offers a more realistic and robust blueprint to weather the harshest scenarios, representing a near-ideal realization of a community microgrid.Overall, scenario 6 sets a compelling precedent for future community microgrids' capacity and operational planning under uncertainty, especially those targeting 100% VRE-based generation.

Conclusions
This paper proposed a comprehensive and holistic approach to microgrid planning, which incorporates DRP strategies, accurate forecasting, and integrated sizing and operation planning for managing the complexities and uncertainties in VRE-based community microgrids.This study aimed at evaluating and determining the best optimal configuration and planning approach for component sizing and operation planning with consideration for flexibility management strategies for a community microgrid with the lowest TLCC, highest reliability, and minimum VRE curtailments.Six cases with unique strategies for managing challenges posed by VREs and load demand in the optimal planning and operation of a community microgrid, consisting of BESS, PV, and WT, were investigated.From the results, Case 2, which considered the TOU VP-CPP DRP pricing, achieved a 5% TLCC without sacrificing reliability compared to Case 1, which is the base case without the DRP, primarily due to TOU VPP on the pricing.However, it lacks sensitivity to VREs and demand variations.On the other hand, Case 3 considered the proposed SSAP VP-CPP DRP, yielding optimal system planning at a higher reliability performance with a minimum TLCC (of about 7% compared to Case 1) due to its adaptive pricing based on the supply-demand power imbalances state in the system; however, the optimization mentioned above is based on a deterministic planning approach.The simulation results for Cases 4, 5, and 6 are based on stochastic planning approaches.Case 4 considered VRE and load demand uncertainties, offering higher resilience, although at a higher TLCC due to more extensive system component requirements.Case 5, an improvement upon Case 2 but based on stochastic-based planning, integrates LSTM-based forecasting for VRE output and load demand and yields better performances in reliability.However, its effectiveness is hampered by the fixed pricing inherent in TOU DRP.Overall, Case 6 amalgamates features from preceding cases, incorporating SSAP DRP based on adaptive pricing, LSTM-based forecasting, and stochastic optimization.This results in enhanced adaptability and resilience to uncertainties.Incorporating LSTM forecasting combined with SSAP VP-CPP DRP further enhances the system, providing foresight and ensuring ample time for effective mobilization of FDRs to shift demand to periods of surplus generation or curtail demand during supply shortfalls.This synergistic approach likely bolsters the microgrid's resilience against extreme events and ensures optimal VRE power utilization.Although Case 6 is more expensive than Case 3, its robust decision-making under uncertainty provides guaranteed reliability under extreme weather events or upon the occurrences of a critical state in the microgrid system.Thus, the proposed planning approach can be considered the optimal blueprint for developing future VRE-based community microgrid systems.

Figure 1 Figure 1 .
Figure 1 depicts the proposed system configuration for a VRE-based community microgrid system design.The proposed model incorporates WT, BESS, PV systems, and various load types.

MultiFigure 2 .
Figure 2. Flowchart for proposed planning framework for a VRE-based community microgrid considering LSTM forecasting, uncertainties, and advanced DRPs.
are the set TOU-VP-CPP DRP prices of electricity for the yth period and the xth period, respectively.E pd pr (x) and E pd pr (y) are the incentive payments, while E ps pr (x) and E ps pr (y) are the penalties for non-compliance with the DRP provisions by the consumers, respectively.

Figure 3 .
Figure 3.The actual versus one-hour-ahead LSTM-predicted values of solar irradiances.

Figure 4 .
Figure 4.The actual versus one-hour-ahead LSTM-predicted values of wind speed.

Figure 5 .
Figure 5.The actual versus one-hour-ahead LSTM-predicted values of load demand.

Figure 6 .
Figure 6.Shows solar irradiance uncertainty scenarios based on MCSs.

Figure 7 .
Figure 7. Shows wind speed uncertainty scenarios based on MCSs.

Figure 8 .
Figure 8. Shows load demand uncertainty scenarios based on MCSs.

Figure 9 .
Figure 9.The Pareto front for the feasible and non-dominated solutions for all considered simulation cases.

Table 1 .
Techno-economic parameters and specifications.
During a normal state, the load profile is categorized into three pricing periods: peak demand from 7 p.m. to 11 p.m. at 150% of the flat rate, off-peak from 8 a.m. to 7 p.m. at the reference price, and low peak at 50% of the flat rate.-use variable peak critical peak pricing (TOU-VP-CPP DRP).The pricing structure is similar to that of Case 2. • Case 6-Stochastic planning considering uncertainty, LSTM forecasting, and SSAP DRP: • Case 2-Deterministic-based planning considering TOU-VP-CPP DRP: This case integrates the time-of-use (TOU) with variable peak critical pricing (TOU-VP-CPP DRP).In this case, a TOU pricing model is merged with a VP-CPP DRP overlay for exceptional events.• Case 5-Stochastic-based planning considering uncertainty, TOU DRP, and LSTM forecasting: This case employs stochastic optimization with MCSs to account for the uncertainty in VREs and the load demand.It optimizes operation planning using time-of

Table 3 .
The optimal component capacities, DPSP and LPP, and their corresponding TLCCs for the first four best-ranked non-dominated solutions for each of the six considered cases.