## Abstract

This chapter presents a distributed optimization method named sequential distributed consensus-based ADMM for solving nonlinear constrained convex optimization problems arising in smart grids in order to derive optimal energy management strategies. To develop such distributed optimization method, multi-agent system and consensus theory are employed. Next, two smart grid problems are investigated and solved by the proposed distributed algorithm. The first problem is called the dynamic social welfare maximization problem where the objective is to simultaneously minimize the generation costs of conventional power plants and maximize the satisfaction of consumers. In this case, there are renewable energy sources connected to the grid, but energy storage systems are not considered. On the other hand, in the second problem, plug-in electric vehicles are served as energy storage systems, and their charging or discharging profiles are optimized to minimize the overall system operation cost. It is then shown that the proposed distributed optimization algorithm gives an efficient way of energy management for both problems above. Simulation results are provided to illustrate the proposed theoretical approach.

### Keywords

- optimal energy management
- distributed optimization
- social welfare maximization
- ADMM
- smart grid
- multi-agent system
- consensus
- electric vehicle

## 1. Introduction

In any energy system, optimal energy management (OEM) is an essential problem because it directly affects to both the technical (e.g., operation and control) and economic (i.e., profit) aspects of such energy system. Recently, smart grid has been proposed as a solution to improve the greenhouse gas emissions and the efficiency and energy management in electric power grids [1]. Important components in smart grid are renewable energy sources (RESs) and distributed energy resources (DERs), e.g., rooftop photovoltaic (PV), electric vehicles (EVs), distributed energy storage systems (ESSs), etc. Those RESs and DERs are expected to replace the polluted fossil-based energy sources for generating electric power and to increase the mobility and flexibility of power grids.

However, the fluctuating and intermittent nature of RESs and the close or on-site location of DERs to end users make the OEM problem in smart grids more complex than that in traditional power grids. This urges the development of new concepts and approaches to deal with challenges that arose in smart grids. Some examples include demand side management (DSM) and real-time (dynamic) pricing (RTP) [2, 3]. As one of the main DSM activities [3, 4, 5], demand response (DR) motivates changes in electric use by end-use customers, in response to changes in the price of electricity over time, or gives incentive payments designed to induce lower electricity use at times of high market prices or when grid reliability is jeopardized [6]. DR not only shifts the load in peak times but also increases the grid’s energy efficiency and customers’ benefits.

Traditionally, the OEM problem in transmission power networks is treated as the economic dispatch (ED) problem (see, e.g., [7]). Nonetheless, DSM including DR is often not included in the ED problem. To overcome this drawback, the social welfare maximization (SWM) problem is set up and solved, where the benefits from both the suppliers and the consumers are taken into account [8, 9, 10, 11, 12, 13, 14]. The effectiveness of the SWM problem has been verified in [15]. On the other hand, in distribution power networks, the OEM problem is usually investigated with the existence of an intermediate player called the aggregator who manages the power exchange between a small distribution grid and a larger or main grid. Therefore, the OEM problem in such situations means to maximize the benefits of the DER owners, consumers, and the aggregator.

To suppress the redundancy or to supplement the lack of energy from the fluctuating outputs of RESs, and to make the energy scheduling more flexible, ESSs are being introduced into smart grids as a solution. For instance, in power distribution systems or microgrids, EV’s batteries are sources of mobile and distributed ESSs that might contribute to the energy efficiency, security, and flexibility of such distribution systems or microgrids. The stability and robustness of vehicle-to-grid (V2G) energy networks have been investigated in [16]. The problem of power scheduling with electric vehicle (PSwEV) in a microgrid has been introduced under a multi-agent setting in [17]. Due to the increase of market share of EVs and plug-in hybrid electric vehicles (PHEVs) predicted until 2050 [18], it is reasonable to believe that the PSwEV problem will be popular and important in the near future.

To solve optimization problems arising in OEM problems, the existing methods can be classified depending on the centralized or distributed nature of such methods and the heuristic or analytical characteristic of the obtained solution. The security and resiliency of centralized approaches are weak due to a single point of failure and the huge communication and data processing, at the central unit. Those limitations can be improved by distributed approaches using multi-agent system (MAS), where each agent corresponds to a bus or a portion of the grid and each agent only communicates with a few other neighboring agents. On the other hand, the heuristic methods (e.g., [19, 20]) usually require a long running time and local solutions, which are less effective than analytical methods for convex optimization problems. Thus, distributed and analytical approaches will be developed in the current chapter to solve convex optimization problems representing OEM problems in smart grids.

A MAS-based distributed method for solving the ED problem in smart grid was proposed in [7] where the power losses are approximated by quadratic functions and the nonlinear coupling of oscillating agents is employed for decentralized solution derivation from the Karush-Kuhn-Tucker (KKT) conditions. The projected gradient methods were utilized in [10] to solve the SWM problem, where a MAS was utilized to derive the supply-demand mismatch in a distributed fashion. Another method named dual decomposition was used in [8] to get a distributed solution when the power balance is not strictly required. If the power balance is required, a distributed observer design was employed in [11] to estimate the power mismatch. The Vickrey-Clarke-Groves (VCG) mechanism was used in [9], but it is centralized. A distributed method was presented in [12], but the communication structure was all-to-all. Next, two consensus protocols were introduced in [13] to derive a distributed method for solving the SWM problem. Lastly, the SWM problem with transmission losses modeled by a quadratic function was investigated in [14].

This chapter presents an approach named sequential distributed consensus-based ADMM (SDC-ADMM) for solving nonlinear convex optimization problems having both equality and inequality constraints, which include those from OEM problems in smart grids. The attractive features of this approach are as follows: (i) viable for a general and broad class of constrained convex programming, (ii) distributed implementation, (iii) analytical updates of variables, and (iv) unnecessary checking of the active constraints in the KKT conditions, e.g., as in [7], which slows down the convergence speed and increases the computational complexity. Then the effectiveness of the proposed approach will be demonstrated through two specific OEM problems in smart grids, namely, dynamic SWM (DSWM) and PSwEV.

The rest of this chapter is organized as follows. Section 2 introduces a class of constrained optimization problems in power grids followed by two specific problems. Then an approach to solve those optimization problems is given in Section 3. Simulation results to illustrate the proposed approach are provided in Section 4. Finally, Section 5 summarizes the chapter.

## 2. Constrained optimization problems in smart grid

A lot of OEM problems in power grids can be represented by the following general form of constrained convex programming:

where

Due to the global constraint (2), (1) is a centralized optimization problem. However, (1) is decomposable into subproblems corresponding to individual time slots; hence we can derive a sub-optimal solution to (1) by resolving it sequentially, i.e., from

### 2.1 Dynamic social welfare maximization problem

Consider a smart grid consisting of * m*demand units. Denote

The generation cost for CG unit

where

where

where

where

for

### 2.2 Power scheduling with electric vehicle

In this problem, we include battery operation into the microgrid to suppress the high demand at the high-cost time of utility electricity. Furthermore, we consider EV battery instead of the stationary battery storage to reduce the installation cost of the battery system.

Our microgrid model consists of * one*microgrid operator. This microgrid is connected to the main grid (MG) whose electricity trading price is predescribed as

#### 2.2.1 Diesel generation and load demand

The generation cost function

For the microgrid internal trading, the revenue function of DGs has the following form:

Load demands are assumed as fixed parameters in this problem. The electricity cost of load demands is calculated by

#### 2.2.2 Electric vehicle

For simplicity, we assume that EVs have only one round-trip route per day, and the home of each EV owner is the only charging point for each EV.

Denote * h-th*EV during time slot

*(*t

To reduce computational cost, * h-th*EV as if the EV route just lasts for one time slot.

The state of charge (SOC) of EV battery at the starting point of a next time slot depends on the SOC at the starting point of current time slot and a charging/discharging efficiency

SOC constraint is as follows:

When EVs are at home (from the arrival time to the next departure time), their charging/discharging scheduling can be utilized for DR actions. The variable

Algorithm 1: |
---|

1: Departure time 2: 3: 4: 5: 6: to 37: 8: 9: 10: 11: to 312: 13: |

The battery life function of EVs depends on EVs charging/discharging power [23], as follows:

where

The revenue function of EVs is defined in [21], taking into account the battery life cost:

#### 2.2.3 Microgrid operator

The revenue function of the microgrid operator is calculated by

where

#### 2.2.4 Power balance constraint in the microgrid

With the existence of EVs and the MG, the power balance constraint in the microgrid has more terms than that in the DSWM problem, as follows:

#### 2.2.5 PSwEV optimization problem

The PSwEV problem is to maximize the total revenue of DGs, EVs, load demands, and the microgrid operator, as follows:

s.t. (22), (9), (10), (13)–(19), and (21)

where

Substituting (11), (12) and (18)–(20) into (23), the PSwEV maximization programming in (23) can be rewritten as a minimization problem below:

## 3. Sequential distributed consensus-based ADMM approach

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 following subproblems

and solves them starting from

### 3.1 Multi-agent system description for smart grid

The SDC-ADMM approach is based on MAS and consensus theory so that it can be run in parallel in all generation and consumption units. Hence, the MAS 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

### 3.2 Reformulation of smart grid optimization problems

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 global and local constraints:

together with their indicator functions [24]

Hence, (25) can be rewritten as follows:

Because the indicator function of a closed, non-empty convex set is proper, closed, and convex [25], the cost functions in (28) are also proper, closed, and convex with respect to

where

This algorithm is stopped if the criteria

with

In the following, the variables

### 3.3 P -update step

The update of

of which the strong duality holds [25]. Let

Since

where

** Theorem 1.**Given a connected undirected communication graph

Consequently, the following consensus law is utilized:

where

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

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

* Proof:*Similar to the proof of Theorem 1 in [26], so it is omitted here for brevity. ■

Remark 1: If

### 3.4 X -update step

The update of

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:

which is easily solved by existing methods.

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

### 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.

Algorithm 2: . |
---|

Each agent determines its local constraint set Each agent calculates All agents run the consensus law (39) with initial values (38), then compute Each agent updates its variable Each agent updates its variable Each agent updates its variable the stopping criteria are true break; |

### 3.6 Pricing mechanism

For several grid optimization problems represented in the form of (1), e.g., economic dispatch or power scheduling, DSWM, PSwEV, etc., an electricity pricing mechanism is needed to drive the electricity trading in the grid. Interestingly, the optimal Lagrange multiplier associated with the equality constraint (2) is often regarded as the market-clearing price. That will be proved under mild assumptions in the following:

** Theorem 2.**For a sufficiently small but positive

* Proof:*For the OEM problems in smart grids, the convex functions

where

The optimal energy price in the system is achieved when the market is cleared, at which the marginal costs of all agents are the same. Hence,

In the proposed SDC-ADMM algorithm, this means

Substituting (48) into (35), we have

If

Thus, as long as the proposed SDC-ADMM algorithm converges, the optimal energy price

## 4. Simulation results for test systems

In this section, simulation results for two problems, DSWM and PSwEV, are provided to illustrate the effectiveness of the proposed SDC-ADMM algorithm.

### 4.1 Test case 1: DSWM problem

For this problem, a modified IEEE 39-bus system (see Figure 1) is used as the test system where it is assumed that there are PV generation units in the system with the total maximum output of 210 MW. The parameters of generators and demand units are taken from [26]. The average PV output curve, which is shown in Figure 2, is suitably scaled from the real PV data collected in New England [28]. Moreover, an average load profile taken from New England Independent System Operator [29] is utilized and properly scaled to obtain the time-varying upper bounds of demand units. This load profile has two demand peaks at 11:00 am and 8:00 pm, and the highest demand is at 8:00 pm, as seen in Figure 3.

Other parameters in the simulation are as follows. The absolute and relative tolerances are set to be

Figures 3 and 4 display the total and individual power generated and consumed in the test system which are obtained by the proposed SDC-ADMM algorithm. Thanks to PV energy, the peak demand is shifted from 8 pm to 1 pm at which the PV output is maximum, as observed in Figure 3.

Then the electricity price is exhibited in Figure 5 showing that it is highest at 8 pm and lowest at 1–2 pm. This explains why the peak demand can be shifted. Next, the total welfare in the grid is shown in Figure 6 where the maximum welfare is attained at 1 pm when the consumers use most energy and the CG units produce least energy. Finally, Figure 7 shows the convergence of the proposed SDC-ADMM algorithm.

### 4.2 Test case 2: PSwEV problem

In this test case, a microgrid having 2 DGs, 16 EVs, 4 load demands, 4 PV generations, and a microgrid operator is considered with a 3-day duration. The total number of agents is 27, in which the controllable agents are those for 2 DGs, 16 EVs, and the microgrid operator. The total PV curve and the total demand curve are given in Figure 8. The prescribed electricity transaction price

The departure and arrival time and required traveling energies of 16 EVs are randomly generated from mix Gaussian distributions of this parameter of an actual set of 1400 EVs. The maximum energy capacity of each EV battery is 17.6 kWh, and the SOC limits of each EV battery are set at 20 and 80% of the maximum energy capacity, respectively.

The absolute and relative tolerances are set to be

Consequently, the simulations for hundreds of different scenarios corresponding to the above random times are run with the proposed SDC-ADMM algorithm. The results for one specific scenario are then shown in Figures 10–12.

Figure 10 shows the benefit of utilizing PV generation and EV charging in the microgrid. First, DG output power is reduced around the time period of high PV output, while the load demand is quite high. Second, when PV output is high, the microgrid operator can sell the redundant electricity to the utility at the highest price. Last, even though EVs do not have much correlation to PV output due to the EV traveling times, they still benefit the microgrid with their optimal charging and discharging schedules in which the charging is executed at low-price time periods of utility, and vice versa, the discharging is made at high-price time periods of utility. Moreover, the discharging also provides microgrid electricity for selling to the utility at a high price.

Subsequently, the SOC profiles of 16 EVs are depicted in Figure 11. It can be observed that the EV batteries will be charged in the early morning when the electricity price is low, but not to the maximum allowed SOC, i.e., 80% of maximum battery capacity, because of the using of EV charging/discharging strategy in Algorithm 1 and the realistic EV data that only around 6 kWh is enough for each EV round-trip. Further, the charged/discharged SOCs of EVs are different due to their differences on charging/discharging times and required energy for traveling.

Finally, the convergence of the proposed SDC-ADMM algorithm in the PSwEV problem is shown in Figure 11, and the consensus processes in the distributed algorithm for calculating the optimal electric price inside the microgrid are displayed in Figures 12 and 13.

## 5. Conclusions

In this chapter, a distributed optimization algorithm called sequential distributed consensus-based alternating direction method of multipliers (SDC-ADMM) is proposed for optimal energy management in smart grids. This algorithm is applicable to a broad class of linear or nonlinear constrained convex programming, of which two specific problems in smart grids have been studied in this chapter. The first problem DSWM tries to maximize the total social welfare in transmission grids in the presence of renewable energy and power losses, while the second problem PSwEV considers the power scheduling in distribution microgrids with renewable energy, electric vehicle as mobile storage, and a microgrid operator. It is then shown that the proposed SDC-ADMM algorithm works well for both problems, in which an optimal real-time electricity pricing scheme is derived as a part of the algorithm which facilitates demand response. Additionally, the existence of renewable energy and electric vehicles with suitable charging and discharging strategies is benefit to the grid for reducing the electricity price and the output power from nonrenewable energy generation.