# Competitive Equilibrium in Microgrids With Dynamic Loads

Zeinab Salehi, Yijun Chen, Ian R. Petersen, Elizabeth L. Ratnam, and Guodong
Shi This work was supported by the Australian Research Council under grants
DP190102158, DP190103615, LP210200473, and DP230101014.Z. Salehi, I. R.
Petersen and E. L. Ratnam are with the Research School of Engineering, The
Australian National University, Canberra, Australia. (E-mail:
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>Y. Chen and G. Shi are with the Australian Center
for Field Robotics, School of Aerospace, Mechanical and Mechatronic
Engineering, The University of Sydney, NSW, Australia. (e-mail:
<EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

In this paper, we consider microgrids that interconnect prosumers with
distributed energy resources and dynamic loads. Prosumers are connected
through the microgrid to trade energy and gain profit while respecting the
network constraints. We establish a local energy market by defining a
competitive equilibrium which balances energy and satisfies voltage
constraints within the microgrid for all time. Using duality theory, we prove
that under some convexity assumptions, a competitive equilibrium is equivalent
to a social welfare maximization solution. Additionally, we show that a
competitive equilibrium is equivalent to a Nash equilibrium of a standard
game. In general, the energy price for each prosumer is different, leading to
the concept of locational prices. We investigate a case under which all
prosumers have the same locational prices. Additionally, we show that under
some assumptions on the resource supply and network topology, locational
prices decay to zero after a period of time, implying the available supply
will be more than the demand required to stabilize the system. Finally, two
numerical examples are provided to validate the results, one of which is a
direct application of our results on electric vehicle charging control.

##  I Introduction

A microgrid is an electrical network that connects a group of loads and
distributed energy resources (DERs) such as solar panels, battery storage, and
electric vehicles (EVs) — which can operate in isolation from the bulk grid
[1]. Market-based approaches can encourage end customers owning DERs
(prosumers) to participate in microgrid operations while maximizing their
economic profits and utilities [2]. Prosumers that participate in microgrid
operations can improve voltage regulation [3], frequency regulation [4], and
demand-side management [5].

To incentivize local market participation within a microgrid we consider a
competitive equilibrium [10]. The concept of a competitive equilibrium was
first introduced in microeconomics as the pair of resource price and consumed
resource which clears the market [6]. At a competitive equilibrium, each
prosumer maximizes its individual payoff, as the summation of the income from
resource trading and the utility from resource consumption, such that the
total supply balances the total demand. A competitive equilibrium is analogous
to frequency regulation in a power system [11]. While a competitive
equilibrium maximizes the payoff of individuals considering their local
constraints, a social welfare problem maximizes the utility for an entire
community considering both local and global constraints [14].

A competitive equilibrium is Pareto optimal, in the sense that no one can
change their decision unilaterally without reducing the payoff of at least one
other individual [13]. It is proved that under some convexity assumptions, a
competitive equilibrium and a social welfare maximization solution are
equivalent [10, 6]. The relationship between a competitive equilibrium and a
generalized Nash equilibrium has been widely studied in the literature [8, 7].
Arrow and Debreu [9] were the first to show that a competitive equilibrium can
be obtained as a solution to a generalized game with a price player.

Several authors have considered a competitive equilibrium in markets with
static loads [10, 12, 11], while others have focused on dynamic loads [14, 16,
15, 17]. Dynamic loads such as EVs and thermostatically controlled loads
(TCLs) can be operated to improve the resilience of a microgrid[18]. To ensure
the power delivered to microgrid customers is of a high quality, voltages must
also be regulated [19]. Accordingly, several authors have considered market
mechanisms focusing on voltage regulation in power systems [20, 21]. For
example, Li in [22] introduces a competitive equilibrium to balance the energy
in a microgrid subject to voltage constraints and static loads.

In this paper, we extend the work in [22] to dynamic loads by defining a new
competitive equilibrium that incorporates grid constraints. We consider
locational prices associated with a competitive equilibrium which consist of
two parts: (i) the energy price reflecting the energy balance across the
network; and (ii) prices reflecting voltage regulation within the microgrid.
Depending on the topology of the microgrid, the locational price at each node
can be different. The main contributions of the paper are as follows.

  * •

Using duality theory, we prove that under some convexity assumptions, a
competitive equilibrium is equivalent to a social welfare maximization
solution.

  * •

We show that a competitive equilibrium is equivalent to a Nash equilibrium of
a standard game.

  * •

We present conditions under which the locational prices are the same across
the network.

  * •

We show that under certain assumptions on the resource supply and network
topology, the locational prices have a decaying behavior.

The rest of the paper is organized as follows. In Section II, we describe a
microgrid with dynamic loads, and the associated power flow equations.
Additionally, we present a real-world application (EV charging) to motivate
our problem formulation. In Section III, we define a competitive equilibrium
and a social welfare maximization problem, followed by investigating some of
their properties. Then, we consider the relationship between a competitive
equilibrium and a Nash equilibrium. Finally, Section IV provides simulation
results (including EV charging), and Section V concludes the paper.

##  II Problem Formulation

In this section, we describe a microgrid that serves dynamic loads. Then, we
describe EV charging as a real-world application.

###  II-A Microgrids With Dynamic Loads

Consider a radial microgrid with $n$ prosumers indexed in the set
$\mathcal{N}=\\{1,2,...,n\\}$. Each prosumer $i\in\mathcal{N}$ corresponds to
a residential, commercial, or an industrial building with uncontrollable loads
such as lights, and controllable loads such as EVs and TCLs. Each prosumer is
also equipped with local energy production such as solar panels. We study the
microgrid over a finite time horizon which is divided into $T$ time intervals
of length $\Delta$. Time intervals $t$ are indexed in the set
$\mathcal{T}=\\{0,\cdots,T-1\\}$. The net supply (i.e., generation minus
uncontrollable loads) for prosumer $i\in\mathcal{N}$ is denoted by
$a_{i}(t)\in\mathbb{R}$. The dynamics associated with the controllable loads
of prosumer $i\in\mathcal{N}$ are described by

$\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),\quad
t\in\mathcal{T},$ (1)

where $\mathbf{x}_{i}(t)\in\mathbb{R}^{d}$ is the state (e.g., state of charge
(SoC) of an EV battery) and $\mathbf{u}_{i}(t)\in\mathbb{R}^{m}$ is the
control input (e.g., charge and discharge rate of an EV). The states and
control inputs are physically constrained by

$\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},\quad\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},$

where $\underline{\mathbf{x}}_{i}$ and $\underline{\mathbf{u}}_{i}$ are the
lower bounds, and $\overline{\mathbf{x}}_{i}$ and $\overline{\mathbf{u}}_{i}$
are the upper bounds. Reaching the state $\mathbf{x}_{i}(t)$ and applying the
control input $\mathbf{u}_{i}(t)$, prosumer $i$ achieves a running utility
$f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t)):\mathbb{R}^{d}\times\mathbb{R}^{m}\mapsto\mathbb{R}$
at time $t\in\mathcal{T}$, and a terminal utility
$\Phi_{i}(\mathbf{x}_{i}(T)):\mathbb{R}^{d}\mapsto\mathbb{R}$ at the final
time step. The energy consumption/withdrawal as a result of taking the control
action $\mathbf{u}_{i}(t)$ is denoted by
$h_{i}(\mathbf{u}_{i}(t)):\mathbb{R}^{m}\mapsto\mathbb{R}$. Each prosumer $i$
has a surplus/shortage of energy $a_{i}(t)-h_{i}(\mathbf{u}_{i}(t))$ which can
be traded through the microgrid. In what follows, we describe power flows in a
microgrid and the associated voltage constraints that must be respected.

###  II-B Microgrid Power Flows

Each prosumer is connected to a node in the microgrid. The network has $n+1$
nodes indexed in the set $\mathcal{N}\cup\\{0\\}$ where $0$ is the reference
node (feeder). The set of all lines in the network is denoted by
$\mathcal{E}$, where $(i,j)\in\mathcal{E}$ represents the line connecting
nodes $i$ and $j$ with the resistance $r_{ij}$ and reactance $x_{ij}$. Denote
by $V_{i}(t)\in\mathbb{C}$ the voltage phasor at node
$i\in\mathcal{N}\cup\\{0\\}$ and time step $t$, and $v_{i}(t)=|V_{i}(t)|^{2}$.
The square magnitude of the reference voltage is given and fixed, i.e.,
$v_{0}(t)=v_{0}$. Let $p_{i}(t)\in\mathbb{R}$ and $q_{i}(t)\in\mathbb{R}$
denote the net average active and reactive power injections at node
$i\in\mathcal{N}\cup\\{0\\}$ and time interval $t\in\mathcal{T}$,
respectively. We suppose there is no external power injection to the network,
i.e., $p_{0}(t)=q_{0}(t)=0$. The average active and reactive power flows from
node $i$ to $j$ are denoted by $P_{ij}(t)$ and $Q_{ij}(t)$, respectively.
Power flow in the network can be described by the LinDistFlow model [23]

$\displaystyle P_{ij}(t)=-p_{j}(t)+\sum_{k:(j,k)\in\mathcal{E}}P_{jk}(t),$ (2)
$\displaystyle Q_{ij}(t)=-q_{j}(t)+\sum_{k:(j,k)\in\mathcal{E}}Q_{jk}(t),$
$\displaystyle
v_{i}(t)-v_{j}(t)=2\big{(}r_{ij}P_{ij}(t)+x_{ij}Q_{ij}(t)\big{)}.$

According to (2), the injected power must be balanced; that is,

$\sum_{i=1}^{n}p_{i}(t)=0.$ (3)

Let $\mathcal{P}_{i}$ denote the unique path from node $0$ to node $i$. The
voltage equation in (2) can be simplified as in [24] to

$v_{i}(t)=v_{0}+\sum_{k=1}^{n}\big{(}R_{ik}p_{k}(t)+X_{ik}q_{k}(t)\big{)},\quad
i\in\mathcal{N},$ (4)

where we have
$R_{ik}=2\sum_{(h,l)\in\mathcal{P}_{i}\cap\mathcal{P}_{k}}r_{hl}$, and
$X_{ik}=2\sum_{(h,l)\in\mathcal{P}_{i}\cap\mathcal{P}_{k}}x_{hl}$. At each
node $i\in\mathcal{N}$, the voltage magnitude must remain within an acceptable
range (typically $\pm 5\%$ of a nominal voltage). For simplicity, we suppose
$q_{i}(t)$ is a given constant at each node $i\in\mathcal{N}$, i.e.,
$q_{i}(t)=q_{i}$. The voltage constraints can be written as

$\underline{v}_{i}\leq\sum_{k=1}^{n}R_{ik}p_{k}(t)\leq\overline{v}_{i},\quad
i\in\mathcal{N},$ (5)

where $\underline{v}_{i}$ and $\overline{v}_{i}$ are the lower and upper
bounds on $v_{i}(t)-v_{0}-\sum_{k=1}^{n}X_{ik}q_{k}$. In the remainder, by
power we mean average active power.

For node (prosumer) $i\in\mathcal{N}$, let $\lambda_{i}(t)\in\mathbb{R}$
denote the locational price for unit energy injection (energy trading) during
time interval $t\in\mathcal{T}$. Given $\lambda_{i}(t)$, prosumer $i$ decides
about the amount of its power injection $p_{i}(t)$ that is physically
constrained by $p_{i}(t)\Delta\leq a_{i}(t)-h_{i}(\mathbf{u}_{i}(t))$; the
prosumer aims to maximize its total payoff as the summation of the utility
from energy consumption and the income $\lambda_{i}(t)p_{i}(t)\Delta$ from
energy trading, over the whole horizon.

###  II-C Motivating Example (EV Charging)

As a real-world application, one may consider EV charging, where each prosumer
corresponds to a residential building with EVs as controllable loads. The
dynamics are represented by [25]

$x_{i}(t+1)=x_{i}(t)+\eta_{i}u_{i}(t)\Delta,$ (6)

where $x_{i}(t)$ is the SoC indicating the energy remained in the battery (in
kWh), $u_{i}(t)$ is the charge/discharge rate (in kW), and $\eta_{i}$ is the
charge/discharge efficiency, for EV $i$ at time $t$. The consumed/withdrawn
energy by EV $i$ is $h_{i}(u_{i}(t))=u_{i}(t)\Delta$, where $\Delta$ is the
sampling time (in hour). Each EV has $C$ kWh battery capacity. To extend the
EV battery lifespan, the SoC should remain within $20\%$ to $85\%$ of the
battery capacity [26], so $0.2C\leq x_{i}(t)\leq 0.85C$. Additionally, the
charge/discharge rate is bounded by $-\overline{u}\leq
u_{i}(t)\leq\overline{u}$, where $\overline{u}$ depends on the charger or the
battery type. We study the network over a time horizon $T$. All EVs arrive for
charging/discharging at the beginning of the horizon and depart at the end of
the horizon. Each prosumer $i\in\mathcal{N}$ tries to maximize its payoff with
the utility functions $f_{i}(x_{i}(t),u_{i}(t))=-u_{i}^{2}(t)$ and
$\Phi_{i}(x_{i}(T))=-(x_{i}(T)-0.85C)^{2}$. We aim to design a local market
which serves the interests of prosumers while respecting the network
constraints (3) and (5).

##  III Main Results

In this section, we propose a decentralized energy market that respects the
grid constraints, in particular voltage constraints, by defining a competitive
equilibrium.

###  III-A Decentralized Energy Market

For prosumer $i\in\mathcal{N}$, denote
$\mathbf{U}_{i}=(\mathbf{u}_{i}^{\top}(0),\dots,\mathbf{u}_{i}^{\top}(T-1))^{\top}$
and $\mathbf{p}_{i}=(p_{i}(0),\dots,p_{i}(T-1))^{\top}$ as the vectors of
control inputs and power injections over the time horizon, respectively. At
time step $t\in\mathcal{T}$, Denote
$\mathbf{u}(t)=(\mathbf{u}_{1}^{\top}(t),\dots,\mathbf{u}_{n}^{\top}(t))^{\top}$,
$\mathbf{p}(t)=(p_{1}(t),\dots,p_{n}(t))^{\top}$, and
$\mathbf{x}(t)=(\mathbf{x}_{1}^{\top}(t),\dots,\mathbf{x}_{n}^{\top}(t))^{\top}$
as the vectors of control inputs, power injections, and dynamical states
corresponding to all prosumers, respectively. We denote by
$\mathbf{U}=(\mathbf{u}^{\top}(0),\dots,\mathbf{u}^{\top}(T-1))^{\top}$ and
$\mathbf{P}=(\mathbf{p}^{\top}(0),\dots,\mathbf{p}^{\top}(T-1))^{\top}$ the
vectors of control inputs and power injections associated with all prosumers
over the whole horizon, respectively. Let
$\bm{\lambda}(t)=(\lambda_{1}(t),\dots,\lambda_{n}(t))^{\top}$ and
$\bm{\Lambda}=(\bm{\lambda}^{\top}(0),\dots,\bm{\lambda}^{\top}(T-1))^{\top}$
denote the vectors of energy prices associated with all prosumers at time step
$t\in\mathcal{T}$ and over the whole time horizon, respectively.

###### Definition 1

The triplet $(\bm{\Lambda}^{\ast},\mathbf{U}^{\ast},\mathbf{P}^{\ast})$ is a
competitive equilibrium if the following conditions are satisfied.

  * (i)

At the equilibrium, the individual payoff function of each prosumer
$i\in\mathcal{N}$ is maximized subject to the local constraints; i.e.,
$(\mathbf{U}_{i}^{\ast},\mathbf{p}_{i}^{\ast})$ solves

$\begin{aligned}
\max_{{\mathbf{U}_{i}},\mathbf{p}_{i}}\quad&\sum_{t=0}^{T-1}\Big{(}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+\lambda^{\ast}_{i}(t)p_{i}(t)\Delta\Big{)}+{\Phi_{i}(\mathbf{x}_{i}(T)})\\\
{\rm
s.t.}\quad&\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),\\\
\quad&p_{i}(t)\Delta\leq a_{i}(t)-h_{i}(\mathbf{u}_{i}(t)),\\\
\quad&\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},\\\
\quad&\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\quad
t\in\mathcal{T}.\end{aligned}$

(7)

  * (ii)

At the equilibrium, the power flow is balanced; i.e.,

$\sum_{i=1}^{n}p_{i}^{\ast}(t)=0,\quad t\in\mathcal{T}.$ (8)

  * (iii)

At the equilibrium, the voltage constraints are satisfied; i.e.,

$\underline{v}_{i}\leq\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)\leq\overline{v}_{i},\,\,i\in\mathcal{N},t\in\mathcal{T}.$
(9)

  * (iv)

Considering $\bm{\Lambda}^{\ast}$, the locational prices satisfy

$\lambda_{i}^{\ast}(t)=\alpha^{\ast}(t)+\sum_{k=1}^{n}\big{[}\underline{\xi}_{k}^{\ast}(t)-\overline{\xi}_{k}^{\ast}(t)\big{]}R_{ki},\,\,i\in\mathcal{N},t\in\mathcal{T},$
(10)

where $\alpha^{\ast}(t)$ is the energy price and
$\underline{\xi}_{k}^{\ast}(t)-\overline{\xi}_{k}^{\ast}(t)$ is the price for
a unit voltage change at node $k$.

  * (v)

If the voltage constraints are not binding, the price for voltage change is
zero; that is,

$\begin{aligned}
\underline{\xi}_{i}^{\ast}(t)\Big{(}\underline{v}_{i}-\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)\Big{)}=\overline{\xi}_{i}^{\ast}(t)\Big{(}\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)-\overline{v}_{i}\Big{)}=0,\\\
\,\,i\in\mathcal{N},t\in\mathcal{T}.\end{aligned}$

(11)

Under the proposed competitive equilibrium, a local energy market can be
established which respects the voltage constraints and balances the power
flow. The optimal price $\lambda^{\ast}_{i}(t)$ is determined by the grid
aggregator while the optimization problem in (7) is solved independently by
each prosumer who acts as a price taker. Next, we define the notion of social
welfare.

###### Definition 2

The pair $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ maximizes the social
welfare if it maximizes the total utilities of all prosumers over the whole
horizon subject to the local and global network constraints. In other words,
$(\mathbf{U}^{\star},\mathbf{P}^{\star})$ is an optimizer to

$\displaystyle\max_{{\mathbf{U}},\mathbf{P}}$
$\displaystyle\sum_{i=1}^{n}\Big{(}\sum_{t=0}^{T-1}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+{\Phi_{i}(\mathbf{x}_{i}(T))}\Big{)}$
(12) $\displaystyle{\rm s.t.}$
$\displaystyle\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),$
$\displaystyle p_{i}(t)\Delta\leq a_{i}(t)-h_{i}(\mathbf{u}_{i}(t)),$
$\displaystyle\sum_{i=1}^{n}p_{i}(t)=0,$
$\displaystyle\underline{v}_{i}\leq\sum_{k=1}^{n}R_{ik}p_{k}(t)\leq\overline{v}_{i},$
$\displaystyle\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},$
$\displaystyle\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\quad
i\in\mathcal{N},\,t\in\mathcal{T}.$

Social welfare maximization is important from the system-level perspective,
and it is solved by the aggregator.

###### Remark 1

The competitive equilibrium in Definition 1, which considers dynamic loads in
a microgrid, is an extension of the works presented in [22] (considering
static loads in a microgrid) and [14] (considering dynamic loads without grid
constraints).

###  III-B Competitive Equilibrium & Social Welfare

In the following, we show that under some conditions, a competitive
equilibrium and a social welfare maximization solution coincide with each
other.

###### Assumption 1

For $i\in\mathcal{N}$, let $f_{i}(\cdot)$ and $\Phi_{i}(\cdot)$ be concave
functions, and $h_{i}(\cdot)$ be a convex function. Suppose Slater’s condition
holds for (7) and (12) [27].

###### Theorem 1

Let Assumption 1 hold. Given a feasible initial condition $\mathbf{x}(0)$, a
competitive equilibrium and a social welfare maximization solution are
equivalent, i.e., the following statements hold.

  * (i)

If $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ maximizes the social welfare,
then there exists $\bm{\Lambda}^{\ast}\in\mathbb{R}^{nT}$ such that
$(\bm{\Lambda}^{\ast},\mathbf{U}^{\star},\mathbf{P}^{\star})$ is a competitive
equilibrium.

  * (ii)

If $(\bm{\Lambda}^{\ast},\mathbf{U}^{\ast},\mathbf{P}^{\ast})$ is a
competitive equilibrium, then $(\mathbf{U}^{\ast},\mathbf{P}^{\ast})$
maximizes the social welfare.

###### Proof:

(i) According to (1), the state $\mathbf{x}_{i}(t)$ can be written as a linear
combination of the initial state $\mathbf{x}_{i}(0)$ and the control sequence
$\mathbf{U}_{i}$ as

$\mathbf{x}_{i}(t)=\mathbf{A}_{i}^{t}\mathbf{x}_{i}(0)+\sum_{j=0}^{t-1}{\mathbf{A}_{i}^{t-j-1}\mathbf{B}_{i}\mathbf{u}_{i}(j)},\quad
t\in\\{1,2,...,T\\}.$ (13)

Substituting (13) into $f_{i}(\cdot)$ and $\Phi_{i}(\cdot)$, we have

$\displaystyle f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))$
$\displaystyle:=\tilde{f}_{i,t}(\mathbf{U}_{i}),$ (14)
$\displaystyle\Phi_{i}(\mathbf{x}_{i}(T))$
$\displaystyle:=\tilde{\Phi}_{i}(\mathbf{U}_{i}),$

where $\tilde{f}_{i,t}(\cdot)$ and $\tilde{\Phi}_{i}(\cdot)$ are concave
functions (the composition of a concave function and an affine function is
concave). For $i\in\mathcal{N}$, define
$\mathbb{U}_{i}=\\{\mathbf{U}_{i}|\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i};\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},\text{for
}t\in\mathcal{T}\\}$, which is a polyhedral set. For any
$(\mathbf{U},\mathbf{P})$ such that $\mathbf{U}_{i}\in\mathbb{U}_{i}$, the
Lagrangian function of (12) is defined as

$\displaystyle L(\mathbf{U},\mathbf{P},$
$\displaystyle\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi})=-\sum_{i=1}^{n}\Big{(}\sum_{t=0}^{T-1}\tilde{f}_{i,t}(\mathbf{U}_{i})+\tilde{\Phi}_{i}(\mathbf{U}_{i})\Big{)}$
(15)
$\displaystyle+\sum_{t=0}^{T-1}\alpha(t)\Big{(}-\sum_{i=1}^{n}p_{i}(t)\Big{)}\Delta$
$\displaystyle+\sum_{t=0}^{T-1}\sum_{i=1}^{n}\underline{\xi}_{i}(t)\Big{(}\underline{v}_{i}-\sum_{k=1}^{n}R_{ik}p_{k}(t)\Big{)}\Delta$
$\displaystyle+\sum_{t=0}^{T-1}\sum_{i=1}^{n}\overline{\xi}_{i}(t)\Big{(}\sum_{k=1}^{n}R_{ik}p_{k}(t)-\overline{v}_{i}\Big{)}\Delta$
$\displaystyle+\sum_{t=0}^{T-1}\sum_{i=1}^{n}\psi_{i}(t)\Big{(}p_{i}(t)\Delta+h_{i}(\mathbf{u}_{i}(t))-a_{i}(t)\Big{)},$

where $\underline{\xi}_{i}(t),\overline{\xi}_{i}(t),\psi_{i}(t)\geq 0$,
$\bm{\alpha}=(\alpha(0),\dots,\alpha({T-1}))^{\top}$,
$\underline{\bm{\Xi}}_{i}=(\underline{\xi}_{i}(0),\dots,\underline{\xi}_{i}(T-1))^{\top}$,
and
$\underline{\bm{\Xi}}=(\underline{\bm{\Xi}}_{1}^{\top},\dots,\underline{\bm{\Xi}}_{n}^{\top})^{\top}$.
We define $\overline{\bm{\Xi}}_{i},\overline{\bm{\Xi}}$, and
$\bm{\Psi}_{i},\bm{\Psi}$ in a similar way. The Lagrangian (15) can be written
as

$L(\mathbf{U},\mathbf{P},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi})=\sum_{i=1}^{n}L_{i}(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}_{i}),$
(16)

where

$\displaystyle L_{i}$
$\displaystyle(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}_{i})=-\sum_{t=0}^{T-1}\Big{(}\tilde{f}_{i,t}(\mathbf{U}_{i})+\alpha(t)p_{i}(t)\Delta$
(17)
$\displaystyle+\sum_{k=1}^{n}\underline{\xi}_{k}(t)R_{ki}p_{i}(t)\Delta-\sum_{k=1}^{n}\overline{\xi}_{k}(t)R_{ki}p_{i}(t)\Delta$
$\displaystyle-\underline{\xi}_{i}(t)\underline{v}_{i}\Delta+\overline{\xi}_{i}(t)\overline{v}_{i}\Delta\Big{)}-\tilde{\Phi}_{i}(\mathbf{U}_{i})$
$\displaystyle+\sum_{t=0}^{T-1}\psi_{i}(t)\Big{(}p_{i}(t)\Delta+h_{i}(\mathbf{u}_{i}(t))-a_{i}(t)\Big{)}.$

Considering (12), let $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ be an optimal
primal solution, and
$(-\bm{\alpha}^{\ast}\Delta,\underline{\bm{\Xi}}^{\ast}\Delta,\overline{\bm{\Xi}}^{\ast}\Delta,\bm{\Psi}^{\ast})$
be an optimal dual solution. Since Slater’s condition holds, strong duality
implies [27]

$(\mathbf{U}^{\star},\mathbf{P}^{\star})\in\arg\min_{\bm{U},\bm{P}}L(\mathbf{U},\mathbf{P},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}^{\ast}),$
(18)

for $\mathbf{U}_{i}\in\mathbb{U}_{i}$. Denote

$\displaystyle\tilde{L}_{i}$
$\displaystyle(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}_{i})=-\sum_{t=0}^{T-1}\Big{(}\tilde{f}_{i,t}(\mathbf{U}_{i})+\alpha(t)p_{i}(t)\Delta$
(19)
$\displaystyle+\sum_{k=1}^{n}\underline{\xi}_{k}(t)R_{ki}p_{i}(t)\Delta-\sum_{k=1}^{n}\overline{\xi}_{k}(t)R_{ki}p_{i}(t)\Delta\Big{)}-\tilde{\Phi}_{i}(\mathbf{U}_{i})$
$\displaystyle+\sum_{t=0}^{T-1}\psi_{i}(t)\Big{(}p_{i}(t)\Delta+h_{i}(\mathbf{u}_{i}(t))-a_{i}(t)\Big{)}.$

Considering (16) and (18), we obtain

$(\bm{U}_{i}^{\star},\bm{p}_{i}^{\star})\in\arg\min_{\bm{U}_{i},\bm{p}_{i}}L_{i}(\bm{U}_{i},\bm{p}_{i},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}_{i}^{\ast}),$
(20)

and, therefore,

$(\bm{U}_{i}^{\star},\bm{p}_{i}^{\star})\in\arg\min_{\bm{U}_{i},\bm{p}_{i}}\tilde{L}_{i}(\bm{U}_{i},\bm{p}_{i},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}_{i}^{\ast}),$
(21)

for $\mathbf{U}_{i}\in\mathbb{U}_{i}$. Besides, since there holds

$(\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}^{\ast})\in\arg\max_{\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}}\min_{\mathbf{U},\mathbf{P}}L(\mathbf{U},\mathbf{P},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi})\\\
=\arg\max_{\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}}\min_{\mathbf{U},\mathbf{P}}\sum_{i=1}^{n}L_{i}(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha},\underline{\bm{\Xi}},\overline{\bm{\Xi}},\bm{\Psi}_{i}),$
(22)

we obtain

$\bm{\Psi}_{i}^{\ast}\in\arg\max_{\bm{\Psi}_{i}}\min_{\mathbf{U}_{i},\mathbf{p}_{i}}L_{i}(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}_{i}),$
(23)

and, therefore,

$\bm{\Psi}_{i}^{\ast}\in\arg\max_{\bm{\Psi}_{i}}\min_{\mathbf{U}_{i},\mathbf{p}_{i}}\tilde{L}_{i}(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}_{i}),$
(24)

where the primal and dual variables are considered to be in their respective
domains. Additionally, the function
$\tilde{L}_{i}(\mathbf{U}_{i},\mathbf{p}_{i},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast},\bm{\Psi}_{i})$
is the Lagrangian of (7) if we define

$\lambda_{i}^{\ast}(t)=\alpha^{\ast}(t)+\sum_{k=1}^{n}\underline{\xi}_{k}^{\ast}(t)R_{ki}-\sum_{k=1}^{n}\overline{\xi}_{k}^{\ast}(t)R_{ki},\quad
t\in\mathcal{T}.$ (25)

Consequently, according to (24), $\mathbf{\Psi}_{i}^{\ast}$ is an optimal dual
solution of (7). Besides, since Slater’s condition holds, strong duality
implies that according to (21), $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ is
an optimal primal solution of (7) satisfying (8)–(11). Therefore,
$(\bm{\Lambda}^{\ast},\mathbf{U}^{\star},\mathbf{P}^{\star})$ is a competitive
equilibrium.

(ii) The proof can be obtained by reversing the proof of part (i). ∎

###### Proposition 1

The locational prices corresponding to a competitive equilibrium satisfy
$\lambda_{i}^{\ast}(t)\geq 0$ for $i\in\mathcal{N}$, $t\in\mathcal{T}$.

###### Proof:

The proof is straightforward following [28, Lemma 1]. ∎

###### Remark 2

Theorem 1 is an extension of [14, Theorem 4] (considering dynamic loads
without voltage constraints) and [22, Theorem 1] (considering static loads
with voltage constraints). The presented proof is related to the previous
works, however, it poses new challenges due to the new framework.

###  III-C Nash Equilibrium

Arrow and Debreu [9] were the first to show that a competitive equilibrium can
be obtained as a solution to a generalized game in which the decision of one
player affects both the objective function and the constraint set of other
players. In this section, however, we show that the competitive equilibrium in
Definition 1 can be obtained as a Nash equilibrium of a standard game with
$n+1$ players. The first $n$ players are prosumers who maximize their payoff
subject to the local constraints. Given a price
$\lambda_{i}(t)=\alpha(t)+\sum_{k=1}^{n}\big{[}\underline{\xi}_{k}(t)-\overline{\xi}_{k}(t)\big{]}R_{ki}$
for $t\in\mathcal{T}$, each prosumer $i\in\mathcal{N}$ obtains
$(\mathbf{U}_{i},\mathbf{p}_{i})$ as a solution to

$\displaystyle\max_{{\mathbf{U}_{i}},\mathbf{p}_{i}}$
$\displaystyle\sum_{t=0}^{T-1}\Big{(}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+\lambda_{i}(t)p_{i}(t)\Delta\Big{)}+{\Phi_{i}(\mathbf{x}_{i}(T)})$
(26) $\displaystyle{\rm s.t.}$
$\displaystyle\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),$
$\displaystyle p_{i}(t)\Delta\leq a_{i}(t)-h_{i}(\mathbf{u}_{i}(t)),$
$\displaystyle\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},$
$\displaystyle\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\quad
t\in\mathcal{T}.$

The last player is an aggregator who takes the role of a price player and
regulates the price such that the power balance constraint and the voltage
constraints are satisfied. Given $p_{i}(t)$ for $i\in\mathcal{N}$ and
$t\in\mathcal{T}$, the price player obtains $(\alpha(t)$,
$\underline{\xi}_{i}(t),\overline{\xi}_{i}(t))$ as a solution to

$\displaystyle\max_{{\bm{\alpha}},\underline{\bm{\Xi}},\overline{\bm{\Xi}}}$
$\displaystyle\sum_{i=1}^{n}\sum_{t=0}^{T-1}\Bigg{[}-\alpha(t)p_{i}(t)+\underline{\xi}_{i}(t)\Big{(}\underline{v}_{i}-\sum_{k=1}^{n}R_{ik}p_{k}(t)\Big{)}$
(27)
$\displaystyle+\overline{\xi}_{i}(t)\Big{(}\sum_{k=1}^{n}R_{ik}p_{k}(t)-\overline{v}_{i}\Big{)}\Bigg{]}$
$\displaystyle{\rm s.t.}$
$\displaystyle\underline{\xi}_{i}(t),\overline{\xi}_{i}(t)\geq 0,\quad
i\in\mathcal{N},\,\,t\in\mathcal{T}.$

The standard game in (26)–(27) stems from the generalized game introduced in
[9], where the objective function of the price player indicates the “law of
supply and demand”.

###### Remark 3

It is straightforward to show that a Nash equilibrium
$(\mathbf{U}^{\ast},\mathbf{P}^{\ast},\bm{\alpha}^{\ast},\underline{\bm{\Xi}}^{\ast},\overline{\bm{\Xi}}^{\ast})$
of the game (26)–(27) is equivalent to a competitive equilibrium and a social
welfare maximization solution.

###  III-D Strictly Implementable Solutions

In general, the locational prices are different at each node in the microgrid.
In this section, we investigate a special case in which all prosumers have the
same locational prices.

###### Definition 3

Let $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ be a solution to

$\displaystyle\max_{{\mathbf{U}},\mathbf{P}}$
$\displaystyle\sum_{i=1}^{n}\Big{(}\sum_{t=0}^{T-1}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+{\Phi_{i}(\mathbf{x}_{i}(T))}\Big{)}$
(28) $\displaystyle{\rm s.t.}$
$\displaystyle\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),$
$\displaystyle p_{i}(t)\Delta\leq a_{i}(t)-h_{i}(\mathbf{u}_{i}(t)),$
$\displaystyle\sum_{i=1}^{n}p_{i}(t)=0,$
$\displaystyle\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},$
$\displaystyle\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\quad
i\in\mathcal{N},\,t\in\mathcal{T}.$

We say $(\mathbf{U}^{\star},\mathbf{P}^{\star})$ is strictly implementable to
a microgrid if it satisfies

$\underline{v}_{i}<\sum_{k=1}^{n}R_{ik}p_{k}^{\star}(t)<\overline{v}_{i},\,\,\,i\in\mathcal{N},\,t\in\mathcal{T}.$

###### Proposition 2

If there exists a strictly implementable solution to (28), then all prosumers
have the same locational prices associated with a competitive equilibrium;
i.e., $\lambda_{i}^{\ast}(t)=\lambda^{\ast}(t)$ for $i\in\mathcal{N}$,
$t\in\mathcal{T}$.

###### Proof:

According to the proof of part (i) in Theorem 1, we have

$\lambda_{i}^{\ast}(t)=\alpha^{\ast}(t)+\sum_{k=1}^{n}\underline{\xi}_{k}^{\ast}(t)R_{ki}-\sum_{k=1}^{n}\overline{\xi}_{k}^{\ast}(t)R_{ki},\,\,\,i\in\mathcal{N},\,t\in\mathcal{T},$

where $\underline{\xi}_{k}^{\ast}(t)\Delta$ and
$\overline{\xi}_{k}^{\ast}(t)\Delta$ are the Lagrange multipliers associated
with the voltage constraints. Since the solution is strictly implementable,
the voltage constraints hold with strict inequality leading to
$\underline{\xi}_{k}^{\ast}(t)=\overline{\xi}_{k}^{\ast}(t)=0$ for
$k\in\mathcal{N}$, $t\in\mathcal{T}$. Therefore,
$\lambda_{i}^{\ast}(t)=\alpha^{\ast}(t)$ for $i\in\mathcal{N}$,
$t\in\mathcal{T}$. ∎

###  III-E Decaying Prices

The energy price depends on the available resources and the network topology.
In the following, we show that under some assumptions on these two factors,
the optimal locational prices decay to zero after a while. To consider
feasible initial conditions, we first define invariant sets.

Suppose $a_{i}(t)$ is constant over the horizon, i.e., $a_{i}(t)=a_{i}$. We
denote by
$\mathscr{X}=\\{\mathbf{x}(t)|\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},\text{
for }i\in\mathcal{N}\\}$ and
$\mathscr{U}=\\{\mathbf{u}(t)|\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i};p_{i}(t)\Delta\leq
a_{i}-h_{i}(\mathbf{u}_{i}(t));\sum_{i=1}^{n}p_{i}(t)=0;\underline{v}_{i}\leq\sum_{k=1}^{n}R_{ik}p_{k}(t)\leq\overline{v}_{i};p_{i}(t)\in\mathbb{R},\text{
for }i\in\mathcal{N}\\}$ the sets of constraints on the states and control
inputs, associated with (12), respectively.

######  Definition 4 (as in [29])

Consider the dynamics in (1) for $i\in\mathcal{N}$. Suppose
$(0,0)\in\mathscr{X}\times\mathscr{U}$. A set $X\subseteq\mathscr{X}$ is
called $\mathscr{U}$-invariant w.r.t $\mathscr{X}$ if for all
$\mathbf{x}(0)\in X$, there exists a control sequence
$\\{\mathbf{u}(t)\\}_{t=0}^{\infty}\in\mathscr{U}$ under which
$\mathbf{x}(t)\in X$ for all $t$, and
$\lim_{t\rightarrow\infty}\mathbf{x}(t)=0$.

The maximal $\mathscr{U}$-invariant set $X_{\text{max}}\subseteq\mathscr{X}$
is the union of all $\mathscr{U}$-invariant sets w.r.t $\mathscr{X}$, which
can be approximated by the algorithm presented in [29].

###### Assumption 2

(i) For $i\in\mathcal{N}$, the functions $f_{i}(\cdot)$ and $\Phi_{i}(\cdot)$
are negative definite (ND) and concave; (ii) the function $h_{i}(\cdot)$ is
convex; (iii) $f_{i}(\cdot)$, $\Phi_{i}(\cdot)$, and $h_{i}(\cdot)$ go through
the origin; (iv) $a_{i}(t)$ is constant over the horizon, i.e.,
$a_{i}(t)=a_{i}$; (v) $D:=\sum_{i=1}^{n}a_{i}>0$; (vi) there holds
$\underline{v}_{i}<\frac{1}{\Delta}\sum_{k=1}^{n}R_{ik}\Big{(}a_{k}-\frac{D}{n}\Big{)}<\overline{v}_{i}$.

###### Theorem 2

Let Assumption 2 hold. If $\mathbf{x}(0)\in X_{\rm max}$ and $T$ is
sufficiently large, then there exists a finite time $\bar{T}(\mathbf{x}(0))<T$
such that for $t\geq\bar{T}(\mathbf{x}(0))$ the locational prices associated
with a competitive equilibrium satisfy $\lambda_{i}^{\ast}(t)=0$,
$i\in\mathcal{N}$.

###### Proof:

Consider the social welfare maximization problem (12). Concavity of
$f_{i}(\cdot)$ and $\Phi_{i}(\cdot)$, and convexity of $h_{i}(\cdot)$ result
in their continuity. Since $\mathbf{x}(0)\in X_{\rm max}$, and
$f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))$ and $\Phi_{i}(\mathbf{x}_{i}(T))$
are negative definite concave functions passing through the origin, if
$T\rightarrow\infty$, then $\lim_{t\rightarrow\infty}\mathbf{x}_{i}(t)=0$ and
$\lim_{t\rightarrow\infty}\mathbf{u}_{i}^{\ast}(t)=0$ for $i\in\mathcal{N}$.
Besides, associated with any $\epsilon>0$, there exists a finite time
$\bar{T}(\mathbf{x}(0))<T$ such that
$\|h_{i}(\mathbf{u}_{i}^{\ast}(t))\|<\epsilon$ and
$\sum_{i=1}^{n}h_{i}(\mathbf{u}_{i}^{\ast}(t))<\sum_{i=1}^{n}a_{i}$ for
$t\geq\bar{T}(\mathbf{x}(0))$, $i\in\mathcal{N}$. In the remainder, by
$\bar{T}$ we mean $\bar{T}(\mathbf{x}(0))$. Selecting $p_{i}^{\ast}(t)$ as

$p_{i}^{\ast}(t)\Delta=a_{i}-h_{i}(\mathbf{u}_{i}^{\ast}(t))+\frac{1}{n}\left(\sum_{i=1}^{n}h_{i}(\mathbf{u}_{i}^{\ast}(t))-\sum_{i=1}^{n}a_{i}\right),$
(29)

the constraints $p_{i}^{\ast}(t)\Delta\leq
a_{i}-h_{i}(\mathbf{u}_{i}^{\ast}(t))$ and $\sum_{i=1}^{n}p_{i}^{\ast}(t)=0$
are satisfied for $t\geq\bar{T}$. Additionally, if $\epsilon$ is selected to
be sufficiently small, there holds
$\underline{v}_{i}<\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)<\overline{v}_{i}$, for
$t\geq\bar{T}$, $i\in\mathcal{N}$. Implementing the first $\bar{T}$ optimal
control inputs
$\mathbf{u}_{i}^{\ast}(0),\dots,\mathbf{u}_{i}^{\ast}(\bar{T}-1)$ on the
system dynamics, we arrive at $\mathbf{x}_{i}^{\ast}(\bar{T})$ for
$i\in\mathcal{N}$. Denote
$\mathbf{U}_{\bar{T}}^{\ast}:=(\mathbf{u}^{\ast\top}(\bar{T}),\dots,\mathbf{u}^{\ast\top}(T-1))^{\top}$.
The principle of optimality implies that $\mathbf{U}_{\bar{T}}^{\ast}$ solves
the following constrained optimal control problem

$\displaystyle\max_{{\mathbf{U}_{\bar{T}}}}$
$\displaystyle\sum_{i=1}^{n}\Big{(}\sum_{t=\bar{T}}^{T-1}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+{\Phi_{i}(\mathbf{x}_{i}(T))}\Big{)}$
(30) $\displaystyle{\rm s.t.}$
$\displaystyle\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),\,\,\,\mathbf{x}_{i}(\bar{T})=\mathbf{x}_{i}^{\ast}(\bar{T}),$
$\displaystyle\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},$
$\displaystyle\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\,\,\,i\in\mathcal{N},\,t\in\\{\bar{T},\dots,T-1\\}.$

As (30) is separable, $\mathbf{U}_{\bar{T}}^{\ast}$ is also a solution to

$\displaystyle\max_{{\mathbf{U}_{i,\bar{T}}}}$
$\displaystyle\sum_{t=\bar{T}}^{T-1}f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))+{\Phi_{i}(\mathbf{x}_{i}(T))}$
(31) $\displaystyle{\rm s.t.}$
$\displaystyle\mathbf{x}_{i}(t+1)=\mathbf{A}_{i}\mathbf{x}_{i}(t)+\mathbf{B}_{i}\mathbf{u}_{i}(t),\,\,\,\mathbf{x}_{i}(\bar{T})=\mathbf{x}_{i}^{\ast}(\bar{T}),$
$\displaystyle\underline{\mathbf{x}}_{i}\leq\mathbf{x}_{i}(t)\leq\overline{\mathbf{x}}_{i},$
$\displaystyle\underline{\mathbf{u}}_{i}\leq\mathbf{u}_{i}(t)\leq\overline{\mathbf{u}}_{i},\,\,\,t\in\\{\bar{T},\dots,T-1\\},$

where
$\mathbf{U}_{i,\bar{T}}:=(\mathbf{u}_{i}^{\top}(\bar{T}),\dots,\mathbf{u}_{i}^{\top}(T-1))^{\top}$
for $i\in\mathcal{N}$. Considering (29), we construct
$\mathbf{P}_{\bar{T}}^{\ast}=(\mathbf{p}^{\ast\top}(\bar{T}),\dots,\mathbf{p}^{\ast\top}(T-1))^{\top}$.
Following (31), it can be concluded that
$(\mathbf{U}_{\bar{T}}^{\ast},\mathbf{P}_{\bar{T}}^{\ast})$ solves the
optimization problem in (7) starting from $\bar{T}$ and
$\mathbf{x}_{i}(\bar{T})=\mathbf{x}_{i}^{\ast}(\bar{T})$ under
$\lambda_{i}^{\ast}(t)=0$ such that (8)–(11) are satisfied with the choice of
$\alpha^{\ast}(t)=\underline{\xi}_{i}^{\ast}(t)=\overline{\xi}_{i}^{\ast}(t)=0$.
Therefore, $(\mathbf{U}_{\bar{T}}^{\ast},\mathbf{P}_{\bar{T}}^{\ast})$ forms a
competitive equilibrium with $\lambda_{i}^{\ast}(t)=0$ for $t\geq\bar{T}$,
$i\in\mathcal{N}$. ∎

###### Remark 4

The decaying behavior of price in Theorem 2 implies that with a suitable
energy supply, a proper network topology, and good enough initial conditions
the available energy will be more than the demand in the long run to stabilize
the system. Such assumptions are restrictive in practice since the initial
conditions are from a small set and the total supply is always positive.
However, a similar case might happen in future energy markets with high
penetration of renewables that have zero marginal costs, leading to low energy
prices.

##  IV Simulation Results

We consider a radial microgrid as in Fig. 1 with $n=9$ nodes and a reference
node $0$, where $r_{ij}=0.5$ k$\Omega$ and $x_{ij}=0$ k$\Omega$ for
$(i,j)\in\mathcal{E}$.

Figure 1: Diagram of the microgrid in Examples 1 and 2.

Let $v_{0}=12.35^{2}$ (kV)2, $\overline{v}_{i}=(1.05^{2}-1)v_{0}$, and
$\underline{v}_{i}=(0.95^{2}-1)v_{0}$ for $i\in\mathcal{N}$.

###  IV-A Real-World Application (EV Charging)

###### Example 1

Consider the EV charging example in Section II-C, where the dynamics are
represented by (6). For $i\in\mathcal{N}$, let $\eta_{i}=0.9$ and
$\Delta=0.5$. Each EV has $C=30$ kWh battery capacity. The SoC and the
charge/discharge rate are constrained by $0.2C\leq x_{i}(t)\leq 0.85C$ and
$-1.8\leq u_{i}(t)\leq 1.8$, respectively. We study the network over a time
horizon $T=100$. Suppose all EVs arrive for charging/discharging at the
beginning of the horizon and depart at the end of the horizon. Each prosumer
$i\in\mathcal{N}$ tries to maximize its payoff with the utility functions
$f_{i}(x_{i}(t),u_{i}(t))=-u_{i}^{2}(t)$ and
$\Phi_{i}(x_{i}(T))=-(x_{i}(T)-0.85C)^{2}$.

Suppose EVs have the initial SoC
$\mathbf{x}(0)=(0.23,0.21,0.2,0.24,0.27,0.25,0.3,0.25,0.28)^{\top}C$. The net
supply $a_{i}(t)$ of each prosumer is sinusoidal and depicted in Fig. 2.

Figure 2: Net supply $a_{i}(t)$ in Example 1.

We solve the social welfare maximization problem in (12) to obtain the optimal
solution $(\mathbf{U}^{\star}_{i},\mathbf{p}_{i}^{\star})$, and the optimal
locational prices $\lambda_{i}^{\ast}(t)$ as the combination of the Lagrange
multipliers associated with the energy balance constraint and the voltage
constraints for $i\in\mathcal{N}$. The optimal locational prices are depicted
in Fig. 3.

Figure 3: Locational prices $\lambda_{i}^{\ast}(t)$ in Example 1.

Considering $\lambda^{\ast}_{i}(t)$, we solve (7) to obtain the competitive
equilibrium $(\mathbf{U}_{i}^{\ast},\mathbf{p}_{i}^{\ast})$ for
$i\in\mathcal{N}$. For illustration, we depict
$(\mathbf{U}^{\star}_{i},\mathbf{p}_{i}^{\star})$ and
$(\mathbf{U}_{i}^{\ast},\mathbf{p}_{i}^{\ast})$ for $i=1,5,8$ in Fig. 4.

Figure 4: Competitive equilibrium and social welfare maximization solution in
Example 1.

Additionally, Fig. 5 illustrates
$\tilde{v}_{i}(t):=\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)$ for $i\in\mathcal{N}$,
where the horizontal dashed lines represent $\underline{v}_{i}$ and
$\overline{v}_{i}$.

Figure 5: The $\tilde{v}_{i}(t)=\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)$ in
Example 1.

Our observations are as follows.

  * •

Fig. 3 indicates that $\lambda_{i}^{\ast}(t)\geq 0$ for $i\in\mathcal{N}$,
$t\in\mathcal{T}$, validating Proposition 1.

  * •

Fig. 4 illustrates that the competitive equilibrium and the social welfare
maximization solution coincide, validating Theorem 1.

  * •

Considering Fig. 5, when
$\underline{v}_{i}<\sum_{k=1}^{n}R_{ik}p_{k}^{\ast}(t)<\overline{v}_{i}$ for
all $i\in\mathcal{N}$ (e.g., $30<t<40$), we have
$\lambda_{i}^{\ast}(t)=\lambda^{\ast}(t)$ as shown in Fig. 3. This is
consistent with Proposition 2.

###  IV-B Synthetic Microgrid ($3$-Dimensional Loads)

###### Example 2

Each node $i\in\mathcal{N}$ is associated with the dynamics in (1) with the
following state-space matrices

$\displaystyle{\mathbf{A}_{i}}=\left[{\begin{array}[]{*{20}{c}}{1.1}&{0}&{0}\\\
{0}&{0.6}&{0}\\\
{0}&{0}&{-0.8}\end{array}}\right],\,{\mathbf{B}_{i}}=\left[{\begin{array}[]{*{20}{c}}4&5\\\
2&1\\\ 3&5\end{array}}\right].$ (32)

For $i\in\mathcal{N}$, suppose $\mathbf{x}_{i}(0)=(8,10,12)^{\top}$ which lies
in the maximal $\mathscr{U}$-invariant set $X_{\text{max}}$. We denote by
$\mathbf{I}$ the identity matrix with an appropriate dimension. Let
$\Delta=0.83$ and

$\begin{gathered}\begin{aligned}
f_{i}(\mathbf{x}_{i}(t),\mathbf{u}_{i}(t))&=-\mathbf{x}_{i}^{\top}(t)\mathbf{Q}_{i}\mathbf{x}_{i}(t)-\mathbf{u}_{i}^{\top}(t)\mathbf{R}_{i}\mathbf{u}_{i}(t),\\\
\Phi_{i}(\mathbf{x}_{i}(T))&=-\mathbf{x}_{i}^{\top}(T)\mathbf{Q}_{i}\mathbf{x}_{i}(T),\\\
h_{i}(\mathbf{u}_{i}(t))&=\mathbf{u}_{i}^{\top}(t)\mathbf{H}_{i}\mathbf{u}_{i}(t),\end{aligned}\end{gathered}$
(33)

where for $i\in\mathcal{N}$, we have $\mathbf{Q}_{i}=0.5\mathbf{I}$,
$\mathbf{R}_{i}=0.3\mathbf{I}$, $\mathbf{H}_{i}=3\mathbf{I}$. Consider
$a_{1}(t)=a_{4}(t)=10$, $a_{2}(t)=-a_{9}(t)=9$, $a_{3}(t)=-7$, $a_{5}(t)=-5$,
$a_{6}(t)=-8$, $a_{7}(t)=11$, and $a_{8}(t)=12$. For $i\in\mathcal{N}$, the
states and control inputs are bounded by
$-12\times\boldsymbol{1}\leq\mathbf{x}_{i}(t)\leq 12\times\boldsymbol{1}$ and
$-10\times\boldsymbol{1}\leq\mathbf{u}_{i}(t)\leq 10\times\boldsymbol{1}$,
respectively, where $\boldsymbol{1}$ is a vector of an appropriate dimension
whose entries are all $1$. Following the same procedure as in Example 1, the
locational prices $\lambda_{i}^{\ast}(t)$ are obtained by solving (12), and
depicted in Fig. 6.

Figure 6: Locational prices $\lambda_{i}^{\ast}(t)$ in Example 2.

As can be seen, $\lambda_{i}^{\ast}(t)=0$ for $t\geq 23$, $i\in\mathcal{N}$,
which is consistent with Theorem 2.

##  V Conclusions

This paper has considered microgrids with dynamic loads, DERs, and distributed
energy allocations. Defining a competitive equilibrium, we presented a local
energy market that respects the voltage constraints in the microgrid, inspired
by the work presented in [22]. We showed that a competitive equilibrium is
equivalent to a Nash equilibrium of a standard game. We proved that under some
assumptions, a competitive equilibrium and a social welfare maximization
solution coincide. Considering that the locational prices associated with a
competitive equilibrium are different at each node in the microgrid, we
investigated a special case leading to the same locational prices.
Furthermore, we showed that under some assumptions on the resource supply and
network topology, the locational prices decay to zero after a period of time,
implying the supply would be more than the demand required to stabilize the
system. Finally, we simulated two numerical examples, including EV charging as
a real-world application, to validate the results. In future work, extensions
to loads with nonlinear dynamics are possible.

## References

  * [1] M. Sandelic, S. Peyghami, A. Sangwongwanich, and F. Blaabjerg, “Reliability aspects in microgrid design and planning: Status and power electronics-induced challenges,” Renewable and Sustainable Energy Reviews, vol. 159, p. 112127, 2022.
  * [2] X. Zhou, E. Dall’Anese, L. Chen, and A. Simonetto, “An incentive-based online optimization framework for distribution grids,” IEEE Transactions on Automatic Control, vol. 63, no. 7, pp. 2019–2031, 2018.
  * [3] A. Paudel, M. Khorasany, and H. B. Gooi, “Decentralized local energy trading in microgrids with voltage management,” IEEE Transactions on Industrial Informatics, vol. 17, no. 2, pp. 1111–1121, 2021.
  * [4] E. King, C. Bakker, A. Bhattacharya, S. Chatterjee, F. Pan, M. R. Oster, and C. J. Perkins, “Solving the dynamics-aware economic dispatch problem with the Koopman operator,” in Proc. 12th ACM International Conference on Future Energy Systems, 2021, pp. 137–147.
  * [5] Y. Tao, J. Qiu, and S. Lai, “A data-driven management strategy of electric vehicles and thermostatically controlled loads based on modified generative adversarial network,” IEEE Transactions on Transportation Electrification, vol. 8, no. 1, pp. 1430–1444, 2022.
  * [6] A. Mas-Colell, M. D. Whinston, and J. R. Green, Microeconomic Theory. London, U.K.: Oxford Univ. Press, 1995.
  * [7] C. H. Beloso and E. M. Garcia, “Market games and Walrasian equilibria,” Journal of Dynamics & Games, vol. 7, pp. 65–77, 2020.
  * [8] F. Facchinei and C. Kanzow, “Generalized Nash equilibrium problems,” Ann. Oper. Res., vol. 175, no. 1, pp. 177–211, 2010.
  * [9] K. J. Arrow and G. Debreu, “Existence of equilibrium for a competitive economy,” Econometrica, vol. 22, no. 3, pp. 265–290, 1954.
  * [10] S. Li, J. Lian, A. J. Conejo, and W. Zhang, “Transactive energy systems: The market-based coordination of distributed energy resources,” IEEE Control Systems Magazine, vol. 40, no. 4, pp. 26–52, 2020.
  * [11] Z. Salehi, Y. Chen, E. Ratnam, I. R. Petersen, and G. Shi, “Social shaping for transactive energy systems,” Preprint at arXiv:2109.12967, 2021.
  * [12] Z. Salehi, Y. Chen, E. Ratnam, I. R. Petersen, and G. Shi, “Social shaping of linear quadratic multi-agent systems,” in Proc. 2021 Australian & New Zealand Control Conference (ANZCC), 2021, pp. 232–237.
  * [13] D. Acemoglu, D. Laibson, and J. List, Microeconomics, 2nd edition, Pearson, 2018.
  * [14] Y. Chen, R. Islam, E. Ratnam, I. R. Petersen, and G. Shi, “Competitive equilibriums and social shaping for multi-agent systems,” Automatica, vol. 146, p. 110663, 2022.
  * [15] Z. Salehi, Y. Chen, E. L. Ratnam, I. R. Petersen, and G. Shi, “Competitive equilibriums of multi-agent systems over an infinite horizon,” IFAC-PapersOnLine, vol. 56, pp. 37–42, 2023.
  * [16] Z. Salehi, Y. Chen, E. Ratnam, I. R. Petersen, and G. Shi, “Competitive equilibrium for dynamic multi-agent systems: Social shaping and price trajectories,” Preprint at arXiv:2210.11064, 2022.
  * [17] Z. Salehi, Y. Chen, E. L. Ratnam, I. R. Petersen, and G. Shi, “Competitive equilibrium for dynamic multi-agent systems: Social shaping and price trajectories,” IEEE Transactions on Automatic Control, doi: 10.1109/TAC.2023.3347491.
  * [18] B. Papari, C. S. Edrington, M. Ghadamyari, M. Ansari, G. Ozkan, and B. Chowdhury, “Metrics analysis framework of control and management system for resilient connected community microgrids,” IEEE Transactions on Sustainable Energy, vol. 13, no. 2, pp. 704–714, 2022.
  * [19] W. Kang et al., “Event-triggered distributed voltage regulation by heterogeneous BESS in low-voltage distribution networks,” Applied Energy, vol. 312, p. 118597, 2022.
  * [20] Y. Liu et al., “Fully decentralized P2P energy trading in active distribution networks with voltage regulation,” IEEE Transactions on Smart Grid, vol. 14, no. 2, pp. 1466–1481, 2023.
  * [21] K. Umer, Q. Huang, M. Khorasany, W. Amin, and M. Afzal, “A novel prosumer-centric approach for social welfare maximization considering network voltage constraints in peer-to-peer energy markets,” International Journal of Electrical Power & Energy Systems, vol. 147, p. 108820, 2023.
  * [22] N. Li, “A market mechanism for electric distribution networks,” in Proc. 54th IEEE Conference on Decision and Control (CDC), Osaka, Japan, Dec. 2015, pp. 2276–2282.
  * [23] M. E. Baran and F. F.Wu, “Network reconfiguration in distribution systems for loss reduction and load balancing,” IEEE Transactions on Power Delivery, vol. 4, no. 2, pp. 1401–1407, 1989.
  * [24] M. Farivar, L. Chen, and S. Low, “Equilibrium and dynamics of local voltage control in distribution systems,” in Proc. 52nd IEEE Conference on Decision and Control, 2013, pp. 4329–4334.
  * [25] N. I. Nimalsiri, E. L. Ratnam, D. B. Smith, C. P. Mediwaththe, and S. K. Halgamuge, “Coordinated charge and discharge scheduling of electric vehicles for load curve shaping,” IEEE Transactions on Intelligent Transportation Systems, vol. 23, no. 7, pp. 7653–7665, 2022.
  * [26] H. Xing, M. Fu, Z. Lin, and Y. Mou, “Decentralized optimal scheduling for charging and discharging of plug-in electric vehicles in smart grids,” IEEE Transactions on Power Systems, vol. 31, no. 5, pp. 4118–4127, 2016.
  * [27] S. Boyd and L. Vandenberghe, Convex Optimization. Cambridge, U.K.: Cambridge Univ. Press, 2004.
  * [28] Z. Salehi, Y. Chen, I. R. Petersen, E. L. Ratnam, and G. Shi, “Social shaping of dynamic multi-agent systems over a finite horizon,” in Proc. 61st IEEE Conference on Decision and Control (CDC), Cancun, Mexico, 2022, pp. 4553–4558.
  * [29] P. Gutman and M. Cwikel, “An algorithm to find maximal state constraint sets for discrete-time linear dynamical systems with bounded controls and states,” IEEE Transactions on Automatic Control, vol. AC-31, no. 5, pp. 457–459, 1987.