Optimal Operation of Combined Energy and Water Systems for Community Resilience against Natural Disasters

: One of the most critical challenges for modern power systems is to reliably supply electricity to its consumers during and in the aftermath of natural disasters. As our dependence on electrical power has increased over the years, long-term power outages can lead to devastating impacts on affected communities. Furthermore, power outages can halt the operation of water treatment plants, leading to shortages in clean water, which is essential during post-disaster recovery. One way to address this is to temporarily reconﬁgure power and water networks into localized networks, i.e., electric microgrids and water micro-nets, that utilize local resources to supply local demand independently of the main power grid and/or water network. Utilizing distributed energy resources such as wind and solar and treating wastewater locally for potable reuse can provide the operational ﬂexibility for such systems to operate sustainably. However, due to uncertainties in both renewable energy generation and electric/water consumption, ensuring sustainable operation is a challenging task. In this paper, an optimal operational strategy is proposed for an islanded microgrid/micro-net, considering the stochastic nature of renewable energy resources, electric demand, and water demand. An energy storage system is modeled to address the uncertainty in power generation and demand, in conjunction with local water storage and wastewater treatment to accommodate variable water demands. A two-stage stochastic programming model is formulated and solved to determine an optimal operation strategy for the combined system.


Introduction
The electric power grid has evolved from historical one-way power networks where a single generation unit served a small number of predictable loads, to modern-day power systems, which form the largest running machine ever built by humans, spanning thousands of miles and connecting millions of components [1,2]. The modern power system is not only expanding in size but is also becoming more complex due to increasing penetration of variable energy resources, energy storage systems, electric vehicles, and variable power electronic-controlled loads [3]. As more aspects of our daily lives depend on electricity, access to reliable power is becoming the cornerstone of modern society. Electrical power is essential for running telecommunication systems, transportation systems, pumping stations in metropolitan water distribution systems, water treatment and wastewater management facilities, machines used for food processing and storage, and heating and cooling of buildings, to name a few. Recently, this was further underlined by the Uri winter storm in the state of Texas in February 2021 [4,5]. During the event, the Electric Reliability Council of Texas (ERCOT) had to order transmission service providers (TSPs) and distribution service providers (DSPs) to perform rolling power outages across their territories to prevent a statewide blackout. There are many examples that show the vulnerability of the power grid to natural disasters and manmade disturbances [6][7][8].
In addition to damages to the economy and the environment, most natural disasters result in significant social impacts, especially on socially vulnerable groups. For example, there is sufficient generation available from wind and PV systems, which are otherwise turned off when there is higher electrical demand in the system [33,34]. Clean water from the WWTP can be pumped from lower elevations to higher elevations and stored in water distribution tanks at times of high generation. Once the tanks are filled to a desired height, gravitational force can be utilized to supply water demand to customers with little or no energy consumption.
In order to provide a reliable supply of energy in the system, CES is often considered in conjunction with wind and PV systems [35]. Although CES can help improve the quality of power, its overall cost is significant compared to the zero fuel cost of renewable generators [36]. Another way to mitigate the variability of renewables is to use demand response (DR) [37]. With DR, loads can be controlled (shed or shifted to a different time) such that power generation matches the power demand at any given time. Similarly, there are pump-scheduling techniques proposed in the literature to reduce their energy footprint [38,39]. Many researchers have focused on the operation of microgrids with stochastic energy resources [40]; authors in [41] developed a two-stage stochastic model to estimate a day-ahead optimal strategy for dispatching distributed units, considering the variability of renewable energy resources. Similarly, authors in [42,43] formulated a two-stage stochastic programming problem to incorporate uncertainty in load and PV forecasts. Authors in [43] developed a stochastic mixed-integer programming model to identify the optimal size of power system components considering variability in wind and PV systems.
This paper presents a coordinated water and energy operation strategy in an isolated community, operating as a combined microgrid/micro-net. It has been assumed that the community is either geographically far away from the main grid or is no longer connected to it due to some disturbances causing an outage. It is shown how limited energy and water resources can be optimally allocated to address the needs of the community. To address uncertainties in generation and demand, a stochastic framework is considered. To do this, a two-stage stochastic programming formulation has been proposed which ensures that the demands (both water and power) are met as much as possible, at minimum cost, and with a minimum amount of load shedding or shifting. In the first stage of the problem, the solution determines the amount of water to be purchased from the external source at the start of the dispatch period (e.g., a day in advance) and the amount of energy purchased to charge the battery. It is assumed that the community is equipped with a water storage tank and a CES. Then, during the second stage, the purchased resources are utilized to address demands, while considering the expected probabilities of uncertainties in power generation, water demand, and power demand. Furthermore, load shedding and shifting decisions are considered to assist with dispatch.
The rest of the paper is as follows: A system description is presented in Section 2, followed by the scope of study and contribution of the work in Section 3. Problem formulation is presented in Section 4. A case study is discussed in Section 5 for proof-of-concept purposes, along with future work in Section 6. Finally, the concluding remarks are presented in Section 7 of the paper.

System Description
This paper considers a self-reliant community, which tries to limit external help for its water and energy needs. In other words, the community tries to optimize the use of locally available energy and water resources in order to be resilient against any disturbances in the system. Without loss of generality, the neighborhood is assumed to consist of multiple residential water and energy users connected to a single power distribution bus and water distribution network as shown in Figure 1. Furthermore, it is assumed here that:

•
The microgrid consists of an energy storage system (a battery in this case), a smallscale wind turbine, and rooftop PV systems for individual residential units. These generation units have uncertainties as discussed below. The choice of energy resources does not affect the generality of the problem; however, it is intended to show the impacts of uncertainties in available energy.

•
Similarly in the water distribution network, a storage tank (ST) is installed to supply water demand of the community.

•
The ST receives water through two means: water purchased and delivered by water tankers (or perhaps coming from the main water distribution network), or treated potable water provided by the local WWTP.

•
The geographical area served by the water and energy networks is small and power losses in power distribution lines and water losses in the water system can be ignored safely.
sources does not affect the generality of the problem; however, it is intended to show the impacts of uncertainties in available energy.

•
Similarly in the water distribution network, a storage tank (ST) is installed to supply water demand of the community.

•
The ST receives water through two means: water purchased and delivered by water tankers (or perhaps coming from the main water distribution network), or treated potable water provided by the local WWTP.

•
The geographical area served by the water and energy networks is small and power losses in power distribution lines and water losses in the water system can be ignored safely.
The residential customers are at a lower elevation than the elevation of the community ST, which means that water can be supplied to the households naturally due to gravity, which saves energy usage on pumping systems that would otherwise be needed. Similarly, the WWTP is located at a lower elevation than the individual households so that the wastewater from households can flow to the WWTP naturally without a need for pumping. However, the treated clean water needs to be pumped to the ST, and the WWTP treats the incoming batch of the wastewater over a 2 h time period. This schematic diagram shows how the energy generators and loads are connected to a microgrid bus. A ST receives water from external sources and supplies water to the community. Wastewater from households is treated in a WWTP and clean water is pumped into ST for reuse. This paper presents a stochastic optimization model that optimizes the combined operation of the integrated microgrid/micro-net system, considering the uncertainties associated with power generation, power demand, and water demand.
In order to model the uncertainties, a scenario-based approach is utilized in this paper. This is adopted because it considers the system uncertainties as random input variables and assigns probabilities to each scenario based on data observations [44]. Without loss of generality, four uncertain parameters are considered, i.e., power demand, water demand, wind power generation, and PV power generation, each one having two levels The residential customers are at a lower elevation than the elevation of the community ST, which means that water can be supplied to the households naturally due to gravity, which saves energy usage on pumping systems that would otherwise be needed. Similarly, the WWTP is located at a lower elevation than the individual households so that the wastewater from households can flow to the WWTP naturally without a need for pumping. However, the treated clean water needs to be pumped to the ST, and the WWTP treats the incoming batch of the wastewater over a 2 h time period. This paper presents a stochastic optimization model that optimizes the combined operation of the integrated microgrid/micro-net system, considering the uncertainties associated with power generation, power demand, and water demand.
In order to model the uncertainties, a scenario-based approach is utilized in this paper. This is adopted because it considers the system uncertainties as random input variables and assigns probabilities to each scenario based on data observations [44]. Without loss of generality, four uncertain parameters are considered, i.e., power demand, water demand, wind power generation, and PV power generation, each one having two levels of low and high values for each time-step to represent hourly variations. These levels could occur based on factors such as the time of day and/or occupancy of individual residential units. For a t number of time-steps and l number of levels, the total number of scenarios for m number of uncertain parameters is l t·m . This has been conceptually shown for two uncertain parameters, X and Y, with two levels of uncertainty, H and L, for each, over a total of two timesteps-resulting in a combined total of 16 scenarios as indicated in Table 1. Each level H or L has its corresponding probability of occurrence which can be estimated using historical data. As the number of uncertain parameters or time-steps increases, the total number of scenarios will increase exponentially, resulting in an exponential rise in computational time [45]. This indicates that in order to solve the stochastic model with a large number of time-steps or uncertain parameters, scenario reduction techniques may be necessary [46,47]. The scenario-reduction method, however, reduces the accuracy in calculating the actual solution as it eliminates scenarios to decrease computational time. In this paper, a sliding window approach is presented by considering a smaller number of time-steps that would significantly reduce the total number of scenarios to be computed at once. Hence, at each point in time, the proposed SP model is solved over a three-hour window to determine decision variables such as the battery SOC, the amount of loads shed/shift, and the volume of water in ST. This approach will provide a total of 4096 scenarios that are incorporated into the SP model. It should be noted that these scenarios are chosen for proof-of-concept purposes and do not affect the generality of the proposed methodology. Higher number of scenarios will improve the accuracy of the model, at the expense of the simulation time.

Scope and Contribution of Work
This paper considers the quasi-steady-state operation of a microgrid and devises a strategy to maintain power balance under uncertainties. This is to ensure frequency stability in the microgrid under various operating conditions. It has been assumed in this paper that energy resources (PV, wind, and CES) are equipped with necessary local control systems to be able to operate in an islanded mode and generate the desired level of active power. As such, this aspect is considered outside the scope of the current study.
The contributions of the paper can be outlined as below: (1) Although numerous papers in the literature have addressed the problem of optimal control and energy dispatch of electric microgrids, this paper focuses on the co-optimization model, where both power, water, and wastewater networks are con- sidered, along with interconnections between the three; this aspect is less explored in the literature. (2) The proposed methodology ensures that the water distribution system, which is critical for post-disaster recovery, remains operational and available. (3) This research provides a case for investing distributed community-scale water and energy technologies, for instance, distributed wastewater treatment, rather than fully centralized approaches, which could provide a single point of failure during major disturbances. (4) Furthermore, this research demonstrates that the flexibility of a small-scale local water distribution network can be harnessed to balance load-generation in a microgrid with renewable energy resources.

Problem Formulation
The main goal in this paper is to propose a strategy to minimize the overall cost of meeting water and power demands over the dispatch period, while minimizing load shedding, given uncertainties in both water and power consumption. The problem is formulated in the form of a two-stage stochastic optimization: The first-stage variables are assumed to be the amount of water to be purchased from an external resource and the amount of power to charge the battery before the dispatch period begins. The second-stage variables consist of the dispatch (charge/discharge) schedule of the battery, operation schedule of the wastewater treatment plant, and the amount of load shift or shed for individual users during each scenario.

Objective Function
The objective function is shown in (1). The first two terms indicate the costs of purchasing water to store in the storage tank and power to charge the battery. These are the first-stage variables. The next term, weighed by the probabilities of individual scenarios, indicates the cost of discharging the battery as well as the penalties associated with load shedding. The number of deep discharge cycles available in a battery limits the lifetime of the battery and it is modeled in terms of cost per deep discharge of the battery. The optimization model tries to minimize the power obtained from battery discharge. The discharging amount would change as the likely scenarios for power generation and demand change. This has been modeled as a cost function in (1). The fourth term in the objective function is used to ensure that individual power demands are supplied at the desired time and desired kW level as much as possible for each scenario. Here, when a shiftable load at time t and scenario s is served at the intended time, its corresponding binary variable will be 1 (i.e., v i,t,t,s = 1), which indicates that the load will not be shed or shifted to a future time-step and that there will be no penalty cost. Otherwise, any load shed or shift (i.e., when v i,t,t,s = 0) introduces a penalty into the objective function, which is weighed by the occupancy level of the house.
The cost-based approach in this formulation can be viewed in the form of penalties associated with each objective function. For instance, the cost function for the battery discourages battery usage when wind and PV systems generate power. This is to prolong the life of the battery by minimizing the number of its charge/discharge cycles. Similarly, purchasing power from grids or water from an external source is discouraged using the cost (penalty) in the objective function. The big M represents a large number and is intended to, whenever technically possible, discourage load shedding in the microgrid. This is because supplying as many customers as possible is more important than the actual cost of dispatch, as is the case in any emergency dispatch strategy.

Constraints
The multi-objective optimization problem in (1) is solved subject to the following constraints. It is assumed in this formulation that there will be no revenue from water distribution because water will be supplied to meet minimum demand without any cost to the users. Furthermore, the pump operating cost is included in the battery discharging cost.

Power Balance
At each time-step and for each scenario, the total amount of power provided by the generation resources must equal the total demand, as given in (2). Power generation from wind and PV resources depends on wind velocity and solar irradiance, respectively. This means that the power generation level may change under different scenarios. Similarly, power demand and water demand may change according to different considered scenarios, as modeled in (3). Since the power demand in the micro-grid is an uncertain parameter for a given time, it is divided among all customers connected to the grid using contribution factors as given in (4). These contribution factors can be estimated based on historical demand profiles. This approach helps reduce the total number of scenarios to be considered for power demand. Equation (5) estimates the contribution of shiftable and non-shiftable loads to the total power demand of a customer. In this formulation, the electrical power losses in the microgrid have been ignored because of the small geographical span of the power distribution network. However, for a larger distribution network that consist of longer distribution lines, the power loss can be easily incorporated into the formulation. ) ∀i ∈ N, ∀t ∈ T,∀s ∈ S : P d,NSH i,t,s ) ∀i ∈ N, ∀t ∈ T,∀s ∈ S :

Demand Response (Load Shifting and Load Shedding)
Demand shifting is a form of demand response, in which a certain portion of demand is shifted to a future time. The amount of demand-shifting should be regulated as it can cause inconvenience for customers. As given in Equation (6), a shiftable load can only be shifted to one future time-step, and not multiple time-steps. The load may be shed instead of being shifted to a future time-step as given by the inequality sign in Equation (6). Load shedding is another form of demand response used in this paper. It is assumed here that demand shifting is not performed partially and, if scheduled, the entire load will be shifted to a future time-step. The constraint (7) limits the number of times a customer may experience demand shifting during the dispatch period. It should be noted that for a shiftable load, v i,t,t,s = 1 indicates that the load will be supplied at time t as intended during scenario s, and it will not be shifted to a future time-step. ∀i ∈ N, ∀k ∈ T,∀s ∈ S : T ∑ t=k v i,k,t,s ≤ 1 (6) ∀i ∈ N,∀s ∈ S :

Battery Constraints
For a given time t and scenario s, the battery can be either charging or discharging, but not both (see (8)). Also, the constraints for the state-of-charge (SOC) of the battery are represented by (9) and (10). Without loss of generality, it is assumed that prior to the dispatch period, the battery had been left depleted. It is possible to raise the charge on the battery prior to the start of the dispatch period by purchasing power from a utility. The amount of power to be purchased is a first-stage variable, which is determined based on the severity and likelihood of different scenarios. For future time-steps, battery SOC will be determined based on the level at which it is charged or discharged, as well as a self-discharge rate. For any time-step and any scenario, the SOC must remain between the maximum and minimum acceptable limits, as indicated in (8).

Power Generation Constraints
Power generated by wind turbines and PV panels for time t during scenario s depends on the available wind speed and solar irradiance, respectively (see (11)). The wind speed and solar irradiance vary randomly based on the scenarios in Section 2, which will then be used to determine the power generated by each resource. It is assumed here that the same amount of solar irradiance is available for all PV units since the geographical area of the microgrid is small. The input and output kW from the battery system is limited by its maximum power for each time and scenario, as given in (12).

Water Demand Constraints
For each scenario, the total amount of water flow provided by the storage tank to the community should equal the total water demand, which is a sum of individual customers' water demands. At the beginning of the dispatch period, it has been assumed that the tank had been filled to the minimum level, and the neighborhood has the option of purchasing water from an external resource prior to the realization of various scenarios as given in (14). The amount of purchased water is a first-stage variable. This water purchase from external sources may be necessary because the WWTP is assumed to take at least 2 h to treat the water obtained from the residential neighborhood, as given by zero outflow from WWTP in (15) during time-steps 1 and 2. The volume of water in the ST is computed using the inflow and outflow rates of water in the ST (see (16)). Total volume of water in the ST should be within the acceptable range indicated in (17).

Wastewater Management Constraints
A certain fraction of water discharged from the customer collects at the WWTP to be treated (see (18)). Considering the hourly timeline of this problem formulation, this has been considered to occur at the same time-step t. Flow through pipes is limited by the maximum allowable rate, as indicated in (19). The volume of water in the WWTP is computed using the inflow and outflow rates of water in the WWTP (see (20)). There is a minimum and maximum allowable range for the water volume in the WWTP which should be maintained at all times for each scenario, as shown in (21). Finally, the amount of water treated in the WWTP and pumped into the ST determines the total power consumption in the wastewater treatment system. In this formulation, the volume of water treated and pumped back to the ST is assumed to be proportional to the power consumption in the WWTP and pumping system, as shown in (22). Constraint (23) ensures that there is no waste outflow during the first two hours of the study period because the WWTP will take 2 h for treatment. ) ∀i ∈ N,∀t ∈ T,∀s ∈ S : q d i,t,s ≤ q max (19) ∀t ∀t ∈ T : P ww t,s = (p ww + p pump ) · q ww,out t,s · ∆ ∀s ∈ S : q ww,eff

Solution Methodology and Input Data
A hypothetical electrical microgrid is considered as the case study in this paper that consists of three residential units. As discussed in Section 2, four uncertain parameters are considered, i.e., wind power generation, PV power generation, total electrical demand in the network, and water demand in the water distribution system. Each of these parameters are assumed to have a high and a low level and to change on an hourly basis. Data for wind and PV power generation and the energy demands of the customers are estimated using the data available from the US Department of Energy, National Renewable Energy Laboratory, National Solar Radiation, and Residential Energy Consumption Survey, as explained in [48]. Similarly, household occupancy is estimated based on the data provided in the same paper. The water demand for customers is modeled considering the estimated data provided by the U.S. Geological Survey (USGS) in [49], which indicates that on average each person uses about 100 gallons of water per day on the higher end. This paper accounts for the occupancy levels of households to estimate total water use per household per day. It should be noted that the values of all input parameters are chosen for demonstration purposes only and as such, they do not affect the generality of the problem. Further, it is assumed that each household consists of a combination of shiftable and non-shiftable loads as given in Table 2. It is assumed that approximately 60% of energy demand is for non-shiftable loads and 40% for shiftable loads. Table 2 provides energy per day for a typical single-family household adopted from EIA data [50]. The data in Table 2 is based on an average 30 kWh of energy usage per day for a single-family household (877 kWh per month) with two occupants. Some of the nonshiftable loads considered in this study are, for example, power demand due to general lighting, refrigerators, and cooking stoves and microwaves, since their interruption could lead to inconvenience. This accounts for 60% of total household energy consumption. However, other appliances such as TVs and other large electronics, washers and dryers, and dishwashers are considered to be shiftable, since their operation times can be changed without significantly impacting residents. This accounts for 40% of total household energy consumption. Since household occupancy affects the energy consumption of both shiftable and non-shiftable loads, different occupancy profiles (ranging from one occupant to five occupants) have been considered for the customers in the community in order to introduce diversity in energy consumption of the houses. It is assumed that the maximum allowable number of times during the study period that a customer may experience demand shifting (or TSH) is 1. For the data on Φ STC , α, SOC min /SOC max , γ, c B , and η c /η d readers are referred to [51]. A single wind turbine is considered for this study, with a diameter of approximately 7 m (200 m 2 swept area). The air density ρ a is assumed to be 1.25 kg/m 3 . P i PV,STC values of 5 kW to 10 kW in each house have been assigned to reflect the PV generation of each customer [52]. The CES is considered to be sized at 140kW. The water distribution system is assumed to already be installed and ready to be operated in the community. The maximum flow per house is 0.0001262 m 3 /s (2.0 gallons per minute (GPM)) at approximately 60 pound per square inch (PSI) of pressure (or 414 kPa), as recommended in [53].
The proposed optimization formulation is solved using General Algebraic Modeling System (GAMS) software developed by GAMS Development Corp, Fairfax VA, USA in an Intel ® Core™ i7-8750H CPU @ 2.5 GHz-2.21 GHz computer. As expected, the solution time increases with increases in the number of scenarios. Two cases have been considered: The first case (case 1) considers two time-steps of analysis, and hence a total of 256 different scenarios (four variables, at two levels each, over two timesteps). The second case (case 2) considers three time-steps instead, raising the total number of scenarios to 4096. The solution time for case 2 is 607 s (~10 min), which is significantly higher than that of case 1 at less than 2 s. Table 3 lists the results of the analysis for both cases. For case 1, the community would need to purchase 12.92 kWh of electrical energy at the beginning of the study period in order to meet the energy needs for the next 2 h (i.e., the duration of the study period). Similarly, 6.48 m 3 of water is necessary to properly meet the water needs of customers. The CES would need to supply 19.48 kWh of electricity at a cost of $13.88. On average, it would cost approximately $10.83 per hour for the community to meet their energy and water needs. Considering the dispatch over a 3 h period, 3 kWh of electricity and 6.48 m 3 of water are needed from external sources in order to meet the energy and water needs. In this case, the CES would need to supply a total of 19.94 kWh to account for insufficient generation from wind and PV systems. This would cost approximately $7 per hour. It is important to note that having more information about the future may support the decision process for the system operator, since more possible scenarios are considered. However, generally speaking, it does not indicate that more information will guarantee a more favorable (i.e., less expensive) solution. Table 3. Solution of the proposed co-optimization problem.

Objective Function Value Cost ($) Value Cost ($)
Power purchased from utility (kWh) 12 * The average probability of demand response represents how likely it is for any customer to see either load shedding or shifting considering the probability of different scenarios for power generation and demand. A 0% value indicates that the microgrid has sufficient power generation to meet the demand for all possible scenarios considered in the study.
The following sections further discuss the results of the case studies for three strategically chosen scenarios. While the overall results are summarized in Table 3, these three individual scenarios are provided for demonstration purposes, and in general do not have any uniqueness over other scenarios modeled. Instead, they represent the overall pattern in the output of the formulation as the uncertain parameters change their values.
The following scenarios are compared to demonstrate the results of case 2: • Scenario 1: This scenario represents operating conditions during which power generation is less than power demand in the microgrid with high water demand. • Scenario 2: This scenario represents operating conditions during which power generation is more than power demand in the microgrid with low water demand. • Scenario 3: This scenario represents operating conditions during which power generation and demand in the microgrid are close in value with average water demand. Figure 2 shows the power generation level from different sources (wind, PV, and battery discharging) and the power demand (household energy demand, WWTP power demand, and battery charging) for each time-step. During scenario 1, there is approximately 46 kW of demand during time-step 3 in the microgrid, which is being supplied from the primary generation sources of wind (26 kW) and PV systems (20 kW). Because generation is sufficient to supply the entire demand, the battery is neither charging nor discharging (also shown by the constant SOC level in Figure 3 for scenario 1 time-step 3). On the other hand, for time-step 2 during scenario 1, the CES is discharging at a rate of approximately 45 kW, because during that time, the total demand (approximately 103 kW) is more than the power generated by primary sources (approximately 58 kW from wind and PV). Similarly, during time-step 1 of scenario 1, the CES is discharging at a rate of 25 kW. For scenario 2, during which power generation is more than the demand, the battery is charging at rates of approximately 4 kW and 13 kW at time-steps 1 and 3, respectively. This way, the stored energy can be utilized when needed. During scenario 3, the total generated power from wind and PV systems is close to the power demand in time-steps 1 and 2, but not completely enough to meet the entire demand. Hence, CES discharges at a lower rate of 4 kW in both times compared to scenario 1. The primary sources meet the power demand during time-step 3, which means the CES system is offline, as shown in the graph. generated power from wind and PV systems is close to the power demand in time-steps 1 and 2, but not completely enough to meet the entire demand. Hence, CES discharges at a lower rate of 4 kW in both times compared to scenario 1. The primary sources meet the power demand during time-step 3, which means the CES system is offline, as shown in the graph. Figure 2. Graphs on the left show hourly power generation from individual sources at different time-steps and power demand at corresponding times, during the three representative scenarios. The graphs on the right side illustrate the total power generation (from wind and PV) and total power demand, for different scenarios and at different times.
The CES system stores power from the external source (grid) prior to time-step 1, as shown in Figure 3. The figure also shows the variations in the SOC of the battery as it undergoes charge and discharge cycles. As expected, the battery can be either charging or discharging at a given time-step, but not both. Figure 2. Graphs on the left show hourly power generation from individual sources at different time-steps and power demand at corresponding times, during the three representative scenarios. The graphs on the right side illustrate the total power generation (from wind and PV) and total power demand, for different scenarios and at different times.
The CES system stores power from the external source (grid) prior to time-step 1, as shown in Figure 3. The figure also shows the variations in the SOC of the battery as it undergoes charge and discharge cycles. As expected, the battery can be either charging or discharging at a given time-step, but not both.
Depending upon available generation and demand, there may be instances of demand response in order to ensure the power balance in the microgrid. Figure 4 shows the instances of load shedding in the microgrid. It can be seen that Customer 3 experiences load shedding during time-step 1 of scenario 1 (when generation is not enough to meet the demand).  Figure 3. Hourly battery status (ON or OFF) and battery SOC for the three scenarios. For all scenarios, the battery is initially charged at 98%. As expected, scenario 1 indicates a significant drop in battery SOC, whereas in scenario 2, the battery undergoes some instances of charging. Scenario 3 also shows discharge; however, at a significantly lower rate than that of scenario 1.
Depending upon available generation and demand, there may be instances of demand response in order to ensure the power balance in the microgrid. Figure 4 shows the instances of load shedding in the microgrid. It can be seen that Customer 3 experiences load shedding during time-step 1 of scenario 1 (when generation is not enough to meet the demand). Hourly battery status (ON or OFF) and battery SOC for the three scenarios. For all scenarios, the battery is initially charged at 98%. As expected, scenario 1 indicates a significant drop in battery SOC, whereas in scenario 2, the battery undergoes some instances of charging. Scenario 3 also shows discharge; however, at a significantly lower rate than that of scenario 1.

Figure 3.
Hourly battery status (ON or OFF) and battery SOC for the three scenarios. For all scenarios, the battery is initially charged at 98%. As expected, scenario 1 indicates a significant drop in battery SOC, whereas in scenario 2, the battery undergoes some instances of charging. Scenario 3 also shows discharge; however, at a significantly lower rate than that of scenario 1.
Depending upon available generation and demand, there may be instances of demand response in order to ensure the power balance in the microgrid. Figure 4 shows the instances of load shedding in the microgrid. It can be seen that Customer 3 experiences load shedding during time-step 1 of scenario 1 (when generation is not enough to meet the demand). Finally, Figure 5 shows the operation state of the water network. It can be seen that the WWTP starts supplying water to the ST at the beginning of time-step 3, which is then used to meet the water demand for that time-step. During the first two hours of operation there is no outflow from the WWTP, even though there is an increase in its volume. This is because it takes time for the WWTP to treat the wastewater received from the residents. As expected, the water volume in the ST decreases to respond to the water demand in the system. Depending upon the water demand rate for a given scenario, the water level in the ST may change at a higher or lower rate than other scenarios for the same time-step. Figure 4. Load shedding or shifting instances during all three scenarios. During scenarios 2 and 3, there is sufficient generation to meet the demand; therefore, no load shedding or shifting is performed. However, during scenario 1, customer 3 experiences a load shed for time-step 3 (although not during times 1 or 2). Finally, Figure 5 shows the operation state of the water network. It can be seen that the WWTP starts supplying water to the ST at the beginning of time-step 3, which is then used to meet the water demand for that time-step. During the first two hours of operation there is no outflow from the WWTP, even though there is an increase in its volume. This is because it takes time for the WWTP to treat the wastewater received from the residents. As expected, the water volume in the ST decreases to respond to the water demand in the system. Depending upon the water demand rate for a given scenario, the water level in the ST may change at a higher or lower rate than other scenarios for the same time-step.
(a) (b) Figure 5. (a) Hourly water volume in the ST and WWTP during scenarios 1 and 3. During time-steps 1 and 2, the total water demand is being supplied by the outflow of the ST. There is no outflow from the WWTP for the first 2 h of operation, but there is an increase in its volume as the customers use water during these time-steps. During time-step 3, the WWTP starts supplying water to the ST, which in turn, supplies water to meet the demand, (b) Hourly water volume in the ST and WWTP during scenario 2. Since the ST tank has enough water to supply the low water demand for scenario 2 the WWTP does not need to be run for this scenario, as shown by zero outflow in Figure 5b. The wastewater that was stored in time-steps 1 and 2 will flow out of the WWTP as effluent, as indicated by the reduced water volume in the WWTP at time-step 3.

Future Recommendations
The proposed dispatch strategy provides a plan for resource allocation and demand response for smooth operation of a combined microgrid/micro-net. In the analysis presented in this paper, the focus was on frequency stability and ensuring power balance within the microgrid. This is not unusual, as often we assume that one of the energy resources (CES in this case) can act as a grid-forming unit and dictate the voltage. However, for a more detailed analysis, AC power flow equations as well as operational constraints for the reactive power can be included to ensure voltage stability and sufficient node voltage support. From a mathematical perspective, this can negatively affect the tractability of the optimization problem, as it introduces nonlinear terms. One way to avoid this, is to use Cartesian coordinates by breaking the node voltage equations into two: one for the real part and another for the imaginary part. Although this approach may still leave certain bilinear terms, the highly nonlinear sine and cosine terms will be avoided. An example of how this can be done for an unbalanced distribution network is shown in one of the author's previous work [54]. There is no outflow from the WWTP for the first 2 h of operation, but there is an increase in its volume as the customers use water during these time-steps. During time-step 3, the WWTP starts supplying water to the ST, which in turn, supplies water to meet the demand, (b) Hourly water volume in the ST and WWTP during scenario 2. Since the ST tank has enough water to supply the low water demand for scenario 2 the WWTP does not need to be run for this scenario, as shown by zero outflow in (b). The wastewater that was stored in time-steps 1 and 2 will flow out of the WWTP as effluent, as indicated by the reduced water volume in the WWTP at time-step 3.

Future Recommendations
The proposed dispatch strategy provides a plan for resource allocation and demand response for smooth operation of a combined microgrid/micro-net. In the analysis presented in this paper, the focus was on frequency stability and ensuring power balance within the microgrid. This is not unusual, as often we assume that one of the energy resources (CES in this case) can act as a grid-forming unit and dictate the voltage. However, for a more detailed analysis, AC power flow equations as well as operational constraints for the reactive power can be included to ensure voltage stability and sufficient node voltage support. From a mathematical perspective, this can negatively affect the tractability of the optimization problem, as it introduces nonlinear terms. One way to avoid this, is to use Cartesian coordinates by breaking the node voltage equations into two: one for the real part and another for the imaginary part. Although this approach may still leave certain bilinear terms, the highly nonlinear sine and cosine terms will be avoided. An example of how this can be done for an unbalanced distribution network is shown in one of the author's previous work [54].
Incorporating reactive power into the equations necessitates adding an inequality constraint for generation resources to ensure that the lower and upper limits are not exceeded, and another one to maintain the limit on the apparent power S. For instance, for a generic source g: ∀g ∈ G, ∀t ∈ T,∀s ∈ S : Q min g ≤ Q g,t,s ≤ Q max g (24) ∀g ∈ G, ∀t ∈ T,∀s ∈ S : S 2 g,t,s = P 2 g,t,s + Q 2 g,t,s ≤ (S max g ) 2 If desired, an inequality equation can also be added to ensure acceptable power flow limits through different series elements such as lines or transformers (if any).
∀l ∈ L, ∀t ∈ T,∀s ∈ S : S l,t,s ≤ S max l (26) It can be seen that these equations convert the optimization model into a nonlinear one, which requires special treatment for achieving acceptable tractability and convergence. Many researchers have proposed solution techniques based on quadratic programming, semidefinite programming, conic programming, or linearization and convexification of the model so that a solution can be obtained in polynomial time [55][56][57][58].
Lastly, it was assumed in this paper that the various scenarios and their probabilities (which were assumed to be equal) are known beforehand. This may not always be the case, however. In fact, finding the PDF of certain random variables may not be practical. This is especially true for variables that have highly stochastic variations. In those circumstances, the optimization model needs to be converted into a robust optimization model. Unlike the stochastic programming used in this paper, in robust optimization, no information is available about the random variables other than the range of values they may take. Then, the optimization problem is converted into a robust counterpart form, which ensures optimality even under worst-case conditions.

Conclusions
This paper presented a strategy for combined water and energy operation in an isolated community that is operating as a microgrid/micro-net. It is assumed that the community has been disconnected from the main power grid and the water distribution network due to a large disturbance such as a natural disaster and is expected to operate in a standalone mode. To do this, the community is assumed to be equipped with a battery system, renewable energy resources such as a wind turbine and multiple rooftop PV panels, a water storage tank, and a wastewater treatment plant that is capable of providing potable water. The problem was formulated as a two-stage stochastic optimization scenario, where the main objective is to supply the demand (water and power) as much as possible, at minimum cost, subject to the uncertainties in both demand and renewable generation. In the first stage, the problem determines the amount of water to be purchased from the outside world (if any) and the amount of power to be purchased from the main grid to initially charge the battery (if any). These are then optimally allocated using the secondstage recourse variables during the dispatch period. Recourse variables consist of the amount of charge/discharge of the battery at any point in time, the level of load shift/shed for each customer at any point in time, the operation status of the wastewater treatment facility, and the amount of water to be provided to the community by the storage tank. It was shown through a proof-of-concept case study that limited resources can be optimally allocated to allow for the continued operation of the community until services become available from the outside world. To improve tractability of the optimization problem, a sliding window approach was used where the problem was solved for a time horizon of 2-3 h at a time. Extending the simulation time can significantly increase the number of variables to be considered, which for off-the-shelf optimization software packages, may negatively impact the convergence rate or simulation time. However, such limitations will not exist in commercial optimization packages.  Cost per deep discharge usage of the battery ($); calculated using the total cost of purchasing and maintaining the battery divided by the maximum number of deep discharges available over its lifetime c u Cost of water purchase at the beginning of study period ($/m 3 ) k ww Portion of water consumed that will be discharged as waste; the ratio of water inflow to households to water outflow to sewer system D i Contribution factor for customer i: fraction of total electric demand in the system consumed by customer i.