0% found this document useful (0 votes)
6 views

A Convex Approximation For The Tertiary Control of

Uploaded by

ludwig215223
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

A Convex Approximation For The Tertiary Control of

Uploaded by

ludwig215223
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Electric Power Systems Research 199 (2021) 107423

Contents lists available at ScienceDirect

Electric Power Systems Research


journal homepage: www.elsevier.com/locate/epsr

A Convex Approximation for the Tertiary Control of


Unbalanced Microgrids.
Diego-Alejandro Ramirez a, Alejandro Garcés *, b, Juan-José Mora-Flórez b
a
XM S.A. E.S.P, Cl. 12 Sur N18-168, Medellín, Colombia
b
Department of electric power systems engineering. Universidad Tecnológica de Pereira. AA: 97 - Post Code: 660003 - Pereira, Colombia

A R T I C L E I N F O A B S T R A C T

Keywords: This article presents an optimization model for tertiary control in three-phase unbalanced microgrids. This model
Tertiary control considers 24h operation and includes renewable energy sources, energy storage devices, and grid code limita­
Optimal power flow tions. Power flow equations are simplified using a recently developed approximation based on Wirtinger’s cal­
Convex optimization
culus. The proposed model is evaluated both theoretically and practically. From the theoretical point of view, the
Wirtinger calculus
Linear power flow
model is suitable for tertiary control since it is convex; hence, global optimum, uniqueness of the solution, and
convergence of the interior point method are guaranteed. From the practical point of view, the model is simple
enough to be implemented in a small single-board computer with low time calculation. The latter is evaluated by
implementing the model in a Raspberry-Pi board with the CIGRE low voltage benchmark; the model is also
evaluated in the IEEE 123-nodes test system for power distribution networks.

1.2. State of the art

1. Introduction TC is the highest level in the hierarchy for microgrids operation [4].
It defines the optimal operation point for the active and reactive power
1.1. Motivation in each distributed resource and how much energy the microgrid is
willing to trade with the primary grid to satisfy the power balance be­
Modern power distribution systems include distributed resources tween the load and power generation [5].
like wind and solar generation as well as storage devices. These com­ The problem is closely related to the optimal power flow and the
ponents can be grouped, forming a microgrid with potential improve­ management of energy storage devices. The optimal power flow is a
ments in efficiency and reliability. However, to achieve these classic problem that has regained importance due to the challenges
improvements, a microgrid must be complemented with an optimization associated with introducing renewable energy and new advances in
algorithm called tertiary control, which will be referred to as TC in the convex optimization [6]. A modern approach to this problem is based on
rest of the paper [1]. conic approximations such as semidefinite programming and
An optimization model for TC requires to include constraints related second-order cone optimization (see [7] and the references therein for a
to renewable energies and energy storage devices and an accurate rep­ complete review of this subject). These relaxations transform the
resentation of the power flow equations. Besides, the model must be non-convex problem into a convex thereof with theoretical and practical
tailored for real implementation. Therefore, it is convenient to formulate advantages related to global optimal, uniqueness of the solution, and
a model that guarantees global optimum, uniqueness of the solution, and fast convergence rate [8]. Despite obvious theoretical advances, these
convergence of the algorithms. Convex optimization emerges as a suit­ algorithms are far from becoming a proper tertiary control in practical
able alternative in this context. Nevertheless, the power flow equations applications [9]. Computational time may be high, especially in semi­
introduce non-convex constraints that require linearization, considering definite approximations, and its implementation may require solvers
a trade-off between precision and convexity [2]. On the other hand, the that allow conic programming [10]. In addition, the algorithms should
model must be simple enough to be implemented in a practical situation, be tailored to be implemented in low-cost single-board computers and
with a well-defined time frame for the entire process, and considering not in a desktop computer.
time calculations and latency of the communications [3].

* Corresponding author. Tel.: 5763217389.


E-mail addresses: [email protected] (D.-A. Ramirez), [email protected] (A. Garcés), [email protected] (J.-J. Mora-Flórez).

https://doi.org/10.1016/j.epsr.2021.107423
Received 26 May 2020; Received in revised form 25 February 2021; Accepted 2 June 2021
Available online 20 June 2021
0378-7796/© 2021 Elsevier B.V. All rights reserved.
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

Nomenclature IH Vector of nodal currents


nchar
kt Losses in the energy storage during charging
αk Exponential model of load k ndisch Losses in the energy storage during discharging
kt
∘ Hadamard product
pchar
kt Power in the battery during charging
I3 Identity matrix of size 3 × 3
pdisch Power in the battery during discharging
E Set of three-phase branches (hyperbranches) kt
grid
H Set of three-phase nodes (hypernodes) pt Total power supplied for the main grid at time t
N Hypernodes different from slack, i.e N = H − S ploss
t Total power loss at time t
S Slack hypernode skt Apparent power in node k at time t
⊗ Kronecker product ssolar
kt Power generated by photovoltaic unit k at time t
∂ Conventional derivative swind Power generated by wind turbine k at time t
kt
ψt Irradiance at time t vnom Nominal phase-to-neutral voltage
ρk Productivity coefficient associated with the solar panel k VE Vector of branch voltages
̂
∂ Wirtinger’s derivative VH Vector of nodal voltages
A Node-branch incidence matrix wt wind speed at time t
ekt Energy in the battery k at time t YH Three-phase admittance matrix
ekt Energy stored in the battery k at time t
IE Vector of branch currents

Another classic approach for the optimal power flow problem is


using heuristic algorithms [11]. These algorithms have an extensive Table 1
history in power systems applications, especially in planning problems. Aspects considered in recent references about tertiary control for microgrids.
However, they are not suitable for real-time operation problems. Aspect Conic Heuristics AI Energy Proposed
Computational time is cumbersome in these algorithms, and conver­ relaxations Management
gence is not guaranteed [12]. Besides, the abuse of heuristic analogies in Reference [6] to [9] [11] to [15] [17] to [19] approach
optimization problems has been criticized in the scientific community [12] to
[16]
[13]. Other methods based on artificial intelligence have also been
proposed, especially reinforcement learning [14] and neural networks Convergence • •
guarantee
[15]. These types of algorithms are promising for real-time imple­
Global • •
mentation, although they may be improved by theoretical analysis of the optimum
optimization problem [16]. Energy storage • •
TC must consider power flow constraints and energy management of Practical • •
both renewable generation and energy storage resources [17]. This oriented
aspect is usually studied under the name of energy storage management Implementation •
[18]. The problem may allow 24h operation but tends to neglect the Stochastic •
model
network effects. The stochastic nature of the problem has been also
studied [19] in both the optimal power flow and the energy manage­
ment problems. 1.4. Organization of the paper

1.3. Contribution The paper is organized as follows: Section 2 shows the architecture of
the proposed TC. A general representation of three-phase microgrids and
This paper presents a model based on a linearization recently pro­ their main components, such as wind turbines, solar panels, and energy
posed in [20]. The contribution of the article can be summarized as storage devices, is presented in Section 3. Next, a general formulation of
follows: the power flow equations for grid-connected operation is presented in
Section 4. The proposed Wirtinger linearization is described in Section 5,
• An optimization model for 24h operation, considering unbalanced resulting in a convex model. The CIGRE microgrid benchmark results are
operation, realistic models of the loads and, renewable and storage presented in Section 6, followed by its software implementation. Finally,
devices. conclusions and recent references are presented.
• A convex approximation of the batteries losses and the exponential
models of loads (previous linearizations considered constant 2. Tertiary control in microgrids
impedance, current, and power, known as ZIP models and did not
consider the non-linear model of the batteries). Microgrids are usually operated using a hierarchical control that
• A static reserve model that allows the transition from grid-connected emulates the automatic generation control of conventional power sys­
to island operation. tems. This hierarchy consists of three controls known as primary, sec­
• An implementation in a small single-board computer (a Raspberry ondary, and tertiary control. Primary control aims to synchronize and
Pi) that demonstrates the proposed algorithm can be implemented in stabilize the microgrid, while secondary control aims to achieve nominal
practice at a low cost. frequency; finally, tertiary control aims to optimize the operation.
Therefore, TC operates in a stationary or quasi-stationary state.
Table 1 shows a comparison with recent references, considering the A typical architecture for TC is shown in Figure 1. Renewable re­
main aspects for TC in microgrids. • indicates an aspect that was fully sources and energy storage devices are integrated through power elec­
considered in the reference, indicates an aspect that was partially tronics converters to control active and reactive power. However, this
considered, and indicates an aspect that was not considered in said control is limited by the converters’ capacity and the primary resource
reference.

2
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

Fig. 1. Integration of wind, solar and energy storage devices through power electronic converters, including TC.

availability (i.e., solar irradiance and wind speed). Besides, the state of
charge of the batteries (SOC) must be managed to minimize power loss
and/or reduce costs. Therefore, an optimization problem requires to be
executed by a central controller in real-time.
Real-time may means different things, according to the application.
For a primary control, real-time is an action executed in the order of
seconds or even milliseconds, whereas for the tertiary control, real-time
is in the order of minutes. The tertiary control is, therefore, a quasi-
dynamic model that works in an entire day.
Different types of communications technologies can be used in this
architecture, for example, WiFi or ZigBee [21]. In any case, delays or
latency must be considered; these delays include those associated with
the optimization model and those associated with the communications.
The maximum latency experienced by the ZigBee technology for a dis­
tance of 50 m with 50-byte packets was 18 ms, according to [22]. Fig. 2. Hypergraph representation for line sections in microgrids
Therefore, the primary source of delay is the execution time of the
optimization model. Therefore, fast algorithms with convergence guar­
anteed are required.
The central controller can be any device, such as a personal computer Circuit variables in each hyperbranch l ∈ E are represented by a 3 ×
or an industrial computer; however, it is advisable an embedded system 3 admittance matrix as given in (1).
dedicated explicitly for TC. This system must be small and reliable to be Il = Yl Vl (1)
placed in the point of common coupling, that is, the point where the
microgrid is electrically connected to the electric distribution system. These matrices can be grouped together in a block diagonal matrix YE
The optimization model requires to be accurate but straightforward that relates the vector of three-phase voltages with the vector of three-
enough to be implemented in this device. This is the main objective of phase currents, as given in (2).
the model presented in the next section.
IE = YE VE (2)
3. Modelling
where VE and IE are vectors where the first elements correspond to the
phase A, next the phase B and finally the phase C. An incidence matriz
3.1. Three-phase grid
A ∈ RH ×E is created for the hypergraph, where akl = 1 if the hyper­
A three-phase microgrid is represented as a connected hypergraph G branch l ∈ E is in the direction k→m and akl = − 1 if it is in the direction
= {H , E }, where H represents the set of hypernodes and E ⊆N ×N m→k. The other entries of the matrix are zero. This matrix requires to be
represents the hyperbranches. Each hypernode and hyperbranch has increased in order to consider three phases in each hypernode. There­
three components that represent phases {A, B, C} as depicted in Fig 2. fore, the following expressions are obtained:
Along this section and for the rest of the paper, matrices and vectors IH = (I3 ⊗ A)IE (3)
are represented in capital letter whereas entries of these matrices/vec­
tors are represented in lower case letters. Unless otherwise specified, all VE = (I3 ⊗ A)⊤ VH (4)
variables are defined in the complex domain; x represents the complex
conjugate of x, and X⊤ is the conjugate transpose of X. Subscripts IH = (I3 ⊗ A)YE ((I3 ⊗ A))⊤ VH = YH VH (5)
represent node and/or time whereas superscripts represent labels of the
variables, if they are text, and, exponentiation if they are numeric. where I3 is the identity matrix of size 3 × 3, YH is the three-phase

3
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

admittance matrix, ⊗ is the Kronecker product and (⋅)⊤ represents the vkt αk
transpose conjugate. sload
kt = sZIP
kt ‖ ‖ (15)
vnom
The hypernode set is divided in two new sets H = {S , N } where S
represents the slack hypernode and N are the rest of hypernodes. A time series for sload
k is required in order to obtain the 24h operation.
Therefore, the model of the grid is given by the following matrix
equations: 3.3. Photovoltaic units

IS = YSS VS + YSN VN (6) The model that represents the power supplied by the photovoltaic
units (PVs) during a period is presented in (16)
IN = YNS VS + YNN VN (7)
psolar
kt ≤ ρk ψ t (16)
where
( ) where psolar
kt power that the photovoltaic generator can inject in the
YSS YSN
YH = (8) period t, ρk is the productivity coefficient associated to the solar panel,
YNS YNN
and ψ t corresponds to the irradiance measured in (W/m2 ), perpendic­
Notice that S is size three since there are three slack nodes in the sys­ ular to the panel for the period t. The model requires a time series of ψ
tem, corresponding to each phase. The voltage VS is given by (9): for 24 h. Power electronic converters are allow to reduce their produc­
⎛ ⎞ tion if required by the optimization model there in the inequality.
1
VS = v nom ⎝ − 2π /3j ⎠
e (9)
3.4. Wind turbine model
e2π/3j
Generally, a model for the generated wind power may be obtained
where vnom is the nominal voltage in per unit, measured in the point of
using a wind turbine profile obtained experimentally. In this case, the
point of common coupling. On the other hand, voltages VN are variables
proposed model represents an approximation of the active power sup­
in the optimization model and thus, the current in each node of the grid
plied by the wind turbine; thus the wind power may be calculated based
is in function of these voltages
∑ ∑ on the wind speed and the wind turbine power coefficient as follows:
ik = ysk vs + ykm vm , ∀k ∈ N (10) ( )
⎧ nom wt 3 ⎫
s∈S m∈N

⎪ kp nom
, if 0 ≤ wt ≤ wnom
k ⎪


⎪ w k



⎪ ⎪

multiplying by vk an expression for the nodal powers is obtained as ⎪





⎨ ⎬
follows: wind
pkt ≤ (17)
nom nom max
∑ ∑ ⎪ p k , if w k ≤ w t ≤ w k ⎪
⎪ ⎪
skt = vkt ymk vmt + vkt ykm vmt , ∀k ∈ N (11) ⎪








⎪ ⎪

m∈S m∈N ⎪
⎩ ⎪

max
where vk represents the complex conjugate of vk and sk = pk +jqk is the 0, if wk ≤ wt
total apparent power in node k. A subscripts t was added to all variables
to indicate the time since the model is formulated for one day operation. where pwind
kt corresponds to the maximum power that the wind turbine
Each node may have different power injections such as wind and can deliver in the period of time t, the wind speed is a time variable
solar generation, energy storage and, loads. Therefore, the following described by wt , and pnom is the rated power that each of the wind tur­
balance of power in each node is obtained: bines can inject to the system. wnom represents the rated wind speed at
which the turbines generate its rated power, and the maximum wind
skt = swind
kt + ssolar
kt + sbattery
kt − sload
kt (12) speed that the turbines tolerates is represented by wmax . The model re­
quires a time series of the wind velocity during a period of time.
Total losses of the grid are calculated as given in (13).

ploss
(
= real VS⊤ t YSS VS t + 2VS⊤ t YSN VN t + VN⊤ t YNN VN t
)
(13) 3.5. Battery energy storage
t

Further, the power supplied by the main grid to the microgrid is The following equation proposes a simplified dynamic model of the
defined as follows battery energy storage k at each time t.
( )
pgrid
t = real((YSS VS t + YSN VN t )⊤ VS t ) (14) ekt = ekt− 1 + pchar disch
kt − pkt Δt (18)

This variable defines the interchange of power with the main grid,
where pchar is the charging power, pdisch is the power at discharge, and ekt
and hence, it is essential for the optimization model. kt kt
is the energy stored by the batteries, considering a positive value if it
injects power to the microgrid and a negative value for the charging
mode. Δt is the time discretization (usually 1h). A quadratic model of the
3.2. Three-phase exponential load model
losses in the battery and the converter is proposed, considering effi­
ciencies of charge and discharge as follows:
Three-phase loads are represented by a general model that considers
constant power, constant current, and constant impedance [23]. This ( char )2
nchar
kt = achar
k pkt + bchar char
k pkt + ck
char
(19)
model can be described in terms of a constant α ∈ {0, 1, 2} as given in
(15) where 0 corresponds to constant power, 1 to constant current and 2 ( disch )2
ndisch = adisch pkt + bdisch pdisch + cdisch (20)
to constant impedance. Fractional values of αk are also allowed in the kt k k kt k

model.

4
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

this model is taken from data-sheets of batteries (see for example [24]). 4. Optimization problem
It is important to remark that acharge and adischarge are always positive.
Then, the active power delivered by the battery energy storage is given The proposed power flow requires a time series for wind speed, solar
by the following equations: irradiance, and power demand. The optimization model search for
( ) optimal use of energy storage devices as given below, where all variables
pchar disch
kt − pkt = real sbattery (21) depend on the time, and therefore, the subindex t is omitted in most of
the equations.
The model seeks to minimize the costs ct of the energy supplied by
3.6. Power and voltage limits
the primary grid. The model of each component and the grid itself are
also considered. For the sake of completeness, the entire model is pre­
Photovoltaic units, wind turbines, and battery energy storage devices
sented in Table 2 including the type of equation (notice that quadratic
are integrated into the microgrid through power electronic converters,
equality constraints are also non-convex).
as depicted in Fig 1. These converters can generate or consume reactive
The model presented in Table 2 is called, in this paper, as non-convex
power on the assumption that the current and apparent power is below
tertiary control model (hereafter called NC-TC Model). This model
its maximum.
contains some complex variables (e.g sk , vk and vm ) which simplifies its
Therefore, the apparent power is limited by the following constrain:
representation. However, it is important to remark that this is only a
‖ sdevice
k ‖≤ sdevice
max , ∀device ∈ {wind, solar, battery} (22) representation since an optimization model requires to be defined in an
ordered set (for example, the set Rn ). Therefore, each equality constraint
Notice that this constraint is convex. with complex variables must be separated into real and imaginary parts.
On the other hand, voltage limits are considered by the following This complex representation allows a simple formulation of the linear­
constraint: izations using Wirtinger’s calculus. The resulting linearizations can be
written directly in complex form, in packages such as cvxpy as explained
‖ vk − vnom ‖≤ δvnom (23)
in the next section.
where δ is the maximum voltage deviation according to the grid code.
4.1. Convex identification

3.7. Static reserve NC-TC model is non-linear and non-convex, and therefore, a convex
approximation is required. However, some parts of the model are
A static reserve is proposed in the model. This new concept is strongly already convex, for instance, affine equations. Power loss, grid power,
related to the energy stored by the batteries. It is applied because it and loss in the battery energy storage devices are all quadratic equality
needs to keep the system secure and in equilibrium when the system constraints. These equations define, in principle, non-convex sets.
changes from grid-connected to island operation. The static reserve However, they can be transformed into convex sets by replacing equality
guarantees a time of safe operation in which the demand of the micro­ for inequality constraints and noticing that these quadratic forms are all
grid can be supplied by the available generation and energy stored by convex. This approximation is suitable since the objective function in­
the batteries. Taking this criterion into account, a deficit dt of power cludes minimizing pgrid and hence, the inequality gap tends to be
provided by generators is defined as a function of the demand and the minimized.
power injected by the slack node to the microgrid as given in (24), The only remaining non-convex constraints are (11) and (15). These
∑ constraints will be linearized by using Wirtinger calculus as presented in
dt = sload
k − pgrid
t (24) the next subsection.
k∈N

Therefore, the energy stored by the batteries is limited by the 5. Convex model
following constraints:
∑ 5.1. Wirtinger’s linearization
ekt ≥ real(dt ) (25)
In general, an equality constraint is non-convex unless it is an affine
battery
k∈N

battery equation. Therefore, a linearization is recommended in order to


Where N ⊆N is the subset of nodes that have battery energy
storage. approximate the model to a convex set.
Let us consider a complex variable z = x + jy and a complex function
f(z) = u + jv. The Wirtinger’s derivate and the conjugate Wirtinger’s
Table 2
derivate are defined as follows:
Non-convex model for the tertiary control (NC-TC Model)
̂ ( ) ( )
Equation Type Characteristic ∂f 1 ∂u ∂v j ∂v ∂u
= + + − (26)
∑ grid objective function affine ∂z 2 ∂x ∂y 2 ∂x ∂y
min t ct p t
(11) load flow non-convex ( ) ( )
(12) power balance affine
̂
∂f 1 ∂u ∂v j ∂v ∂u
= − + + (27)
(13) power loss quadratic equality ∂z 2 ∂x ∂y 2 ∂x ∂y
(14) grid power quadratic equality
(15) load model non-convex These operators are very similar to the conventional derivatives,
(16) solar generation affine despite the fact that they are not derivatives in the Cauchy-Riemann
(17) wind generation affine
sense (see [25] and [26] for more details). More importantly, these
(18) energy balance affine
(19) battery charging quadratic equality operators allow a linearization on the complex numbers for
(20) battery discharge quadratic equality non-holomorphic functions such as (11) and (15).
(21) battery power affine A complex function linearization in terms of the Wirtinger’s opera­
(22) converter capacity second-order cone tors is defined as follows:
(23) voltage limits second-order cone
(24) power deficit affine
(25) static reserve affine

5
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

̂
∂f ̂
∂f
f ≈ f (z0 ) + Δz + Δz (28) SN t = K⋅V N t + L⋅VN t + U (38)
∂z ∂z
Precision of this approximation was evaluated in [20], where results
For example, a function f = vk vm can be linearized around a point vk0 ,
demonstrated errors less than 1 × 10− 3 in voltages. It is important to
vm0 as follows:
remark that the linearization is defined in the complex domain, there­
( )
fore, vk0 must consider the phase (i.e., e0j for phase A, e− 2π/3j for phase B
f vk , vm = vk vm (29)
and e2π/3j for phase C).

≈ vk0 vm0 + vm0 Δvk + vk0 Δvm (30) 5.3. Wirtinger’s linearization for exponential loads
( )
= vk0 vm0 + vm0 vk − vk0 + Equation (15) can be also linearized using Wirtinger’s calculus. The
(31)
non-linear term in this expression is given by (39).
vk0 (vm − vm0 )
( )α2
= vm0 vk + vk0 vm − vk0 vm0 (32) ‖ vk ‖α = vk vk (39)

Notice that Wirtinger’s derivatives fulfill the basic properties for dif­ Linearizing around vk0 the following expression is obtained
ferentiation known from real-valued analysis concerning the linearity,
( )α2 ( )α2 ̂
product rule and composition of functions. ∂ ‖ vk ‖α ̂
∂ ‖ vk ‖α
vk vk ≈ vk0 vk0 + Δvk + Δvk
∂vk ∂vk
(40)
( )α2− 1 ( )
5.2. Wirtinger’s Linearization of the power flow equations ( )α α
= vk0 v*k0 2 + vk0 vk0 vk0 Δvk + vk0 Δvk
2
The linearization presented in (32) can be used for linearizing (11),
as follows: Considering that the voltages of the system are near of the nominal
value, a good point of linearization is vk0 = vnom ejϕ as the complex
∑ ∑ ( )
skt = vkt ymk vmt + ykm vm0 vk + vk0 vm − vk0 vm0 (33) nominal voltage, where ϕ is 0, − 2π/3 or 2π/3 according to the phase.
m∈S m∈N Therefore, the nonlinearity of the ZIP load model is represented linearly
by the following expression:
After simple algebraic manipulations the following matrix repre­
sentation is obtained: ( )α2
vk vk ≈ (vnom )α +
SN t =(diag(Y
( )S ⋅VS t )⋅V N t + diag(YN ⋅V
(N 0 )⋅V N t +
) ( ( )) (41)
(34) α nom α− 2 nom − jϕ ( )
diag V N 0 ⋅YN )⋅VN t − diag(VN 0 )⋅ YN ⋅V N 0 (v ) v e vk − vnom ejϕ + vnom ejϕ vk − vnom e− jϕ
2

Equation (34) defines an affine space which constitutes an approxima­ Then, simplifying (41), the following equation is obtained:
tion of the power flow. The following matrices are defined in order to ( )α2
simplify the nomenclature:
vk vk = (vnom )α +
K = diag(YS VS ) + diag(YN ⋅VN 0 ) (35) ( ) (42)
α
( ) (vnom )α− 2
vnom e− jϕ vk + vnom ejϕ vk − 2(vnom )2
2
L = diag V N 0 ⋅YN (36)
Therefore, (15) is replaced by the following affine equation:
( ) ( )
U = − diag(VN 0 )⋅ YN ⋅V N 0 (37) SNloadt = SNZIPt ∘ M + HVN t + TV N t (43)

Therefore, Constraint (11) is transformed into the following affine where ∘ represents the Hadamard product and M, H, T are constant
equation: vectors given by

Table 3 M= diag(1 − α) (44)


Convex model for the tertiary control (Convex-TC) ( α )
Equation Type Modification
H = diag (45)
2vnom ejϕ
∑ grid objective function affine
t ct p t
min ( α )
(38) load flow non-convex T = diag (46)
2v e− jϕ
nom
(12) power balance affine
(13) power loss quadratic inequality
For the sake of completeness, the model with all the aforementioned
(14) grid power quadratic inequality
(43) load model affine approximations is presented in Table 3.
(16) solar generation affine This model will be called Convex-TC in the following sections in
(17) wind generation affine order to differentiate from the NC-TC model. Notice that, the objective
(18) energy balance affine function includes a quadratic function with a positive definite matrix.
(19) battery charging quadratic inequality
(20) battery discharge quadratic inequality
This property is guaranteed if the hypergraph is connected. Therefore,
(21) battery power affine the function is strongly convex, and this implies a global optimum and
(22) converter capacity second-order cone unique solution. In addition, the quadratic inequality constraints are
(23) voltage limits second-order cone also convex.
(24) power deficit affine
(25) static reserve affine

6
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

5.4. Operation under surplus energy limitation


Table 4
Loads description according to the exponential load model
Some grid codes prevent the sale of surpluses of energy. In these
Node Peak power demand (W) α
cases, the model must be limited with an additional constrain in order to
prevent the power in the slack node becomes negative. The optimization 11 13400 2
model is modified in order to include this constraint as follows: 13 47000 0
14 40000 2
∑ grid
min ct pt 18 70900 0
t 19 15600 1
( )
real pgrid
t ≥0 (47)
( grid )
imag pt ≥0
+ all constrains of Convex-TC
When the available energy is higher than the total load, the micro­
grid remains connected to the main grid, but the active and reactive
power interchanged between the grid, and the microgrid is zero.

6. Results

6.1. CIGRE low voltage benchmark test system

A modified version of the benchmark test system for low-voltage


microgrids proposed by CIGRE in [27] was initially used to illustrate
Fig. 4. Prices from XM S.A.S, Colombian national interconnected system
the use of the model and its performance. This system is a 19-nodes,
operator. Real time pricing for 24 consecutive hours in 2019.
typical residential network with a peak power demand of 186.9 kW
and a nominal voltage of 400V. The system was modified to include
renewable generation and energy storage devices, as depicted in Fig 3.

Fig. 3. The CIGRE low voltage benchmark test system.

7
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

The exponential model described in subsection 3.2 was used for the
loads, with values of α given in Table 4. The system was analyzed for
operation in 24h with intervals of 1h; a variable energy cost ct was
considered as shown in Figure 4.
Two main cases were analyzed, namely:

Case 1 (surplus sale): in this case, the slack node can inject and
receive power from the microgrid; the
optimization model decides the purchase
or sale of energy, according to market
prices and the generation and demand
conditions of the microgrid.
Case 2 (without surplus sale): in this case, the slack node is limited to Fig. 6. Optimal solar generation () and available solar generation () for the
only supply power, i.e., the microgrid Case 1. The algorithm always takes the maximum solar generation.
cannot inject power to the main grid.
This type of limitation is due to some
grid codes that are restrictive in terms of
surplus sales.

6.2. Case 1 (surplus sale)

The behavior of the TC for this case is shown in Fig 5, where pgrid is
the power taken or sold to the main grid, and pER represents the power
provided by the photovoltaic units, wind turbines, and batteries. As a
result, the microgrid takes power from the main grid in periods where
the renewable generation and batteries can not satisfy the load or when
the energy has a low price. Eventually, the microgrid sold power to the
system when the generator can supply the load, and there is an excess of
generation.
The photovoltaic generation uses all its available resources, injecting Fig. 7. Optimal wind generation () and available wind generation () for Case 1.
the maximum amount of power that the irradiance profile allows in all The algorithm always take the maximum available power.
the periods. The behavior of the photovoltaics units is represented in Fig
6.
Wind turbines have the same behavior as photovoltaic sources, as
shown in Fig 7. These use the available wind speed profile, giving a
result where the turbine can provide the maximum power in each period
according to the wind speed forecast.
Finally, and considering an initial batteries SOC of 50%, these have a
response to the load, as shown in Fig 8.
Notice that all batteries have similar behavior; they charge
completely in periods of low prices, low demand and/or high genera­
tion, to discharge in periods with high demand when the prices are
higher.

6.3. Case 2 (without surplus sale)

The power provided by the slack node is limited in all the periods of
Fig. 8. Energy stored in each battery for Case 1, considering the SOC of the
the tertiary control. This constraint is represented as follows: batteries between 30% and 100% of the batteries energy.
pgrid
t ≥0 (48)

Fig. 5. Tertiary control the slack node (), load demand () and power PER () for Fig. 9. Energy exchange with the main grid (), total generation () and total
the Case 1. demand () for Case 2.

8
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

Table 5
Performance comparison between different solvers.
Case Solver Execution Iterations Operative cost Status
time (s) ($)

Mosek 0.13 17 -146340.52 Optimal


Case ECOS 0.19 33 -146340.52 Optimal
I ECOS 0.35 33 -146340.52 Optimal
BB
SCS 1.55 2560 Solved/
Inaccurate
Mosek 0.32 36 7887.18 Optimal
Case ECOS 0.12 21 7887.18 Optimal
II ECOS 0.18 21 7887.18 Optimal
BB
Fig. 10. Optimal power generation () and available power solar generation () SCS 3.1 121 Solved/
for Case 2. The solar panels reduce their generation during the peak in order to Inaccurate
maintain islanded operation.

the balance in periods that the load power overtakes the generation, as
shown in Fig 12; in these periods, the tertiary control requires to mini­
mize the purchase of energy to the main grid and reduce costs in the
peak of demand.

6.4. Software implementation

All numerical experiments were performed in CvxPy, a domain-


specific language for convex optimization embedded in Python [28].
This module allows to write the model in a natural optimization syntax
and call free and/or commercial packages to solve the problem.
Fig. 11. Optimal wind generation () and available wind generation () for Case Different solvers were used to comparing the model performance in
2. The wind turbines reduce their generation maintaining the islanded opera­ terms of operative cost and execution time. Results are presented in
tion an the balance between generation and power demand.
Table 5, using a personal computer with 64-bit Operating system and
processor Intel (R) Core (TM) i7-8700 CPU, 3.20 GHz, and 8GB of RAM.
Except for SCS, all solvers achieve the same optimal solution,
although with different time calculations and number of iterations. The
model achieves the same global solution as was expected for convex
optimization models. Time calculation was less than 1s for the solvers in
which the model achieves convergence. This performance is important
because a tertiary control must be executed in real-time, with the ar­
chitecture already depicted in Fig 1.
In practice, the optimization model is executed by a central
controller that may be a personal computer or even a small single-board
computer. Results presented in Table 5 demonstrate the proposed model
is suitable for the former case. However, it is crucial to evaluate the
model performance for a single-board computer.
In this work, a Raspberry-pi is proposed as a central controller; this is
a low-cost small single-board computer used in industrial applications.
Fig. 12. Energy stored in each battery for Case 2, considering the SOC of the The computation power of such a small device is much lower compared
batteries between 30% and 100% of the batteries energy. to a personal computer. However, it has some practical advantages,
namely: the size of this board is 65mm x 30mm, so it can be integrated,
for example, into the measurement unit of the microgrid; its cost is more
Therefore, renewable generation never overtakes the load demand, than 20 times lower than a personal or industrial computer; it does not
and the microgrid can not inject power into the main grid. In the periods have, nor does it require, additional elements such as graphic or sound
that the demand exceeds the maximum renewable generation and the cards; in general, it can be used as an embedded application for central
power that the batteries can provide, the main grid injects power to the control.
microgrid to supply the loads, as shown in Fig 9. All simulations presented in Section 6 were executed again in a
The photovoltaic generation uses almost all of its available resources, Rasberry-pi model BV 1.2 with a 1.2 GHz 64-bit quad-core processor,
limiting its generation in periods of maximum irradiance, as depicted in onboard 802.11n WiFi, Bluetooth, and USB boot capabilities. This board
Fig 10. In this way, the microgrid keeps an equilibrium between gen­ uses a Linux operative system and includes a Python interpreter. This
eration and demand. Likewise, wind turbines reduce their generation to Rasberry-pi allowed the installation of the module CvxPy for solving the
balance the load and generation. The behavior related to the wind tur­ optimization problems. The solver ECOS was used since this solver was
bines is shown in Fig 11. explicitly designed for embedded applications [29]. For Case 1, the same
Eventually, the SOC and the batteries’ initial state is the same as in results as Section 6 were obtained 24.6 seconds; for Case 2, the same
the previous case. The batteries tend to charge up when existing a sur­ results were obtained in 33.93 seconds. In both cases, the response of the
plus of power supplied by the generation, seizing all the resources. convex-TC implementation was suitable for real-time requirements
However, the batteries try to inject power to the microgrid to maintain mentioned in section 2.

9
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

Fig. 13. Modified IEEE123 test distribution system

6.5. Extension to power distribution networks

Although the proposed model was explicitly designed for microgrids,


it may be extended to large power distribution systems; therefore, nu­
merical experiments were performed in a modified version of the IEEE
123 node test feeder [30]. This model includes overhead and under­
ground single-phase lines, capacitor banks, unbalanced loads with
constant current, constant impedance, and constant power models. This
test system was modified to include wind and solar energy and battery
energy storage, as shown in Fig 13.
The proposed algorithm was executed under the same considerations
as Case 1, using a personal computer with a 64-bit Operating system and
processor Intel (R) Core (TM) i7-8700 CPU, 3.20 GHz, and 8GB of RAM.
Fig. 14. General results for the IEEE 123 node test system. The model, in this case, consists of 197040 constraints, with 32736
convex cones and 196656 scalar variables. Despite its large size, the
problem was solved in 2.26 seconds on average. Figure 14 shows the
cycle of charge and discharge of battery energy storage devices. Results
for each distributed resource are depicted in Fig 15.

7. Conclusions

In this paper, an convex optimization model for the tertiary control


of unbalanced microgrids was proposed. This model considered 24h
operation with unbalanced loads; Also, it considered a realistic model of
the loads, renewable energy sources, and storage devices. A Wirtinger
linearization was used for the power flow equations, the exponential
model of the loads, and the quadratic model of the battery energy
storage. The method was implemented under changing wind and solar
Fig. 15. Total power generation for each distributed resource in the IEEE 123
energy penetration. The proposed methodology ensured the optimum
node test system.
operation of the microgrid components.

10
D.-A. Ramirez et al. Electric Power Systems Research 199 (2021) 107423

A real-time, low-cost, accurate implementation of the model was also https://doi.org/10.1016/j.epsr.2020.106414.http://www.sciencedirect.com/sci


ence/article/pii/S0378779620302200
considered. A Raspberry-pi was proposed as a central controller. The
[9] L. Bobo, A. Venzke, S. Chatzivasileiadis, Second-order cone relaxations of the
computation power of such a small device is much lower compared to a optimal power flow for active distribution grids: Comparison of methods,
personal computer. However, the proposed model was executed suc­ International Journal of Electrical Power and Energy Systems 127 (2021) 106625,
cessfully in this device. In this way, it was demonstrated the proposed https://doi.org/10.1016/j.ijepes.2020.106625.http://www.sciencedirect.com/sci
ence/article/pii/S0142061520341703
model might be used for real-time operation. This implementation was a [10] A. Venzke, S. Chatzivasileiadis, D.K. Molzahn, Inexact convex relaxations for ac
proof of concept under the worst-case scenario. optimal power flow: Towards ac feasibility, Electric Power Systems Research 187
An intelligent predictor system based on prevision weather data (2020) 106480, https://doi.org/10.1016/j.epsr.2020.106480.http://www.scienc
edirect.com/science/article/pii/S0378779620302832
(wind speed, solar irradiance, and temperature) has to be designed in [11] S. Li, W. Gong, L. Wang, X. Yan, C. Hu, Optimal power flow by means of improved
further work. Prediction uncertainties on the renewable energies and adaptive differential evolution, Energy 198 (2020) 117314, https://doi.org/
load demand predictions have to be considered to design an autonomous 10.1016/j.energy.2020.117314.http://www.sciencedirect.com/science/article/
pii/S0360544220304217
system for an isolated area. [12] Z. Deng, M.D. Rotaru, J.K. Sykulski, Kriging assisted surrogate evolutionary
computation to solve optimal power flow problems, IEEE Transactions on Power
Founding Systems 35 (2) (2020) 831–839, https://doi.org/10.1109/TPWRS.2019.2936999.
[13] K. Srensen, Metaheuristics the metaphor exposed, International Transactions in
Operational Research 22 (1) (2015) 3–18, https://doi.org/10.1111/itor.12001.
This research result is funded by UTP and the Colombian Science https://onlinelibrary.wiley.com/doi/abs/10.1111/itor.12001
Ministry (Minciencias), project 111077657914, contract 031-2018, and [14] J.C. Bedoya, Y. Wang, C.-C. Liu, Distribution system resiliency under asynchronous
information using reinforcement learning, IEEE Transactions on Power Systems
project 321-2019.
(2021), https://doi.org/10.1109/TPWRS.2021.3056543.1–1
[15] W. Liu, P. Zhuang, H. Liang, J. Peng, Z. Huang, Distributed economic dispatch in
CRediT authorship contribution statement microgrids based on cooperative reinforcement learning, IEEE Transactions on
Neural Networks and Learning Systems 29 (6) (2018) 2192–2203.
[16] A. Venzke, G. Qu, S. Low, S. Chatzivasileiadis, Learning optimal power flow: Worst-
Diego-Alejandro Ramirez: Methodology, Software, Writing - orig­ case guarantees for neural networks, 2020, 2006.11029.
inal draft. Alejandro Garcés: Conceptualization, Methodology, Writing [17] D. Groppi, A. Pfeifer, D.A. Garcia, G. Krajačić, N. Duic, A review on energy storage
- original draft, Validation. Juan-José Mora-Flórez: Validation, Writing and demand side management solutions in smart energy islands, Renewable and
Sustainable Energy Reviews 135 (2021) 110183, https://doi.org/10.1016/j.
- original draft, Writing - review & editing. rser.2020.110183.http://www.sciencedirect.com/science/article/pii/S136403212
0304731
Declaration of Competing Interest [18] D. Wang, J. Qiu, L. Reedman, K. Meng, L.L. Lai, Two-stage energy management for
networked microgrids with high renewable penetration, Applied Energy 226
(2018) 39–48, https://doi.org/10.1016/j.apenergy.2018.05.112.http://www.sci
The authors declare that they have no known competing financial encedirect.com/science/article/pii/S0306261918308328
interests or personal relationships that could have appeared to influence [19] P. Vergara, J.C. Lopez, M.J. Rider, H.R. Shaker, L.C. da Silva, B.N. Jorgensen,
A stochastic programming model for the optimal operation of unbalanced three-
the work reported in this paper. phase islanded microgrids, International Journal of Electrical Power and Energy
Systems 115 (2020) 105446, https://doi.org/10.1016/j.ijepes.2019.105446.
References http://www.sciencedirect.com/science/article/pii/S0142061519306234
[20] D. Ramirez, A. Garces, J. Mora-Florez, A wirtinger linearization for the power flow
in microgrids. IEEE General Meeting 2019, Atlanta, Georgia, August 2019, 2019.
[1] M.F. Zia, E. Elbouchikhi, M. Benbouzid, Microgrids energy management systems: A
[21] M. Saleh, Y. Esa, M.E. Hariri, A. Mohamed, Impact of information and
critical review on methods, solutions, and prospects, Applied Energy 222 (2018)
communication technology limitations on microgrid operation, Energies 12 (15)
1033–1055, https://doi.org/10.1016/j.apenergy.2018.04.103.http://www.scienc
(2019), https://doi.org/10.3390/en12152926.https://www.mdpi.com/1996-1
edirect.com/science/article/pii/S0306261918306676
073/12/15/2926
[2] F. Capitanescu, Critical review of recent advances and further developments
[22] S. Lab, An1138: Zigbee mesh network performance, AN1138 (2019).
needed in ac optimal power flow, Electric Power Systems Research 136 (2016)
[23] M. Bazrafshan, N. Gatsis, Comprehensive modeling of three-phase distribution
57–68, https://doi.org/10.1016/j.epsr.2016.02.008.http://www.sciencedirect.co
systems via the bus admittance matrix, IEEE Transactions on Power Systems 33 (2)
m/science/article/pii/S0378779616300141
(2018) 2015–2029, https://doi.org/10.1109/TPWRS.2017.2728618.
[3] Y. Tang, K. Dvijotham, S. Low, Real-time optimal power flow, IEEE Transactions on
[24] SMA, Technical information for efficiency and derating of Sunny Boy storage, SMA,
Smart Grid 8 (6) (2017) 2963–2973, https://doi.org/10.1109/TSG.2017.2704922.
2019.
[4] F. Delfino, G. Ferro, M. Robba, M. Rossi, An architecture for the optimal control of
[25] R. Remmert, Theory of Complex Functions 1, volume 1, Springer-Verlag, New
tertiary and secondary levels in small-size islanded microgrids, International
York, 1989.
Journal of Electrical Power and Energy Systems 103 (2018) 75–88, https://doi.
[26] R. Hunger, An introduction to complex differentials and complex differentiability,
org/10.1016/j.ijepes.2018.05.026.http://www.sciencedirect.com/science/article/
technical report (2007).https://mediatum.ub.tum.de/doc/631019/631019.pdf
pii/S0142061517330090
[27] S. Papathanassiou, N. Hatziargyriou, K. Strunz, A benchmark low voltage
[5] D.Y. Yamashita, I. Vechiu, J.-P. Gaubert, A review of hierarchical control for
microgrid network, CIGRE Symposium (2005).
building microgrids, Renewable and Sustainable Energy Reviews 118 (2020)
[28] S. Diamond, S. Boyd, CVXPY: A Python-embedded modeling language for convex
109523, https://doi.org/10.1016/j.rser.2019.109523.http://www.sciencedirect.
optimization, Journal of Machine Learning Research 17 (83) (2016) 1–5.
com/science/article/pii/S1364032119307312
[29] A. Domahidi, E. Chu, S. Boyd, Ecos: An socp solver for embedded systems. 2013
[6] F. Zohrizadeh, C. Josz, M. Jin, R. Madani, J. Lavaei, S. Sojoudi, A survey on conic
European Control Conference (ECC), 2013, pp. 3071–3076, https://doi.org/
relaxations of optimal power flow problem, European Journal of Operational
10.23919/ECC.2013.6669541.
Research 287 (2) (2020) 391–409, https://doi.org/10.1016/j.ejor.2020.01.034.
[30] K.P. Schneider, B.A. Mather, B.C. Pal, C. Ten, G.J. Shirek, H. Zhu, J.C. Fuller, J.L.
http://www.sciencedirect.com/science/article/pii/S0377221720300552
R. Pereira, L.F. Ochoa, L.R. de Araujo, R.C. Dugan, S. Matthias, S. Paudyal, T.
[7] D.K. Molzahn, I.A. Hiskens, A survey of relaxations and approximations of the
E. McDermott, W. Kersting, Analytic considerations and design basis for the ieee
power flow equations, Foundations and Trends®in Electric Energy Systems 4 (1-2)
distribution test feeders, IEEE Transactions on Power Systems 33 (3) (2018)
(2019) 1–221, https://doi.org/10.1561/3100000012.https://doi.org/10.1561/3
3181–3188, https://doi.org/10.1109/TPWRS.2017.2760011.
100000012
[8] Z. Yuan, M. Paolone, Properties of convex optimal power flow model based on
power loss relaxation, Electric Power Systems Research 186 (2020) 106414,

11

You might also like