$\displaystyle\sum_{j=1}^{J}(\mathbf{A}_{j}^{\top}\bm{\mu}_{j}+\mathbf{d}_{j}\nu_{j})=\mathbf{c}$
(2b) $\displaystyle\norm{\bm{\mu}_{j}}_{2}\leq\nu_{j},\enspace\forall
j=1,2,\dots,J.$ (2c)

Similarly, we write an arbitrary SOCP problem with rotated SOC constraints as

$\displaystyle\underset{{\mathbf{x}}}{\text{min}}\quad\mathbf{c}^{\top}\mathbf{x}\quad\text{s.t.}\quad\norm{\mathbf{A}_{j}\mathbf{x}+\mathbf{b}_{j}}^{2}_{2}\leq\mathbf{d}_{j}^{\top}\mathbf{x}+e_{j},\quad\forall
j=1,2,\dots,J.$ (3)

From the definition of a rotated second-order cone (Mosek ApS 2021), we have
the equivalence

$\displaystyle\norm{\mathbf{A}_{j}\mathbf{x}+\mathbf{b}_{j}}^{2}_{2}\leq\mathbf{d}_{j}^{\top}\mathbf{x}+e_{j}\Leftrightarrow-\begin{bmatrix}\mathbf{A}_{j}\mathbf{x}+\mathbf{b}_{j}\\\
\mathbf{d}_{j}^{\top}\mathbf{x}+e_{j}\\\
\frac{1}{2}\end{bmatrix}\leqslant_{\mathcal{C}^{\text{R}}_{j}}0,$

where $\mathcal{C}^{\text{R}}_{j}\subseteq\mathbb{R}^{k_{j}+2}$ denotes the
rotated second-order cone. As before, defining Lagrange multipliers
$\bm{\lambda}_{j}=[\bm{\mu}_{j}^{\top}\quad\nu_{j}\quad\kappa_{j}]^{\top}\in\mathbb{R}^{k_{j}+2}$
for $j=1,2,\dots,J$, such that $\bm{\mu}_{j}\in\mathbb{R}^{k_{j}}$,
$\nu_{j}\in\mathbb{R}_{+}$ and $\kappa_{j}\in\mathbb{R}_{+}$, the Lagrangian
function for the problem (3) can be written as

$\displaystyle\Theta(\mathbf{x},\bm{\mu}_{1},\dots,\bm{\mu}_{J},\nu_{1},\dots,\nu_{j},\kappa_{1},\dots,\kappa_{J})=\mathbf{c}^{\top}\mathbf{x}-\sum_{j=1}^{J}(\bm{\mu}_{j}^{\top}\mathbf{A}_{j}\mathbf{x}+\bm{\mu}_{j}^{\top}\mathbf{b}_{j}+\frac{1}{2}\kappa_{j}+\nu_{j}\mathbf{d}^{\top}_{j}\mathbf{x}+\nu_{j}e_{j}),$

from which the dual problem is derived as

$\displaystyle\underset{{\bm{\mu}_{j},\nu_{j},\kappa_{j}}}{\text{max}}\quad$
$\displaystyle-\sum_{j=1}^{J}(\mathbf{b}_{j}^{\top}\bm{\mu}_{j}+e_{j}\nu_{j}+\frac{1}{2}\kappa_{j})$
(4a) s.t.
$\displaystyle\sum_{j=1}^{J}(\mathbf{A}_{j}^{\top}\bm{\mu}_{j}+\mathbf{d}_{j}\nu_{j})=\mathbf{c}$
(4b)
$\displaystyle\norm{\bm{\mu}_{j}}^{2}_{2}\leq\kappa_{j}\nu_{j},\enspace\forall
j=1,2,\dots,J.$ (4c)

###  6.2 Dual Problem to Problem $\mathcal{M}^{\text{c}}$

Let $\mathcal{D}^{\text{c}}$ denote the dual problem to the market-clearing
problem $\mathcal{M}^{\text{c}}$. We now derive $\mathcal{D}^{\text{c}}$
relying on the dualization approach in section 6.1. Let
$\Theta$($\mathbf{q}_{i}$,$\mathbf{z}_{i}$,$\bm{\mu}_{it}^{\text{Q}},\kappa_{it}^{\text{Q}},\nu_{it}^{\text{Q}}$,
$\;\bm{\mu}_{ij}$,$\;\nu_{ij}$,
$\;\bm{\gamma}_{i}$,$\;\bm{\lambda}_{p}\;$,$\;\underline{\bm{\varrho}}_{t}$,$\;\overline{\bm{\varrho}}_{t}$)
denote the Lagrangian function of $\mathcal{M}^{\text{c}}$ given by

$\displaystyle\Theta$
$\displaystyle=\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\left(z_{it}+{\mathbf{c}_{it}^{\text{L}}}^{\top}\mathbf{q}_{it}\right)-\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\left({\bm{\mu}^{\text{Q}}_{it}}^{\top}\mathbf{C}_{it}^{\text{Q}}\mathbf{q}_{it}+\frac{1}{2}\kappa_{it}^{\text{Q}}+\nu_{it}^{\text{Q}}z_{it}\right)$
$\displaystyle\quad-\sum_{i\in\mathcal{I}}\sum_{j\in\mathcal{J}_{i}}\left(\bm{\mu}_{ij}^{\top}(\mathbf{A}_{ij}\mathbf{q}_{i}+\mathbf{b}_{ij})+\nu_{ij}(\mathbf{d}_{ij}^{\top}\mathbf{q}_{i}+e_{ij})\right)+\bm{\gamma}^{\top}(\mathbf{F}_{i}\mathbf{q}_{i}-\mathbf{h}_{i})-\sum_{p\in\mathcal{P}}\bm{\lambda}_{p}^{\top}\sum_{i\in\mathcal{I}}\mathbf{G}_{ip}\mathbf{q}_{ip}$
$\displaystyle\quad+\sum_{t\in\mathcal{T}}\left(\overline{\bm{\varrho}}_{t}^{\top}\left(\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(:,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\right)-\overline{\mathbf{s}}\right)-\underline{\bm{\varrho}}_{t}^{\top}\left(\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(:,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\right)+\overline{\mathbf{s}}\right)\right).$
(5)

For notational convenience, let the cost vectors for various hours be stacked
to obtain $\mathbf{c}^{\text{L}}_{i}\in\mathbb{R}^{K_{i}T}$ and a block
diagonal matrix
$\mathbf{C}_{i}^{\text{Q}}=\mathbf{C}_{i1}^{\text{Q}}\oplus\cdots\oplus\mathbf{C}_{iT}^{\text{Q}}\in\mathbb{R}^{K_{i}T\times
K_{i}T}$. Let $\bm{\mu}^{\text{Q}}_{i}\in\mathbb{R}^{K_{i}T}$ and
$\bm{\nu}^{\text{Q}}_{i}\in\mathbb{R}^{T}$ denote the stacked versions of the
dual variables $\bm{\mu}_{it}^{\text{Q}}$ and $\nu_{it}^{\text{Q}}$,
respectively. Further, let $\widehat{\bm{\lambda}}_{i}\in\mathbb{R}^{K_{i}T}$
denote the stacked version of an auxiliary dual variable
$\widehat{\bm{\lambda}}_{it}\in\mathbb{R}^{K_{i}}$ for each market participant
$i$ with its $k$-th element given by

$\displaystyle\widehat{\lambda}_{itk}=\begin{cases}[\mathbf{G}_{ip}\bm{\lambda}_{p}]_{t},~{}&\text{if}\;k=p,\\\
0,~{}&\text{otherwise}.\end{cases}$ (6)

This auxiliary dual variable represents the contribution of each market
participant towards the trades of the $P$ commodities in the market. Finally,
we define an auxiliary variable representing the $i$-th participant’s
contribution towards network congestion, denoted by
$\widehat{\bm{\varrho}}_{it}\in\mathbb{R}^{K_{i}}$ given by

$\displaystyle\widehat{\varrho}_{itk}=\begin{cases}\mathbb{1}^{\top}[\mathbf{G}_{ip}]_{(:,t)}\mathbb{I}_{n_{i}}\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t}),~{}&\text{if}\;k=p,\\\
0,~{}&\text{otherwise},\end{cases}$ (7)

where $\mathbb{1}\in\mathbb{R}^{T}$ and $\mathbb{I}_{n_{i}}\in\mathbb{R}^{N}$
is an indicator vector having the element corresponding to the node
$n_{i}\in\mathbb{N}$ where participant $i$ is located as 1, while all other
elements are zero. The variables $\widehat{\bm{\varrho}}_{it}$ are then
stacked to obtain $\widehat{\bm{\varrho}}_{i}\in\mathbb{R}^{K_{i}T}$. With
these substitutions, we write the dual problem $\mathcal{D}^{\text{c}}$ which
is also an SOCP problem, as

$\displaystyle\underset{{\Xi}}{\text{max}}\quad$
$\displaystyle-\sum_{i\in\mathcal{I}}\sum_{j\in\mathcal{J}_{i}}(\mathbf{b}_{ij}^{\top}\bm{\mu}_{ij}+e_{ij}\nu_{ij})-\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\frac{1}{2}\kappa_{it}^{\text{Q}}-\sum_{t\in\mathcal{T}}{\overline{\mathbf{s}}}^{\top}(\underline{\bm{\varrho}}_{t}+\overline{\bm{\varrho}}_{t})$
(8a) s.t.
$\displaystyle\mathbb{1}-\bm{\nu}_{i}^{\text{Q}}=\mathbb{0},\;\forall i$ (8b)
$\displaystyle\mathbf{c}^{\text{L}}_{i}-\mathbf{C}_{i}^{Q}\bm{\mu}_{i}^{\text{Q}}-\sum_{j\in\mathcal{J}_{i}}(\mathbf{A}_{ij}^{\top}\bm{\mu}_{ij}+\mathbf{d}_{ij}\nu_{ij})+\mathbf{F}_{i}^{\top}\bm{\gamma}_{i}-\widehat{\bm{\lambda}}_{i}+\widehat{\bm{\varrho}}_{i}=\mathbb{0},\enspace\forall
i$ (8c)
$\displaystyle\norm{\bm{\mu}^{\text{Q}}_{it}}^{2}_{2}\leq\kappa_{it}^{\text{Q}}{\nu}_{it}^{\text{Q}},\;\forall
t,\;\forall i$ (8d)
$\displaystyle\norm{\bm{\mu}_{ij}}_{2}\leq\nu_{ij},\;\forall
j\in\mathcal{J}_{i},~{}\forall i.$ (8e)
$\displaystyle\eqref{eq:lambda_it_def}-\eqref{eq:varrho_it_def},\;\forall
k=1,2,\dots,K_{i},\;\forall t,\;\forall i,$ (8f)

where the set of variables is
$\Xi=\\{\bm{\mu}^{\text{Q}}_{i},\kappa_{it}^{\text{Q}},\bm{\nu}_{i}^{\text{Q}},\bm{\mu}_{ij},\nu_{ij},\bm{\gamma}_{i},\bm{\lambda}_{p},\widehat{\bm{\lambda}}_{i},\underline{\bm{\varrho}}_{t},\overline{\bm{\varrho}}_{t},\widehat{\bm{\varrho}}_{i}\\}.$

##  7 Proofs

### Proof of Theorem 3.2

First, we prove the existence of essentially strictly feasible solutions to
the market-clearing problem $\mathcal{M}^{\text{c}}$ and its dual
$\mathcal{D}^{\text{c}}$, inspired by the theory presented in Lobo et al.
(1998). From Definition 3.1, finding strictly feasible solutions to the primal
market-clearing problem $\mathcal{M}^{\text{c}}$ reduces to finding tuples
$(\mathbf{q_{i}},\mathbf{z}_{i}),\;\forall i$, which strictly satisfy the SOC
constraints (9b)-(9c). Likewise, proving strict dual feasibility reduces to
finding tuples
$(\bm{\mu}_{it}^{\text{Q}},\kappa_{it}^{\text{Q}},\nu_{it}^{\text{Q}}),\;\forall
t,\;\forall i$ and $(\bm{\mu}_{ij},\nu_{ij}),\;\forall
j\in\mathcal{J}_{i},\;\forall i$ that strictly satisfy the SOC constraints
(8d)- (8e), respectively. Relying on a variant of the big-M method widely
applied to LP problems (Fortuny-Amat and McCarl 1981), we require the
following auxiliary result to find strictly feasible solutions to
$\mathcal{D}^{\text{c}}$.

###### Lemma 7.1

Given the feasibility of the market-clearing problem $\mathcal{M}^{\text{c}}$,
for each market participant $i\in\mathcal{I}$, there exists a large enough
finite scalar bound $\overline{D}^{Q}_{i}\in\mathbb{R}$ on the Euclidean norm
of $\mathbf{q}_{i}$ given by
$\norm{\mathbf{q}_{i}}_{2}\leq\overline{D}^{Q}_{i}$, such that the optimal
solution to $\mathcal{M}^{\text{c}}$, denoted by
$(\mathbf{q}_{i}^{\star},\mathbf{z}_{i}^{\star})$, is unchanged with addition
of the norm bounds.

###### Proof 7.2

Proof: For each participant $i\in\mathcal{I}$, the $K_{i}$ number of decision
variables at each hour $t$ constituting $\mathbf{q}_{it}$ are either the
commodity contributions $[\mathbf{q}_{ip}]_{t}$ for the $p\in\mathcal{P}$
physical commodities discussed in section 2.1 or any physical state variables
pertaining to the participants. Hence, $\mathbf{q}_{it},\;\forall t$ are, in
fact, finite and both bounded above and below. Observe that, a bounded
$\mathbf{q}_{it}$ results in a bounded $z_{it}$ due to (9b). Given feasible
points $\mathbf{q}_{i},\;\forall i$, one could arbitrarily choose scalars
$\overline{D}^{Q}_{i}$ such that
$\overline{D}^{Q}_{i}\geq\norm{\mathbf{q}_{i}}_{2},\;\forall i$ and
iteratively solve $\mathcal{M}^{\text{c}}$ for values of
$\overline{D}^{Q}_{i}$ large enough such that the optimal solution
$(\mathbf{q}_{i}^{\star},\mathbf{z}_{i}^{\star}),\;\forall i$ no longer
changes over the subsequent iterations. Such an iterative scheme would result
in the norm bounds $\overline{D}^{Q}_{i},\forall i$, thereby completing the
proof.

Due to Definition 3.1 and Lemma 7.1, we write a reduced form of market-
clearing problem $\mathcal{M}^{\text{c}}$ while retaining only the SOC
constraints with additional norm bound constraints

$\displaystyle\underset{{\mathbf{{q}}_{i},\mathbf{z}_{i}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}}\;\sum_{t\in\mathcal{T}}\;({z}_{it}+{\mathbf{c}_{it}^{\text{L}}}^{\top}\mathbf{q}_{it})$
(9a) s.t.
$\displaystyle\norm{\mathbf{C}^{\text{Q}}_{it}\mathbf{q}_{it}}_{2}^{2}\leq{z}_{it},\;\forall
t,\;\forall i$ $\displaystyle:$
$\displaystyle(\bm{\mu}^{\text{Q}}_{it},\kappa^{\text{Q}}_{it},\nu^{\text{Q}}_{it})$
(9b)
$\displaystyle\norm{\mathbf{A}_{ij}\mathbf{{q}}_{i}+\mathbf{b}_{ij}}_{2}\leq\mathbf{d}^{\top}_{ij}\mathbf{{q}}_{i}+e_{ij},\;\forall
j\in\mathcal{J}_{i},\;\forall i$ $\displaystyle\colon$
$\displaystyle(\bm{\mu}_{ij},~{}{\nu}_{ij})$ (9c)
$\displaystyle\norm{\mathbf{q}_{i}}_{2}\leq\overline{D}^{Q}_{i},\;\forall i,$
$\displaystyle\colon$
$\displaystyle(\overline{\bm{\mu}}_{i},\overline{{\nu}}_{i})$ (9d)

where Lagrangian multipliers $\overline{\bm{\mu}}_{i}\in\mathbb{R}^{K_{i}T}$
and $\overline{\nu}_{i}\in\mathbb{R}_{+}$ are associated with the norm bound
constraints. Following the approach in section 6, the dual problem to (9) in
variables
$\Xi^{\text{R}}=\\{\bm{\mu}^{\text{Q}}_{i},\kappa_{it}^{\text{Q}},\bm{\nu}_{i}^{\text{Q}},\bm{\mu}_{ij},\nu_{ij},\overline{\bm{\mu}}_{i},\overline{\nu}_{i}\\}$
writes as

$\displaystyle\underset{{\Xi^{\text{R}}}}{\text{max}}\quad$
$\displaystyle-\sum_{i\in\mathcal{I}}\sum_{j\in\mathcal{J}_{i}}(\mathbf{b}_{ij}^{\top}\bm{\mu}_{ij}+e_{ij}\nu_{ij})-\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\frac{1}{2}\kappa_{it}^{\text{Q}}-\sum_{i\in\mathcal{I}}\overline{D}^{Q}_{i}\overline{\nu}_{i}$
(10a) s.t.
$\displaystyle\mathbb{1}-\bm{\nu}_{i}^{\text{Q}}=\mathbb{0},\;\forall i$ (10b)
$\displaystyle\mathbf{c}^{\text{L}}_{i}-\mathbf{C}_{i}^{Q}\bm{\mu}_{i}^{\text{Q}}-\sum_{j=1}^{J_{i}}(\mathbf{A}_{ij}^{\top}\bm{\mu}_{ij}+\mathbf{d}_{ij}\nu_{ij})+\overline{\bm{\mu}}_{i}=\mathbb{0},\enspace\forall
i$ (10c)
$\displaystyle\norm{\bm{\mu}^{\text{Q}}_{it}}^{2}_{2}\leq\kappa_{it}^{\text{Q}}\nu_{it}^{\text{Q}},\;\forall
t,\;\forall i$ (10d)
$\displaystyle\norm{\bm{\mu}_{ij}}_{2}\leq\nu_{ij},\;\forall
j\in\mathcal{J}_{i},~{}\forall i$ (10e)
$\displaystyle\norm{\bm{\overline{\mu}}_{i}}_{2}\leq\overline{\nu}_{i},\;\forall
i.$ (10f)

Proving the existence of strictly feasible points for (10) is straightforward.
Taking any arbitrary vectors $\bm{\mu}_{ij},\;\forall
j\in\mathcal{J}_{i},\;\forall i$ and $\bm{\mu}_{it}^{\text{Q}},\;\forall
t,\;\forall i$, we can compute the values of
$\nu_{ij}>\norm{\bm{\mu}_{ij}}_{2}$ and
$\kappa_{it}^{\text{Q}}>\norm{\bm{\mu}_{it}^{\text{Q}}}_{2}$, while
$\nu_{it}^{\text{Q}}=1$ from (10b). Now, the variable
$\overline{\bm{\mu}}_{i}$ follows from the equality constraint (10c) and
consequently, $\overline{\nu}_{i}$ can be any number larger than
$\norm{\bm{\overline{\mu}}_{i}}_{2}$. We have therefore found at least one
strictly feasible solution to (10), which proves the essentially strict
feasibility of the dual problem $\mathcal{D}^{\text{c}}$ given that Lemma 7.1
holds.

Next, we prove the essentially strict feasibility of the primal market-
clearing problem $\mathcal{M}^{\text{c}}$ employing the so-called Phase-I
method, discussed in Boyd and Vandenberghe (2004, §11.4). Consider an SOCP
problem in variables $(\mathbf{q}_{i},\mathbf{z}_{i},x_{i},x_{i}^{\text{Q}})$
where $x_{i}\in\mathbb{R}$ and $x_{i}^{\text{Q}}\in\mathbb{R}$ are arbitrary
slack variables

$\displaystyle\underset{{{\mathbf{{q}}_{i},\mathbf{z}_{i},x_{i},x_{i}^{\text{Q}}}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}}\;\sum_{t\in\mathcal{T}}\;({z}_{it}+{\mathbf{c}_{it}^{\text{L}}}^{\top}\mathbf{q}_{it})+\sum_{i\in\mathcal{I}}\;(x_{i}+x_{i}^{\text{Q}})$
(11a) s.t.
$\displaystyle\norm{\mathbf{C}^{\text{Q}}_{it}\mathbf{q}_{it}}_{2}^{2}\leq{z}_{it}+x_{i}^{\text{Q}},\;\forall
t,\;\forall i$ (11b)
$\displaystyle\norm{\mathbf{A}_{ij}\mathbf{{q}}_{i}+\mathbf{b}_{ij}}_{2}\leq\mathbf{d}^{\top}_{ij}\mathbf{{q}}_{i}+e_{ij}+x_{i},\;\forall
j\in\mathcal{J}_{i},\;\forall i.$ (11c)

Observe that, obtaining strictly solutions to the primal problem (11) and its
dual problem is straightforward. For instance, choosing

$\displaystyle\mathbf{q}_{i}=\mathbb{0},\;x_{i}>\underset{{j\in\mathcal{J}_{i}}}{\text{max}}\;\norm{b_{ij}}_{2}-e_{ij},\;\forall
i,\;$ (12a)
$\displaystyle\text{any}\;\mathbf{z}_{i}\in\mathbb{R}^{T}_{+}\;\text{and}\;x_{i}^{\text{Q}}>\underset{{t\in\mathcal{T}}}{\text{max}}\;-{z}_{it},\;\forall
i,$ (12b)

gives a strictly feasible primal solution to (11). Likewise, a strictly
feasible solution for the dual problem to (11) can be found by an approach
(omitted from presentation, for the sake of brevity) discussed above, i.e., by
adding non-binding upper bound constraints on the primal variables
$(x_{i},x_{i}^{\text{Q}}),\;\forall i$. Consequently, Alizadeh and Goldfarb
(2003, Theorem 13) establishes strong duality for (11) due to strict primal
and dual feasibility. We now provide an auxiliary result relating the
augmented problem (11) to the primal market-clearing problem
$\mathcal{M}^{\text{c}}$.

###### Lemma 7.3

For the tuple
$({\mathbf{q}}_{i}^{\star},{\mathbf{z}}_{i}^{\star},{x}_{i}^{\star},{{x}_{i}^{\text{Q}}}^{\star}),\;\forall
i$ denoting the optimal solution to problem (11), only one of the following
conditions holds:

  1. (i)

if ${x}^{\star}_{i}<0,\;\forall i$ and
${{x}_{i}^{\text{Q}}}^{\star}<0,\;\forall i$, then
$({\mathbf{q}}_{i}^{\star},{\mathbf{z}}_{i}^{\star}),\;\forall i$ is strictly
feasible for the problem $\mathcal{M}^{\text{c}}$, or

  2. (ii)

if for any participant $i$, ${x}^{\star}_{i}=0$ or
${{x}_{i}^{\text{Q}}}^{\star}=0$, then for that participant
$({\mathbf{q}}_{i}^{\star},{\mathbf{z}}_{i}^{\star})$ is strictly feasible for
problem $\mathcal{M}^{\text{c}}$, provided
$e_{ij}>\norm{\mathbf{b}_{ij}}_{2},\;\forall j\in\mathcal{J}_{i}$ and the
quadratic cost components $\mathbf{c}^{\text{Q}}_{it}\neq\mathbb{0},\;\forall
t$.

###### Proof 7.4

Proof: First, observe that if the tuple of optimal solution solution
$({\mathbf{q}}_{i}^{\star},{\mathbf{z}}_{i}^{\star},{x}_{i}^{\star},{{x}_{i}^{\text{Q}}}^{\star}),\;\forall
i$ to problem (11) is such that for any $i$, $x_{i}^{\star}>0$ or
${{x}_{i}^{\text{Q}}}^{\star}>0$, then it implies that the market-clearing
problem $\mathcal{M}^{\text{c}}$ is infeasible, which contradicts our
assumption in Theorem 3.2. Hence, for feasibility of the problem (11), we have
$x_{i}\leq 0,\;\forall i$ and $x_{i}^{\text{Q}}\leq 0,\;\forall i$. Now, from
(11b) and (11c), it is clear that if both $x_{i}^{\star}<0,\;\forall i$ and
${x_{i}^{\text{Q}}}^{\star}<0,\;\forall i$ hold, we have found
$(\mathbf{q}_{i}^{\star},\mathbf{z}_{i}^{\star}),\;\forall i$ which strictly
satisfy the SOC inequalities in $\mathcal{M}^{\text{c}}$, i.e., (9b) and (9c).
Conversely, if the optimal solution is obtained such that for any $i$,
$x_{i}^{\star}=0$ or ${x_{i}^{\text{Q}}}^{\star}=0$, then
$(\mathbf{q}_{i}^{\star},\mathbf{z}_{i}^{\star})$ strictly satisfies the SOC
inequalities corresponding to the $i$-th participant in
$\mathcal{M}^{\text{c}}$ under some mild conditions derived from (12). Note
that ${x_{i}^{\text{Q}}}^{\star}=0>\underset{{t}}{\text{max}}\;-z_{it}$ holds
true only if $z_{it}>0,\;\forall t$. This is ensured by non-zero quadratic
cost components of the market participant $i$ at all hours, i.e.,
$\mathbf{c}_{it}^{\text{Q}}\neq\mathbb{0},\;\forall t$. Moreover if any
$\mathbf{c}_{it}^{\text{Q}}=\mathbb{0}$, then the constraint (9b)
corresponding to that hour is trivially satisfied and therefore, can be
possibly eliminated. Lastly, from
$x_{i}^{\star}=0>\underset{{j\in\mathcal{J}_{i}}}{\text{max}}\;\norm{b_{ij}}_{2}-e_{ij}$,
we obtain $\norm{b_{ij}}_{2}-e_{ij}<0,\forall j\in\mathcal{J}_{i}$, which is
then a requirement for $\mathbf{q}_{i}^{\star}=\mathbb{0}$ from (12a) to be
strictly feasible for (9c). This completes the proof.

From Lemma 7.3, solving problem (11) leads to
$(\mathbf{q}_{i},\mathbf{z}_{i}),\;\forall i$ that are essentially strictly
feasible for $\mathcal{M}^{\text{c}}$ under some mild conditions. Evident from
the Examples in section 2 and the formulations provided in section 8, these
conditions are met in the practical implementations of
$\mathcal{M}^{\text{c}}$. We have now proved that an essentially strictly
feasible solution to the market-clearing problem $\mathcal{M}^{\text{c}}$
exists.

For the market-clearing problem $\mathcal{M}^{\text{c}}$, essentially strict
feasibility of the primal and dual problems is necessary and sufficient for
strong duality to hold for the primal-dual pair of problems
$\mathcal{M}^{\text{c}}$ and $\mathcal{D}^{\text{c}}$ (Ben-Tal and Nemirovski
2001, Theorem 1.4.4), thereby completing the proof.

### Proof of Theorem 3.3

The proof follows from the partial Lagrangian function of
$\mathcal{M}^{\text{c}}$, obtained by keeping the constraints (9b)-(9d) and
relaxing the others, which we write as

$\displaystyle\hat{\Theta}$
$\displaystyle=-\sum_{p\in\mathcal{P}}\bm{\lambda}_{p}^{\top}\sum_{i\in\mathcal{I}}\mathbf{G}_{ip}\mathbf{q}_{ip}+\sum_{t\in\mathcal{T}}\overline{\bm{\varrho}}_{t}^{\top}\left(\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(:,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\right)-\overline{\mathbf{s}}\right)$
$\displaystyle\qquad-\sum_{t\in\mathcal{T}}\underline{\bm{\varrho}}_{t}^{\top}\left(\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(:,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\right)+\overline{\mathbf{s}}\right).$

With the substitution of the auxiliary variable
$\mathbf{Q}_{p}^{\text{inj}},\;\forall p\in\mathcal{P}$ defined in (14)
followed by a rearrangement of terms, the partial Lagrangian equivalently
writes as follows

$\displaystyle\hat{\Theta}$
$\displaystyle=\underbrace{-\sum_{p\in\mathcal{P}}\bm{\lambda}_{p}^{\top}{\mathbf{Q}_{p}^{\text{inj}}}^{\top}\mathbb{1}}_{\text{System-
wide
balance}}+\underbrace{\sum_{t\in\mathcal{T}}\overline{\bm{\varrho}}_{t}^{\top}\left(\sum_{p\in\mathcal{P}}\bm{\Psi}\;[{\mathbf{Q}_{p}^{\text{inj}}}]_{(:,t)}\right)-\sum_{t\in\mathcal{T}}\overline{\bm{\varrho}}_{t}^{\top}\overline{\mathbf{s}}-\sum_{t\in\mathcal{T}}\underline{\bm{\varrho}}_{t}^{\top}\left(\sum_{p\in\mathcal{P}}\bm{\Psi}\;[{\mathbf{Q}_{p}^{\text{inj}}}]_{(:,t)}\right)-\sum_{t\in\mathcal{T}}\underline{\bm{\varrho}}_{t}^{\top}\overline{\mathbf{s}}}_{\text{Line
flow limits}},$ (13)

where the vector of ones $\mathbb{1}\in\mathbb{R}^{N}$. Here, the partial
Lagrangian comprises of terms corresponding to the system-wide balance
equalities and the line flow limit inequalities, as indicated. In the sense of
Bohn et al. (1984), the spot price of electricity for consumers at a given
hour is analytically expressed as the sum of shadow price of the system
balance constraint and the sensitivity of changes in the demand to the flow in
the capacity-constrained transmission lines. We denote these optimal prices
$\bm{\Pi}_{p}\in\mathbb{R}^{N\times T}$ for the $p$-th commodity and provide
an analytical expression in the following. We derive an expression for the
spot price of commodities as the negative sensitivity of the partial
Lagrangian (13) to the nodal injections as

$\displaystyle\frac{\partial\hat{\Theta}}{\partial[{\mathbf{Q}_{p}^{\text{inj}}}]_{(:,t)}}=-\Big{(}-\mathbb{1}[\bm{\lambda}_{p}]_{t}+\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)},\;\forall
p,\;~{}\forall t,$ (14)

where the negative sign originates from the sign convention adopted in this
work, such that the consumption (withdrawals) are given by
$\mathbf{q}_{ip}\in\mathbb{R}^{T}_{-}$. For compactness of expression, we
extend (14) to all hours by defining auxiliary variables
$\underline{\bm{\rho}},~{}\overline{\bm{\rho}}\in\mathbb{R}^{L\times T}$ and
$\bm{\Lambda}_{p}\in\mathbb{R}^{N\times T}$, such that
$\overline{\bm{\rho}}=[\overline{\bm{\varrho}}_{1}~{}\cdots~{}\overline{\bm{\varrho}}_{T}]$,
$\underline{\bm{\rho}}=[\underline{\bm{\varrho}}_{1}~{}\cdots~{}\underline{\bm{\varrho}}_{T}]$
and $\bm{\Lambda}_{p}=\mathbb{1}^{\top}\otimes\bm{\lambda}_{p}$. Lastly, we
express the spatial prices as

$\displaystyle\mathbf{\Pi}_{p}={\bm{\Lambda}}_{p}-\bm{\Psi}^{\top}(\overline{\bm{\rho}}-\underline{\bm{\rho}}),\;\forall
p,$ (15)

which are analogous in structure to conventional LMPs prevalent in LP-based
market-clearing problems. Theorem 3.2 proves strong duality for the market-
clearing problem $\mathcal{M}^{\text{c}}$, thereby ensuring the optimality of
the spatial prices when the dual variables in (15) are replaced by their
values at the optimal solution.

### Proof of Theorem 3.4.

To prove the equivalence of the optimization problem $\mathcal{M}^{\text{c}}$
with the equilibrium $\mathcal{E}^{\text{c}}$, we show that the KKT conditions
of the equilibrium problem are identical to those of the optimization. First,
for the network operator’s congestion rent maximization problem (12), let
$\Theta_{\text{NO}}$ denote the Lagrangian function of the problem (12). We
write the KKT conditions defining the optimal solution as

  * •

Stationarity condition:

$\displaystyle\frac{\partial\Theta_{\text{NO}}}{\partial\mathbf{y}_{t}}=\bm{\omega}_{t}+\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})=\mathbb{0},\;\forall
t$ (16a)

  * •

Primal feasibility, dual feasibility and complementarity conditions:

$\displaystyle-$
$\displaystyle\bm{\Psi}\mathbf{y}_{t}\leq\overline{\mathbf{s}};\quad\underline{\bm{\varrho}}_{t}\geq\mathbb{0};\quad\underline{\bm{\varrho}}_{t}\odot(\bm{\Psi}\mathbf{y}_{t}+\overline{\mathbf{s}})=\mathbb{0}$
(16b)
$\displaystyle\bm{\Psi}\mathbf{y}_{t}\leq\overline{\mathbf{s}};\quad\overline{\bm{\varrho}}_{t}\geq\mathbb{0};\quad\overline{\bm{\varrho}}_{t}\odot(\bm{\Psi}\mathbf{y}_{t}-\overline{\mathbf{s}})=\mathbb{0},$
(16c)

where $\odot$ denotes the Hadamard (element-wise) product operator.

For each participant $i\in\mathcal{I}$, let
$\Theta_{i}(\mathbf{q}_{i},\mathbf{z}_{i},\bm{\mu}_{it}^{\text{Q}},\kappa_{it}^{\text{Q}},\nu_{it}^{\text{Q}},\bm{\mu}_{ij},\nu_{ij},\bm{\gamma}_{i},\bm{\widehat{\lambda}}_{ip}$)
denote the Lagrangian function for problem (11) given by

$\displaystyle\Theta_{i}$
$\displaystyle=\sum_{p\in\mathcal{P}}\text{tr}(\bm{\Pi}_{p}^{\top}\mathbf{W}_{ip})-\sum_{t\in\mathcal{T}}\Big{(}z_{it}+{\mathbf{c}_{it}^{\text{L}}}^{\top}\mathbf{q}_{it}\big{)}-\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\big{(}\sum_{p\in\mathcal{P}}[\mathbf{W}_{ip}]_{(:,t)}\big{)}+\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\big{(}\sum_{p\in\mathcal{P}}\mathbb{I}_{n_{i}}[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\big{)}$
$\displaystyle\quad+\sum_{t\in\mathcal{T}}\Big{(}\bm{\mu}_{it}^{\text{Q}}\mathbf{C}_{it}^{\text{Q}}\mathbf{q}_{it}+\frac{1}{2}\kappa_{it}^{\text{Q}}+\nu_{it}^{\text{Q}}z_{it}\Big{)}+\sum_{j\in\mathcal{J}_{i}}\Big{(}\bm{\mu}_{ij}^{\top}\big{(}\mathbf{A}_{ij}\mathbf{q}_{i}+\mathbf{b}_{ij}\big{)}+\nu_{ij}(\mathbf{d}_{ij}^{\top}\mathbf{q}_{i}+e_{ij}\big{)}\Big{)}$
$\displaystyle\quad\quad-\bm{\gamma}_{i}^{\top}(\mathbf{F}_{i}\mathbf{q}_{i}-\mathbf{h}_{i})+\widehat{\bm{\lambda}}_{ip}^{\top}\Big{(}\mathbf{G}_{ip}\mathbf{q}_{ip}-\mathbf{W}_{ip}^{\top}\mathbb{1}\Big{)}$
(17)

Using the auxiliary dual variables $\bm{\mu}_{i}^{\text{Q}},\;\bm{\nu}_{i}$
and parameters $\mathbf{c}_{i}^{\text{L}},\mathbf{C}_{i}^{\text{Q}}$ defined
previously in section 6.2, we write the KKT optimality conditions for a
participant $i\in\mathcal{I}$ as

  * •

Stationarity conditions:

$\displaystyle\frac{\partial\Theta_{i}}{\partial\mathbf{q}_{i}}$
$\displaystyle=-\mathbf{c}_{i}^{\text{L}}+\mathbf{C}_{i}^{\text{Q}}\bm{\mu}_{i}^{\text{Q}}+\sum_{j\in\mathcal{J}_{i}}\big{(}\mathbf{A}_{ij}^{\top}\bm{\mu}_{ij}+\mathbf{d}_{ij}\nu_{ij}\big{)}-\mathbf{F}_{i}^{\top}\bm{\gamma}_{i}+\frac{\partial}{\partial\mathbf{q}_{i}}\Big{(}\bm{\widehat{\lambda}}_{ip}^{\top}\big{(}\mathbf{G}_{ip}\mathbf{q}_{ip}\big{)}\Big{)}$
$\displaystyle\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad+\frac{\partial}{\partial\mathbf{q}_{i}}\Big{(}\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\big{(}\mathbb{I}_{n_{i}}\sum_{p\in\mathcal{P}}[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}\big{)}\Big{)}=\mathbb{0}$
(18a) $\displaystyle\frac{\partial\Theta_{i}}{\partial\mathbf{W}_{ip}}$
$\displaystyle=\mathbf{\Pi}_{p}-\bm{\widehat{\lambda}}_{ip}\mathbb{1}^{\top}-\bm{\Omega}=\mathbf{0},\;\forall
p\in\mathcal{P},$ (18b)
$\displaystyle\frac{\partial\Theta_{i}}{\partial\mathbf{z}_{i}}$
$\displaystyle=\mathbb{1}-\bm{\nu}_{i}=\mathbb{0}$ (18c)

where $\bm{\Omega}\in\mathbb{R}^{N\times
T}\coloneqq\begin{bmatrix}\bm{\omega}_{1}&\bm{\omega}_{2}&\cdots&\bm{\omega}_{T}\end{bmatrix}$,
such that the term
$\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\big{(}\sum_{p\in\mathcal{P}}[\mathbf{W}_{ip}]_{(:,t)}\big{)}$
in the Lagrangian (17) reduces to
$\text{tr}(\bm{\Omega}^{\top}\mathbf{W}_{ip})$. Furthermore, from (16a), we
have
$\bm{\omega}_{t}=-\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})$
at the optimal solution. With this and from the definitions of
$\widehat{\bm{\lambda}}_{i}$ and $\widehat{\bm{\varrho}}_{i}$ in (6) and (7),
respectively, (18a) reduces to

$\displaystyle\frac{\partial\Theta_{i}}{\partial\mathbf{q}_{i}}$
$\displaystyle=-\mathbf{c}_{i}^{\text{L}}+\mathbf{C}_{i}^{\text{Q}}\bm{\mu}_{i}^{\text{Q}}+\sum_{j\in\mathcal{J}_{i}}\big{(}\mathbf{A}_{ij}^{\top}\bm{\mu}_{ij}+\mathbf{d}_{ij}\big{)}-\mathbf{F}_{i}^{\top}\bm{\gamma}_{i}+\widehat{\bm{\lambda}}_{i}-\widehat{\bm{\varrho}}_{i}=\mathbb{0}$
(18d)

Similarly, the stationarity condition (18b) reduces to

$\displaystyle\frac{\partial\Theta_{i}}{\partial\mathbf{W}_{ip}}=\mathbf{\Pi}_{p}-\bm{\widehat{\lambda}}_{ip}\mathbb{1}^{\top}+\bm{\Psi}^{\top}(\overline{\bm{\rho}}-\underline{\bm{\rho}})=\mathbf{0},\;\forall
p\in\mathcal{P},$ (18e)

following the definitions of auxiliary dual variables $\overline{\bm{\rho}}$
and $\underline{\bm{\rho}}$ in Theorem 3.3.

  * •

Primal feasibility, dual feasibility and complementarity conditions:

$\displaystyle\norm{\mathbf{C}^{\text{Q}}_{it}\mathbf{q}_{it}}_{2}^{2}\leq{z}_{it}\;;\;\;\norm{\bm{\mu}_{it}^{\text{Q}}}_{2}^{2}\leq\kappa_{it}^{\text{Q}}\nu_{it}^{\text{Q}},\;\kappa_{it}^{\text{Q}}\geq
0,\nu_{it}^{\text{Q}}\geq
0\;;\;\;\begin{bmatrix}{\bm{\mu}_{it}^{\text{Q}}}^{\top}\quad\nu_{it}^{\text{Q}}\quad\kappa_{it}^{\text{Q}}\end{bmatrix}\begin{bmatrix}\mathbf{C}_{it}^{\text{Q}}\mathbf{q}_{it}\\\
z_{it}\\\ \frac{1}{2}\end{bmatrix}=0,\;\;\forall t$ (18f)
$\displaystyle\norm{\mathbf{A}_{ij}\mathbf{q}_{i}+\mathbf{b}_{ij}}_{2}\leq\mathbf{d}_{ij}^{\top}\mathbf{q}_{i}+e_{ij}\;;\;\;\norm{\bm{\mu}_{ij}}_{2}\leq\nu_{ij},\;\nu_{ij}\geq
0\;;\;\;\begin{bmatrix}{\bm{\mu}}^{\top}_{ij}\quad\nu_{ij}\end{bmatrix}\Big{(}\begin{bmatrix}\mathbf{A}_{ij}\\\
\mathbf{d}_{ij}^{\top}\end{bmatrix}\mathbf{q}_{i}+\begin{bmatrix}\mathbf{b}_{ij}\\\
e_{ij}\end{bmatrix}\Big{)}=0,\;\;\forall j\in\mathcal{J}_{i}$ (18g)
$\displaystyle\mathbf{F}_{i}\mathbf{q}_{i}=\mathbf{h}_{i};\quad\bm{\gamma}_{i}\text{
free}$ (18h)
$\displaystyle\eqref{eq:lambda_it_def}-\eqref{eq:varrho_it_def},\;\forall
k=1,2,\dots,K_{i},\;\forall t,\;\forall i.$ (18i)

Equations (• ‣ 7), (18c)-(18i), $\forall i\in\mathcal{I}$ and (13) form the
KKT optimality conditions for the equilibrium problem
$\mathcal{E}^{\text{c}}$. Observe that, in addition to the primal and dual
feasibility involving SOC constraints, (18f)-(18g) ensure the conic
complementarity condition is met at the optimal solution (Alizadeh and
Goldfarb 2003, Theorem 16).

To see that the KKT optimality conditions for the optimization problem
$\mathcal{M}^{\text{c}}$ are identical to those of the equilibrium, observe
that at the optimal solution:

  1. (i)

${\widehat{\bm{\lambda}}}^{\star}_{ip},\;\forall i\in\mathcal{I}$ appearing in
(18e) are attained such that
${\widehat{\bm{\lambda}}}^{\star}_{ip}=\bm{\lambda}_{p}^{\star},\forall
p\in\mathcal{P},\;\forall i\in\mathcal{I}$, where
$\bm{\lambda}_{p}^{\star},\;\forall p\in\mathcal{P}$ corresponds to the
system-wide price of the commodities. Therefore, (18e) provides the analytical
expression for conic spatial prices as formulated in Theorem 3.3, and

  2. (ii)

$\mathbf{y}^{\star}_{t},\;\forall t$ appearing in (16b)-(16c) are obtained
such that
$\mathbf{y}_{t}^{\star}=\sum_{p\in\mathcal{P}}[{\mathbf{Q}_{p}^{\text{inj}}}^{\star}]_{(:,t)},\;\forall
t$. This follows from the market-clearing condition (13a). Note that the
auxiliary variable ${\mathbf{Q}_{p}^{\text{inj}}}$ appears in the partial
Lagrangian of problem $\mathcal{M}^{\text{c}}$, as shown (13).

This establishes the equivalence of the KKT optimality conditions for the
centrally-solved optimization problem $\mathcal{M}^{\text{c}}$ and the
equilibrium problem $\mathcal{E}^{\text{c}}$, thereby completing the proof.

### Proof of Corollary 3.5

To prove existence of solutions to the competitive spatial price equilibrium
problem $\mathcal{E}^{\text{c}}$, we recall Rosen (1965, Theorem 1) which
provides an existence result for solutions to equilibrium problems conditioned
on the convexity and compactness of each participant’s strategy sets and the
continuity of their payoff functions. For the market participants
$i\in\mathcal{I}$, while convexity and closure of the strategy sets are given
by the feasibility region defined by equalities and non-strict inequalities
(11b)-(11e), Lemma 7.1 proves that $(\mathbf{q}_{i},\mathbf{z}_{i}),\;\forall
i$ are bounded. Note that the quantities bought or sold by the $i$-th
participant $\mathbf{W}_{ip},\;\forall p$ are bounded, conditioned on the
boundedness of $\mathbf{q}_{i}$ due to (11e). Consequently, the strategy sets
of the participants are convex as well as closed and bounded, thereby
satisfying the convexity and compactness conditions. Further, each
participant’s cost function (11a) is continuous in the decision variables. For
the network operator, convexity and compactness of the strategy set is given
due to the network limits and continuity of the payoff function is satisfied
by the linear objective function in (12). Therefore, from Rosen (1965, Theorem
1), this proves that at least one solution exists for the spatial price
equilibrium problem $\mathcal{E}^{\text{c}}$. To derive conditions under which
at most one solution exists to problem $\mathcal{E}^{\text{c}}$, we refer to
the equivalence of equilibrium problem $\mathcal{E}^{\text{c}}$ to the convex
market-clearing optimization problem $\mathcal{M}^{\text{c}}$ established by
Theorem 3.4. From this equivalence, the uniqueness of allocations
$\mathbf{q}_{i}^{\star},\;\forall i$ at the equilibrium relies on the strict
convexity of the problem $\mathcal{M}^{\text{c}}$, which we characterize in
Remark 2.10. However, observe that, the uniqueness of solutions to the dual
market-clearing problem $\mathcal{D}^{\text{c}}$ is not given due to lack of
the strict convexity property of the dual objective (8a). Therefore,
uniqueness of spatially-differentiated conic prices
$\bm{\Pi}_{p}^{\star},\;\forall p$ given by (10) is not guaranteed. This
completes the proof.

### Proof of Theorem 3.6

  1. (i)

Market efficiency: An efficient market maximizes social welfare, such that no
participant unilaterally deviates from the market-clearing outcomes since each
participant maximizes her profit at the optimal allocations
$\mathbf{q}_{i}^{\star}$ and prices $\bm{\Pi}_{p}^{\star},\;\forall p$. Under
the assumption of perfectly competitive market participants, this is given if
the KKT optimality conditions of the centrally-solved optimization problem
$\mathcal{M}^{\text{c}}$ and equilibrium problem $\mathcal{E}^{\text{c}}$
involving rational and self-interested actors are identical, which we have
established in Proof of Theorem 3.4.

  2. (ii)

Cost recovery: Mathematically, the non-negativity of payoff for the market
participants holds true, if at the optimal solution

$\displaystyle\sum_{p\in\mathcal{P}}\text{tr}({{\bm{\Pi}_{p}^{\star}}^{\top}}{\mathbf{W}^{\star}_{ip}})-\sum_{t\in\mathcal{T}}\left({z}^{\star}_{it}+{\mathbf{c}_{it}^{\text{L}}}^{\top}\mathbf{q}^{\star}_{it}\right)-\sum_{t\in\mathcal{T}}{\bm{\omega}^{\star}_{t}}^{\top}\Big{(}\sum_{p\in\mathcal{P}}\big{(}[\mathbf{W}^{\star}_{ip}]_{(:,t)}-\mathbb{I}_{n_{i}}[\mathbf{G}_{ip}\mathbf{q}^{\star}_{ip}]_{t}\big{)}\Big{)}\geq
0,\;\forall i\in\mathcal{I}.$ (19)

To prove that (19) holds, we derive the dual problem to each participant’s
profit maximization problem (11). The dual problem in variables
$\Xi_{i}=\\{\bm{\mu}^{\text{Q}}_{i},\kappa_{it}^{\text{Q}},\bm{\nu}_{i}^{\text{Q}},\bm{\mu}_{ij},\nu_{ij},\bm{\gamma}_{i}\\}$
writes as

$\displaystyle\forall
i\in\mathcal{I}\begin{cases}\underset{{\Xi_{\text{i}}}}{\text{min}}\quad&\sum_{j\in\mathcal{J}_{i}}(\mathbf{b}_{ij}^{\top}\bm{\mu}_{ij}+e_{ij}\nu_{ij})+\sum_{t\in\mathcal{T}}\frac{1}{2}\kappa_{it}^{\text{Q}}+\bm{\gamma}_{i}^{\top}\mathbf{h}_{i}\\\
\text{s.t.}\quad&\eqref{KKT:qi_3}-\eqref{KKT:qi_2}\\\
&\norm{\bm{\mu}_{it}^{\text{Q}}}_{2}^{2}\leq\kappa_{it}^{\text{Q}}\nu_{it}^{\text{Q}},\;\forall
t\\\ &\norm{\bm{\mu}_{ij}}_{2}\leq\nu_{ij},\;\forall j\in\mathcal{J}_{i}\\\
&\kappa_{it}^{\text{Q}}\geq 0,\;\nu_{it}^{\text{Q}}\geq 0,\end{cases}$ (20)

Using Lemmas 7.1 and 7.3 provided in the Proof of Theorem 3.2, existence of
strictly feasible primal-dual solutions to the participant’s profit
maximization problem (11) and its dual (20) is established (omitted from
presentation, for the sake of brevity). Consequently, from Theorem 3.2, strong
duality holds for this primal-dual pair, thereby enforcing the primal problem
(11) and its dual (20) to attain identical objective function values at the
optimal solution. Condition (19) is equivalent to the non-negativity of the
dual objective in (20) at the optimal solution, which we now analyze in the
following.

Observe that, the second term of the objective function of the dual problem
(20) is non-negative from the primal feasibility condition $\kappa_{it}\geq
0,\forall i$. The first term, enclosed in parenthesis, is non-negative if
$e_{ij}\geq\norm{\mathbf{b}_{ij}}_{2},\;\forall j\in\mathcal{J}_{i}$. This
stems from the Cauchy-Schwarz Inequality, i.e., we have

$\displaystyle|\mathbf{b}_{ij}^{\top}\bm{\mu}_{ij}|\leq\norm{\mathbf{b}_{ij}}_{2}\norm{\bm{\mu}_{ij}}_{2}\leq\norm{\mathbf{b}_{ij}}_{2}\nu_{ij},\;\forall
j\in\mathcal{J}_{i},$

where the last inequality is due to the primal feasibility condition
$\norm{\bm{\mu}_{ij}}_{2}\leq\nu_{ij},\;\forall j\in\mathcal{J}_{i}$. With the
condition $e_{ij}\geq\norm{\mathbf{b}_{ij}},\;\forall j\in\mathcal{J}_{i}$, we
have $|\mathbf{b}_{ij}^{\top}\bm{\mu}_{ij}|\leq e_{ij}\nu_{ij},\;\forall
j\in\mathcal{J}_{i}$. Under the condition
$e_{ij}\geq\norm{\mathbf{b}_{ij}}_{2}$, $e_{ij}\nu_{ij}\geq 0\;\forall
j\in\mathcal{J}_{i}$; therefore, the first term in the objective is bounded
below by 0. The variable $\bm{\gamma}_{i}$ is free, therefore the third term
in the objective is guaranteed to be non-negative if
$\mathbf{h}_{i}=\mathbb{0}$. This completes the proof of cost recovery for the
market participants $i\in\mathcal{I}$ under the conditions: (i)
$e_{ij}\geq\norm{\mathbf{b}_{ij}}_{2},\;\forall j\in\mathcal{J}_{i},\;\forall
i$ and (ii) $\mathbf{h}_{i}=\mathbb{0},\;\forall i$.

  3. (iii)

Revenue adequacy: Mathematically, revenue adequacy of the market operator is
satisfied if

$\displaystyle\underbrace{\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}\text{tr}({{\bm{\Pi}_{p}^{\star}}}^{\top}\mathbf{W}_{ip}^{\star})}_{\text{Term
A}}\;\;\underbrace{-\sum_{t\in\mathcal{T}}{\bm{\omega}_{t}^{\star}}^{\top}\mathbf{y}_{t}^{\star}}_{\text{Term
B}}\geq 0,$ (21)

where Term A refers to the net payments received from the $i\in\mathcal{I}$
market participants for the $p\in\mathcal{P}$ commodities and Term B refers to
the payments made to the network operator towards transmission service. To
reduce notational complexity, we drop the superscript $\star$ denoting optimal
values in the proof that follows, yet they are always implied. Using (14), we
expand Term A and rearrange the summation operators to reflect the dependence
of variables

$\displaystyle\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}\text{tr}({{\bm{\Pi}_{p}}}^{\top}\mathbf{W}_{ip})$
$\displaystyle=\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\Big{(}\Big{(}\mathbb{1}[\bm{\lambda}_{p}]_{t}-\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)}^{\top}[\mathbf{W}_{ip}]_{(:,t)}\Big{)}$
$\displaystyle=\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}\sum_{t\in\mathcal{T}}\Big{(}[\bm{\lambda}_{p}]_{t}\mathbb{1}^{\top}[\mathbf{W}_{ip}]_{(:,t)}\Big{)}-\sum_{t\in\mathcal{T}}\Big{(}\Big{(}\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)}^{\top}\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}[\mathbf{W}_{ip}]_{(:,t)}\Big{)}$
(22)

Gathering the equalities (11e) representing the transaction quantities with
the injections (or withdrawals) for the $I$ participants, we have
$\mathbf{W}_{ip}^{\top}\mathbb{1}=\mathbf{G}_{ip}\mathbf{q}_{ip},\;\forall i$.
Since this equality holds individually for each participant, we can add them
for all participants to get
$\sum_{i\in\mathcal{I}}\mathbb{1}^{\top}\mathbf{W}_{ip}=\sum_{i\in\mathcal{I}}(\mathbf{G}_{ip}\mathbf{q}_{ip})^{\top}$,
such that

$\displaystyle\sum_{i\in\mathcal{I}}\mathbb{1}^{\top}[\mathbf{W}_{ip}]_{(:,t)}=\sum_{i\in\mathcal{I}}[\mathbf{G}_{ip}\mathbf{q}_{ip}]_{t}=0,\quad\forall
t,$ (23)

where the second equality results from the market-clearing condition (13b)
which must hold at optimality. Therefore, the first term in (22) vanishes. The
second term in (22) is non-zero only if there is a congestion in the grid,
i.e., any $\overline{\bm{\varrho}}_{t}\neq 0$ or
$\underline{\bm{\varrho}}_{t}\neq 0$. Next, we expand the Term B in (21),
using the stationarity condition (16a) and the market-clearing condition
(13a), as

$\displaystyle-\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\mathbf{y}_{t}=\sum_{t\in\mathcal{T}}\Big{(}\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)}^{\top}\sum_{p\in\mathcal{P}}[\mathbf{Q}_{p}^{\text{inj}}]_{(:,t)}$
(24)

which is again non-zero only if there is congestion in the network, i.e., the
network operator earns congestion rent. We remove the summation over the hours
by using the expression for the conic spatial prices given by Theorem 3.3 and
the auxiliary variables defined therein, to rewrite Term B of (21) as

$\displaystyle-\sum_{t\in\mathcal{T}}\bm{\omega}_{t}^{\top}\mathbf{y}_{t}$
$\displaystyle=\sum_{t\in\mathcal{T}}\Big{(}\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)}^{\top}\sum_{p\in\mathcal{P}}[\mathbf{Q}_{p}^{\text{inj}}]_{(:,t)}$
$\displaystyle\quad=\sum_{p\in\mathcal{P}}\text{tr}\Big{(}(\bm{\Psi}^{\top}(\overline{\bm{\rho}}-\overline{\bm{\rho}}))^{\top}\mathbf{Q}_{p}^{\text{inj}}\Big{)}=\sum_{p\in\mathcal{P}}\text{tr}\Big{(}(\bm{\Lambda}_{p}-\bm{\Pi}_{p})^{\top}\mathbf{Q}_{p}^{\text{inj}}\Big{)}.$
(25)

Similarly, using (23), we rewrite Term A of (21) after rearrangement as

$\displaystyle\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}\text{tr}({{\bm{\Pi}_{p}}}^{\top}\mathbf{W}_{ip})$
$\displaystyle=-\sum_{t\in\mathcal{T}}\Big{(}\Big{(}\bm{\Psi}^{\top}(\overline{\bm{\varrho}}_{t}-\underline{\bm{\varrho}}_{t})\Big{)}^{\top}\sum_{p\in\mathcal{P}}\sum_{i\in\mathcal{I}}[\mathbf{W}_{ip}]_{(:,t)}\Big{)}$
$\displaystyle\quad=-\sum_{p\in\mathcal{P}}\text{tr}\Big{(}(\bm{\Lambda}_{p}-\bm{\Pi}_{p})^{\top}(\sum_{i\in\mathcal{I}}\mathbf{W}_{ip})\Big{)}.$
(26)

Observe that $\sum_{i\in\mathcal{I}}\mathbf{W}_{ip}$ sums the transaction
quantities over the nodes and periods for all participants for a given
commodity $p$, which is indeed equal to the commodity-specific net nodal
injections given by (14), i.e.,
$\mathbf{Q}_{p}^{\text{inj}}=\sum_{i\in\mathcal{I}}\mathbf{W}_{ip},\;\forall
p$. Therefore, the terms in (25) and (26) cancel each other out, thereby
satisfying the revenue adequacy condition for the market operator at the
optimal solution. As a result, we have shown that there exists a budget
balance for the market operator under the proposed conic market framework,
i.e., the market-operator does not accrue any surplus revenue.

##  8 Market-clearing Problems

For the uncertainty-aware conic market framework proposed in the paper, we
first outline the participant models in section 8.1, followed by the chance-
constrained market-clearing problem and its reformulation as the SOCP problem
$\mathcal{M}^{\text{cc}}$ in section 8.2. In section 8.3 we provide
formulations for the two LP-based uncertainty-aware benchmark market-clearing
problems, $\mathcal{R}1$ and $\mathcal{R}2$. Finally, section 8.4 formulates
the real-time market-clearing problem entailed in the out-of-sample simulation
studies discussed in section 4.

###  8.1 Modeling of Market Participants

To enhance the clarity of exposition, we define subsets of market participants
$\mathcal{I}$ comprised of flexible power producers
$\mathcal{F}\subseteq\mathcal{I}$, energy storage owners
$\mathcal{S}\subseteq\mathcal{I}$ and inflexible consumers
$\mathcal{D}\subseteq\mathcal{I}$. Let the uncertainty faced by the market-
clearing problem arise from a set of weather-dependent renewable power
producers $\mathcal{W}\subseteq{\mathcal{I}}$, such that
$\mathcal{F}\cup\mathcal{S}\cup\mathcal{D}\cup\mathcal{W}=\mathcal{I}$ and
$\mathcal{F}\cap\mathcal{S}\cap\mathcal{D}\cap\mathcal{W}=\emptyset$. We
consider consumers to be inflexible. However, the methodology adopted in this
paper is extendable to include demand-side flexibility providers.

#### Weather-dependent power producers:

At the day-ahead stage, the stochastic power production
$\tilde{q}_{it}\in\mathbb{R}$ from weather-dependent power producers
$i\in\mathcal{W}=\\{1,2,\dots,W\\}$ are modeled as

$\displaystyle\tilde{q}_{it}(\bm{\xi}_{t})=\hat{q}_{it}-\xi_{it},\;\forall
i\in\mathcal{W},\forall t,$ (27)

where $\hat{q}_{it}\in\mathbb{R}$ is the nominal production, usually in the
form of the best-available day-ahead forecast, while the random variable
$\xi_{it}\in\mathbb{R}$ is the forecast error encountered by producer $i$ at
hour $t$. The stochastic power production $\tilde{q}_{it}$ has an upper bound
given by the rated power production capacity $\overline{Q}_{i}$, while being
bounded below by $\underline{Q}_{i}=0$. The vector
$\bm{\xi}=\begin{bmatrix}\xi_{11}\quad\xi_{21}\quad\dots\quad\xi_{Wt}\quad\dots\quad\xi_{WT}\end{bmatrix}^{\top}\in\mathbb{R}^{WT}$
denotes the overall uncertainty faced by the market-clearing problem, formed
by extending $\bm{\xi}_{t}\in\mathbb{R}^{W}$, as defined in Example 2.2, to a
multi-period setting. We assume that $\bm{\xi}$ follows an unknown
multivariate probability distribution $\mathbb{P}_{\xi}$, characterized by
mean $\bm{\mu}\in\mathbb{R}^{WT}$ and covariance
$\bm{\Sigma}\in\mathbb{R}^{WT\times WT}$, which are estimated by the system
operator having an access to a finite number of historical measurement
samples. Without much loss of generality, we assume the distribution
$\mathbb{P}_{\xi}$ to have a mean $\bm{\mu}=\mathbb{0}$, as any non-zero
elements of the sample mean are used to update the forecast $\hat{q}_{it}$ in
(27). The structure of ${\bm{\Sigma}}$ is such that its diagonal blocks,
comprised of sub-matrices, ${\bm{\Sigma}}_{t}\in\mathbb{R}^{W\times
W},\;\forall t$, capture the spatial correlation among the forecast errors at
hour $t$, while the off-diagonal blocks contain information about spatio-
temporal correlation of uncertainty. The net deviation from the day-ahead
forecasts realized during real-time operation at hour $t$ is thus given by
$\mathbb{1}^{\top}\bm{\xi}_{t}\in\mathbb{R}$. As a sign convention,
$\mathbb{1}^{\top}\bm{\xi}_{t}>0$ implies a deficit of production from
renewable energy sources during real-time operation stage as compared to the
day-ahead forecast. Weather-dependent power producers are associated with a
decision vector
${\bm{q}}_{it}=\begin{bmatrix}\hat{q}_{it}\quad\xi_{it}\end{bmatrix}^{\top},\;\forall
t,\;\forall i\in\mathcal{W}$ such that participation in the two commodities
traded in the market is determined as follows. For the commodity energy, i.e.,
$p=1$, the contribution is given by

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\hat{q}_{i1}\quad\hat{q}_{i2}\;\dots\;\hat{q}_{i(T-1)}\quad\hat{q}_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\text{diag}(\mathbb{1}),\;\forall
i\in\mathcal{W},$

where $\mathbb{1}\in\mathbb{R}^{T}$. For $p=2$, i.e., flexibility, the
weather-dependent power producers are modeled as the uncertainty sources

$\displaystyle{\bm{q}}_{ip}=\mathbb{1},\;\mathbf{G}_{ip}=-\begin{bmatrix}&\mathbb{1}^{\top}\bm{\xi}_{1}&\cdots&0\\\
&\vdots&\ddots&\vdots\\\
&0&\cdots&\mathbb{1}^{\top}\bm{\xi}_{T}\end{bmatrix},\;\forall
i\in\mathcal{W},$

where $\mathbb{1}\in\mathbb{R}^{T}$ and the negative sign arises from the
convention adopted in (27).

#### Flexible power producers:

For each flexible power producer $i\in\mathcal{F}$, we model the stochastic
power production during real-time operation at hour $t$ as

$\displaystyle\tilde{q}_{it}(\bm{\xi}_{t})=\hat{q}_{it}+h_{it}(\bm{\xi}_{t})\;,\;\forall
i\in\mathcal{F},\;\forall t,$ (28)

where $\hat{q}_{it}$ denotes the nominal production and the function
$h_{it}(\bm{\xi}_{t}):\mathbb{R}^{W}\mapsto\mathbb{R}$ is the adjustment
policy allocated to the market participant $i$, encoding its share in the
recourse actions needed to mitigate the net deviation in the electricity
system arising from forecast errors realized at hour $t$. Typically, these
adjustment policies $h_{it}(\bm{\xi}_{t})$ represent convex decision rules,
which may be linear (Georghiou et al. 2019) or generalized (Georghiou et al.
2015). In this work, we adopt adjustment policies affinely dependent on the
total uncertainty faced by the system operator, such that

$\displaystyle
h_{it}(\bm{\xi}_{t})=\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it}\;,\;\forall
i\in\mathcal{F},\;\forall t,$

where $\alpha_{it}$ is the adjustment policy allocated to participant $i$ at
hour $t$. The nominal production quantity $\hat{q}_{it}$ and the policy
$\alpha_{it}$ are optimally decided by the day-ahead market-clearing program.
Recalling Example 2.2, we write chance constraints limiting the production
from participants to their uppers limit $\overline{Q}_{i}$ as

$\displaystyle\mathbb{P}_{\xi}\Big{(}\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it}\leq\overline{Q}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t,\;\forall i\in\mathcal{F},$ (29a) which is reformulated as a
$W+1$-dimensional SOC constraint $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\alpha_{it}}_{2}\leq\overline{Q}_{i}-\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{F},$ (29b)

where $\mathbf{X}_{t}\in\mathbb{R}^{W\times W}$ is obtained by Cholesky
decomposition of the submatrix $\bm{\Sigma}_{t}$ of the covariance matrix
$\bm{\Sigma}$ such that $\bm{\Sigma}_{t}=\mathbf{X}_{t}\mathbf{X}_{t}^{\top}$.
Recall that the parameter $r_{\hat{\varepsilon}}$ is a safety parameter,
related to constraint violations, chosen by the system operator based on the
knowledge of distribution $\mathbb{P}_{\xi}$, such that
$r_{\hat{\varepsilon}}$ increases as $\hat{\varepsilon}$ decreases. Similar
reformulation is obtained for the lower bounds on the production,
$\underline{Q}_{i}$. Apart from the production bounds, a flexible power
producer may have capacity bounds on the flexibility provision, denoted by
$\underline{Q}_{i}^{R},\;\overline{Q}_{i}^{R}$, which are reformulated in a
similar manner. Lastly, inter-temporal constraints such as the limits on the
downward and upward ramping rates
$\underline{\Delta}_{i},\;\overline{\Delta}_{i}\in\mathbb{R}$ are modeled as

$\displaystyle\mathbb{P}_{\xi}\Big{(}(\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it})-(\hat{q}_{i(t-1)}+\mathbb{1}^{\top}\bm{\xi}_{t-1}\alpha_{i(t-1)})\geq-\underline{\Delta}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t>2,\;\forall i\in\mathcal{F}$ (30a)
$\displaystyle\mathbb{P}_{\xi}\Big{(}(\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it})-(\hat{q}_{i(t-1)}+\mathbb{1}^{\top}\bm{\xi}_{t-1}\alpha_{i(t-1)})\leq\overline{\Delta}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t>2,\;\forall i\in\mathcal{F}$ (30b) and reformulated as $2W+1$-dimensional
SOC constraints of the form $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t-1:t}\begin{bmatrix}\phantom{-}\mathbb{1}^{\top}\alpha_{i(t-1)}\quad&-\mathbb{1}^{\top}\alpha_{it}\end{bmatrix}^{\top}}_{2}\leq\underline{\Delta}_{i}-(\hat{q}_{it-1}-\hat{q}_{it}),\;\forall
t>2,\;\forall i\in\mathcal{F}$ (30c) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t-1:t}\begin{bmatrix}-\mathbb{1}^{\top}\alpha_{i(t-1)}\quad&\phantom{-}\mathbb{1}^{\top}\alpha_{it}\end{bmatrix}^{\top}}_{2}\leq\overline{\Delta}_{i}+(\hat{q}_{it-1}-\hat{q}_{it}),\;\forall
t>2,\;\forall i\in\mathcal{F},$ (30d)

where $\mathbf{X}_{t-1:t}\in\mathbb{R}^{2W\times 2W}$ denotes the
factorization of the blocks of covariance matrix $\bm{\Sigma}$ corresponding
to the spatio-temporal covariance of forecast errors in two consecutive hours.
Flexible power producers participate in the conic market with decision vectors
${\bm{q}}_{it}=\begin{bmatrix}\hat{q}_{it}\quad\alpha_{it}\end{bmatrix}^{\top},\forall
t,\;\forall i\in\mathcal{F}$. Towards the commodity energy, i.e., $p=1$,
flexible generators contribute as

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\hat{q}_{i1}\quad\hat{q}_{i2}\;\dots\;\hat{q}_{i(T-1)}\quad\hat{q}_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\text{diag}(\mathbb{1}),\;\forall
i\in\mathcal{F},$

with $\mathbb{1}\in\mathbb{R}^{T}$. For the commodity flexibility ($p=2$), the
contribution is given by

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\alpha_{i1}\quad\alpha_{i2}\;\dots\;\alpha_{i(T-1)}\quad\alpha_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\begin{bmatrix}&\mathbb{1}^{\top}\bm{\xi}_{1}&\cdots&0\\\
&\vdots&\ddots&\vdots\\\
&0&\cdots&\mathbb{1}^{\top}\bm{\xi}_{T}\end{bmatrix},\;\forall
i\in\mathcal{F}.$

#### Energy storage operators:

$1$$2$$t$$T$$\overline{B}_{i}$$\underline{B}_{i}$$E^{0}_{i}$$\tilde{q}_{it}$$E_{it}$$\overline{E}_{i}$$\underline{E}_{i}$
Figure 8: Illustration of the operation of an energy storage unit for
flexibility provision.

For each energy storage unit $s\in\mathcal{S}$, the power produced or consumed
during real-time operation at hour $t$ is given by

$\displaystyle\tilde{q}_{it}(\bm{\xi}_{t})=\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it}\;,\;\forall
i\in\mathcal{S},\;\forall t,$ (31)

where $\hat{q}_{it}$ is the nominal production/consumption and $\gamma_{it}$
is the affine adjustment policy allocated. We adopt the sign convention
$\tilde{q}_{it}(\bm{\xi}_{t})>0$ for hours when the storage is discharging
(production), while $\tilde{q}_{it}(\bm{\xi}_{t})<0$ indicates charging
(consumption). In practice, energy storage units are limited by their charging
and discharging capacities which are modeled using chance constraints as

$\displaystyle\mathbb{P}_{\xi}\Big{(}\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it}\leq\eta_{i}^{\text{D}}\overline{Q}^{\text{D}}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t,\;\forall i\in\mathcal{S}$ (32a)
$\displaystyle\mathbb{P}_{\xi}\Big{(}\hat{q}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it}\geq-\frac{1}{\eta_{i}^{\text{C}}}\overline{Q}^{\text{C}}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t,\;\forall i\in\mathcal{S}$ (32b) and are reformulated as $W+1$-dimensional
SOC constraints as $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\gamma_{it}}_{2}\leq\eta_{i}^{\text{D}}\overline{Q}^{\text{D}}_{i}-\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{S}$ (32c) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\gamma_{it}}_{2}\leq\frac{1}{\eta_{i}^{\text{C}}}\overline{Q}^{\text{C}}_{i}+\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{S},$ (32d)

where $\eta_{i}^{\text{D}},\eta_{i}^{\text{C}}\in[0,1]$ are energy conversion
factors representing discharging and charging efficiencies, while
$\overline{Q}_{i}^{D},\;\overline{Q}_{i}^{C}\in\mathbb{R}$ are, respectively,
the maximum discharging and charging capacities of the energy storage unit
$i\in\mathcal{S}$. Inter-temporal constraints are critical for energy storage
units to ensure that (i) the storage operation trajectory remains within the
limits of state of charge, and (ii) the storage unit is neither depleted nor
over-charged at the end of market-clearing horizon. While the former ensures
safe operation of the storage unit within its operational limits, the latter
is relevant in a market-clearing setup where the storage unit is expected to
provide flexibility to the grid on an ongoing basis. Figure 8 shows the
trajectory (in red) of energy content of a storage unit. At each hour, the
changes to energy content due to production (discharging) or consumption
(charging) by the storage unit is given by $\tilde{q}_{it}(\bm{\xi}_{t})$,
with the rate of change being limited by the charging and discharging power
limits in (32). The energy content of a storage unit evolves as

$\displaystyle\mathbb{P}_{\xi}\Big{(}E_{i}^{0}-\sum_{t^{\prime}=1}^{t}(\hat{q}_{it^{\prime}}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it^{\prime}})\leq\overline{E}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t,\;\forall i\in\mathcal{S}$ (33a)
$\displaystyle\mathbb{P}_{\xi}\Big{(}E_{i}^{0}-\sum_{t^{\prime}=1}^{t}(\hat{q}_{it^{\prime}}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it^{\prime}})\geq\underline{E}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
t,\;\forall i\in\mathcal{S},$ (33b) which are reformulated as $W\times
t+1,\;\forall t$-dimensional SOC constraints, expressed as $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:t}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{it}\end{bmatrix}^{\top}}_{2}\leq\overline{E}_{i}-E_{i}^{0}+\sum_{t^{\prime}=1}^{t}\hat{q}_{it^{\prime}},\;\forall
t,\;\forall i\in\mathcal{S}$ (33c) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:t}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{it}\end{bmatrix}^{\top}}_{2}\leq
E_{i}^{0}-\underline{E}_{i}-\sum_{t^{\prime}=1}^{t}\hat{q}_{it^{\prime}},\;\forall
t,\;\forall i\in\mathcal{S},$ (33d)

where $E_{i}^{0}\in\mathbb{R}$ is the energy content at $t=0$ and
$\underline{E}_{i},\;\overline{E}_{i}\in\mathbb{R}$ are the minimum and
maximum energy storage capacity of the storage unit, respectively, such that
$E_{i}^{0}\in[\underline{E}_{i},\;\overline{E}_{i}]$. Furthermore, to ensure
the ongoing market-participation of the storage unit, we utilize the concept
of end-of-horizon energy neutrality. We define lower and upper bounds,
$\underline{B}_{i},\;\overline{B}_{i}\in\mathbb{R}$ respectively, around the
initial energy stored $E_{i}^{0}$ to reflect the preference of the energy
storage owner on the energy content at the end of market-clearing horizon, see
Figure 8. This ensures the end-of-horizon energy content to be within
$[E_{i}^{0}-\underline{B}_{i},\;E_{i}^{0}+\overline{B}_{i}]$. These
preferences are captured through chance constraints

$\displaystyle\mathbb{P}_{\xi}\Big{(}E_{i}^{0}-\sum_{t^{\prime}=1}^{T}(\hat{q}_{it^{\prime}}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it^{\prime}})\leq
E_{i}^{0}+\overline{B}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
i\in\mathcal{S}$ (34a)
$\displaystyle\mathbb{P}_{\xi}\Big{(}E_{i}^{0}-\sum_{t^{\prime}=1}^{T}(\hat{q}_{it^{\prime}}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it^{\prime}})\geq
E_{i}^{0}-\underline{B}_{i}\Big{)}\geq(1-\hat{\varepsilon}),\;\forall
i\in\mathcal{S}$ (34b) which are reformulated as $W\times T+1$-dimensional SOC
constraints, expressed as $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:T}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{iT}\end{bmatrix}^{\top}}_{2}\leq\overline{B}_{i}+\sum_{t^{\prime}=1}^{T}\hat{q}_{it^{\prime}},\;\forall
i\in\mathcal{S}$ (34c) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:T}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{iT}\end{bmatrix}^{\top}}_{2}\leq\underline{B}_{i}-\sum_{t^{\prime}=1}^{T}\hat{q}_{it^{\prime}},\;\forall
i\in\mathcal{S}.$ (34d)

Each energy storage operators participates in the conic market with a decision
vector
${\bm{q}}_{it}=\begin{bmatrix}\hat{q}_{it}\quad\gamma_{it}\end{bmatrix}^{\top},\forall
t,\;\forall i\in\mathcal{S}$. Likewise, towards the commodity energy, i.e.,
$p=1$, we have

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\hat{q}_{i1}\quad\hat{q}_{i2}\;\dots\;\hat{q}_{i(T-1)}\quad\hat{q}_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\text{diag}(\mathbb{1}),\;\forall
i\in\mathcal{S},$

with $\mathbb{1}\in\mathbb{R}^{T}$. For the commodity flexibility ($p=2$), the
storage unit contributes to the trades as

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\gamma_{i1}\quad\gamma_{i2}\;\dots\;\gamma_{i(T-1)}\quad\gamma_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\begin{bmatrix}&\mathbb{1}^{\top}\bm{\xi}_{1}&\cdots&0\\\
&\vdots&\ddots&\vdots\\\
&0&\cdots&\mathbb{1}^{\top}\bm{\xi}_{T}\end{bmatrix},\forall i\in\mathcal{S}.$

#### Inflexible consumers:

For each inflexible consumer $d\in\mathcal{D}$, the power consumed during
real-time operation at hour $t$ is given by
$\tilde{q}_{it}(\bm{\xi}_{t})=\hat{q}_{it},\;\forall i\in\mathcal{D},\;\forall
t$, where $\hat{q}_{it}\in\mathbb{R}_{-}$ is the power demand by consumer
$d\in\mathcal{D}$. The above modeling can be extended to include flexible
consumers that may respond to the uncertainty by reducing/increasing their
consumption based on an affine adjustment policy, similar to flexible
generators and energy storage units. However, for clarity of exposition, this
paper is restricted to modeling inflexible and perfectly inelastic demand.
Each consumer contributes towards the trades of commodity energy, i.e., for
$p=1$, as

$\displaystyle{\bm{q}}_{ip}=\begin{bmatrix}\hat{q}_{i1}\quad\hat{q}_{i2}\;\dots\;\hat{q}_{i(T-1)}\quad\hat{q}_{iT}\end{bmatrix}^{\top},\;\mathbf{G}_{ip}=\text{diag}(\mathbb{1}),\;\forall
i\in\mathcal{D},$

where $\mathbb{1}\in\mathbb{R}^{T}$. Lastly, for $p=2$, considering inflexible
consumers, we have
${\bm{q}}_{ip}=\mathbb{0},\;\mathbf{G}_{ip}=\mathbf{0},\;\forall
i\in\mathcal{D}$.

###  8.2 Chance-constrained Market Clearing

In the following, we formulate the chance-constrained market-clearing problem
in stochastic optimization variables $\tilde{q}_{it}(\bm{\xi}_{t}),\;\forall
i\in\mathcal{I}$ which are functions of the random variable $\bm{\xi}_{t}$. We
drop this dependency for notational convenience, yet it is always implied.

$\displaystyle\underset{{{\tilde{q}}_{it}}}{\text{min}}\quad\;\mathbb{E}^{\mathbb{P}_{\xi}}\Big{[}\sum_{i\in\mathcal{I}\setminus\mathcal{D}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}{\tilde{q}}_{it}^{2}+{{c}_{it}^{\text{L}}}{\tilde{q}}_{it}\Big{)}\Big{]}$
(35a) $\displaystyle\quad\text{s.t.}\quad\mathbb{P}_{\xi}\left[\begin{aligned}
&\sum_{i\in\mathcal{I}}\mathbf{G}_{ip}\tilde{\mathbf{q}}_{ip}=\mathbf{0}_{T},\;\forall
p\in\mathcal{P},\end{aligned}\right]\overset{\text{a.s.}}{=}1,$ (35b)
$\displaystyle\phantom{\text{s.t.}}\quad\quad\mathbb{P}_{\xi}\left[\begin{aligned}
&\underline{Q}_{i}\leq\tilde{q}_{it}\leq\overline{Q}_{i},\;\forall t,\;\forall
i\in\mathcal{F}\cup\mathcal{W}\\\ &-\underline{Q}_{i}^{R}\leq
h_{it}(\bm{\xi}_{t})\leq\overline{Q}_{i}^{R},\;\forall i\in\mathcal{F}\\\
&-\underline{\Delta}_{i}\leq\tilde{q}_{it}-\tilde{q}_{i(t-1)}\leq\overline{\Delta}_{i},\;\forall
t>2,\;\forall i\in\mathcal{F}\\\
&-\frac{1}{\eta_{i}^{C}}\overline{Q}_{i}^{\text{C}}\leq\tilde{q}_{it}\leq\eta_{i}^{D}\overline{Q}_{i}^{\text{D}},\;\forall
t,\;\forall i\in\mathcal{S}\\\ &\underline{E}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{t}\tilde{q}_{it^{\prime}}\leq\overline{E}_{i},\;\forall
t,\;\forall i\in\mathcal{S}\\\ &E_{i}^{0}-\underline{B}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{T}\tilde{q}_{it^{\prime}}\leq
E_{i}^{0}+\overline{B}_{i},\;\forall i\in\mathcal{S}\\\
&-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\tilde{\mathbf{q}}_{ip}]_{t}\right)\leq\overline{s}_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L}\end{aligned}\right]\geq 1-\varepsilon,$ (35c)

where the objective function (35a) minimizes the expected cost, which is
equivalent to minimizing negative social welfare when facing an inflexible and
perfectly inelastic demand. The almost sure (a. s.) constraint (35b) ensures
the satisfaction of the supply-demand balance constraint for both commodities
with a probability of 1, whereas the chance constraint (35c) ensures the
inequalities are jointly met with a probability of $(1-\varepsilon)$. The
prescribed constraint violation probability $\varepsilon\in(0,1)$ reflects
risk tolerance of the system operator towards the violation of technical
limits of the system and in our numerical studies discussed in section 4, we
set $\varepsilon=0.05$. The chance-constrained market-clearing problem (35) is
computationally intractable since it involves infinitely many constraints
arising from the uncertain production from weather-dependent power producers.
We gain tractability by expressing the stochastic variables
$\tilde{q}_{it},\;\forall i,\;\forall t$ as affine, finite-dimensional
functions of the random variable $\xi$ as discussed in the previous section,
resulting in an approximate solution to the infinite-dimensional problem. In
the following, we discuss the reformulations to reach the final tractable
SOCP-based chance-constrained market-clearing problem.

#### Reformulation of joint chance constraint:

Observe that (35c) models a joint violation of the constraints, in contrast to
the individual chance constraints discussed so far. In this paper, following
the Bonferroni approximation of joint chance constraints (Xie et al. 2019), we
adopt a consideration of individual chance constraints with the analytical
parameterization of risk. Let $N^{\text{ineq}}$ denote the number of
individual inequalities forming the joint chance constraint (35c), such that
$\bm{\hat{\varepsilon}}\in\mathbb{R}_{+}^{{N}^{\text{ineq}}}$ collects all the
individual violation probabilities for the inequality constraints. The
Bonferroni reformulation of joint chance constraint mandates that the
individual constraint violation probabilities be chosen such that
$\mathbb{1}^{\top}\bm{\hat{\varepsilon}}\leq\varepsilon$. Furthermore, this
approach provides a joint constraint feasibility guarantee even if the choice
of individual probabilities is done trivially, e.g., $\bm{\hat{\varepsilon}}$
is chosen such that
$\hat{\varepsilon}_{k}=\frac{\varepsilon}{N^{\text{ineq}}},\;\forall
k=1,2,\dots,N^{\text{ineq}}.$ We compute the individual constraint violation
probabilities in this manner and adopt the SOC reformulation techniques for
individual chance constraints discussed so far.

#### Reformulation of almost sure constraint:

The almost sure constraint (35b) must be held at the optimal solution to (35)
with a probability of 1. Considering the affine dependency of the stochastic
decision variables $\tilde{q}_{it},\;\forall i,\;\forall t$ with respect to
the random variables $\bm{\xi}_{t}$, this amounts to a separation of (35b)
into nominal and recourse equalities. Corresponding to the two commodities
energy and flexibility, these equalities are given by

$\displaystyle\sum_{i\in\mathcal{I}}\;\mathbf{G}_{ip}{\mathbf{q}}_{ip}=\mathbb{0},\;p=1$
(36a)
$\displaystyle\sum_{i\in\mathcal{I}\setminus{(\mathcal{W}\cup\mathcal{D})}}\;\text{diag}(\mathbb{1}){\mathbf{q}}_{ip}=\mathbb{1},\;p=2.$
(36b)

#### Power flow limits:

Apart from the participant-specific chance constraints discussed so far, the
constraints limiting the power flows in the network are

$\displaystyle\mathbb{P}_{\xi}\Big{[}\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\tilde{\mathbf{q}}_{ip}]_{t}\right)\leq\overline{s}_{\ell}\Big{]}\geq
1-\hat{\varepsilon},\;\forall t,\;\forall\ell\in\mathcal{L}$ (37a)
$\displaystyle\mathbb{P}_{\xi}\Big{[}\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{p\in\mathcal{P}}\;[\mathbf{G}_{ip}\tilde{\mathbf{q}}_{ip}]_{t}\right)\geq-\overline{s}_{\ell}\Big{]}\geq
1-\hat{\varepsilon},\;\forall t,\;\forall\ell\in\mathcal{L},$ (37b)

which require tractable reformulations. In the following, we illustrate the
reformulation of (37a) as an SOC constraint and adopt a similar approach for
the other flow direction. First, we rewrite (37a) such that nominal and
uncertainty-dependent terms are separable. To that end, we define auxiliary
network matrices
$\bm{\Psi}^{\text{F}}\in\mathbb{R}^{N\times\absolutevalue{\mathcal{F}}}$,
$\bm{\Psi}^{\text{S}}\in\mathbb{R}^{N\times\absolutevalue{\mathcal{S}}}$,
$\bm{\Psi}^{\text{W}}\in\mathbb{R}^{N\times W}$ and
$\bm{\Psi}^{\text{D}}\in\mathbb{R}^{N\times\absolutevalue{\mathcal{D}}}$ which
map the flexible power producers, energy storage units, weather-dependent
power producers and consumers, respectively, to the electricity network nodes.
We collect all commodity contributions by participant groups at a given hour
by defining auxiliary variables
$\tilde{\mathbf{q}}^{\text{F}}_{t},\;\hat{\mathbf{q}}^{\text{F}}_{t},\;\bm{\alpha}_{t}\in\mathbb{R}^{|\mathcal{F}|}$
to denote the stochastic production, nominal production and the adjustment
policies for the flexible power producers,
$\tilde{\mathbf{q}}^{\text{S}}_{t},\;\hat{\mathbf{q}}^{\text{S}}_{t},\;\bm{\gamma}_{t}\in\mathbb{R}^{|\mathcal{S}|}$
to denote stochastic production, nominal production and adjustment policies
for the storage units, $\hat{\mathbf{q}}^{\text{W}}_{t}\in\mathbb{R}^{W}$ for
the forecasted production from weather-dependent power producers and lastly,
$\hat{\mathbf{q}}^{\text{D}}_{t}\in\mathbb{R}^{|\mathcal{D}|}$ for the
inflexible demand from consumers. With that, we rewrite (37a) as

$\displaystyle\mathbb{P}_{\xi}\Big{[}[\bm{\Psi}(\bm{\Psi}^{F}\tilde{\mathbf{q}}^{F}_{t}+\bm{\Psi}^{S}\tilde{\mathbf{q}}^{S}_{t}+\bm{\Psi}^{W}(\tilde{\mathbf{q}}^{W}_{t}-\bm{\xi}_{t})+\bm{\Psi}^{D}\hat{\mathbf{q}}^{\text{D}}_{t})]_{\ell}\leq\overline{s}_{\ell}\Big{]}\geq
1-\hat{\varepsilon},\;\forall t,\;\forall\ell\in\mathcal{L},$ (38)

which we then reformulate as an SOC constraint after separating the nominal
and uncertainty-dependent terms. The final SOC reformulation for (37a) results
in $\forall t,\;\forall\ell\in\mathcal{L}$,

$\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}[\bm{\Psi}(\bm{\Psi}^{F}\bm{\alpha}_{t}\mathbb{1}^{\top}+\bm{\Psi}^{S}\bm{\gamma}_{t}\mathbb{1}^{\top}-\bm{\Psi}^{W})]^{\top}_{(\ell,:)}}_{2}\leq\overline{s}_{\ell}-[\bm{\Psi}(\bm{\Psi}^{F}\hat{\mathbf{q}}^{F}_{t}+\bm{\Psi}^{S}\hat{\mathbf{q}}^{S}_{t}+\bm{\Psi}^{W}\hat{\mathbf{q}}^{W}_{t}+\bm{\Psi}^{D}\hat{\mathbf{q}}^{D}_{t})]_{\ell}\;\;.$
(39)

#### Objective function reformulation:

We decompose the objective (35a) among the various participants and expand the
stochastic term to its nominal and recourse values to obtain

$\displaystyle\mathbb{E}^{\mathbb{P}_{\xi}}\Big{[}$
$\displaystyle\underbrace{\sum_{i\in\mathcal{F}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}({\hat{q}}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it})^{2}+{{c}_{it}^{\text{L}}}({\hat{q}}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\alpha_{it})\Big{)}}_{\text{Term
A}}$
$\displaystyle\quad+\underbrace{\sum_{i\in\mathcal{S}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}({\hat{q}}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it})^{2}+{{c}_{it}^{\text{L}}}({\hat{q}}_{it}+\mathbb{1}^{\top}\bm{\xi}_{t}\gamma_{it})\Big{)}}_{\text{Term
B}}+\underbrace{\sum_{i\in\mathcal{W}}\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}({\hat{q}}_{it}-\bm{\xi}_{it})^{2}+{c}_{it}^{\text{L}}({\hat{q}}_{it}-{\xi}_{it})\Big{)}}_{\text{Term
C}}\Big{]}.$

Linearity of the expectation operator allows us to separate the cost terms and
we rewrite the cost of flexible generators, i.e., Term A as

$\displaystyle\sum_{i\in\mathcal{F}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}\hat{q}_{it}^{2}+{c}^{\text{Q}}_{it}\;\mathbb{E}^{\mathbb{P}_{\xi}}[(\mathbb{1}^{\top}\bm{\xi}_{t})^{2}]\alpha_{it}^{2}+2\hat{q}_{it}{c}^{\text{Q}}_{it}\;\mathbb{E}^{\mathbb{P}_{\xi}}[\mathbb{1}^{\top}\bm{\xi}_{t}]\alpha_{it}+{{c}_{it}^{\text{L}}}{\hat{q}}_{it}+c^{\text{L}}_{it}\;\mathbb{E}^{\mathbb{P}_{\xi}}[\mathbb{1}^{\top}\bm{\xi}_{t}]\alpha_{it}\Big{)}.$

The zero-mean assumption made on $\bm{\xi}_{t}$ factors out the terms last two
terms under the expectation operator. As discussed in Bienstock et al. (2014),
the first term under expectation operator can be reformulated as the variance
of $\bm{\xi}_{t}$, i.e.,
$\mathbb{E}^{\mathbb{P}_{\xi}}[(\mathbb{1}^{\top}\bm{\xi}_{t})^{2}]=\text{var}(\mathbb{1}^{\top}\bm{\xi}_{t})=\mathbb{1}^{\top}\bm{\Sigma}_{t}\mathbb{1}$,
where $\bm{\Sigma}_{t}$ is the covariance matrix as previously discussed.
Therefore, the Term A reduces to

$\displaystyle\sum_{i\in\mathcal{F}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}\hat{q}_{it}^{2}+{c}^{\text{Q}}_{it}\;\mathbb{1}^{\top}\bm{\Sigma}_{t}\mathbb{1}\alpha_{it}^{2}+{{c}_{it}^{\text{L}}}{\hat{q}}_{it}\Big{)}.$

Lastly, following Example 2.9, we reformulate the quadratic cost terms as a
rotated SOC constraint in the interest of analytical and computational appeal.
Introducing variables $z^{\hat{q}}_{it}\in\mathbb{R}$ and
$z^{\alpha}_{it}\in\mathbb{R}$, for any fixed values of $\hat{q}_{it}$ and
$\alpha_{it}$, Term A of the objective function retrieves the expected cost by
solving the following SOCP problem

$\displaystyle\underset{{z^{\hat{q}}_{it},z^{\alpha}_{it}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{F}}\;\sum_{t\in\mathcal{T}}\;\Big{(}z^{\hat{q}}_{it}+z^{\alpha}_{it}+{{c}_{it}^{\text{L}}}\hat{q}_{it}\Big{)}$
(40a) s.t.
$\displaystyle\norm{({c}^{\text{Q}}_{it})^{\frac{1}{2}}\hat{q}_{it}}_{2}^{2}\leq{z}^{\hat{q}}_{it},\;\forall
t,\;\forall i\in\mathcal{F}$ (40b)
$\displaystyle\norm{\mathbf{X}_{t}\mathbb{1}({c}^{\text{Q}}_{it})^{\frac{1}{2}}\alpha_{it}}_{2}^{2}\leq{z}^{\alpha}_{it},\;\forall
t,\;\forall i\in\mathcal{F}.$ (40c)

Term B of the objective function characterizing the cost of operation of
energy storage units follows a similar reformulation. For the set of wind
power producers, i.e., the cost in Term C, we use the following equivalence to
eliminate the expectation operator

$\displaystyle\sum_{i\in\mathcal{W}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}\hat{q}_{it}^{2}+{c}^{\text{Q}}_{it}\;\mathbb{E}^{\mathbb{P}_{\xi}}[{\xi}_{it}^{2}]+{{c}_{it}^{\text{L}}}{\hat{q}}_{it}\Big{)}\Leftrightarrow\sum_{i\in\mathcal{W}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}\hat{q}_{it}^{2}+{c}^{\text{Q}}_{it}\;\text{tr}[\bm{\Sigma}_{t}]+{{c}_{it}^{\text{L}}}{\hat{q}}_{it}\Big{)}.$

The quadratic term in the expression is then reformulated as a rotated SOC
constraint as before. The term $c_{it}^{\text{Q}}\text{tr}[\bm{\Sigma}_{t}]$
is a cost term that is constant, depending on the historical forecast error
samples.

Adopting the reformulations of the objective function and the chance
constraints, we obtain the final tractable chance-constrained market-clearing
problem $\mathcal{M}^{\text{cc}}$. Solved centrally by the system operator,
the problem $\mathcal{M}^{\text{cc}}$ is an SOCP problem that results in
optimal market-clearing quantities and prices for both the commodities traded
in the market, i.e., energy and flexibility.

$\displaystyle\underset{{\mathcal{V}^{\text{opt}},\mathcal{V}^{\text{aux}}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}\setminus\mathcal{D}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{z}_{it}^{\hat{q}_{it}}+c_{it}^{\text{L}}\hat{q}_{it}\Big{)}+\sum_{i\in\mathcal{F}}\;\sum_{t\in\mathcal{T}}\;z_{it}^{\alpha}+\sum_{i\in\mathcal{S}}\;\sum_{t\in\mathcal{T}}\;z_{it}^{\gamma}+\sum_{i\in\mathcal{W}}\;\sum_{t\in\mathcal{T}}\;c_{it}^{\text{Q}}\text{tr}[\bm{\Sigma}_{t}]$
(41a) s.t.
$\displaystyle\norm{({c}^{\text{Q}}_{it})^{\frac{1}{2}}\hat{q}_{it}}_{2}^{2}\leq{z}^{\hat{q}}_{it},\;\forall
t,\;\forall i\in\mathcal{I}\setminus\mathcal{D}$ (41b)
$\displaystyle\norm{\mathbf{X}_{t}\mathbb{1}({c}^{\text{Q}}_{it})^{\frac{1}{2}}\alpha_{it}}_{2}^{2}\leq{z}^{\alpha}_{it},\;\forall
t,\;\forall i\in\mathcal{F}$ (41c)
$\displaystyle\norm{\mathbf{X}_{t}\mathbb{1}({c}^{\text{Q}}_{it})^{\frac{1}{2}}\gamma_{it}}_{2}^{2}\leq{z}^{\gamma}_{it},\;\forall
t,\;\forall i\in\mathcal{S}$ (41d) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\alpha_{it}}_{2}\leq\overline{Q}_{i}-\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{F}$ (41e) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\alpha_{it}}_{2}\leq\hat{q}_{it}-\underline{Q}_{i},\;\forall
t,\;\forall i\in\mathcal{F}$ (41f) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\alpha_{it}}_{2}\leq\overline{Q}^{R}_{i},\;\forall
t,\;\forall i\in\mathcal{F}$ (41g) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\alpha_{it}}_{2}\leq\underline{Q}^{R}_{i},\;\forall
t,\;\forall i\in\mathcal{F}$ (41h) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t-1:t}\begin{bmatrix}-\mathbb{1}^{\top}\alpha_{i(t-1)}l\quad&\phantom{-}\mathbb{1}^{\top}\alpha_{it}\end{bmatrix}^{\top}}_{2}\leq\overline{\Delta}_{i}+(\hat{q}_{it-1}-\hat{q}_{it}),\;\forall
t>2,\;\forall i\in\mathcal{F}$ (41i) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t-1:t}\begin{bmatrix}\phantom{-}\mathbb{1}^{\top}\alpha_{i(t-1)}\quad&-\mathbb{1}^{\top}\alpha_{it}\end{bmatrix}^{\top}}_{2}\leq\underline{\Delta}_{i}-(\hat{q}_{it-1}-\hat{q}_{it}),\;\forall
t>2,\;\forall i\in\mathcal{F}$ (41j) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\gamma_{it}}_{2}\leq\eta_{i}^{\text{D}}\overline{Q}^{\text{D}}_{i}-\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{S}$ (41k) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}\mathbb{1}\gamma_{it}}_{2}\leq\frac{1}{\eta_{i}^{\text{C}}}\overline{Q}^{\text{C}}_{i}+\hat{q}_{it},\;\forall
t,\;\forall i\in\mathcal{S}$ (41l) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:t}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{it}\end{bmatrix}^{\top}}_{2}\leq\overline{E}_{i}-E_{i}^{0}+\sum_{t^{\prime}=1}^{t}\hat{q}_{it^{\prime}},\;\forall
t,\;\forall i\in\mathcal{S}$ (41m) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:t}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{it}\end{bmatrix}^{\top}}_{2}\leq
E_{i}^{0}-\underline{E}_{i}-\sum_{t^{\prime}=1}^{t}\hat{q}_{it^{\prime}},\;\forall
t,\;\forall i\in\mathcal{S}$ (41n) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:T}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{iT}\end{bmatrix}^{\top}}_{2}\leq\overline{B}_{i}+\sum_{t^{\prime}=1}^{T}\hat{q}_{it^{\prime}},\;\forall
i\in\mathcal{S}$ (41o) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{1:T}\begin{bmatrix}\mathbb{1}^{\top}\gamma_{i1}\quad\mathbb{1}^{\top}\gamma_{i2}\;\cdots\;\mathbb{1}^{\top}\gamma_{iT}\end{bmatrix}^{\top}}_{2}\leq\underline{B}_{i}-\sum_{t^{\prime}=1}^{T}\hat{q}_{it^{\prime}},\;\forall
i\in\mathcal{S}$ (41p)
$\displaystyle\sum_{i\in\mathcal{I}}\mathbf{G}_{ip}{\mathbf{q}}_{ip}=\mathbb{0},\;p=1$
(41q)
$\displaystyle\sum_{i\in\mathcal{I}\setminus{(\mathcal{W}\cup\mathcal{D})}}\text{diag}(\mathbb{1}){\mathbf{q}}_{ip}=\mathbb{1},\;p=2$
(41r) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}[\bm{\Psi}(\bm{\Psi}^{F}\bm{\alpha}_{t}\mathbb{1}^{\top}+\bm{\Psi}^{S}\bm{\gamma}_{t}\mathbb{1}^{\top}-\bm{\Psi}^{W})]^{\top}_{(\ell,:)}}_{2}\leq\overline{s}_{\ell}$
$\displaystyle\qquad\qquad\qquad\qquad-[\bm{\Psi}(\bm{\Psi}^{F}\hat{\mathbf{q}}^{F}_{t}+\bm{\Psi}^{S}\hat{\mathbf{q}}^{S}_{t}+\bm{\Psi}^{W}\hat{\mathbf{q}}^{W}_{t}+\bm{\Psi}^{D}\hat{\mathbf{q}}^{D}_{t})]_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L}$ (41s) $\displaystyle
r_{\hat{\varepsilon}}\norm{\mathbf{X}_{t}[\bm{\Psi}(\bm{\Psi}^{F}\bm{\alpha}_{t}\mathbb{1}^{\top}+\bm{\Psi}^{S}\bm{\gamma}_{t}\mathbb{1}^{\top}-\bm{\Psi}^{W})]^{\top}_{(\ell,:)}}_{2}\leq\overline{s}_{\ell}$
$\displaystyle\qquad\qquad\qquad\qquad+[\bm{\Psi}(\bm{\Psi}^{F}\hat{\mathbf{q}}^{F}_{t}+\bm{\Psi}^{S}\hat{\mathbf{q}}^{S}_{t}+\bm{\Psi}^{W}\hat{\mathbf{q}}^{W}_{t}+\bm{\Psi}^{D}\hat{\mathbf{q}}^{D}_{t})]_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L},$ (41t)

where the set of optimization variables is
$\mathcal{V}^{\text{opt}}=\\{\hat{q}_{it},z_{it}^{\hat{q}_{it}},\alpha_{it},z_{it}^{\hat{\alpha}_{it}},\gamma_{it},z_{it}^{\hat{\gamma}_{it}}\\}$
and the set of auxiliary variables is
$\mathcal{V}^{\text{aux}}=\\{\mathbf{q}_{ip},\hat{\mathbf{q}}^{\text{F}}_{t},\bm{\alpha}_{t},\hat{\mathbf{q}}^{\text{S}}_{t},\bm{\gamma}_{t},\hat{\mathbf{q}}^{\text{W}}_{t},\hat{\mathbf{q}}^{\text{D}}_{t}\\}$,
formed as previously discussed.

###  8.3 LP-based market-clearing benchmarks

In the following, we concisely formulate the two reference uncertainty-aware
benchmarks within the LP framework. To account for the quadratic costs of
market participants in an LP problem, we perform a piecewise linear
approximation of the cost by discretizing the production quantities into a set
of bins given by $\mathcal{Y}=\\{1,2,\dots,Y\\}$.

#### Deterministic two-stage market framework:

In the deterministic market-clearing problem $\mathcal{R}1$, the system
operator procures energy and flexibility (in the form of reserve capacity) in
the day-ahead market. Thereafter, during real-time operation stage, via
another market-clearing mechanism, the reserves are activated based on the
allocation capacity bounds cleared during the day-ahead market. This two-stage
deterministic market-clearing problem is a natural uncertainty-aware extension
of currently-operational electricity markets.

Day-ahead market-clearing problem ${\mathcal{R}{1}}_{a}$:

$\displaystyle\underset{{{q}^{\text{DA}}_{ity},{q}^{\text{R}}_{it}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}\setminus{\mathcal{D}}}\;\sum_{t\in\mathcal{T}}\;\sum_{y\in\mathcal{Y}}\;\Big{(}{{c}_{ity}^{\text{Y}}}{q}_{ity}^{\text{DA}}\Big{)}+\sum_{i\in\mathcal{F}\cup\mathcal{S}}\sum_{t\in\mathcal{T}}c_{it}^{R}q_{it}^{R}$
(42a) s.t. $\displaystyle
0\leq{q}^{\text{DA}}_{ity}\leq\frac{1}{Y}(\overline{Q}_{i}-\underline{Q}_{i}),\;\forall
y,\;\forall t,\;\forall i\in\mathcal{I}\setminus\mathcal{D}$ (42b)
$\displaystyle\underline{Q}_{i}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}\leq\overline{Q}_{i},\;\forall
t,\;\forall i\in\mathcal{F}\cup\mathcal{W}$ (42c)
$\displaystyle\underline{Q}_{i}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}+{q}^{\text{R}}_{it}\leq\overline{Q}_{i},\;\forall
t,\;\forall i\in\mathcal{F}$ (42d)
$\displaystyle-\underline{\Delta}_{i}\leq\sum_{y\in\mathcal{Y}}({q}^{\text{DA}}_{ity}-{q}^{\text{DA}}_{i(t-1)y})\leq\overline{\Delta}_{i},\;\forall
t>2,\;\forall i\in\mathcal{F}$ (42e)
$\displaystyle-\frac{1}{\eta_{i}^{\text{C}}}\overline{Q}_{i}^{C}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}\leq\eta_{i}^{\text{D}}\overline{Q}_{i}^{D},\;\forall
t,\;\forall i\in\mathcal{S}$ (42f)
$\displaystyle-\frac{1}{\eta_{i}^{\text{C}}}\overline{Q}_{i}^{C}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}+q_{it}^{R}\leq\eta_{i}^{\text{D}}\overline{Q}_{i}^{D},\;\forall
t,\;\forall i\in\mathcal{S}$ (42g) $\displaystyle\underline{E}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{t}(\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{it^{\prime}y}+q_{it}^{R})\leq\overline{E}_{i},\;\forall
t,\;\forall i\in\mathcal{S}$ (42h) $\displaystyle
E_{i}^{0}-\underline{B}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{t}(\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{it^{\prime}y}+q_{it^{\prime}}^{R})\leq
E_{i}^{0}+\overline{B}_{i},\;\forall i\in\mathcal{S}$ (42i) $\displaystyle
0\leq{q}^{\text{R}}_{it}\leq\overline{Q}^{\text{R}}_{i},\;\forall t,\;\forall
i\in\mathcal{F}\cup\mathcal{S}$ (42j)
$\displaystyle\sum_{i\in\mathcal{I}}\sum_{y\in\mathcal{Y}}q_{ity}^{\text{DA}}=0,\;\forall
t$ (42k)
$\displaystyle\sum_{i\in\mathcal{F}\cup\mathcal{S}}{q}^{\text{R}}_{it}\geq
M_{\text{R}},\;\forall t$ (42l)
$\displaystyle-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\;\;\sum_{y\in\mathcal{Y}}{{q}}^{\text{DA}}_{ity}\right)\leq\overline{s}_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L},$ (42m)

where the parameter $M_{\text{R}}$ is the exogenously-determined minimum
reserve requirement set by the system operator. Next, closer to real-time the
following flexibility activation problem is solved for each uncertainty
realization, denoted by $\widehat{\bm{\xi}}$.

Real-time flexibility activation problem,
${\mathcal{R}{1}}_{b},\;\forall\;\widehat{\bm{\xi}}$:

$\displaystyle\underset{{{q}^{\text{RT}}_{ity}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}\setminus{\mathcal{D}}}\;\sum_{t\in\mathcal{T}}\;\sum_{y\in\mathcal{Y}}{c}^{\text{Y}}_{ity}{{{q}}_{ity}^{\text{RT}}}+\sum_{i\in\mathcal{W}}c^{\text{spill}}q^{\text{RT}}_{it}-\sum_{i\in\mathcal{D}}c^{\text{shed}}q^{\text{RT}}_{it}$
(43a) s.t.
$\displaystyle-\frac{{{q}^{\text{R}}_{it}}^{\star}}{Y}\leq{q}^{\text{RT}}_{ity}\leq\frac{{{q}^{\text{R}}_{it}}^{\star}}{Y},\;\forall
y,\;\forall t,\;\forall i\in\mathcal{F}\cup\mathcal{S}$ (43b)
$\displaystyle-{{q}^{\text{R}}_{it}}^{\star}\leq\sum_{y\in\mathcal{Y}}q_{ity}^{\text{RT}}\leq{{q}^{\text{R}}_{it}}^{\star},\;\forall
t,\;\forall i\in\mathcal{F}\cup\mathcal{S}$ (43c) $\displaystyle 0\leq
q^{\text{RT}}_{ity}\leq\frac{\hat{q}_{it}-\widehat{\xi}_{it}}{Y},\;\forall
t,\;\forall i\in\mathcal{W}$ (43d) $\displaystyle-\frac{\hat{q}_{it}}{Y}\leq
q^{\text{RT}}_{ity}\leq 0,\;\forall t,\;\forall i\in\mathcal{D}$ (43e)
$\displaystyle\sum_{i\in\mathcal{I}\setminus\mathcal{W}}\sum_{y\in\mathcal{Y}}q_{ity}^{\text{RT}}=\mathbb{1}^{\top}\widehat{\bm{\xi}}_{t}+\sum_{i\in\mathcal{W}}q^{\text{RT}}_{it},\;\forall
t$ (43f)
$\displaystyle-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\;\sum_{y\in\mathcal{Y}}\Big{(}{{{q}}^{\text{DA}}_{ity}}^{\star}+{q}_{ity}^{\text{RT}}\Big{)}\right)\leq\overline{s}_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L},$ (43g)

where
$({q_{ity}^{\text{DA}}}^{\star},{q_{it}^{\text{R}}}^{\star})=\text{argmin}\;{\mathcal{R}{1}}_{a}$
are day-ahead dispatch and reserve capacity, respectively.

#### Scenario-based market framework:

The scenario-based stochastic market-clearing problem $\mathcal{R}2$ is a two-
stage problem. The first stage involves the day-ahead schedules as a result of
the so-called here-and-now decisions, whereas the second stage adjusts the
day-ahead schedules with real-time adjustments to mitigate the uncertainty
from weather-dependent power producers (wait-and-see). The adjustment
decisions for real-time stage are already included in the day-ahead market-
clearing problem by considering a finite number of uncertainty realization
scenarios, anticipating that the actual power production is captured in the
scenarios considered. Like with $\mathcal{R}1$, we adopt a linear
approximation of the quadratic costs to remain within the LP framework. In the
following, we provide a concise formulation for this benchmark.

$\displaystyle\underset{{{q}^{\text{DA}}_{ity},q_{ityk}^{\text{RT}}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}\setminus{\mathcal{D}}}\;\sum_{t\in\mathcal{T}}\sum_{y\in\mathcal{Y}}\;\Big{(}{c}^{\text{Y}}_{ity}{{q}}_{ity}^{\text{DA}}\Big{)}+\sum_{k=1}^{K}\phi_{k}\Big{[}\sum_{i\in\mathcal{I}\setminus{\mathcal{D}}}\sum_{t\in\mathcal{T}}\sum_{y\in\mathcal{Y}}\Big{(}{c}^{\text{Y}}_{ity}{{q}}_{ity}^{\text{RT}}\Big{)}\Big{]}$
(44a) s.t. $\displaystyle 0\leq
q_{ity}^{\text{DA}}\leq\frac{1}{Y}(\overline{Q}_{i}-\underline{Q}_{i}),\;\forall
y,\;\forall t,\;\forall i\in\mathcal{I}\setminus\mathcal{D}$ (44b)
$\displaystyle\underline{Q}_{i}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}\leq\overline{Q}_{i},\;\forall
t,\;\forall i\in\mathcal{F}\cup\mathcal{W}$ (44c)
$\displaystyle-\underline{\Delta}_{i}\leq\sum_{y\in\mathcal{Y}}({q}^{\text{DA}}_{ity}-{q}^{\text{DA}}_{i(t-1)y})\leq\overline{\Delta}_{i},\;\forall
t>2,\;\forall i\in\mathcal{F}$ (44d)
$\displaystyle-\frac{1}{\eta_{i}^{C}}\overline{Q}_{i}^{C}\leq\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{ity}\leq\eta_{i}^{D}\overline{Q}_{i}^{D},\;\forall
t,\;\forall i\in\mathcal{S}$ (44e) $\displaystyle\underline{E}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{t}\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{it^{\prime}y}\leq\overline{E}_{i},\;\forall
t,\;\forall i\in\mathcal{S}$ (44f) $\displaystyle
E_{i}^{0}-\underline{B}_{i}\leq
E_{i}^{0}-\sum_{t^{\prime}=1}^{T}\sum_{y\in\mathcal{Y}}{q}^{\text{DA}}_{it^{\prime}y}\leq
E_{i}^{0}+\overline{B}_{i},\;\forall i\in\mathcal{S}$ (44g)
$\displaystyle\sum_{i\in\mathcal{I}}\sum_{y\in\mathcal{Y}}q_{ity}^{\text{DA}}=0,\;\forall
t$ (44h)
$\displaystyle-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{y\in\mathcal{Y}}\;{{q}}^{\text{DA}}_{ity}\right)\leq\overline{s}_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L}$ (44i)
$\displaystyle-\frac{\underline{Q}_{i}^{R}}{Y}\leq
p_{itky}^{\text{RT}}\leq\frac{\overline{Q}_{i}^{R}}{Y}\;\forall y,\;\forall
k,\;\forall t,\;\forall i\in\mathcal{F}\cup\mathcal{S}$ (44j)
$\displaystyle-\underline{Q}_{i}^{R}\leq\sum_{y\in\mathcal{Y}}p_{itky}^{\text{RT}}\leq\overline{Q}_{i}^{R},\;\forall
k,\;\forall t,\;\forall i\in\mathcal{F}\cup\mathcal{S}$ (44k)
$\displaystyle-\underline{Q}_{i}\leq\sum_{y\in\mathcal{Y}}(p_{ity}^{\text{DA}}+p_{itky}^{\text{RT}})\leq\overline{Q}_{i},\;\forall
k,\;\forall t,\;\forall i\in\mathcal{F}\cup\mathcal{W}$ (44l)
$\displaystyle-\frac{1}{\eta_{i}^{C}}\overline{Q}_{i}^{C}\leq\sum_{y\in\mathcal{Y}}({q}^{\text{DA}}_{ity}+{q}^{\text{RT}}_{itky})\leq\eta_{i}^{D}\overline{Q}_{i}^{D},\;\forall
k,\;\forall t,\;\forall i\in\mathcal{S}$ (44m)
$\displaystyle\underline{E}_{i}\leq
E_{i}^{0}-(\sum_{t^{\prime}=1}^{t}\sum_{y\in\mathcal{Y}}({q}^{\text{DA}}_{it^{\prime}y}+{q}^{\text{RT}}_{it^{\prime}ky}))\leq\overline{E}_{i},\;\forall
t,\;\forall i\in\mathcal{S}$ (44n) $\displaystyle
E_{i}^{0}-\underline{B}_{i}\leq
E_{i}^{0}-(\sum_{t^{\prime}=1}^{t}\sum_{y\in\mathcal{Y}}({q}^{\text{DA}}_{it^{\prime}y}+{q}^{\text{RT}}_{it^{\prime}ky}))\leq
E_{i}^{0}+\overline{B}_{i},\;\forall k,\;\forall i\in\mathcal{S}$ (44o)
$\displaystyle\sum_{i\in\mathcal{I}}\sum_{y\in\mathcal{Y}}q_{itky}^{\text{RT}}=0,\;\forall
k,\;\forall t$ (44p)
$\displaystyle-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\sum_{y\in\mathcal{Y}}\;({q}^{\text{DA}}_{ity}+{q}^{\text{RT}}_{itky})\right)\leq\overline{s}_{\ell},\;\forall
k,\;\forall t,\;\forall\ell\in\mathcal{L}$ (44q)

###  8.4 Out-of-sample simulations

Out-of-sample simulations are performed to evaluate the quality of the day-
ahead market-clearing outcomes by fixing the decisions obtained at the day-
ahead stage to their optimal values and solving a real-time flexibility
activation problem. For the proposed conic market framework, the out-of-sample
problem (45) formulated in the following admits fixed day-ahead decisions
$({q_{it}}^{\star},\alpha^{\star}_{it},\gamma^{\star}_{it})$ obtained from the
solution to $\mathcal{M}^{cc}$. For the LP-based benchmark problems, we use
${q_{it}}^{\star}=\sum_{y\in\mathcal{Y}}{q^{\text{DA}}_{ity}}^{\star}$ from
the solution to $\mathcal{R}1_{a}$ for the deterministic benchmark problem and
${q_{it}}^{\star}=\sum_{y\in\mathcal{Y}}{q^{\text{DA}}_{ity}}^{\star}$ from
the solution to $\mathcal{R}2$ for the scenario-based stochastic benchmark
problem. We have, $\forall\widehat{\bm{\xi}}:$

$\displaystyle\underset{{{q}^{\text{RT}}_{it}}}{\text{min}}\quad$
$\displaystyle\sum_{i\in\mathcal{I}\setminus{\mathcal{D}}}\;\sum_{t\in\mathcal{T}}\;\Big{(}{c}^{\text{Q}}_{it}({{{q}}_{it}^{\star}}+{{{q}}_{it}^{\text{RT}}})^{2}+{{c}_{it}^{\text{L}}}(q_{it}^{\star}+{q}_{it}^{\text{RT}})\Big{)}+\sum_{i\in\mathcal{W}}c^{\text{spill}}q^{\text{RT}}_{it}+\sum_{i\in\mathcal{D}}c^{\text{shed}}q^{\text{RT}}_{it}$
(45a) s.t.
$\displaystyle\underline{Q}_{i}\leq{{q}_{it}}^{\star}+{q}^{\text{RT}}_{it}\leq\overline{Q}_{i},\;\forall
t,\;\forall i\in\mathcal{F}$ (45b)
$\displaystyle-\underline{\Delta}_{i}\leq{{q}_{it}}^{\star}+{q}^{\text{RT}}_{it}\leq\overline{\Delta}_{i},\;\forall
t>1,\;\forall i\in\mathcal{F}$ (45c)
$\displaystyle-\frac{1}{\eta^{\text{C}}}\overline{Q}^{\text{C}}_{i}\leq{{q}_{it}}^{\star}+{q}^{\text{RT}}_{it}\leq\eta^{\text{D}}\overline{Q}_{i}^{\text{D}},\;\forall
t,\;\forall i\in\mathcal{S}$ (45d) $\displaystyle\underline{E}_{i}\leq
E_{i}^{0}-(\sum_{t^{\prime}=1}^{t}{{q}_{it^{\prime}}}^{\star}+{q}^{\text{RT}}_{it^{\prime}})\leq\overline{E}_{i},\;\forall
t,\;\forall i\in\mathcal{S}$ (45e) $\displaystyle
E_{i}^{0}-\underline{B}_{i}\leq
E_{i}^{0}-(\sum_{t^{\prime}=1}^{t}{{q}_{it^{\prime}}}^{\star}+{q}^{\text{RT}}_{it^{\prime}})\leq
E_{i}^{0}+\overline{B}_{i},\;\forall i\in\mathcal{S}$ (45f) $\displaystyle
0\leq q^{\text{RT}}_{it}\leq\hat{q}_{it}-\widehat{\xi}_{it},\;\forall
t,\;\forall i\in\mathcal{W}$ (45g) $\displaystyle-\hat{q}_{it}\leq
q^{\text{RT}}_{it}\leq 0,\;\forall t,\;\forall i\in\mathcal{D}$ (45h)
$\displaystyle-\underline{Q}_{i}^{R}\leq
q_{it}^{RT}\leq\overline{Q}_{i}^{R},\;\forall t,\;\forall
i\in\mathcal{F}\cup\mathcal{S}$ (45i)
$\displaystyle\sum_{i\in\mathcal{I}\setminus\mathcal{W}}q_{it}^{\text{RT}}=\mathbb{1}^{\top}\widehat{\bm{\xi}}_{t}+\sum_{i\in\mathcal{W}}q^{\text{RT}}_{it},\;\forall
t$ (45j)
$\displaystyle-\overline{s}_{\ell}\leq\sum_{n\in\mathcal{N}}[\bm{\Psi}]_{(\ell,n)}\left(\sum_{i\in\mathcal{I}_{n}}\;{{q}_{it}}^{\star}+{q}^{\text{RT}}_{it}\right)\leq\overline{s}_{\ell},\;\forall
t,\;\forall\ell\in\mathcal{L}$ (45k) For $\mathcal{M}^{\text{cc}}$, these
additional constraints restrict the real-time adjustments: $\displaystyle
q_{it}^{\text{RT}}=\mathbb{1}^{\top}\widehat{\bm{\xi}}_{t}\alpha^{\star}_{it},\;\forall
t,\;\forall i\in\mathcal{F}\;\quad;\quad
q_{it}^{\text{RT}}=\mathbb{1}^{\top}\widehat{\bm{\xi}}_{t}\gamma^{\star}_{it},\;\forall
t,\;\forall i\in\mathcal{S}.$ (45l)

## References

  * Bienstock et al. (2014) Bienstock D, Chertkov M, Harnett S (2014) Chance-constrained optimal power flow: Risk-aware network control under uncertainty. _SIAM Review_ 56(3):461–495.
  * Fortuny-Amat and McCarl (1981) Fortuny-Amat J, McCarl B (1981) A representation and economic interpretation of a two-level programming problem. _The Journal of the Operational Research Society_ 32(9):783–792.
  * Georghiou et al. (2015) Georghiou A, Wiesemann W, Kuhn D (2015) Generalized decision rule approximations for stochastic programming via liftings. _Mathematical Programming_ 152(1):301–338.
  * Georghiou et al. (2019) Georghiou A, Kuhn D, Wiesemann W (2019) The decision rule approach to optimization under uncertainty: methodology and applications. _Computational Management Science_ 16(4):545–576.
  * Xie et al. (2019) Xie W, Ahmed S, Jiang R (2019) Optimized bonferroni approximations of distributionally robust joint chance constraints. _Mathematical Programming_ 1–34. URL https://doi.org/10.1007/s10107-019-01442-8