3.3 P-update step

3. Sequential distributed consensus-based ADMM approach

min∑ M i¼1 fi

s:t:∑ M i¼1

3.1 Multi-agent system description for smart grid

3.2 Reformulation of smart grid optimization problems

M i¼1

� �

μiPi ¼ ξ

0 : P∈ Π<sup>1</sup> ∞ : P∉ Π<sup>1</sup>

<sup>Π</sup><sup>1</sup> <sup>¼</sup> <sup>P</sup><sup>∈</sup> <sup>R</sup><sup>M</sup> : <sup>∑</sup>

together with their indicator functions [24]

(

min∑ M i¼1 fi

I1ð Þ¼ P

Hence, (25) can be rewritten as follows:

following subproblems

Research Trends and Challenges in Smart Grids

this section.

global and local constraints:

36

As mentioned in Section 2, the optimization problem (1) will be solved by a sequential approach presented in the current section, which separates (1) into the

and solves them starting from t ¼ 1 until t ¼ N. Thus, (25) is well-defined and

The SDC-ADMM approach is based on MAS and consensus theory so that it can

To develop the SDC-ADMM approach, (25) is first reformulated into the 2-block form of ADMM. The following closed convex sets are defined corresponding to the

I2ð Þ¼ X

(

, <sup>Π</sup><sup>2</sup> <sup>¼</sup> <sup>X</sup> <sup>∈</sup> <sup>R</sup><sup>M</sup> : Xi <sup>∈</sup> <sup>Ω</sup><sup>i</sup> � �

> 0 : X ∈ Π<sup>2</sup> ∞ : X ∉ Π<sup>2</sup>

ð Þþ Pi I1ð Þþ P I2ð Þ X (28)

s:t:P � X ¼ 0 (29)

description for smart grid needs to be introduced first. More specifically, each agent is assigned to a generation or demand unit, and the communication among agents is represented by an undirected graph ℊ. Each node represents a unit in the grid whose variable is xi or ξ, and each edge represents the communication between two nodes. For each node i, denote ℵ<sup>i</sup> its neighbor set and ℵ<sup>i</sup> j j the cardinality of ℵi.

be run in parallel in all generation and consumption units. Hence, the MAS

the time index t can be dropped for conciseness. Then to solve (25), existing methods can be utilized, e.g., gradient-based methods, dual decomposition method, etc. Nevertheless, an approach called sequential distributed consensus-based ADMM (SDC-ADMM), which combines the advantages of the aforementioned methods [24] and avoids problems of centralized approaches, will be proposed in

ð Þ xið Þt (25)

μixiðÞ¼ t ξð Þt (26)

xið Þt ∈ Ωið Þt (27)

The update of P in (30) is in fact equivalent to solving the following convex optimization problem:

$$\min\_{P} \sum\_{i=1}^{M} f\_i(P\_i) + \frac{\rho}{2} \left\| P - X^k + u^k \right\|\_2^2 \tag{33}$$

$$\text{s.t.} \sum\_{i=1}^{M} \mu\_i P\_i = \xi \tag{34}$$

of which the strong duality holds [25]. Let λ<sup>k</sup>þ<sup>1</sup> be the Lagrange multiplier associated with (34) and λ <sup>k</sup>þ<sup>1</sup> its optimal value, at the iteration <sup>k</sup> <sup>þ</sup> 1 of the SDC-ADMM algorithm. Then the Karush-Kuhn-Tucker (KKT) conditions can be used to find Pkþ<sup>1</sup> from the following equations:

$$\left. \frac{\partial f\_i(P\_i)}{\partial P\_i} \right|\_{P\_i = P\_i^{k+1}} + \rho \left( P\_i^{k+1} - X\_i^k + u\_i^k \right) = \overline{\lambda}^{k+1} \mu\_i \tag{35}$$

$$\sum\_{i=1}^{M} \mu\_i P\_i^{k+1} = \xi \tag{36}$$

Proof: Similar to the proof of Theorem 1 in [26], so it is omitted here for brevity. ■ Remark 1: If ξðÞ¼ t 0, then zMþ<sup>1</sup> is not needed, and hence, there are only M

<sup>M</sup> , z∗,<sup>2</sup> <sup>¼</sup> <sup>∑</sup><sup>M</sup>

<sup>i</sup>¼1a^<sup>i</sup> M

 2

i

<sup>2</sup> (42)

<sup>k</sup>þ<sup>1</sup> by (41);

(44)

s:t:X ∈ Π<sup>2</sup> (43)

s:t:Xi ∈ Ω<sup>i</sup> (45)

agents in the consensus problem in Theorem 1. Accordingly,

DOI: http://dx.doi.org/10.5772/intechopen.84136

3.4 X-update step

programming:

<sup>z</sup>∗, <sup>1</sup> <sup>¼</sup> <sup>∑</sup><sup>M</sup>

min X

needs to solve a local scalar-constrained quadratic programming:

min Xi

solution [26]. Similar results are obtained for the PSwEV problem.

which is easily solved by existing methods.

3.5 Algorithm summarization

While 1≤ t ≤ N do

For k ¼ 1, …, max\_iter do %P-update step

%X-update step

%u-update step

end end end

39

Each agent calculates a^<sup>i</sup> and ^

%Check the stopping criteria if the stopping criteria are true then

break;

a summary for the algorithm is provided.

Algorithm 2: SDC-ADMM algorithm for solving (1).

Each agent determines its local constraint set Ωið Þt ;

Each agent updates its variable P<sup>k</sup>þ<sup>1</sup> <sup>i</sup> as in (37);

Each agent updates its variable ukþ<sup>1</sup> <sup>i</sup> as in (32);

bi, or ξ;

Each agent updates its variable X<sup>k</sup>þ<sup>1</sup> <sup>i</sup> by solving (44) and (45);

All agents run the consensus law (39) with initial values (38), then compute λ

Pkþ<sup>1</sup>

i¼1 ^ bi

A Distributed Optimization Method for Optimal Energy Management in Smart Grid

The update of X in (31) is obtained by solving a constrained quadratic

<sup>P</sup>kþ<sup>1</sup> � <sup>X</sup> <sup>þ</sup> uk 

Further, (42) and (43) is decentralized because both the cost function (42) and the constraint (43) are individually decomposable. Therefore, each agent (unit) just

<sup>i</sup> � Xi <sup>þ</sup> uk

<sup>2</sup>

For the DSWM problem, (45) is simply an interval, and Xi has an analytical

The convergence of the proposed SDC-ADMM algorithm can be proved in a similar manner to that in [26]; hence it is ignored here for brevity. In the following,

Since fi ð Þ Pi are known, <sup>P</sup>kþ<sup>1</sup> <sup>i</sup> can be easily determined from (35). To find λ kþ1 , the values of Pkþ<sup>1</sup> <sup>i</sup> computed from (35) are substituted into (36). Usually, fi ð Þ Pi are chosen to be linear or quadratic functions for simplicity. Hence, the first term on the left-hand side of (35) is in the form of a linear function of Pkþ<sup>1</sup> <sup>i</sup> , denoted by eai Pkþ<sup>1</sup> <sup>i</sup> þ ebi . This leads to

$$\overline{\hat{\lambda}}^{k+1} = \frac{\xi + \sum\_{i=1}^{M} \hat{b}\_i}{\sum\_{i=1}^{M} \hat{a}\_i} \tag{37}$$

where <sup>a</sup>^<sup>i</sup> <sup>≜</sup> <sup>μ</sup><sup>2</sup> i <sup>a</sup>~iþ<sup>ρ</sup> , ^ bi <sup>≜</sup> <sup>μ</sup>i<sup>ρ</sup> �X<sup>k</sup> <sup>i</sup> <sup>þ</sup>uk ð Þ<sup>i</sup> <sup>þ</sup>μ<sup>i</sup> ~ bi <sup>a</sup>~iþ<sup>ρ</sup> . The optimal value of <sup>λ</sup><sup>k</sup>þ<sup>1</sup> shown in (37) is a global variable because the information of all variables are needed. Therefore, in order to calculate it in a distributed manner, consensus theory is employed where each unit in the grid corresponding to a variable is represented by an agent which exchange its parameters a^<sup>i</sup> and ^ bi and ξ (if ξ 6¼ 0) with a few neighbors in each iteration k of the SDC-ADMM algorithm. This is introduced in the following theorem:

Theorem 1. Given a connected undirected communication graph ℊ among agents, the initial conditions of agents are set to be

$$\begin{aligned} \mathbf{z}\_i(\mathbf{0}) &= \left[\hat{\boldsymbol{b}}\_i, \hat{\boldsymbol{a}}\_i\right]^T, i = \mathbf{1}, \dots, M \\\\ \mathbf{z}\_{M+1}(\mathbf{0}) &= \left[\boldsymbol{\xi}, \mathbf{0}\right]^T \end{aligned} \tag{38}$$

Consequently, the following consensus law is utilized:

$$z(l+\mathbf{1}) = w\_{\vec{\imath}i}z\_{\vec{\imath}}(l) + \sum\_{j \in \mathbb{N}} w\_{\vec{\jmath}i} z\_{\vec{\jmath}}(l) \tag{39}$$

where wij are Metropolis weights [27] defined by

$$w\_{\vec{\eta}} = \begin{cases} 1/(\mathbf{1} + \max\left(|\mathbb{N}\_i|, |\mathbb{N}\_{\vec{\eta}}|\right)) & : j \in \mathbb{N}\_i \\ 1 - \sum\_{j \in \mathbb{N}\_i} w\_{\vec{\eta}} & : j = i \\ 0 & : \text{ otherwise} \end{cases} \tag{40}$$

Then the consensus of all agents is achieved, where the consensus states are

$$z\_{\*,1} = \frac{\xi + \sum\_{i=1}^{M} \hat{b}\_i}{M+1}, z\_{\*,2} = \frac{\sum\_{i=1}^{M} \hat{a}\_i}{M+1}$$

Thus, the optimal Lagrange multiplier can be obtained in a distributed manner by

$$\overline{\lambda}^{k+1} = \frac{\mathbb{Z}\_{\*,1}}{\mathbb{Z}\_{\*,2}} \tag{41}$$

A Distributed Optimization Method for Optimal Energy Management in Smart Grid DOI: http://dx.doi.org/10.5772/intechopen.84136

Proof: Similar to the proof of Theorem 1 in [26], so it is omitted here for brevity. ■ Remark 1: If ξðÞ¼ t 0, then zMþ<sup>1</sup> is not needed, and hence, there are only M agents in the consensus problem in Theorem 1. Accordingly,

$$z\_{\*,1} = \frac{\sum\_{i=1}^{M} \hat{b}\_i}{M}, z\_{\*,2} = \frac{\sum\_{i=1}^{M} \hat{a}\_i}{M}$$

### 3.4 X-update step

∂fi ð Þ Pi ∂Pi

Research Trends and Challenges in Smart Grids

ð Þ Pi are known, <sup>P</sup>kþ<sup>1</sup>

. This leads to

i <sup>a</sup>~iþ<sup>ρ</sup> , ^

exchange its parameters a^<sup>i</sup> and ^

bi <sup>≜</sup> <sup>μ</sup>i<sup>ρ</sup> �X<sup>k</sup>

agents, the initial conditions of agents are set to be

Since fi

eai Pkþ<sup>1</sup> <sup>i</sup> þ ebi

the values of Pkþ<sup>1</sup>

where <sup>a</sup>^<sup>i</sup> <sup>≜</sup> <sup>μ</sup><sup>2</sup>

theorem:

manner by

38

� � � � Pi¼Pkþ<sup>1</sup> i

<sup>þ</sup> <sup>ρ</sup> <sup>P</sup>kþ<sup>1</sup>

μiP<sup>k</sup>þ<sup>1</sup>

chosen to be linear or quadratic functions for simplicity. Hence, the first term on

<sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>ξ</sup> <sup>þ</sup> <sup>∑</sup><sup>M</sup>

global variable because the information of all variables are needed. Therefore, in order to calculate it in a distributed manner, consensus theory is employed where each unit in the grid corresponding to a variable is represented by an agent which

iteration k of the SDC-ADMM algorithm. This is introduced in the following

zið Þ¼ <sup>0</sup> ^

zMþ<sup>1</sup>ð Þ¼ <sup>0</sup> ½ � <sup>ξ</sup>; <sup>0</sup> <sup>T</sup>

z lð Þ¼ þ 1 wiiziðÞþl ∑

1= 1 þ max ℵ<sup>i</sup> j j; ℵ<sup>j</sup>

Consequently, the following consensus law is utilized:

where wij are Metropolis weights [27] defined by

8 >>><

>>>:

1 � ∑ j ∈ ℵ<sup>i</sup>

<sup>z</sup>∗, <sup>1</sup> <sup>¼</sup> <sup>ξ</sup> <sup>þ</sup> <sup>∑</sup><sup>M</sup>

wij ¼

Theorem 1. Given a connected undirected communication graph ℊ among

bi; a^<sup>i</sup> h i<sup>T</sup>

~ bi ∑<sup>M</sup> <sup>i</sup>¼<sup>1</sup>a^<sup>i</sup>

∑ M i¼1

the left-hand side of (35) is in the form of a linear function of Pkþ<sup>1</sup>

λ

<sup>i</sup> <sup>þ</sup>uk ð Þ<sup>i</sup> <sup>þ</sup>μ<sup>i</sup>

<sup>i</sup> � <sup>X</sup><sup>k</sup>

<sup>i</sup> computed from (35) are substituted into (36). Usually, fi

i¼1 ^ bi

<sup>i</sup> <sup>þ</sup> <sup>u</sup><sup>k</sup> i

<sup>i</sup> can be easily determined from (35). To find λ

<sup>a</sup>~iþ<sup>ρ</sup> . The optimal value of <sup>λ</sup><sup>k</sup>þ<sup>1</sup> shown in (37) is a

bi and ξ (if ξ 6¼ 0) with a few neighbors in each

, i ¼ 1, …, M

j∈ ℵ<sup>i</sup>

� � � � � � � � : <sup>j</sup><sup>∈</sup> <sup>ℵ</sup><sup>i</sup>

wij : j ¼ i

<sup>i</sup>¼<sup>1</sup>a^<sup>i</sup> M þ 1

0 : otherwise

Then the consensus of all agents is achieved, where the consensus states are

i¼1 ^ bi <sup>M</sup> <sup>þ</sup> <sup>1</sup> , z∗, <sup>2</sup> <sup>¼</sup> <sup>∑</sup><sup>M</sup>

Thus, the optimal Lagrange multiplier can be obtained in a distributed

λ

<sup>k</sup>þ<sup>1</sup> <sup>¼</sup> <sup>z</sup>∗, <sup>1</sup> z∗, <sup>2</sup> kþ1

<sup>i</sup> ¼ ξ (36)

μ<sup>i</sup> (35)

<sup>i</sup> , denoted by

kþ1 ,

ð Þ Pi are

(37)

(38)

(40)

(41)

wijzjð Þl (39)

� � <sup>¼</sup> <sup>λ</sup>

The update of X in (31) is obtained by solving a constrained quadratic programming:

$$\min\_{\mathbf{X}} \left\| P^{k+1} - \mathbf{X} + \boldsymbol{u}^k \right\|\_2^2 \tag{42}$$

$$\text{s.t.}\\X \in \Pi\_2 \tag{43}$$

Further, (42) and (43) is decentralized because both the cost function (42) and the constraint (43) are individually decomposable. Therefore, each agent (unit) just needs to solve a local scalar-constrained quadratic programming:

$$\min\_{X\_i} \left( P\_i^{k+1} - X\_i + \mathfrak{u}\_i^k \right)^2 \tag{44}$$

$$\text{s.t.}\\X\_i \in \Omega\_i \tag{45}$$

which is easily solved by existing methods.

For the DSWM problem, (45) is simply an interval, and Xi has an analytical solution [26]. Similar results are obtained for the PSwEV problem.

#### 3.5 Algorithm summarization

The convergence of the proposed SDC-ADMM algorithm can be proved in a similar manner to that in [26]; hence it is ignored here for brevity. In the following, a summary for the algorithm is provided.

