# Resilience Enhancement of Microgrids with Distributionally Robust Optimal Sizing and Location of Distributed Energy Resources Under Supply-Demand Uncertainty and Random Contingencies

Pascal Quach, Yiping Fang, Anne Barros

► To cite this version:

Pascal Quach, Yiping Fang, Anne Barros. Resilience Enhancement of Microgrids with Distributionally Robust Optimal Sizing and Location of Distributed Energy Resources Under Supply-Demand Uncertainty and Random Contingencies. 35th European Safety and Reliability Conference (ESREL2025) and the 33rd Society for Risk Analysis Europe Conference (SRA-E 2025), European Safety and Reliability Association (ESRA); Society for Risk Analysis Europe (SRA-E); University of Stavanger, Jun 2025, Stavanger, Norway. 10.3850/978-981-94-3281-3_ESREL-SRA-E2025-P5045-cd hal-05158630

HAL Id: hal-05158630

https://hal.science/hal-05158630v1

Submitted on 15 Jul 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Proceedings of the 35th European Safety and Reliability & the 33rd Society for Risk Analysis Europe Conference
*Edited by Eirik Bjorheim Abrahamsen, Terje Aven, Frederic Bouder, Roger Flage, Marja Ylönen*
©2025 ESREL SRA-E 2025 Organizers. *Published by Research Publishing, Singapore.*
doi: 10.3850/978-981-94-3281-3_ESREL-SRA-E2025-P5045-cd

# Resilience enhancement of microgrids with distributionally robust optimal sizing and location of distributed energy resources under supply-demand uncertainty and random contingencies

**Pascal Quach**

Université Paris-Saclay, CentraleSupélec, Laboratoire Génie Industriel, 91190, Gif-sur-Yvette, France.
pascal.quach@centralesupelec.fr

**Yiping Fang**

Chair Risk and Resilience of Complex Systems, CentraleSupélec, Laboratoire Génie Industriel, 91190, Gif-sur-Yvette, France.
Université Paris-Saclay, CentraleSupélec, Laboratoire Génie Industriel, 91190, Gif-sur-Yvette, France.
yiping.fang@centralesupelec.fr

**Anne Barros**

Chair Risk and Resilience of Complex Systems, CentraleSupélec, Laboratoire Génie Industriel, 91190, Gif-sur-Yvette, France.
Université Paris-Saclay, CentraleSupélec, Laboratoire Génie Industriel, 91190, Gif-sur-Yvette, France.
anne.barros@centralesupelec.fr

Microgrids equipped with local distributed energy resources (DERs) and islanding capabilities have been shown to enhance the resilience in modern power systems by mitigating disturbances. However, the size and location of distributed energy resources are critical factors in determining their economic and technical viability. In this study, we model random contingencies alongside commonly studied generation and demand uncertainties to guide investment decisions, improving system defenses against unexpected outage events whilst maintaining economic and technical optimality. We develop distributionally robust optimization models for the two-stage stochastic programming optimal design and operations problem under simultaneous continuous supply-demand uncertainty, and discrete random contingencies. The solution methods rely on known tractable reformulations of distributionally robust optimization (DRO) problems that allow us to solve the problem using off-the-shelf commercial solvers.

**Keywords:** microgrid, resilience, sizing and location, stochastic optimization, distributionally robust optimization, two-stage stochastic programming, uncertainty, line failures, distributed energy resources, N-k security

# 1. Introduction

The resilience of power systems is regularly challenged by increasingly frequent and severe high-impact low-probability (HILP) environmental events (Seneviratne, S.I et al., 2023), e.g., hurricanes, wildfires, etc., causing widespread power outages and economic losses (Ciapessoni et al., 2023). Climate change alters the hazard profile of a region not only across their intensity, frequency, but also its duration, timing and spatial extent (Ranasinghe et al., 2023). Consequently, it is primordial to safeguard critical infrastructures (CIs) against events that will occur with previously unseen seasonality, speed of onset, and ge-

ographical extent. In June 2024, Hurricane Beryl broke meteorological records, being “the earliest Category 5 hurricane observed in the Atlantic basin on record, and only the second Category 5 hurricane to occur in July after Hurricane Emily in 2005” (Papin (2024)).

Building upon growing need for resilience, we focus our work on power system resilience, which can be defined as “the ability to limit the extent, severity and duration of system degradation following an extreme event.” (Ciapessoni et al. (2023)). In practice, large investments in DER for local generation, storage and control decreases vulnerability and increases response rate to large
<figure><img src="image_2.png" /><figcaption>Fig. 1. Resilience curve. System performance as an indicator of resilience throughout system disturbance</figcaption></figure>

system shocks (Panteli and Mancarella, 2015). Such networks are often called microgrids (Mannay et al., 2015), crucially having the capability to operate off-grid in islanded mode. Successful large-scale microgrid experiments have already been conducted, see Enedis (2011); Vogel et al. (2024).

From a methodological point of view, resilience is best captured by sequential decision-making frameworks, such as reinforcement learning, or multi-stage optimization frameworks (Ouyang and Fang, 2017; Kamruzzaman et al., 2021; Zhao et al., 2022). When fine-grained operations of the network are not of interest, graph-based approaches can also be used to assess network resilience (Herrera et al., 2016). In fact, it is often the case that resilience is pictured as system performance in time fig. 1, where the system is disturbed at time $t=0$ and system performance is an indicator of resilience during each phase.

DRO is a mixed framework, combining the probability modeling from stochastic programming (SP) with the worst-case approach of robust optimization (RO) (Kuhn et al., 2024). The uncertainty set is replaced by an ambiguity set $\mathcal{P}$, modelling a probability distribution that is itself uncertain, where the term “ambiguity” refers to the unknown nature of the distribution (Ellsberg, 1961). The family of distributions $\mathcal{P}$ is arbitrarily described through moments, support or other properties. Kuhn et al. (2025) presents the recent key findings of the field. A survey of DRO literature can also be found at (Rahimian and Mehrotra, 2022).

DER sizing and location (Prakash and Khodod, 2016) has a vast literature, in which uncertain parameters range from distributed generators output, load, emissions and price of the electric-

ity. Fewer have focused on the *defender-attacker-defender* model (Wang et al., 2014; Billionnet et al., 2016; Yang et al., 2021; Shi et al., 2023), and even less integrate standard N-k security constraints (Chalil Madathil et al., 2018; Bagheri and Zhao, 2019) with the operational model of the power network. We place our contribution in this line of work, by developing a DRO model for microgrid sizing and siting of DERs considering continuous supply-demand uncertainty and discrete random contingencies on system components.

We apply this approach to model a *defender-attacker-defender* model, where the defender is the utility planner, the attacker is nature as in uncertainties of supply-demand and random contingencies, and the defender is the microgrid operator. Our approach merges planning decisions with simulated operation, hence conflating the duties of utilities and network operators, but also arguably their interests. Utilities might prefer economic profit at the expense of network resilience, with the opposite being true for operators. Framing our problem with a cooperative mindset, utilities provide a service to operators, investing in DER to reduce operators’ costs whilst insuring adequate investment in generation capacity. We denote its value the price of resilience, that is the cost of improving the system’s resilience against unexpected events compared to the baseline cost of maximizing utilities’ economic profits.

Our contributions are twofold: (i) we present and reformulate an original distributionally robust optimization model for the optimal design and operations of microgrids under simultaneous continuous supply-demand uncertainty $\xi$ and discrete random contingencies $Z$; (ii) we propose a novel framing of the *defender-attacker-defender* model, where the defender is the utility planner, the attacker is nature, and the defender is the microgrid operator.

The rest of the work is structured as follows. A technical description of the network model and its operations is provided in section 2. Ambiguity sets for uncertain variables are detailed in section 3. In particular, we detail the reformulation steps of the tri-level problem into a single-stage tractable
program in section 3.1.

## 2. Modelling

Let Eq. (P) be the full problem

$$ \min_{x \in \mathcal{X}} \max_{P_Z \in \mathcal{P}_Z} \int_{\mathcal{Z}} \max_{\mathcal{P}_{\xi} \in \mathcal{P}_{\xi}} \int_{\Xi} Q(x, \xi, z) d\mathcal{P}_{\xi} d\mathcal{P}_Z \quad (P) $$

where $\mathcal{X} \subseteq \mathbb{R}^I$ is the feasible region of the first stage, $x$ are investment decisions, $Z$ random vector of the power line status with support $\mathcal{Z}$, and $\xi$ the random vector of the supply-demand with support $\Xi$. $\mathcal{P}_Z$ is the ambiguity set of $Z$ and $\mathcal{P}_{\xi}$ of $\xi$. $D(x)$ is the investment cost function, $O(y)$ the operations cost and the second stage $Q(x, \xi, Z)$ is

$$ Q(x, \xi, Z) = \min_{y \in \mathcal{Y}} O(y) \quad (1) $$

$$ \mathcal{Y} = \left\{ \begin{array}{l} y : S_{\xi}x + V_{Z}y = g_{\xi} \\ Tx + Wy \leq h \\ x \in \mathcal{X} \end{array} \right\} \quad (2) $$

with $\mathcal{Y} \subseteq \mathbb{R}^J$ the nonempty feasible region of the second stage. We assume relatively complete recourse, that is for every $x \in \mathcal{X}$, there exists a solution to Eq. (1). Matrices $S_{\xi}$, $V_{Z}$ and vector $g_{\xi}$ are subscripted with $\xi$ and $Z$ to indicate that they are random with respect to $\xi$ and $Z$.

We denote by $v(x)$ our inner problem without decisions $x$, defined

$$ v(x) := \max_{\mathcal{P}_Z \in \mathcal{P}_Z} \int_{\mathcal{Z}} \psi(x, z) \, d\mathcal{P}_Z \quad (3) $$

$$ \text{s.t.} \quad \psi(x, z) := \max_{\mathcal{P}_{\xi} \in \mathcal{P}_{\xi}} \mathbb{E}_{\mathcal{P}_{\xi}} Q(x, \xi, z). \quad (4) $$

### 2.1. Network model

The distribution network (DN) is modeled by a connected undirected graph $G = (\mathcal{N}, \mathcal{E})$, with $\mathcal{N} = \{\emptyset, 1, \dots, N\}$ the set of $N$ nodes, $\mathcal{N}^+$ the set of $N^{(+)} = N - 1$ nodes without its root node $\emptyset$ (substation).

The radial network is connected to the main grid by the root node. Power injections occur at the point of common coupling (PCC) indicated by $\emptyset$, with active and reactive power injections respectively $p_{\emptyset,t}$ (kW) and $q_{\emptyset,t}$ (VAr). Active and reactive power transactions are allowed with fixed costs $C_{\emptyset}$ (€/kW) and variable costs $V_{\emptyset}^P$ and $V_{\emptyset}^Q$ (€/kWh). The fixed part is expressed with respect

to a reference power $P_{\emptyset}$ (kW). The system operator negotiates these costs in the power purchase agreement with a supplier. For example, $V_{\emptyset}$ can be the day-ahead market cost of electricity. For simplicity, we assume that $V_{\emptyset}$ are constant over the time horizon $\mathcal{T}$.

### 2.2. Microgrid design

Investment decisions are taken with respect to distinct technology choices for generators and battery energy storage systems (BESSs). Different technical characteristics are chosen to balance the trade-offs between investment costs and operational flexibility. Each potential investment $k \in \mathcal{K}$ is described by its rated active power capacity $P_k$, that is the designed fully loaded power output in watt, as opposed to the actual active power output $p_{k,t}$. The investment cost $I_k$ (€/kW), operating cost $OM_k$ (€/kW), and the variable cost $V_k$ (€/kWh) are given for each investment. Additionally for energy storage technologies, we take into account their rated energy capacity $E_s$ (Wh), computed from its design minimum hours of operation $H_s$ (h), e.g., 3 hours. The operating cost $OM_k$ is the sum of a power cost $C_s^P$ (€/kW) and an energy cost $C_s^E$ (€/kWh) times the design hours of operation $H_s$.

The investment costs $D(x)$ are the total capital costs $I_k$ and estimated operating costs $OM_k$ of the planned installed capacity $x_k P_k$ and reference active power purchase $P_{\emptyset}$. The operations costs $O(y)$ are the total variable costs $V_k$ of the active power generation $p_{k,t}$ and complex power transactions $p_{\emptyset,t}$ and $q_{\emptyset,t}$ over the time horizon $\mathcal{T}$. For energy storage technologies, the active power generation $p_{s,t}$ is the sum of the charging and discharging power $p_{s,t}^+$ and $p_{s,t}^-$. Without network reconfiguration, the network will not be fully connected after a failure event. Hence, we track load shedding due to unmet demand at node level by positive slack variables $|\mathcal{L}_{u,t}^P|$ and $|\mathcal{L}_{u,t}^Q|$. They are penalized by fixed costs $V_{ls}^P$ and $V_{ls}^Q$ (€/kWh).

Each technology provides the characteristics of a reference unit. Each decision for technology $k$ is taken with respect to the number of units $x_k \in \{N_{k,\min}, \dots, N_{k,\max}\}$ and the connection node $x_{k,u} \in \{0, 1\}$, with $N_k$ the maximum number
of units for technology $k$. An installed technology can be connected once at any non-root node $u \in \mathcal{N}^+$ (Eq. (5)). Conversely, each network node can welcome up only one connection (Eq. (6)). Any connection must also lead to a nonzero installed capacity (Eq. (8)) and reciprocally (Eq. (7)). Let $\mathcal{K}$ denote the set all of investments technologies, then the above constraints are formulated by the following equations

$$ \sum_{u \in \mathcal{N}} x_{k,u} \le 1 \quad \forall k \in \mathcal{K} \quad (5) $$

$$ \sum_{k \in \mathcal{K}} x_{k,u} \le 1 \quad \forall u \in \mathcal{N} \quad (6) $$

$$ x_k \le N_{k,\max} \sum_{u \in \mathcal{N}} x_{k,u} \quad \forall k \in \mathcal{K} \quad (7) $$

$$ x_k \ge N_{k,\min} \sum_{u \in \mathcal{N}} x_{k,u} \quad \forall k \in \mathcal{K} \quad (8) $$

$$ x_k \in \{0, \dots, N_{k,\max}\} \quad \forall k \in \mathcal{K} \quad (9) $$

$$ x_{k,u} \in \{0, 1\} \quad \forall k \in \mathcal{K}, \forall u \in \mathcal{N} \quad (10) $$

where $x_{k,u} = 1$ indicates that technology $k$ is connected at node $u$, and $x_k = n$ indicates that no unit of technology $n$ is installed. All variables $x_{k,\emptyset}$ are fixed at 0. The first-stage feasible set is then defined by $\mathcal{X} = \{x : \text{Eqs. (5) to (10)}\}$.

The following system components are listed for investment: dispatchable generators $\mathcal{G}$, nondispatchable generators $\mathcal{G}^\dagger$ and battery energy storage systems $\mathcal{S}$.

## 2.3. Grid operations

The microgrid is operated on the time horizon $\mathcal{T} = 1, \dots, T$. All physical units are converted to the standard per unit notation when possible. Let $\mathcal{K} = \mathcal{G} \cup \mathcal{G}^\dagger \cup \mathcal{S}$ designate all technologies listed for investment.

We assume nondispatchable generation capacity to have no variable costs $V_g^\dagger$. We also consider that a small amount of dispatchable generation capacity is already installed, denoted in generator set $\mathcal{G}^N$, with power output $p_{k,t}^N$ (kW) and rated apparent power capacity $S_k^N$ (kW). Their locations $x_{g,u}^N$ are predetermined, where $x_{g,u}^N = 1$. They have fixed operating costs $OM_k^N$ (€/kW) and variable costs $V_k^N$ (€/kWh).

We are given observations of generation pro-

files $p_{g,t}^\dagger, q_{g,t}^\dagger$ of nondispatchable renewable energy sources (RESs) $g \in \mathcal{G}^\dagger$ and load profiles $d_{u,t}^P, d_{u,t}^Q$ at buses $u \in \mathcal{N}$

## 2.4. Power Flow

We model the power flow using the AC LinDistFlow equations (Baran and Wu, 1989b). We assume that the network phases are balanced and that flows are bidirectional. Line status variables $z_{u,t}$ are binary, with $z_{u,t} = 1$ indicating that line $u$ is operational. Power flow variables are constrained by the operational status of each line $z_{u,t}$. We write the active and reactive power flows to node $u$ as $P_{u,t}, Q_{u,t}$, the voltage magnitude squared $v_{u,t}$ and power injections $\tilde{p}_{u,t}, \tilde{q}_{u,t}$ at node $u$, the line's resistance $R_u$ and reactance $X_u$. In case of unmet demand, we introduce positive slack variables in each direction $\text{ls}_{u,t}^P, \text{ls}_{u,t}^{-P}, \text{ls}_{u,t}^Q, \text{ls}_{u,t}^{-Q}$ to penalise the unmet demand. The LinDistFlow model formulation is given by Eqs. (11) to (17). $P_{\emptyset,t}$ and $Q_{\emptyset,t}$ are fixed at 0.

For accounting the economic costs of load shedding, we use the notation $|\text{ls}_{u,t}^P| = |\text{ls}_{u,t}^{+P} + \text{ls}_{u,t}^{-P}$ and $|\text{ls}_{u,t}^Q| = |\text{ls}_{u,t}^{+Q} + \text{ls}_{u,t}^{-Q}$.

## 2.5. Supply and Demand

For all generators, the power output is constrained by the rated power capacity $P_k$. Power transactions at the substation are not subject to maximum power purchase capacities.

$$ 0 \le p_{g,t} \le P_g x_g \quad \forall g \in \mathcal{G}, \forall t \in \mathcal{T} \quad (18) $$

$$ p_{g,t}^N \in [0, P_k^N] \quad \forall g \in \mathcal{G}^N, \forall t \in \mathcal{T} \quad (19) $$

$$ p_{\emptyset,t} \in \mathbb{R}^+ \quad \forall t \in \mathcal{T} \quad (20) $$

Dispatchable generators provide active $p_{k,t}$ and reactive power $q_{k,t}$ to the extent of their rated power capacity $S_k$.

$$ |q_{g,t}| \le x_g Q_g \quad \forall g \in \mathcal{G}, \forall t \in \mathcal{T} \quad (21) $$

$$ q_{g,t}^N \in [-Q_g^N, +Q_g^N] \quad \forall g \in \mathcal{G}^N, \forall t \in \mathcal{T} \quad (22) $$

$$ q_{\emptyset,t} \in \mathbb{R} \quad \forall t \in \mathcal{T} \quad (23) $$

with bounds $Q_g$ defined by $\sqrt{S^2 - P^2}$. Similarly, nondispatchable generators are operating in con-
$$ \sum_{v \in \text{children}(u)} P_{v,t} = \tilde{p}_{u,t} + P_{u,t} + \text{ls}_{u,t}^{+P} - \text{ls}_{u,t}^{-P} \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (11) $$

$$ \sum_{v \in \text{children}(u)} Q_{v,t} = \tilde{q}_{u,t} + Q_{u,t} + \text{ls}_{u,t}^{+Q} - \text{ls}_{u,t}^{-Q} \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (12) $$

$$ v_{u,t} = v_{\text{parent}(u),t} - 2(R_u P_{u,t} + X_u Q_{u,t}) \quad \forall u \in \mathcal{N}^{+}, \forall t \in \mathcal{T} \quad (13) $$

$$ v_{u,t} \in [V_{u,\min}^2, V_{u,\max}^2] \quad \forall u \in \mathcal{N}^{+}, \forall t \in \mathcal{T} \quad (14) $$

$$ (1 - z_{u,t}) P_{u,t} = 0 \quad \forall u \in \mathcal{N}^{+}, \forall t \in \mathcal{T} \quad (15) $$

$$ (1 - z_{u,t}) Q_{u,t} = 0 \quad \forall u \in \mathcal{N}^{+}, \forall t \in \mathcal{T} \quad (16) $$

$$ \text{ls}_{u,t}^{+P}, \text{ls}_{u,t}^{-P}, \text{ls}_{u,t}^{+Q}, \text{ls}_{u,t}^{-Q} \ge 0 \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (17) $$

stant power factor mode.

$$ q_{g,t}^{\dagger} := p_{g,t}^{\dagger} \tan(\phi_g) \quad \forall g \in \mathcal{G}^{\dagger}, \forall t \in \mathcal{T} \quad (24) $$

$$ \phi_g := \cos^{-1}(\text{pf}_g) \quad \forall g \in \mathcal{G}^{\dagger} \quad (25) $$

$\text{pf}_k = \cos(\phi)$ is the ratio of real power to the apparent power of generator $g$, or simply the cosine of the phase $\phi$. For our purposes, we take the values $\text{pf}_g = 0.95$. Loads' power factors $\text{pf}_u$ are assumed given at node level, from which the reactive power demand is derived

$$ d_{u,t}^{Q} := d_{u,t}^{P} \tan(\phi_{u}) \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (26) $$

$$ \phi_u := \cos^{-1}(\text{pf}_u) \quad \forall u \in \mathcal{N} \quad (27) $$

## 2.6. Energy Storage

Battery technologies operate according to a simple energy balance equation (Eq. (28)), capacity constraints (Eq. (30)) and power limits Eqs. (31) and (32).

$$ e_{s,t} = \Delta t \alpha_s e_{s,t-1} + \eta_s^+ p_{s,t}^+ - \frac{1}{\eta_s^-} p_{s,t}^- \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T}^+ \quad (28) $$

They are described by self-discharge rate $\alpha_s$ (%/hour), and (dis)charging efficiency parameters $\eta_s^\pm$ (%). Let $p_{s,t}^\pm$ be the power sustained at time $t$ for (dis)charge, and $\Delta t$ be the time step resolution, where $\Delta t = 1$ corresponds to 1 h. BESSs are also operated in constant power factor

mode.

$$ e_{s,1} = 0.5 E_s x_s \quad \forall s \in \mathcal{S} \quad (29) $$

$$ E_{s,\min} x_s \le e_{s,t} \le E_s x_s \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T} \quad (30) $$

$$ 0 \le p_{s,t}^{+} \le P_{s,t}^{+} x_s \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T} \quad (31) $$

$$ 0 \le p_{s,t}^{-} \le P_{s,t}^{-} x_s \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T} \quad (32) $$

$$ p_{s,t} := p_{s,t}^{-} - P_{s,t}^{+} \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T} \quad (33) $$

$$ q_{s,t} := p_{s,t} \tan(\phi_s) \quad \forall s \in \mathcal{S}, \forall t \in \mathcal{T} \quad (34) $$

## 2.7. Power Injections

The power injections terms $\tilde{p}_{u,t}$ (Eq. (35)), $\tilde{q}_{u,t}$ (Eq. (36)) are given by all input-output power flows at node $u$ and time step $t$, including the observations from supply-demand variables $\xi$.

$$ \tilde{p}_{u,t} := \sum_{s \in \mathcal{S}} x_{s,u} (p_{s,t}^{-} - p_{s,t}^{+}) + \sum_{g \in \mathcal{G}} x_{g,u} p_{g,t} + \sum_{g \in \mathcal{G}^{\mathcal{N}}} x_{g,u} p_{g,t}^{\mathcal{N}} + \sum_{g \in \mathcal{G}^{\dagger}} x_{g,u} p_{g,t}^{\dagger} - d_{u,t}^{P} + \mathbb{1}_{\{\emptyset\}}(u) p_{\emptyset,t} \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (35) $$

$$ \tilde{q}_{u,t} := \sum_{s \in \mathcal{S}} x_{s,u} q_{s,t} + \sum_{g \in \mathcal{G}} x_{g,u} q_{g,t} + \sum_{g \in \mathcal{G}^{\mathcal{N}}} x_{g,u} q_{g,t}^{\mathcal{N}} + \sum_{g \in \mathcal{G}^{\dagger}} x_{g,u} q_{g,t}^{\dagger} - d_{u,t}^{Q} + \mathbb{1}_{\{\emptyset\}}(u) q_{\emptyset,t} \quad \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \quad (36) $$

## 3. DRO Models

Let $\Xi$ is the support of $\xi$, defined by

$$ \Xi = \left\{ \xi \in \mathbb{R}^X : \begin{array}{l} p_{g,t}^{\dagger} \in [0, 1], \forall g \in \mathcal{G}^{\dagger}, \forall t \in \mathcal{T} \\ d_{u,t}^{P} \in [0, 1], \forall u \in \mathcal{N}, \forall t \in \mathcal{T} \end{array} \right\}. \quad (47) $$
$$v(x) = \min_{x, \lambda, \nu, \lambda_l^\psi, s_{li}, \gamma_{lij}} D(x) + \nu + \lambda\kappa + \sum_{l=1}^{L} \hat{p}_l u_l \quad (37)$$

$$\text{s.t. } u_l \geq -\lambda \qquad \forall l \leq L \quad (38)$$

$$u_l \geq w_l \qquad \forall l \leq L \quad (39)$$

$$w_l \leq \lambda \qquad \forall l \leq L \quad (40)$$

$$b_j(z_l) + a_j^T(z_l)\hat{\xi}_i + \gamma_{lij}^T(d - C\hat{\xi}_i) \leq s_{li} \quad \forall l \leq L, \forall i \leq I, \forall j \leq J(l) \quad (41)$$

$$\|C^T \gamma_{lij} - a_j(z_l)\|_* \leq \lambda_l^\psi \quad \forall l \leq L, \forall i \leq I, \forall j \leq J(l) \quad (42)$$

$$\lambda \geq 0 \qquad (43)$$

$$\nu \text{ free} \qquad (44)$$

$$\gamma_{lij} \geq 0 \qquad \forall l \leq L, \forall i \leq I, \forall j \leq J(l) \quad (45)$$

$$w_l := \lambda_l^\psi \varepsilon + \frac{1}{I} \sum_{i=1}^{I} s_{li} - \nu \quad (46)$$

$\mathcal{P}_\xi(\varepsilon)$ is a Wasserstein-1 ball of radius $\varepsilon$ (Eq. (48)), where $\hat{\mathbb{P}}^I$ is the uniform distribution on observations $\hat{\xi}_i$.

$$\mathcal{P}_{\xi}(\varepsilon) = \left\{ \mathbb{P} \in \mathcal{P}(\Xi) : \Delta(\mathbb{P}, \hat{\mathbb{P}}^I) \leq \varepsilon \right\} \quad (48)$$

We assume failed power lines are not repaired, and accept scenarios up to $N-k$ failures. The support $\mathcal{Z}$ of $Z$ is given by Eq. (49). We artificially generate a reduced scenario set $Z_L$.

$$\mathcal{Z} = \left\{ \begin{array}{l} z \in \{0, 1\}^{N^+ \times T} : \\ \sum_{u \in \mathcal{N}^+} z_{u,T} \geq N^+ - k \\ z_{u,t} \geq z_{u,t+1} \\ \forall u \in \mathcal{N}^+, t \in \mathcal{T} \setminus \{T\} \end{array} \right\} \quad (49)$$

Let $\kappa$ be an arbitrary conservativeness parameter. Let us assume the contingency analysis gives us probability estimates $\hat{p}$ for each scenario $z_l \in Z_L$. $I_\phi(\mathbb{P}, \mathcal{Q})$ is a $\phi$-divergence. Then, the empirical distribution $\hat{\mathbb{P}}_Z$ is defined as

$$\hat{\mathbb{P}}_Z := \left\{ \begin{array}{l} \mathbb{P} \in \mathcal{P}(Z_L) : \\ \mathbb{P}[Z = z_l] = \hat{p}, \forall z_l \in Z_L \end{array} \right\} \quad (50)$$

and the ambiguity set of the contingency random variables $\mathcal{P}_Z(\kappa)$ (Eq. (51)) is with $\phi$-divergence $I_\phi$.

$$\mathcal{P}_Z(\kappa) = \left\{ \mathbb{P} \in \mathcal{P}(Z_L) : I_\phi(\mathbb{P}, \hat{\mathbb{P}}) \leq \kappa \right\} \quad (51)$$

### 3.1. Reformulations

Our solution methodology relies on the combination of the dual problems of $\psi(x, z)$ (Eq. (4)) and $v(x)$ (Eq. (3)) and the linearization of quadratic terms. Specifically, we dualize Eq. (3) with $\phi$-divergence $I_{\phi_v}(\mathbb{P}, \mathcal{Q}) = \sum |p-q|$, where $\phi_v(t) = |t-1|$ is the variation distance. Similarly, we define a well-known Wasserstein-1 ball $\mathcal{P}_\xi(\varepsilon)$ and dualize $\psi(x, z)$ following (Mohajerin Esfahani and Kuhn, 2018, Theorem 4.2., p. 129 and Corollary 5.4 (ii), p. 144). That is, we reformulate the operations stage Eq. (1) as a maximum of linear functions by solving the optimal vertex enumeration problem, i.e., enumerating the vertices of a hyperplane arrangement, then reformulate dualize $\psi(x, z)$. Finally, $v(x)$ reduces to a linear program, to which we prefix the decision stage, yielding the full formulation (Eqs. (37) to (46)).

**Proposition 3.1.** The problem Eq. (3) admits the linear reformulation Eqs. (37) to (46) where $I$ is the number of data points, $J(l)$ is the number of vertices in the hyperplane arrangement $\mathcal{V}(z_l)$, $L$ is the number of scenarios in the contingency set $Z_L$, $C$ and $d$ are matrices used in the half-space representation of support $\Xi$.
## 4. Conclusion and discussion

In this paper, we have presented a comprehensive model for the resilience enhancement of microgrids through the optimal sizing and location of distributed energy resources (DERs) under supply-demand uncertainty and random contingencies. Our approach leverages distributionally robust optimization (DRO) to account for both continuous and discrete uncertainties, providing a robust framework for investment and operational decisions.

We focus this contribution on the mathematical description of the model. We formulated the problem as a two-stage stochastic programming model, where the first stage involves investment decisions and the second stage involves operational decisions under uncertainty. The DRO framework allows us to model the ambiguity in probability distributions of uncertainties, ensuring that the solutions are robust against worst-case scenarios.

Future work will include a case study to demonstrate the model's performance against other approaches on several benchmark distribution networks, e.g., Baran and Wu (1989a)'s 33-bus network, Khodr et al. (2008)'s 141-bus network, etc. Historical data for supply-demand is obtained from national and European open data platforms, e.g., ODRÉ, ENTSO-E, GovData.de, etc. This will help validate the effectiveness of our approach in improving the resilience of power systems against extreme events and uncertainties.

## Acknowledgement

This work was supported by funding from the *Agence Nationale de la Recherche (ANR)* under the project "Robust and Scalable Prescriptive Analytics for the Resilience of Critical Infrastructure Networks – RoScaResilience" (ANR-22-CE39-0003).

## References

Bagheri, A. and C. Zhao (2019, June). Distributionally Robust Reliability Assessment for Transmission System Hardening Plan Under N-k Security Criterion. *IEEE Transactions on Reliability* 68(2), 653–662.

Baran, M. and F. Wu (1989a). Network reconfiguration in distribution systems for loss reduction and load balancing. *IEEE Transactions on Power Delivery* 4(2), 1401–1407.

Baran, M. and F. Wu (1989b, January). Optimal sizing of capacitors placed on a radial distribution system. *IEEE Transactions on Power Delivery* 4(1), 735–743.

Billionnet, A., M.-C. Costa, and P.-L. Poirion (2016, October). Robust optimal sizing of a hybrid energy stand-alone system. *European Journal of Operational Research* 254(2), 565–575.

Chalil Madathil, S., E. Yamangil, H. Nagarajan, A. Barnes, R. Bent, S. Backhaus, S. J. Mason, S. Mashayekh, and M. Stadler (2018, November). Resilient Off-Grid Microgrids: Capacity Planning and N-1 Security. *IEEE Transactions on Smart Grid* 9(6), 6511–6521.

Ciapessoni, E., D. Cirio, A. Pitto, M. van Harte, and M. Panteli (2023). Power System Resilience: Definition, features and properties. *CIGRE Science and Engineering* 2023(30).

Ellsberg, D. (1961, November). Risk, Ambiguity, and the Savage Axioms*. *The Quarterly Journal of Economics* 75(4), 643–669.

Enedis (2011, November). Large-Scale Demonstration of Advanced Smart GRID Solutions with wide Replication and Scalability Potential for EUROPE. Grant 268206.

Herrera, M., E. Abraham, and I. Stoianov (2016, March). A Graph-Theoretic Framework for Assessing the Resilience of Sectorised Water Distribution Networks. *Water Resources Management* 30(5), 1685–1699.

Kamruzzaman, Md., J. Duan, D. Shi, and M. Benidris (2021, November). A Deep Reinforcement Learning-Based Multi-Agent Framework to Enhance Power System Resilience Using Shunt Resources. *IEEE Transactions on Power Systems* 36(6), 5525–5536.

Khodr, H. M., F. G. Olsina, P. M. D. O.-D. Jesus, and J. M. Yusta (2008, July). Maximum savings approach for location and sizing of capacitors in distribution
systems. *Electric Power Systems Research* 78(7), 1192–1203.

Kuhn, D., S. Shafiee, and W. Wiesemann (2024, November). Distributionally Robust Optimization.

Kuhn, D., S. Shafiee, and W. Wiesemann (2025). Distributionally Robust Optimization. *Acta Numerica*.

Marnay, C., S. Chatzivasileiadis, C. Abbey, R. Iravani, G. Joos, P. Lombardi, P. Mancarella, and J. von Appen (2015, September). Microgrid Evolution Roadmap. In *2015 International Symposium on Smart Electric Distribution Systems and Technologies (EDST)*, pp. 139–144.

Mohajerin Esfahani, P. and D. Kuhn (2018, September). Data-driven distributionally robust optimization using the Wasserstein metric: Performance guarantees and tractable reformulations. *Mathematical Programming* 171(1), 115–166.

Ouyang, M. and Y. Fang (2017). A Mathematical Framework to Optimize Critical Infrastructure Resilience against Intentional Attacks. *Computer-Aided Civil and Infrastructure Engineering* 32(11), 909–929.

Panteli, M. and P. Mancarella (2015, May). The Grid: Stronger, Bigger, Smarter?: Presenting a Conceptual Framework of Power System Resilience. *IEEE Power and Energy Magazine* 13(3), 58–66.

Papin, P. (2024, July). Hurricane BERYL. Technical Report 14, NWS National Hurricane Center, Miami, Florida.

Prakash, P. and D. K. Khatod (2016, May). Optimal sizing and siting techniques for distributed generation in distribution systems: A review. *Renewable and Sustainable Energy Reviews* 57, 111–130.

Rahimian, H. and S. Mehrotra (2022, July). Distributionally Robust Optimization: A Review. *Open Journal of Mathematical Optimization* 3, 1–85.

Ranasinghe, R., A. Ruane, R. Vautard, N. Arnell, E. Coppola, F. Cruz, S. Dessai, A. Islam, M. Rahimi, D. R. Carrascal, J. Sillmann, M. Sylla, C. Tebaldi, W. Wang, and R. Zaaboul (2023). Climate Change Information for Regional Impact and for Risk Assessment. In M.-D. V., P. Zhai, A. Pirani, S. Connors, C. Péan, S. Berger, N. Caud, Y. Chen, L. Goldfarb, M. Gomis, M. Huang, K. Leitzell, E. Lonnoy, J. Matthews, T. Maycock, T. Waterfield, O. Yelekçi, R. Yu, and B. Zhou (Eds.), *Climate Change 2021 – The Physical Science Basis. Working Group I Contribution to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change*, pp. 1767–1926. Cambridge: Cambridge University Press.

Seneviratne, S.I, X. Zhang, M. Adnan, W. Badi, C. Dereczynski, A. D. Luca, S. Ghosh, I. Iskandar, J. Kossin, S. Lewis, F. Otto, I. Pinto, M. Satoh, S. Vicente-Serrano, M. Wehner, B. Zhou, M.-D. V., P. Zhai, A. Pirani, S. Connors, C. Péan,

S. Berger, N. Caud, Y. Chen, L. Goldfarb, M. Gomis, M. Huang, K. Leitzell, E. Lonnoy, J. Matthews, T. Maycock, T. Waterfield, O. Yelekçi, R. Yu, and B. Zhou (2023). Weather and Climate Extreme Events in a Changing Climate. In *Climate Change 2021 – The Physical Science Basis. Working Group I Contribution to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change*, pp. 1513–1766. Cambridge: Cambridge University Press.

Shi, Z., T. Zhang, Y. Liu, Y. Feng, R. Wang, and S. Huang (2023, August). Optimal design and operation of islanded multi-microgrid system with distributionally robust optimization. *Electric Power Systems Research* 221, 109437.

Vogel, L., K. Corfee, P. Asmus, S. Bilbao, K. Collins, and Navigant Consulting Inc. (2024, June). Lessons Learned from Energy Commission Microgrid Projects. Final Project Report CEC-500-2024-067, California Energy Commission.

Wang, Z., B. Chen, J. Wang, J. Kim, and M. M. Begovic (2014, September). Robust Optimization Based Optimal DG Placement in Microgrids. *IEEE Transactions on Smart Grid* 5(5), 2173–2182.

Yang, Z., M. Ghadamyari, H. Khorramdel, S. M. Seyed Alizadeh, S. Pirouzi, M. Milani, F. Banishemi, and N. Ghadimi (2021, September). Robust multi-objective optimal design of islanded hybrid system with renewable and diesel sources/stationary and mobile energy storage systems. *Renewable and Sustainable Energy Reviews* 148, 111295.

Zhao, J., F. Li, S. Mukherjee, and C. Sticht (2022, July). Deep Reinforcement Learning-Based Model-Free On-Line Dynamic Multi-Microgrid Formation to Enhance Resilience. *IEEE Transactions on Smart Grid* 13(4), 2557–2567.