## Fast scenario-based decision makingin unbalanced distribution networks

Saverio Bolognani, Florian Dörfler

Automatic Control Laboratory

### active power distribution networks

• Worst case analysis at planning stage
(e.g. California "15% rule")
• A little bit of sensing and actuation
• Real time control

### Distribution Network operation under uncertainty

Exogeneous inputs

• Power generation
• Power demands
• Substation voltage

Grid

state

x_\text{exo}
$x_\text{exo}$
x
$x$

Control inputs

• Tap changer
• Volt/VAR control
• Voltage regulators
• Active power control
• Generation curtailment
x_\text{control}
$x_\text{control}$
x \in \mathcal X
$x \in \mathcal X$

Operational constraints

• Over/under voltage limits
• Line current limits
• Voltage stability

### Distribution network model

Grid state (nodal variables)

x = (v,\theta, p, q)
$x = (v,\theta, p, q)$
v_i = \begin{bmatrix} v_i^a \\ v_i^b \\ v_i^c \end{bmatrix}, \quad i = 1, \ldots, N
$v_i = \begin{bmatrix} v_i^a \\ v_i^b \\ v_i^c \end{bmatrix}, \quad i = 1, \ldots, N$

Power flow equations

v_h e^{j\theta_h} \sum_k \bar{Y}_{hk} v_k e^{-j\theta_k}- p_h - j q_h = 0 \quad \forall h
$v_h e^{j\theta_h} \sum_k \bar{Y}_{hk} v_k e^{-j\theta_k}- p_h - j q_h = 0 \quad \forall h$
G(x) = 0
$G(x) = 0$

Implicit nonlinear model

### Uncertain and control inputs

x_\text{exo} = d
$x_\text{exo} = d$

Exogenous stochastic inputs

x_\text{control} = c
$x_\text{control} = c$

Control inputs available to the DNO

x_\text{exo} = \begin{bmatrix} \cdots & p_i & q_i & \cdots \end{bmatrix}
$x_\text{exo} = \begin{bmatrix} \cdots & p_i & q_i & \cdots \end{bmatrix}$

i
$i$
x_\text{control} = \begin{bmatrix} \cdots & p_k & q_k & \cdots \end{bmatrix}
$x_\text{control} = \begin{bmatrix} \cdots & p_k & q_k & \cdots \end{bmatrix}$

e.g. microgenerator

k
$k$
V x \le w
$V x \le w$

Operational constraints

• Nodal constraints​ (under- / over- voltage, power limits)
• Proxy for line capacity, transformer current limits, etc.

### Chance constrained decision problem

\min \ \ \ J(c)
$\min \ \ \ J(c)$
\text{subject to}\quad\text{Prob}_d\left[ Vx \le w\right] > 1 - \epsilon
$\text{subject to}\quad\text{Prob}_d\left[ Vx \le w\right] > 1 - \epsilon$

Complexity of the problem: feasible region.

An analytical derivation of the feasible region is hopeless

• general probability distribution for
• nonlinear dependence of       on       and
\mathcal F = \left\{ c \,|\, \text{Prob}_d\left[ Vx \le w\right] > 1-\epsilon \right\}
$\mathcal F = \left\{ c \,|\, \text{Prob}_d\left[ Vx \le w\right] > 1-\epsilon \right\}$
d
$d$
c
$c$
x
$x$
d
$d$

Cost of control

Probability of satisfying constraints

\left\{ \begin{matrix} G(x) = 0\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.
$\left\{ \begin{matrix} G(x) = 0\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.$

Nonlinear model

### Chance constraints in Power Systems

L. Roald, M. Vrakopoulou, F. Oldewurtel, G. Andersson (2014)
"Risk-Constrained Optimal Power Flow with Probabilistic Guarantees"

D. Bienstock, M. Chertkov, S. Harnett (2014)
"Chance-Constrained OPF: Risk-Aware Network Control under Uncertainty"

T. Summers, J. Warrington, M. Morari, J. Lygeros (2014)
"Stochastic OPF based on convex approximations of chance constraints"

M. Vrakopoulou, M. Katsampani, K. Margellos, J. Lygeros, G. Andersson (2013)
"Probabilistic security-constrained AC optimal power flow
"

DC model /
power balance eqs.

Planning /

N-1 criterion
replacement

### Scenario approach

Approximate the constraint

via the set of constraints

where          are samples (realizations) of

• Based on stochastic models (fitted to the data)
• Directly from the history of the system
\text{Prob}_d\left[ Vx(c,d) \le w\right] > 1-\epsilon
$\text{Prob}_d\left[ Vx(c,d) \le w\right] > 1-\epsilon$
Vx(c,d^{(i)}) \le w \qquad \forall d^{(i)}, i = 1,\ldots, M(\epsilon)
$Vx(c,d^{(i)}) \le w \qquad \forall d^{(i)}, i = 1,\ldots, M(\epsilon)$
d^{(i)}
$d^{(i)}$
d.
$d.$

G.C. Calafiore, M.C. Campi (2006)
"The scenario approach to robust control design"

### Scenario approach

How many?

\sum_{i=0}^{n_c-1} {{M(\epsilon)}\choose{i}} \epsilon^i (1-\epsilon)^{M(\epsilon)-i} \le \beta
$\sum_{i=0}^{n_c-1} {{M(\epsilon)}\choose{i}} \epsilon^i (1-\epsilon)^{M(\epsilon)-i} \le \beta$
\begin{matrix} \epsilon & M(\epsilon) \\ 0.1 & 143 \\ 0.05 & 291 \\ 0.01 & 1475 \end{matrix}
$\begin{matrix} \epsilon & M(\epsilon) \\ 0.1 & 143 \\ 0.05 & 291 \\ 0.01 & 1475 \end{matrix}$
\beta = 10^{-3}, \quad n_c = 5
$\beta = 10^{-3}, \quad n_c = 5$
• Does not depend on the grid size
• Depends on the number of controls

### Computational complexity

For each sample, compute

and then derive the approximate feasible region

\mathcal F^{(i)} = \left\{ c \,|\, Vx(c,d^{(i)}) \le w \right\}
$\mathcal F^{(i)} = \left\{ c \,|\, Vx(c,d^{(i)}) \le w \right\}$
\hat {\mathcal F} = \bigcap_{i} \mathcal F^{(i)}
$\hat {\mathcal F} = \bigcap_{i} \mathcal F^{(i)}$

Computing each feasible region based on NL grid eqs.

is a computationally very intensive task

K. Dvijotham, K. Turitsyn (2015)
"Construction of power flow feasibility sets"

### Linear manifold approximant

G(x) = 0
$G(x) = 0$

Power flow manifold

x^* \ |\ G(x^*) = 0
$x^* \ |\ G(x^*) = 0$

Nominal state

S. Bolognani and F. Dörfler (2015)
“Fast power system analysis via implicit linearization of the power flow manifold”

\nabla G(x^*) ^T (x- x^*) = 0
$\nabla G(x^*) ^T (x- x^*) = 0$

Tangent space

A_{x^*} x = b_{x^*}
$A_{x^*} x = b_{x^*}$

Under-determined

system of linear equations

### Linear manifold approximant

• Sparse
• Structure preserving
• No assumption on
• X/R ratio
• constant voltage
• Implicit linear relation

Compare with DC, LinDistFlow, ...

\left\{ \begin{matrix} G(x) = 0\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.
$\left\{ \begin{matrix} G(x) = 0\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.$
\left\{ \begin{matrix} Ax = b\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.
$\left\{ \begin{matrix} Ax = b\\x_\text{exo} = d\\x_\text{control}=c \end{matrix} \right.$

Sparse implicit linear model

Implicit nonlinear model

### Linear manifold approximant

General case

Extended state

\tilde x = (v,\theta,\text{Re}(i), \text{Im}(i),p,q)
$\tilde x = (v,\theta,\text{Re}(i), \text{Im}(i),p,q)$
\tilde G(x) = \left[ \begin{matrix} \tilde G^\text{edges}(\tilde x)\\ \tilde G^\text{nodes}(\tilde x) \end{matrix} \right]
$\tilde G(x) = \left[ \begin{matrix} \tilde G^\text{edges}(\tilde x)\\ \tilde G^\text{nodes}(\tilde x) \end{matrix} \right]$
\tilde G^\text{edges}(x) = Yu - i
$\tilde G^\text{edges}(x) = Yu - i$
\tilde G_h^\text{nodes}(x) = u_h \bar i_h - s_h
$\tilde G_h^\text{nodes}(x) = u_h \bar i_h - s_h$
u_h := v_h e^{j\theta_h}
$u_h := v_h e^{j\theta_h}$

From complex-value to real-valued equations

f(x) = Ax
$f(x) = Ax$
\frac{\partial f}{\partial x} = \langle A \rangle, \quad \langle A \rangle := \begin{bmatrix} \text{Re}A & -\text{Im}A \\ \text{Im}A & \text{Re}A \end{bmatrix}
$\frac{\partial f}{\partial x} = \langle A \rangle, \quad \langle A \rangle := \begin{bmatrix} \text{Re}A & -\text{Im}A \\ \text{Im}A & \text{Re}A \end{bmatrix}$

complex-valued

real-valued

\langle \bar A \rangle = N \langle A \rangle N, \quad N := \begin{bmatrix} I & 0 \\ 0 & -I \end{bmatrix}
$\langle \bar A \rangle = N \langle A \rangle N, \quad N := \begin{bmatrix} I & 0 \\ 0 & -I \end{bmatrix}$

### Linear manifold approximant

\frac{\partial \begin{bmatrix} \text{Re}(u) \\ \text{Im}(u) \end{bmatrix} }{ \partial \begin{bmatrix} v \\ \theta \end{bmatrix} } = P(v,\theta) := \begin{bmatrix} \text{diag}(\cos\theta) & -\text{diag}(v) \text{diag}(\sin\theta) \\ \text{diag}(\sin\theta) & \text{diag}(v) \text{diag}(\cos\theta) \end{bmatrix}
$\frac{\partial \begin{bmatrix} \text{Re}(u) \\ \text{Im}(u) \end{bmatrix} }{ \partial \begin{bmatrix} v \\ \theta \end{bmatrix} } = P(v,\theta) := \begin{bmatrix} \text{diag}(\cos\theta) & -\text{diag}(v) \text{diag}(\sin\theta) \\ \text{diag}(\sin\theta) & \text{diag}(v) \text{diag}(\cos\theta) \end{bmatrix}$

Evaluate the partial derivatives of

\tilde G(\tilde x)
$\tilde G(\tilde x)$
\left. \frac{\partial \tilde G}{\partial \tilde x} \right|_{\tilde x^*} = \begin{bmatrix} \langle Y \rangle P(v^*,\theta^*) & -I & 0 \\ N \langle \text{diag } i^* \rangle N P(v^*,\theta^*) & \langle \text{diag } v^* \rangle N & -I \end{bmatrix}
$\left. \frac{\partial \tilde G}{\partial \tilde x} \right|_{\tilde x^*} = \begin{bmatrix} \langle Y \rangle P(v^*,\theta^*) & -I & 0 \\ N \langle \text{diag } i^* \rangle N P(v^*,\theta^*) & \langle \text{diag } v^* \rangle N & -I \end{bmatrix}$
\nabla G^T(x^*) = \begin{bmatrix} \Big( N \langle \text{diag } i^* \rangle N + \langle \text{diag } v^* \rangle N \langle Y \rangle \Big) P(v^*,\theta^*) & -I \end{bmatrix}
$\nabla G^T(x^*) = \begin{bmatrix} \Big( N \langle \text{diag } i^* \rangle N + \langle \text{diag } v^* \rangle N \langle Y \rangle \Big) P(v^*,\theta^*) & -I \end{bmatrix}$

Eliminate currents and obtain

IEEE 13 Test feeder

• Substation voltage regulator
• Variety of phasing
• Shunt capacitor banks

### Approximate feasible region

\mathcal F^{(i)} = \left\{ c \,|\, Vx(c,d^{(i)}) \le w \right\}
$\mathcal F^{(i)} = \left\{ c \,|\, Vx(c,d^{(i)}) \le w \right\}$
\hat{\mathcal F}^{(i)} = \text{Proj}_c \hat{\mathcal F}_x^{(i)}
$\hat{\mathcal F}^{(i)} = \text{Proj}_c \hat{\mathcal F}_x^{(i)}$
\hat{\mathcal{F}}_x^{(i)} = \left\{ x \,|\, \begin{matrix} Ax = b \\ x_\text{exo} = d^{(i)} \\ Vx \le w \end{matrix} \right\}
$\hat{\mathcal{F}}_x^{(i)} = \left\{ x \,|\, \begin{matrix} Ax = b \\ x_\text{exo} = d^{(i)} \\ Vx \le w \end{matrix} \right\}$

Feasible
control inputs

i-th feasible region for the scenario approach

Feasible
states

### Approximate feasible region

Linearization point matters!

• Numerical solution in typical conditions
• Measured state

### Polytope operations

\hat F^{(i)} = \text{Proj}_c \hat F_x^{(i)}
$\hat F^{(i)} = \text{Proj}_c \hat F_x^{(i)}$
\hat F_x^{(i)} = \left\{ x \,|\, \begin{matrix} Ax = b \\ x_\text{exo} = d^{(i)} \\ Vx \le w \end{matrix} \right\}
$\hat F_x^{(i)} = \left\{ x \,|\, \begin{matrix} Ax = b \\ x_\text{exo} = d^{(i)} \\ Vx \le w \end{matrix} \right\}$
\hat F = \bigcap_i \hat F^{(i)}
$\hat F = \bigcap_i \hat F^{(i)}$
• Convenient representation for optimization
• Linear inequalities in reduced dimension
• Many redundant constraints
• Fourier-Motzkin elimination
• Fast operations on polytopes
i = 1,\ldots, N
$i = 1,\ldots, N$
i = 1,\ldots, N
$i = 1,\ldots, N$

### Chance-constrained feasible region

Disturbances

• Power demand of spot loads

Operational constraints

• Under- and over-voltage limits

Decision variables

• Generation curtailment @671
• Tap changer position @630

5% confidence

M(\epsilon) = 181
$M(\epsilon) = 181$
\epsilon = 0.05
$\epsilon = 0.05$

Microgenerator

Tap changer

### Simulations

MultiParametric Toolbox for Matlab by IfA

• Towards real time chance-constrained operation
• Next step:
• Slow data - Forecast of uncertain inputs (offline)
• Fast data - Real time measurements (online)

Saverio Bolognani

bsaverio@ethz.ch

http://control.ee.ethz.ch/~bsaverio