**Energy Management in Microgrids: A Combination of Game Theory and Big Data‐Based Wind Power Forecasting**

Zhenyu Zhou, Fei Xiong, Chen Xu and Runhai Jiao

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.68980

#### Abstract

Energy internet provides an open framework for integrating every piece of equipment involved in energy generation, transmission, transformation, distribution, and consumption with novel information and communication technologies. In this chapter, the authors adopt a combination of game theory and big data to address the coordinated management of renewable and traditional energy, which is a typical issue on energy interconnections. The authors formulate the energy management problem as a three-stage Stackelberg game and employ the backward induction method to derive the closed-form expressions of the optimal strategies. Next, we study the big data-based power generation forecasting techniques and introduce a scheme of the wind power forecasting, which can assist the microgrid to make strategies. Simulation results show that more accurate prediction results of wind power are conducive to better energy management.

Keywords: energy internet, Stackelberg game, microgrid energy management, wind power forecasting

### 1. Introduction

Energy internet has been identified as a key enabler of the third industrial revolution [1], which represents a new paradigm shift for both energy industry and consumers. In this new paradigm, the energy provisioning and demand sides are connected more closely and promptly than ever before by implementing distributed and flexible energy production and consumption while hiding the diversity of underlaying technologies through standardized interfaces [2, 3]. In addition, energy consumers with colocated distributed energy sources and

© 2017 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

distributed energy storage devices within limited areas, such as school, office building, industrial park, and residence community, etc., can form a local energy internet, that is, the microgrid, which provides a promising way of relieving the stress caused by the increasing energy demands and penetrations of renewable energy sources.

Microgrid is, in essence, a flexible and efficient network for interconnecting distributed renewable energy sources, load, and intermediate storage units at consumer premise [4]. It can be treated by the grid as a controllable load or generator and can operate in either islanded or grid-connected mode [5]. However, due to the intermittent and fluctuating characteristics of renewable energy sources and limited generation capacity, the large penetration of uncontrolled and uncoordinated renewable generators into the microgrid especially distribution network will cause a high level of volatility and system disturbances. For instance, the uncertainties brought by renewable energy sources will lead to significant mismatch between generation and load, which results in numerous critical problems such as power imbalance, voltage instability, interarea oscillations, and frequency fluctuations [6]. Hence, novel energy management methodologies are required to harness the full potential of the microgrid to reduce the energy supply-demand imbalance by making the full use of widespread renewable energy resources.

We study a distributed energy management problem in order to efficiently use renewable energy, with the aim of maximizing the individual objective function of each market player while guaranteeing the reliable system operation and satisfying users' electricity demands. Due to the uncertainty and uncontrollability of renewable generation, the authors utilize the big data-based renewable power forecasting techniques to obtain the short-term prediction value [7]. Then, the authors focus on solving the distributed microgrid energy management problem by employing noncooperative game theory [8], which provides an effective mathematical tool for analyzing optimization problems with multiple conflicting objective functions. The major contributions are summarized as follows:


The structure of this chapter is organized as follows. In Section 2, we give a brief review of related works on energy management and prediction technologies. The system model of energy management and problem formulation are provided in Section 3. Section 4 introduces the proposed game-theoretical and data-centric energy management algorithm. The simulation results and analyses are presented in Section 5. Finally, Section 6 gives the conclusion.

### 2. Related works

distributed energy storage devices within limited areas, such as school, office building, industrial park, and residence community, etc., can form a local energy internet, that is, the microgrid, which provides a promising way of relieving the stress caused by the increasing

Microgrid is, in essence, a flexible and efficient network for interconnecting distributed renewable energy sources, load, and intermediate storage units at consumer premise [4]. It can be treated by the grid as a controllable load or generator and can operate in either islanded or grid-connected mode [5]. However, due to the intermittent and fluctuating characteristics of renewable energy sources and limited generation capacity, the large penetration of uncontrolled and uncoordinated renewable generators into the microgrid especially distribution network will cause a high level of volatility and system disturbances. For instance, the uncertainties brought by renewable energy sources will lead to significant mismatch between generation and load, which results in numerous critical problems such as power imbalance, voltage instability, interarea oscillations, and frequency fluctuations [6]. Hence, novel energy management methodologies are required to harness the full potential of the microgrid to reduce the energy supply-demand imbalance by making the full use of widespread renewable

We study a distributed energy management problem in order to efficiently use renewable energy, with the aim of maximizing the individual objective function of each market player while guaranteeing the reliable system operation and satisfying users' electricity demands. Due to the uncertainty and uncontrollability of renewable generation, the authors utilize the big data-based renewable power forecasting techniques to obtain the short-term prediction value [7]. Then, the authors focus on solving the distributed microgrid energy management problem by employing noncooperative game theory [8], which provides an effective mathematical tool for analyzing optimization problems with multiple conflicting objective functions.

• We adopt a combination of game-theoretical and data-centric approaches to address the microgrid energy management problem in energy internet. To address the uncertainties brought by wind turbine, the authors propose a deep learning-based short-term wind power forecasting algorithm by combining stacked autoencoders (SAE), the back-propagation algorithm, and the genetic algorithm. The authors employ SAE with three hidden layers in the pre-training process to extract the characteristics from the training sequence and the back-propagation algorithm to calculate the weights of the overall neural network in the fine-tuning process. Then, the authors adopt a genetic algorithm to optimize the

• We provide thorough introduction and summary of the related works and the state-ofthe-art progress in the research direction of energy management in microgrids. The authors have categorized the existing literature based on research motivations and application scenarios. The authors provide in-depth analysis and discussion on the contributions of the surveyed works, common assumptions, application scenarios, advantages, disadvantages, and possible future directions. The extensive review of available works sheds new insights to the underexplored open issues of energy management design in

neuron number of hidden layers and the learning rate of autoencoders.

energy demands and penetrations of renewable energy sources.

The major contributions are summarized as follows:

energy resources.

210 Development and Integration of Microgrids

microgrids.

The aim of this chapter is to solve the distributed microgrid energy management problem by exploring both game theory and big data analysis in energy internet. The comprehensive summary of the classifications of distributed microgrid energy management is shown in Table 1. Some literature studies propose mathematical tools to deal with uncertainties of renewable energy in energy management problems. Two main methods that have been widely applied to handle day-to-day uncertainties of renewable energy are stochastic optimization


Table 1. A comprehensive summary of distributed microgrid energy management.

and robust optimization [9]. On the one hand, stochastic optimization provides an effective framework to optimize statistical objective functions while the uncertain numerical data are assumed to follow a proverbial probability distribution. In Ref. [10], a multistage framework is presented to minimize the cost of the total energy management system based on stochastic optimization. The authors developed a stochastic dynamic programming method for optimizing the multidimensional energy management problem in Ref. [11]. A stochastic optimizationbased real-time energy management approach was adopted to minimize the operational cost of the total energy system in Ref. [12]. However, considering the complex operation details and various practical constraints in practical applications, the precise estimation of the probability distributions of uncertain data can be a tremendous challenge. Hence, the impact of data uncertainties on the optimality performance may not be sufficiently captured in the stochastic optimization-based energy management approaches.

On the other hand, robust optimization, which considers the worst-case operation scenarios, only requires appropriate information and enable a distribution-free model of data uncertainties [13]. Hence, robust energy management can mitigate the negative effect of uncertainty on the optimality performance and thus overcome the aforementioned limitations of stochastic optimization. In Ref. [14], a novel pricing strategy was presented to enable robustness against the uncertainty of power input. The authors proposed a robust energy-scheduling approach for solving the uncertainty brought by electric vehicles in Ref. [15]. Robust energy management methods were proposed to optimize the energy-dispatching problem while the worstcase scenarios of renewable energy integration have been considered [16, 17]. However, due to the fact that the worst-case scenarios of all uncertain factors are assumed to provide the highest protection against uncertainties, the optimality performance is also severely degraded as the price paid for robustness.

With the development of advanced information and communication technologies, the big data-based forecasting approach can learn from these massive amounts of real-world data, and thus adapt conventional energy management design to this new data-centric paradigm by utilizing the historical knowledge. Taking wind power forecasting as an example, the datacentric approaches mine the relationship between historical data and knowledge to build the prediction model through various approaches, such as persistence methods, linear methods, and nonlinear methods. The persistence method is one of the classic methods for wind power forecasting and is usually utilized as a benchmark method while short-term wind speeds are assumed highly correlated [18]. Linear methods have been shown to outperform most persistence methods in short-term forecasting as they can capture the time relevance and probability distribution of wind speed data [19, 20]. Nonlinear methods such as artificial neural networks (ANNs) [21], support vector machines (SVM) [22, 23], etc., are demonstrated to outperform linear methods in nonlinear models. ANN, which is a simplified model of human brain neural processing, has the advantage of fast self-learning capability, easy implementation, and high prediction accuracy [24]. SVM is a machine-learning model of ANNs to analyze data which is used for classification and regression analysis [25]. To efficiently handle the complex, unlabeled and high-dimensional time series data, deep learning has been proposed in Ref. [26]. As an essential deep learning architecture, SAE plays a fundamental role in unsupervised learning and the objective function can be solved efficiently via fast back propagation [27].

There already exists some work about energy management design in microgrid. In Ref. [28], a double-layer control model, which consists of a dispatch layer to offer the output power of each unit and a schedule layer to provide the operation optimization, is proposed for microgrid energy management. The authors presented a fair energy-scheduling strategy in Ref. [29] to maximize the total system benefit while providing higher energy utilization priorities to users with larger contributions. In Ref. [30], the authors took demand side management and generation scheduling into consideration for ensuring the real-time operation of energy management system. However, the previous studies mainly focus on the total benefit in the energy management system, and ignore the interactions and interconnections among multiple market players, including utility companies, storage companies, microgrids, customers, and so on.

and robust optimization [9]. On the one hand, stochastic optimization provides an effective framework to optimize statistical objective functions while the uncertain numerical data are assumed to follow a proverbial probability distribution. In Ref. [10], a multistage framework is presented to minimize the cost of the total energy management system based on stochastic optimization. The authors developed a stochastic dynamic programming method for optimizing the multidimensional energy management problem in Ref. [11]. A stochastic optimizationbased real-time energy management approach was adopted to minimize the operational cost of the total energy system in Ref. [12]. However, considering the complex operation details and various practical constraints in practical applications, the precise estimation of the probability distributions of uncertain data can be a tremendous challenge. Hence, the impact of data uncertainties on the optimality performance may not be sufficiently captured in the stochastic

On the other hand, robust optimization, which considers the worst-case operation scenarios, only requires appropriate information and enable a distribution-free model of data uncertainties [13]. Hence, robust energy management can mitigate the negative effect of uncertainty on the optimality performance and thus overcome the aforementioned limitations of stochastic optimization. In Ref. [14], a novel pricing strategy was presented to enable robustness against the uncertainty of power input. The authors proposed a robust energy-scheduling approach for solving the uncertainty brought by electric vehicles in Ref. [15]. Robust energy management methods were proposed to optimize the energy-dispatching problem while the worstcase scenarios of renewable energy integration have been considered [16, 17]. However, due to the fact that the worst-case scenarios of all uncertain factors are assumed to provide the highest protection against uncertainties, the optimality performance is also severely degraded as the

With the development of advanced information and communication technologies, the big data-based forecasting approach can learn from these massive amounts of real-world data, and thus adapt conventional energy management design to this new data-centric paradigm by utilizing the historical knowledge. Taking wind power forecasting as an example, the datacentric approaches mine the relationship between historical data and knowledge to build the prediction model through various approaches, such as persistence methods, linear methods, and nonlinear methods. The persistence method is one of the classic methods for wind power forecasting and is usually utilized as a benchmark method while short-term wind speeds are assumed highly correlated [18]. Linear methods have been shown to outperform most persistence methods in short-term forecasting as they can capture the time relevance and probability distribution of wind speed data [19, 20]. Nonlinear methods such as artificial neural networks (ANNs) [21], support vector machines (SVM) [22, 23], etc., are demonstrated to outperform linear methods in nonlinear models. ANN, which is a simplified model of human brain neural processing, has the advantage of fast self-learning capability, easy implementation, and high prediction accuracy [24]. SVM is a machine-learning model of ANNs to analyze data which is used for classification and regression analysis [25]. To efficiently handle the complex, unlabeled and high-dimensional time series data, deep learning has been proposed in Ref. [26]. As an essential deep learning architecture, SAE plays a fundamental role in unsupervised learning and the objective function can be solved efficiently via fast back

optimization-based energy management approaches.

price paid for robustness.

212 Development and Integration of Microgrids

propagation [27].

Game theory has widely been applied in microgrid energy management to provide a distributed self-organizing and self-optimizing solution for optimization problems with conflicting objective functions in Ref. [31]. Games can be classified into two categories based on whether or not binding agreements among players can be enforced externally, that is, noncooperative and cooperative games [32]. Noncooperative games, which offer an analytical framework tailored for characterizing the interactions as well as decision-making process among multiple game players, focus on predicting players' individual strategies and analyzing the competitive decision-making involving players to find the Nash equilibrium. The players will influence the decision-making process despite their partially or even completely conflicting interests upon the result of a decision. In contrast, cooperative games offer mathematical tools to study the interactions of rational cooperative players, and the strategic outcome among those players as well as their utilities can be improved under a common agreement.

For noncooperative game-based microgrid energy management, the authors proposed a multiuser Stackelberg game model for maximizing the benefit of each player in Ref. [33]. In Ref. [34], a new model of electricity market operation was adopted to optimize the objective function of each player. The authors provided a dynamic noncooperative repeated game model to optimize the energy-trading amounts of users with distributed renewable generators [35]. In Ref. [36], a distributed real-time game-theoretical energy management scheme was employed to maximize the total social benefit while minimizing the cost of each player. For microgrid energy management schemes based on cooperative games, the authors proposed a cooperative demand response scheme for reducing the electricity bills of users in Ref. [37]. In Ref. [38], a cooperative energy-trading approach was proposed for the downlink coordinated multipoint transmission powered by smart grids to reduce energy cost. The authors developed a cooperative distributed energy-scheduling algorithm to optimize the energy dispatch problem while considering the integration of renewable generation and energy storage in Ref. [39]. In Ref. [40], the authors provided a multistage market model for minimizing the operational cost of the utility company while maximizing the total benefit of the market. Compared to cooperative games, the noncooperative games have the advantage of a lower communication overhead and do not require a common commitment among various market players. As one kind of noncooperative game models, the Stackelberg game can efficiently model the hierarchy among players, where the leaders have dominant market positions over followers, and can impose their own strategies upon the followers. Considering above two points, the authors propose the noncooperative game-theoretical approach and model the microgrid energy management problem as a three-stage Stackelberg game.

In summary, most of the previous studies have not provided a comprehensive framework for how to utilize the real-world data to improve the energy management performance. The prior statistic knowledge of uncertain renewable power outputs was assumed to be perfectly known and its impact on the energy-trading process among market players has not been fully analyzed. This motivates us to explore the integration of deep learning-based wind power forecasting technique with Stackelberg game-based energy management strategy, so as to make a further step to enable data-centric energy management in future energy internet.

### 3. System model and problem formulation

### 3.1. System model

Figure 1 presents a structure of a typical microgrid energy management system with the utility company, the energy storage company, users, and various kinds of renewable energy sources. In this system, without loss of generality, the authors assume that there is a single conventional energy generation company, which is denoted as the utility company, and a renewable sourcesbased energy storage company, which is denoted as the storage company. The energy storage company which operates independently from the utility company can store and absorb excess

Figure 1. System model of microgrid energy management.

energy during nonpeak periods and deliver it back to the grid during the peak times. Furthermore, the authors assume that there is a single microgrid and there are K users, denoted as K ¼ {1, …, k, …, K}, in this model. The utility company and the storage company are regarded as energy suppliers to meet the electric power demand of the microgrid and ensure the stability of the power system. To implement efficient energy management, the microgrid should be in charge of energy dispatching and be responsible for meeting users' electricity demands based on the forecasting of renewable energy generation. However, due to renewables' uncontrollable fluctuations, variability, intermittent nature, and the capacity limitation of the microgrid, the microgrid may not be able to meet the electricity demand of users by itself and has to purchase electricity from the utility company and the storage company.

#### 3.2. Objective function

#### 3.2.1. Objective function of the utility company

The definition of the utility company's objective function is rather flexible. Generally, the authors consider the cost function consisting of the electricity generation cost denoted as CðLÞ and the pollutant emission cost denoted as IðLÞ [41]. Each of them can be modeled as a quadratic function of the electricity demand L. Besides, line loss, which is mainly caused by resistance of the transmission lines, has been taken into consideration to ensure energy supply. Hence, the objective function of the utility company is formulated as

$$\mathcal{U}\_{\mathcal{S}}(L\_{m,\mathcal{S}'}p\_{\mathcal{S}}) = \mathcal{R}\_{\mathcal{S}}(L\_{m,\mathcal{S}'}p\_{\mathcal{S}}) - \mathcal{C}\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}) - I\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}),\tag{1}$$

where

In summary, most of the previous studies have not provided a comprehensive framework for how to utilize the real-world data to improve the energy management performance. The prior statistic knowledge of uncertain renewable power outputs was assumed to be perfectly known and its impact on the energy-trading process among market players has not been fully analyzed. This motivates us to explore the integration of deep learning-based wind power forecasting technique with Stackelberg game-based energy management strategy, so as to make a

Figure 1 presents a structure of a typical microgrid energy management system with the utility company, the energy storage company, users, and various kinds of renewable energy sources. In this system, without loss of generality, the authors assume that there is a single conventional energy generation company, which is denoted as the utility company, and a renewable sourcesbased energy storage company, which is denoted as the storage company. The energy storage company which operates independently from the utility company can store and absorb excess

further step to enable data-centric energy management in future energy internet.

3. System model and problem formulation

Figure 1. System model of microgrid energy management.

3.1. System model

214 Development and Integration of Microgrids

$$\begin{split} R\_{\mathcal{S}}(L\_{m,\mathcal{S}},p\_{\mathcal{S}}) &= L\_{m,\mathcal{S}}p\_{\mathcal{S}'}\\ \mathcal{C}\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}) &= a\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}})^2 + b\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}) + c\_{\mathcal{S}'}\\ I\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}) &= \alpha\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}})^2 + \beta\_{\mathcal{S}}(\varepsilon\_{\mathcal{S}}L\_{m,\mathcal{S}}). \end{split} \tag{2}$$

RgðLm, g, pgÞ denotes the electricity revenue; CgðεgLm,gÞ and IgðεgLm, <sup>g</sup>Þ are the cost functions of the power generation and the pollutant emission, respectively; Lm, <sup>g</sup> denotes the quantity of electricity bought from the utility company by the microgrid; pg is the unit electricity price of the utility company; and ag, bg, cg, αg, β<sup>g</sup> are the cost parameters of CgðεgLm, <sup>g</sup>Þ and IgðεgLm,gÞ. Assuming that ρ<sup>g</sup> denotes the power loss percentage during power transmission, which is related to voltage, efficiencies of transformers, and resistance of the transmission line. Hence, εgLm, <sup>g</sup> is the actually generated electricity to satisfy the microgrid demand Lm, <sup>g</sup>, where ε<sup>g</sup> ¼ 1=ð1 � ρgÞ.

#### 3.2.2. Objective function of the storage company

The authors considered the power loss inefficiency during the battery charging and discharging processes, as well as line loss, and the objective function of the storage company is formulated as

$$dL\_s(L\_{m,s\prime}p\_s) = R\_s(L\_{m,s\prime}p\_s) - \mathbb{C}\_s(\varepsilon\_s L\_{m,s\prime}),\tag{3}$$

where

$$\begin{aligned} \mathcal{R}\_s(L\_{m,s}, p\_s) &= L\_{m,s} p\_{s'} \\ \mathcal{C}\_s(\varepsilon\_s L\_{m,s}) &= \frac{\varepsilon\_s \varepsilon\_s L\_{m,s}}{\eta\_c \eta\_d} . \end{aligned} \tag{4}$$

RgðLm,s, psÞ denotes the electricity revenue; CsðεsLm,sÞ is the cost function of energy storage; Lm,s denotes the quantity of electricity bought from the storage company by the microgrid; ps is the unit electricity price of the storage company; η<sup>c</sup> and η<sup>d</sup> are the charging and discharging efficiencies of storage equipment, respectively; and cs denotes the unit cost of operation and maintenance. The meaning of ε<sup>s</sup> is the same as ε<sup>g</sup> introduced above.

#### 3.2.3. Objective function of the microgrid

The authors focus on renewable energy which is the main source of the microgrid and consider the satisfaction function based on quality of service of the electricity provided by the utility and storage companies [42]. Hence, the objective function of the microgrid is formulated as

$$\begin{aligned} \mathbf{U}\_{m}(L\_{m,\mathcal{g}},L\_{m,s},p\_{m}) &= \mathbf{R}\_{m,\mathcal{g}}(L\_{m,\mathcal{g}}) + \mathbf{R}\_{m,s}(L\_{m,s}) \\ &- \mathbf{C}\_{m,\mathcal{g}}(L\_{m,\mathcal{g}},p\_{\mathcal{g}}) - \mathbf{C}\_{m,s}(L\_{m,s},p\_{\mathcal{s}}) + \mathbf{R}\_{m}(L\_{k,m},p\_{m}) \\ &- \mathbf{C}\_{m}(\hat{L}\_{r}+\Delta) - I\_{m}(\hat{L}\_{r}+\Delta) + F|\Delta|\end{aligned} \tag{5}$$

where

$$\begin{split} R\_{m,\mathcal{S}}(L\_{m,\mathcal{S}}) &= X\_{m,\mathcal{S}}L\_{m,\mathcal{S}} - \frac{d\_{m,\mathcal{S}}}{2}(L\_{m,\mathcal{S}})^2, \\ R\_{m,\mathcal{s}}(L\_{m,\mathcal{s}}) &= X\_{m,\mathcal{s}}L\_{m,\mathcal{s}} - \frac{d\_{m,\mathcal{s}}}{2}(L\_{m,\mathcal{s}})^2, \\ R\_{m}(L\_{k,m'}p\_{m}) &= \sum\_{k=1}^{K} L\_{k,m}p\_{m'} \\ \mathbf{C}\_{m,\mathcal{S}}(L\_{m,\mathcal{S}'}p\_{\mathcal{S}'}) &= L\_{m,\mathcal{S}}p\_{\mathcal{S}'} \\ \mathbf{C}\_{m,\mathcal{s}}(L\_{m,\mathcal{s}},p\_{\mathcal{s}}) &= L\_{m,\mathcal{s}}p\_{\mathcal{s}'} \\ \mathbf{C}\_{m}(\hat{L}\_{r}+\Delta) &= a\_{m}(\hat{L}\_{r}+\Delta)^2 + b\_{m}(\hat{L}\_{r}+\Delta) + c\_{m} \\ I\_{m}(\hat{L}\_{r}+\Delta) &= a\_{m}(\hat{L}\_{r}+\Delta)^2 + \beta\_{m}(\hat{L}\_{r}+\Delta). \end{split} \tag{6}$$

Rm,gðLm, <sup>g</sup>Þ denotes the satisfaction value; Cm, <sup>g</sup>ðLm, g, pgÞ denotes the payment of the microgrid for electricity bought from the utility company; and Xm, <sup>g</sup> denotes the satisfaction parameter for the utility company. As the satisfaction parameters depend on various factors, such as electricity demands, electricity prices, preferences in different energy sources, weather conditions, etc., it is hard to model the satisfaction parameters accurately. Thus, the authors assume that these parameters are predefined. Analogously, dc,m denotes predefined satisfaction parameters of the microgrid for the utility company. The definitions of Rm,sðLm,sÞ and Cm,sðLm,s, psÞ are similar to those of Rm,gðLm, <sup>g</sup>Þ and Cm, <sup>g</sup>ðLm, g, pgÞ as introduced above; RmðLk,m, pmÞ denotes the electricity revenue acquired from users while Lk,m is the quantity of electricity bought by the <sup>k</sup>th user and pm is the unit electricity price of the microgrid; CmðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup><sup>Þ</sup> and ImðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup><sup>Þ</sup> are the cost functions of wind power generation and wind power pollutant emission, respectively; am, bm, cm, <sup>α</sup>m, <sup>β</sup><sup>m</sup> are the cost parameters of CmðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup><sup>Þ</sup> and ImðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ. <sup>L</sup>^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup> denotes the prediction result of wind power while L^<sup>r</sup> is the real wind power and Δ is the prediction error. F denotes the penalty factor of the prediction error Δ that satisfies F < 0. That is, the payoff of the microgrid will decrease when the result of wind power forecasting is not accurate, which reflects the restriction of the power purchase agreement in the market.

#### 3.2.4. Objective function of users

In a similar way, the authors also take the satisfaction function into consideration. Hence, the objective function of the kth user is given by

$$dL\_k(L\_{k,m}, p\_m) = R\_{k,m}(L\_{k,m}) - \mathbb{C}\_{k,m}(L\_{k,m}, p\_m),\tag{7}$$

where

UsðLm,s, psÞ ¼ RsðLm,s, psÞ � CsðεsLm,sÞ, ð3Þ

: <sup>ð</sup>4<sup>Þ</sup>

ð5Þ

ð6Þ

RsðLm,s, psÞ ¼ Lm,sps, CsðεsLm,sÞ ¼ csεsLm,s

RgðLm,s, psÞ denotes the electricity revenue; CsðεsLm,sÞ is the cost function of energy storage; Lm,s denotes the quantity of electricity bought from the storage company by the microgrid; ps is the unit electricity price of the storage company; η<sup>c</sup> and η<sup>d</sup> are the charging and discharging efficiencies of storage equipment, respectively; and cs denotes the unit cost of operation and

The authors focus on renewable energy which is the main source of the microgrid and consider the satisfaction function based on quality of service of the electricity provided by the utility and storage companies [42]. Hence, the objective function of the microgrid is formulated as

> UmðLm, g, Lm,s, pmÞ ¼ Rm, <sup>g</sup>ðLm, <sup>g</sup>Þ þ Rm,sðLm,sÞ � Cm, <sup>g</sup>ðLm, g, pgÞ � Cm,sðLm,s, psÞ þ RmðLk,m, pmÞ

> > <sup>2</sup> <sup>ð</sup>Lm,g<sup>Þ</sup>

<sup>2</sup> <sup>ð</sup>Lm,s<sup>Þ</sup>

2 ,

2 ,

<sup>2</sup> <sup>þ</sup> bmðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ þ cm,

<sup>2</sup> <sup>þ</sup> <sup>β</sup>mðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ:

� CmðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ � ImðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ þ <sup>F</sup>jΔj,

Rm, <sup>g</sup>ðLm, <sup>g</sup>Þ ¼ Xm,gLm, <sup>g</sup> � dm, <sup>g</sup>

Rm,sðLm,sÞ ¼ Xm,sLm,s � dm,s

K

k¼1

Lk,mpm,

Rm,gðLm, <sup>g</sup>Þ denotes the satisfaction value; Cm, <sup>g</sup>ðLm, g, pgÞ denotes the payment of the microgrid for electricity bought from the utility company; and Xm, <sup>g</sup> denotes the satisfaction parameter for the utility company. As the satisfaction parameters depend on various factors, such as electricity demands, electricity prices, preferences in different energy sources, weather conditions, etc., it is hard to model the satisfaction parameters accurately. Thus, the authors assume that these parameters are predefined. Analogously, dc,m denotes predefined satisfaction parameters

RmðLk,m, pmÞ ¼ <sup>X</sup>

Cm, <sup>g</sup>ðLm, g, pgÞ ¼ Lm,gpg, Cm,sðLm,s, psÞ ¼ Lm,sps, CmðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ ¼ amðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup><sup>Þ</sup>

ImðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup>Þ ¼ <sup>α</sup>mðL^<sup>r</sup> <sup>þ</sup> <sup>Δ</sup><sup>Þ</sup>

maintenance. The meaning of ε<sup>s</sup> is the same as ε<sup>g</sup> introduced above.

3.2.3. Objective function of the microgrid

ηcη<sup>d</sup>

where

216 Development and Integration of Microgrids

where

$$\begin{aligned} R\_{k,m}(L\_{k,m}) &= X\_{k,m} L\_{k,m} - \frac{d\_{k,m}}{2} (L\_{k,m})^2, \\ \mathbf{C}\_{k,m}(L\_{k,m}, p\_m) &= L\_{k,m} p\_m. \end{aligned} \tag{8}$$

Rk,mðLk,mÞ denotes the satisfaction value and Ck,mðLk,m, pmÞ denotes the payment that the kth user pays for electricity bought from the microgrid. The meanings of Xk,m and dk,m are similar to Xm,g and dm, <sup>g</sup>.

#### 3.3. Problem formulation

The authors propose a three-stage Stackelberg game, which consists of leaders and followers to describe the interconnection of each stage and model the energy management process. The three-stage Stackelberg game is described in a distributed manner in Figure 2:

• Stage I: The utility and the storage companies, as leaders of the game, announce the unit electricity price pg and ps to the microgrid. By setting reasonable prices, the companies hope to maximize their own payoffs. Thus, the authors can describe the optimization problem for the utility and storage companies as

$$\max\_{p\_{\mathcal{S}}} \mathcal{U}\_{\mathcal{S}}(p\_{\mathcal{S}}),\tag{9}$$

$$\max\_{p\_s} \mathcal{U}\_s(p\_s). \tag{10}$$

• Stage II: The microgrid can be assumed as the follower of the utility and the storage companies as well as the leader of users. On the one hand, the microgrid determines

Figure 2. The diagram of the three-stage Stackelberg game.

electricity demand Lm,g and Lm,s based on the prediction result of the wind power and the unit prices pg, ps. On the other hand, it announces electricity price pm to users. The objective of the microgrid is also to maximize its payoff by adjusting Lm,g, Lm,s, and pm. We describe the optimization problem for the microgrid as

$$\begin{aligned} \max\_{L\_{m,\mathcal{Y}}, L\_{m,\mathcal{Y}}, p\_{m}} & \mathcal{U}\_{m}(L\_{m,\mathcal{Y}}, L\_{m,\mathcal{Y}}, p\_{m}),\\ \text{s.t.} \quad \mathcal{C}\_{1}: 0 \le \varepsilon\_{\mathcal{S}} L\_{m,\mathcal{S}} & \le L\_{\mathcal{S}, \max\prime} \\ \mathcal{C}\_{2}: 0 \le \varepsilon\_{\mathcal{S}} L\_{m,\mathcal{S}} & \le L\_{\text{s,max}} \\ \mathcal{C}\_{3}: 0 \le p\_{m} & \le p\_{m, \max\prime} \\ \mathcal{C}\_{4}: L\_{m,\mathcal{s}} + L\_{m,\mathcal{S}} & \le \sum\_{k=1}^{K} L\_{k,m} - \hat{L}\_{r} - \Delta > 0, \end{aligned} \tag{11}$$

where Lg,max, Ls,max, and pm,max denote the capacity and pricing constraints.

• Stage III: The kth user ð∀k ∈{1; 2;…;K}Þ, as the follower of the microgrid, determines electricity amount Lk,m purchased from the microgrid based on pm to maximize its payoff. We can describe the optimization problem for the kth user as

$$\max\_{L\_{k,w}} \mathcal{U}\_k(L\_{k,m})\_\prime \tag{12}$$

$$\text{L's.t.} \quad \mathsf{C}\_{\mathsf{S}} : L\_{\mathsf{k},m} \cong L\_{\mathsf{k},b\prime} \tag{13}$$

where Lk, <sup>b</sup> is the basic electricity demand of the kth user.

### 4. Algorithms and analysis

In this section, we first propose a distributed energy management algorithm based on the three-stage Stackelberg game. Then, the big data analysis-based wind power forecasting algorithm is derived by combining SAE, the back-propagation algorithm, and the genetic algorithm.

#### 4.1. Distributed energy management algorithm

We propose a three-stage Stackelberg game to describe the interconnections of each stage and use the backward induction to capture the interrelation of the decision-making process in each stage.

#### 4.1.1. Analysis of the third-stage user game

electricity demand Lm,g and Lm,s based on the prediction result of the wind power and the unit prices pg, ps. On the other hand, it announces electricity price pm to users. The objective of the microgrid is also to maximize its payoff by adjusting Lm,g, Lm,s, and pm.

K

k¼1

UmðLm,g, Lm,s, pmÞ,

Lk,m � <sup>L</sup>^<sup>r</sup> � <sup>Δ</sup> <sup>&</sup>gt; <sup>0</sup>;

ð11Þ

We describe the optimization problem for the microgrid as

Figure 2. The diagram of the three-stage Stackelberg game.

218 Development and Integration of Microgrids

max Lm, g, Lm,s, pm

<sup>C</sup><sup>4</sup> : Lm,s <sup>þ</sup> Lm, <sup>g</sup> <sup>¼</sup> <sup>X</sup>

where Lg,max, Ls,max, and pm,max denote the capacity and pricing constraints.

s:t: C<sup>1</sup> : 0 ≤ εgLm,g ≤ Lg,max, C<sup>2</sup> : 0 ≤ εsLm,s ≤ Ls,max, C<sup>3</sup> : 0 ≤ pm ≤ pm,max,

The optimization objective of the kth user is defined in Eq. (12), which is a standard concave function. Hence, the authors can use the Karush-Kuhn-Tucker (KKT) conditions to solve the optimization problem. The optimal solution of the kth user is given by

$$\begin{cases} \hat{L}\_{k,m1} = \frac{\mathcal{X}\_{k,m} - p\_m}{d\_{k,m}},\\ \hat{L}\_{k,m2} = L\_{k,b\prime} \end{cases} \tag{14}$$

where L^k,m<sup>1</sup> denotes the optimal electricity procurement quantities; L^k,m<sup>2</sup> denotes the scenario where the optimal electricity procurement quantity lines on the boundary of the inequality constraint.

#### 4.1.2. Analysis of the second-stage microgrid game

In stage II, the authors assume user k<sup>0</sup> ∈ K<sup>0</sup> ¼ {1;…, i, …, K<sup>0</sup> } purchases electricity Lk,m<sup>1</sup> and user k<sup>00</sup> ∈ K<sup>00</sup> ¼ {1;…, i,…, K00} purchases electricity Lk,m2. While K ¼ K<sup>0</sup> ⋃K00, the authors can obtain

$$\sum\_{k=1}^{K} L\_{k,m} = \sum\_{k'=1}^{K'} \frac{X\_{k,m} - p\_m}{d\_{k,m}} + \sum\_{k''=1}^{K''} L\_{k,b} \,. \tag{15}$$

Based on KKT conditions, the optimal amount of electricity procured from the utility company is given by

$$\begin{cases} \hat{L}\_{m,\mathcal{J}} = 0, \\\\ \hat{L}\_{m,\mathcal{J}^2} = \frac{X\_{m,\mathcal{J}} - p\_{\mathcal{J}} - \mu\_{m,1}}{d\_{m,\mathcal{J}}}, \\\\ \hat{L}\_{m,\mathcal{J}^3} = \frac{L\_{\mathcal{G},\max}}{\varepsilon\_{\mathcal{S}}}, \end{cases} \tag{16}$$

In a similar way, based on KKT conditions, the optimal amount of electricity procured from the storage company is given by

$$\begin{cases} \hat{L}\_{m,s1} = 0, \\\\ \hat{L}\_{m,s2} = \frac{X\_{m,s} - p\_s - \mu\_{m,1}}{d\_{m,s}}, \\\\ \hat{L}\_{m,s3} = \frac{L\_{s,\max}}{\varepsilon\_s}, \end{cases} \tag{17}$$

The optimal price is given by

$$\begin{cases} \hat{p}\_{m1} = 0, \\ \hat{p}\_{m2} = \frac{\sum\_{k'=1}^{K'} \frac{X\_{k,m}}{d\_{k,m}} + \sum\_{k''=1}^{K''} L\_{k,b} - \mu\_{m1} \sum\_{k'=1}^{k'} \frac{1}{d\_{k,m}}}{\sum\_{k'=1}^{K'} \frac{2}{d\_{k,m}}}, \\ \hat{p}\_{m3} = p\_{m,\text{max}'} \end{cases} \tag{18}$$

<sup>L</sup>^m, <sup>g</sup>1, <sup>L</sup>^m, <sup>g</sup>3, <sup>L</sup>^m,s1, <sup>L</sup>^m,s3, <sup>p</sup>^m1, and <sup>p</sup>^m<sup>3</sup> denote the scenarios that where the optimal solutions line on the boundaries of the inequality constraints. <sup>L</sup>^m, <sup>g</sup>2, <sup>L</sup>^m,s2, and <sup>p</sup>^m<sup>2</sup> denote the interior solutions. When Lm, <sup>g</sup> <sup>¼</sup> 0 or Lm, <sup>g</sup> <sup>¼</sup> Lg,max <sup>ε</sup><sup>g</sup> and Lm,s <sup>¼</sup> 0 or Lm,s <sup>¼</sup> Ls,max <sup>ε</sup><sup>s</sup> , there is no price competition between the utility and storage companies. Thus, the analysis of the corresponding pg and ps is omitted here. Considering the price competition game between the utility company and the storage company, pm can be viewed as a function of pg and ps based on Eq. (18), which is given by

$$p\_m = A\_{m,1} p\_g + A\_{m,2} p\_s + A\_{m,3\prime} \tag{19}$$

where

Energy Management in Microgrids: A Combination of Game Theory and Big Data‐Based Wind Power Forecasting http://dx.doi.org/10.5772/intechopen.68980 221

$$A\_{m,1} = \frac{\frac{1}{d\_{m,\xi}}}{\left(1 + \frac{\sum\_{k'=1}^{K'} \frac{1}{d\_{m,\xi}}}{\frac{2}{d\_{m,\xi}} + \frac{2}{d\_{m,\xi}}}\right) \left(\frac{2}{d\_{m,\xi}} + \frac{2}{d\_{m,\xi}}\right)},$$

$$A\_{m,2} = \frac{\frac{1}{d\_{m,\xi}}}{\left(1 + \frac{\sum\_{k'=1}^{K'} \frac{1}{d\_{m,\xi}}}{\frac{2}{d\_{m,\xi}} + \frac{2}{d\_{m,\xi}}}\right) \left(\frac{2}{d\_{m,\xi}} + \frac{2}{d\_{m,\xi}}\right)},\tag{20}$$

$$A\_{m,3} = \frac{\sum\_{k'=1}^{K'} \frac{X\_{k,m}}{\bar{d}\_{m,\xi}} + \sum\_{k'=1}^{K'} L\_{k,b}}{\left(1 + \frac{\sum\_{k'=1}^{K'} \frac{1}{d\_{m,\xi}}}{2}\right) \sum\_{k'=1}^{K'} \frac{2}{\bar{d}\_{m,\xi}}} - \frac{\left(\sum\_{k'=1}^{K'} \frac{X\_{k,m}}{\bar{d}\_{m,\xi}} + \sum\_{k'=1}^{K'} L\_{k,b}\right) + \bar{d}\_{r} + \Delta}{\left(1 + \frac{\sum\_{k'=1}^{K'} \frac{1}{\bar{d}\_{m,\xi}}}{2}\right) \left(\frac{2}{\bar{d}\_{m,\xi}} + \frac{2}{\bar{d}\_{m,\xi}}\right)}$$

4.2.3. Analysis of the first-stage utility and storage company game In this case, defining Lm,g as a function of pg, we have

dm, <sup>g</sup> þ

dm,s

$$
\hat{L}\_{m,\mathcal{g}}(p\_{\mathcal{g}}) = A\_{\mathcal{g},1}p\_{\mathcal{g}} + A\_{\mathcal{g},2} \tag{21}
$$

dm, <sup>g</sup> þ

dm,s

where

X K

Lk,m <sup>¼</sup> <sup>X</sup> K0

> k 0 ¼1

<sup>L</sup>^m,g<sup>1</sup> <sup>¼</sup> <sup>0</sup>;

<sup>L</sup>^m,g<sup>3</sup> <sup>¼</sup> Lg,max εg ,

<sup>L</sup>^m,s<sup>1</sup> <sup>¼</sup> <sup>0</sup>;

<sup>L</sup>^m,s<sup>3</sup> <sup>¼</sup> Ls,max εs ,

þX<sup>K</sup><sup>00</sup>

X<sup>K</sup><sup>0</sup> k0 ¼1 2 dk,m

<sup>L</sup>^m, <sup>g</sup>1, <sup>L</sup>^m, <sup>g</sup>3, <sup>L</sup>^m,s1, <sup>L</sup>^m,s3, <sup>p</sup>^m1, and <sup>p</sup>^m<sup>3</sup> denote the scenarios that where the optimal solutions line on the boundaries of the inequality constraints. <sup>L</sup>^m, <sup>g</sup>2, <sup>L</sup>^m,s2, and <sup>p</sup>^m<sup>2</sup> denote the interior solutions.

the utility and storage companies. Thus, the analysis of the corresponding pg and ps is omitted here. Considering the price competition game between the utility company and the storage company, pm can be viewed as a function of pg and ps based on Eq. (18), which is given by

<sup>ε</sup><sup>g</sup> and Lm,s <sup>¼</sup> 0 or Lm,s <sup>¼</sup> Ls,max

<sup>k</sup>00¼<sup>1</sup> Lk, <sup>b</sup> � <sup>μ</sup><sup>m</sup>;<sup>1</sup>

Xk,m � pm dk,m

Based on KKT conditions, the optimal amount of electricity procured from the utility company

<sup>L</sup>^m,g<sup>2</sup> <sup>¼</sup> Xm, <sup>g</sup> � pg � <sup>μ</sup><sup>m</sup>;<sup>1</sup> dm, <sup>g</sup>

In a similar way, based on KKT conditions, the optimal amount of electricity procured from the

<sup>L</sup>^m,s<sup>2</sup> <sup>¼</sup> Xm,s � ps � <sup>μ</sup><sup>m</sup>;<sup>1</sup> dm,s

<sup>þ</sup> <sup>X</sup> K00

k00¼1

,

,

X<sup>K</sup><sup>0</sup> k 0 ¼1 1 dk,m

pm ¼ Am;<sup>1</sup>pg þ Am;<sup>2</sup>ps þ Am;<sup>3</sup>, ð19Þ

,

<sup>ε</sup><sup>s</sup> , there is no price competition between

Lk, <sup>b</sup>: ð15Þ

ð16Þ

ð17Þ

ð18Þ

k¼1

8 >>>>>>><

>>>>>>>:

8 >>>>>><

>>>>>>:

p^m<sup>1</sup> ¼ 0;

8

>>>>>>>><

>>>>>>>>:

X<sup>K</sup><sup>0</sup> k0 ¼1 Xk,m dk,m

p^m<sup>3</sup> ¼ pm,max,

p^m<sup>2</sup> ¼

is given by

storage company is given by

220 Development and Integration of Microgrids

The optimal price is given by

When Lm, <sup>g</sup> <sup>¼</sup> 0 or Lm, <sup>g</sup> <sup>¼</sup> Lg,max

where

$$\begin{aligned} A\_{\mathcal{S},1} &= -\frac{1}{d\_{m,\mathcal{S}}} + \frac{\frac{1}{d\_{m,\mathcal{S}}} - \sum\_{k'=1}^{\kappa'} \frac{A\_{m,1}}{d\_{k,m}}}{1 + \frac{d\_{m,\mathcal{S}}}{d\_{m,\mathcal{S}}}}, \\\\ A\_{\mathcal{S},2} &= \frac{X\_{m,\mathcal{S}}}{d\_{m,\mathcal{S}}} - \frac{X\_{m,\mathcal{S}} + \frac{X\_{m,\mathcal{S}} - p\_s}{d\_{m,s}} \sum\_{k'=1}^{\kappa^\*} \frac{X\_{k,m} - A\_{m,2}p\_s - A\_{m,3}}{d\_{k,m}} + \sum\_{k'=1}^{\kappa^\*} L\_{k,b} - \hat{L}\_r - \Delta} \, \end{aligned} \tag{22}$$

Hence, Ug can be written as a quadratic function of pg, which is given by

$$ML\_{\mathcal{S}}(p\_{\mathcal{g}}) = A\_{\mathcal{S},3}(p\_{\mathcal{g}})^2 + A\_{\mathcal{S},4}p\_{\mathcal{g}} + A\_{\mathcal{g},5\prime} \tag{23}$$

where

$$\begin{split} A\_{\mathcal{S},3} &= A\_{\mathcal{S},1} - \varepsilon\_{\mathcal{S}}^2 (a\_{\mathcal{S}} + \alpha\_{\mathcal{S}}) A\_{\mathcal{S},1\prime}^2 \\ A\_{\mathcal{S},4} &= A\_{\mathcal{S},2} [1 - 2\varepsilon\_{\mathcal{S}}^2 (a\_{\mathcal{S}} + \alpha\_{\mathcal{S}}) A\_{\mathcal{S},1}] - \varepsilon\_{\mathcal{S}} (b\_{\mathcal{S}} + \beta\_{\mathcal{S}}) A\_{\mathcal{S},1\prime} \\ A\_{\mathcal{S},5} &= -\varepsilon\_{\mathcal{S}}^2 (a\_{\mathcal{S}} + \alpha\_{\mathcal{S}}) A\_{\mathcal{S},2}^2 - \varepsilon\_{\mathcal{S}} (b\_{\mathcal{S}} + \beta\_{\mathcal{S}}) A\_{\mathcal{S},2} - \mathfrak{c}\_{\mathcal{S}}. \end{split} \tag{24}$$

Since Ug is a convex function of pg based on Eq. (22), the authors can obtain p^<sup>g</sup> by solving the convex function that

$$
\hat{p}\_{\mathcal{g}} = -\frac{A\_{\mathcal{g},4}}{2A\_{\mathcal{g},3}}.\tag{25}
$$

In the same way, p^<sup>s</sup> can be obtained similarly as above since p^<sup>s</sup> has the same solution structure with p^g. The detailed process is omitted here due to space limitations.

#### 4.2. Algorithm of wind power forecasting

We propose a deep learning-based short-term wind power forecasting algorithm by combining SAE, the back-propagation algorithm, and the genetic algorithm. It is noted that the proposed forecasting model can also be applied for other distributed renewable energy sources such as solar energy, hydroenergy, etc. The reason why the authors study the wind power forecasting in this chapter is mainly due to the illustration purpose and the availability of the wind big data. The core of the algorithm is to establish a forecasting model through training on the historical data. Exploiting the statistical relationship among the historical time series data can be divided into two processes: the pre-training process and the fine-tuning process. In the pre-training process, three stacked AEs, which consist of one visible layer, one hidden layer, and one output layer form a neural network. In the fine-tuning process, one more layer is added to the end of the neural network and back-propagation algorithm is applied to obtain more appropriate initial weights of the whole network. Furthermore, for improving the forecasting accuracy, we adopt genetic algorithm to optimize the learning rate of each AE and the number of neurons of each layer.

#### 4.2.1. Training process of the proposed genetic SAE forecasting model

As shown in Figure 3(a), SAE consists of one input layer x, the first hidden layer h1, and one output layer x^. We adopt encoder function f <sup>θ</sup><sup>1</sup> to transform x to a low or a high-dimensional code h<sup>1</sup> and adopt decoder function gθ<sup>1</sup> to reconstruct the original data as x^. We can obtain the values of parameters <sup>θ</sup><sup>j</sup> <sup>¼</sup> {wj, bj, wT <sup>j</sup> , dj}, j∈ {1; 2;…, J} (J denotes the number of layers in SAE) through back propagation, where wj and wT <sup>j</sup> are weight matrices of the encoder and the decoder, bj and dj are biases of the encoder and the decoder, respectively.

We add a new hidden layer h<sup>2</sup> to the whole network, new layer and the original layers are stacked into the existing AE in Figure 3(b). There is a new AE illustrated since h<sup>1</sup> and h<sup>2</sup> are combined as the input layers. Hence, the authors can stack more auto encoders by removing the last layer h<sup>1</sup> and add one more layer. Considering computation complexity, three auto coders are stacked together in this section. The pre-training process is shown as Figure 3(a) and (b), which consists of two hidden layers h1, h<sup>2</sup> and trains the initial weights of the whole network.

Energy Management in Microgrids: A Combination of Game Theory and Big Data‐Based Wind Power Forecasting http://dx.doi.org/10.5772/intechopen.68980 223

Figure 3. The pre-training and fine-tuning process of genetic SAE.

In Figure 3(c), to form the whole genetic SAE neural network, we add an output layer and initialize the set of parameter w4, b<sup>4</sup> between the last hidden layer and the output layer. The process which we adopt back-propagation algorithm to train all the weights and biases of the whole network is called the fine-tuning process. Hence, a deep network with three hidden layers can be trained to converge to a global minimum by the process we proposed.

#### 4.2.2. Optimization of the proposed model

Ag;<sup>3</sup> <sup>¼</sup> Ag;<sup>1</sup> � <sup>ε</sup><sup>2</sup>

Ag;<sup>5</sup> ¼ �ε<sup>2</sup>

4.2. Algorithm of wind power forecasting

values of parameters <sup>θ</sup><sup>j</sup> <sup>¼</sup> {wj, bj, wT

through back propagation, where wj and wT

convex function that

222 Development and Integration of Microgrids

Ag;<sup>4</sup> <sup>¼</sup> Ag;<sup>2</sup>½<sup>1</sup> � <sup>2</sup>ε<sup>2</sup>

<sup>g</sup>ðag <sup>þ</sup> <sup>α</sup>gÞA<sup>2</sup>

<sup>g</sup>ðag <sup>þ</sup> <sup>α</sup>gÞA<sup>2</sup>

with p^g. The detailed process is omitted here due to space limitations.

4.2.1. Training process of the proposed genetic SAE forecasting model

decoder, bj and dj are biases of the encoder and the decoder, respectively.

of two hidden layers h1, h<sup>2</sup> and trains the initial weights of the whole network.

g;1,

Since Ug is a convex function of pg based on Eq. (22), the authors can obtain p^<sup>g</sup> by solving the

<sup>p</sup>^<sup>g</sup> ¼ � Ag;<sup>4</sup> 2Ag;<sup>3</sup>

In the same way, p^<sup>s</sup> can be obtained similarly as above since p^<sup>s</sup> has the same solution structure

We propose a deep learning-based short-term wind power forecasting algorithm by combining SAE, the back-propagation algorithm, and the genetic algorithm. It is noted that the proposed forecasting model can also be applied for other distributed renewable energy sources such as solar energy, hydroenergy, etc. The reason why the authors study the wind power forecasting in this chapter is mainly due to the illustration purpose and the availability of the wind big data. The core of the algorithm is to establish a forecasting model through training on the historical data. Exploiting the statistical relationship among the historical time series data can be divided into two processes: the pre-training process and the fine-tuning process. In the pre-training process, three stacked AEs, which consist of one visible layer, one hidden layer, and one output layer form a neural network. In the fine-tuning process, one more layer is added to the end of the neural network and back-propagation algorithm is applied to obtain more appropriate initial weights of the whole network. Furthermore, for improving the forecasting accuracy, we adopt genetic algorithm to optimize the learning rate of each AE and the number of neurons of each layer.

As shown in Figure 3(a), SAE consists of one input layer x, the first hidden layer h1, and one output layer x^. We adopt encoder function f <sup>θ</sup><sup>1</sup> to transform x to a low or a high-dimensional code h<sup>1</sup> and adopt decoder function gθ<sup>1</sup> to reconstruct the original data as x^. We can obtain the

We add a new hidden layer h<sup>2</sup> to the whole network, new layer and the original layers are stacked into the existing AE in Figure 3(b). There is a new AE illustrated since h<sup>1</sup> and h<sup>2</sup> are combined as the input layers. Hence, the authors can stack more auto encoders by removing the last layer h<sup>1</sup> and add one more layer. Considering computation complexity, three auto coders are stacked together in this section. The pre-training process is shown as Figure 3(a) and (b), which consists

<sup>j</sup> , dj}, j∈ {1; 2;…, J} (J denotes the number of layers in SAE)

<sup>j</sup> are weight matrices of the encoder and the

<sup>g</sup>ðag þ αgÞAg;<sup>1</sup>� � εgðbg þ βgÞAg;<sup>1</sup>,

ð24Þ

<sup>g</sup>;<sup>2</sup> � εgðbg þ βgÞAg;<sup>2</sup> � cg:

: ð25Þ

The learning rate of the network and the number of neurons in hidden layer are the key parameters which have a significant impact on the final prediction performance. Hence, we adopt the genetic algorithm to optimize the parameters of the SAE and the whole network for improving the performance of the models. We regard the historical time series data x as the


individuals of population in genetic algorithm and obtain a multidimensional vector Pðd, tÞ, where there are d individuals in the population denoted as d∈ D ¼ {1;…, d,…, D} and t∈ T ¼ {1;…, t, …, T} is the number of evolution. We assume that the size of the population is D and the maximum of evolution is T. First, we set the initial population as Pð0, 0Þ. Then, we calculate the objective value and the fitness value to select optimal individual for the next generation. After crossover and mutation, we can obtain optimal individual Pðd, TÞ. Algorithm 1 shows the optimization process of the proposed model. To make a fair comparison, we optimize the parameters of the BP algorithm and the SVM algorithm in the similar way. The mean absolute percentage error (MAPE) provides a statistical measure of prediction accuracy of a forecasting method, which is expressed in percentage. It measures how much forecasts can differ from the actual data, which is summed for every evaluation points and divided by the total number of points. Since MAPE has been widely adopted in wind power forecasting, the authors also adopt it to evaluate the accuracy of the prediction model.

### 5. Simulation results

In order to evaluate the prediction accuracy of the proposed wind-forecasting model, real data of wind turbines, which were collected form a local micorgrid in Hebei Province, China, are employed to perform the training and forecasting processes. By excluding unnecessary information, the 1-year data samples of active power, which spans from September 2015 to October 2016, are utilized for simulations. The proposed game-theoretical energy management algorithm with big data-based wind power forecasting is implemented based on Matlab. Simulation results are performed for a scenario which consists of the utility company, the energy storage company, the microgrid, and the users. The simulation parameters are summarized in Table 2. Figure 4 shows the optimal electricity prices of the utility company, the energy storage company, and the microgrid, that is, p^g, p^s, and p^m, versus the basic electricity demands of users Lk, <sup>b</sup>. Lk, <sup>b</sup> is increased from 10 to 100 kW with a step of10, and the corresponding p^g, p^s, and p^<sup>m</sup> are obtained by the proposed algorithm. The simulation results demonstrate that p^g, p^s, and p^<sup>m</sup> increase monotonically as Lk, <sup>b</sup> increases, which is reasonable since the electricity generation cost also increase dramatically as Lk, <sup>b</sup> increases. p^<sup>s</sup> > p^<sup>g</sup> is due to the preference of the microgrid to use clean renewable energy stored by the energy storage company. In addition, we have p^<sup>m</sup> > p^<sup>g</sup> and p^<sup>m</sup> > p^s. Since only one microgrid has been considered in the second stage, the microgrid is always able to make more profits by announcing higher prices toward users than those of the utility and the energy storage companies.

Figures 5 and <sup>6</sup> show the optimal payoff of the microgrid Umðp^m, <sup>L</sup>^m, g, <sup>L</sup>^m,s<sup>Þ</sup> versus the prediction error of wind power forecasting Δ for the two scenarios Δ > 0 and Δ < 0, respectively. Here, Δ > 0 represents that the actual wind power output is less than the predicted amount, and the microgrid has to procure more electricity from both the utility and the energy storage companies. In comparison, Δ < 0 represents that the actual wind power output is more than the predicted amount, and the microgrid will not procure the specified amount of electricity from both the utility and the energy storage companies. Three cases where Lk, <sup>b</sup> ¼ 40; 60; and 80 kW


Table 2. Simulation parameters.

individuals of population in genetic algorithm and obtain a multidimensional vector Pðd, tÞ, where there are d individuals in the population denoted as d∈ D ¼ {1;…, d,…, D} and t∈ T ¼ {1;…, t, …, T} is the number of evolution. We assume that the size of the population is D and the maximum of evolution is T. First, we set the initial population as Pð0, 0Þ. Then, we calculate the objective value and the fitness value to select optimal individual for the next generation. After crossover and mutation, we can obtain optimal individual Pðd, TÞ. Algorithm 1 shows the optimization process of the proposed model. To make a fair comparison, we optimize the parameters of the BP algorithm and the SVM algorithm in the similar way. The mean absolute percentage error (MAPE) provides a statistical measure of prediction accuracy of a forecasting method, which is expressed in percentage. It measures how much forecasts can differ from the actual data, which is summed for every evaluation points and divided by the total number of points. Since MAPE has been widely adopted in wind power forecasting, the

8: Evaluate fitness of Pðd, tÞ: Calculate and store the best, worst, and average objective value for current individuals.

11: Crossover operation to Pðd, tÞ: Do crossover operation on the selected individuals and obtain better individuals.

12: Mutation operation to Pðd, tÞ: Do mutation operation to Pðd, tÞ based on a certain mutation probability.

9: Select operation to Pðd, tÞ: Select optimal individual for the next generation.

In order to evaluate the prediction accuracy of the proposed wind-forecasting model, real data of wind turbines, which were collected form a local micorgrid in Hebei Province, China, are employed to perform the training and forecasting processes. By excluding unnecessary information, the 1-year data samples of active power, which spans from September 2015 to October 2016, are utilized for simulations. The proposed game-theoretical energy management algorithm with big data-based wind power forecasting is implemented based on Matlab. Simulation results are performed for a scenario which consists of the utility company, the energy

authors also adopt it to evaluate the accuracy of the prediction model.

5. Simulation results

Algorithm 1 The proposed genetic SAE Algorithm

1: Procedure: Genetic Algorithm

224 Development and Integration of Microgrids

7: The Pre-training Process:

10: The Fine-turning Process:

2: Begin

4: Set t ¼ 0 5: while t < T do 6: for d∈ D do

13: end for

15: end while

14: Update: t ¼ t þ 1

3: Initialize: Pð0, 0Þ

Figure 4. The optimal electricity prices of the utility company p^g, the energy storage company p^<sup>s</sup> , and the microgrid p^<sup>m</sup> versus the basic electricity demands of user Lk;<sup>b</sup>.

Figure 5. The optimal payoff of the microgrid Um versus the prediction error of wind power forecasting Δ > 0.

have been considered. Both Figures 5 and 6 show that the optimal payoff of the microgrid decreases monotonically as jΔj increases. For example, if Δ is increased from 0 to 10 kW or decreased from 0 to �10 kW, the optimal payoff will be decreased by 9.2 and 22.1% when

Energy Management in Microgrids: A Combination of Game Theory and Big Data‐Based Wind Power Forecasting http://dx.doi.org/10.5772/intechopen.68980 227

Figure 6. The optimal payoff of the microgrid Um versus the prediction error of wind power forecasting Δ < 0.

Lk, <sup>b</sup> ¼ 40 kW, respectively. The reason is that the microgrid will be charged for the difference between the predicted and actual electricity procurement quantities, due to the restriction of power purchase agreement. It is also clear that the optimal payoff is degraded more severely

Figure 7. MAPE of three different models with wind power forecasting step varies.

have been considered. Both Figures 5 and 6 show that the optimal payoff of the microgrid decreases monotonically as jΔj increases. For example, if Δ is increased from 0 to 10 kW or decreased from 0 to �10 kW, the optimal payoff will be decreased by 9.2 and 22.1% when

Figure 5. The optimal payoff of the microgrid Um versus the prediction error of wind power forecasting Δ > 0.

Figure 4. The optimal electricity prices of the utility company p^g, the energy storage company p^<sup>s</sup>

versus the basic electricity demands of user Lk;<sup>b</sup>.

226 Development and Integration of Microgrids

, and the microgrid p^<sup>m</sup>

when Δ < 0 compared to Δ > 0. The reason is that the electricity prices of the utility and the energy storage companies are higher when Δ < 0 compared to the case of Δ > 0.

Figure 7 shows the MAPE value of three different algorithms including BP, SVM, and genetic SAE versus wind power forecasting step. The process of wind power forecasting based on historical data in current time is called step 1. By adding the prediction result to the historical data, the authors can obtain a new prediction result in next hour and the process is called step 2, and so on. A higher step means longer period of prediction, which presents lead to less precise predictions and high MAPE. From the simulation results, the authors found that MAPE increases as prediction step increases. Thus, we can come to the conclusion that the result becomes inaccurate as the step increases. Furthermore, the simulation results demonstrate the authors obtain a minimum prediction error by genetic SAE algorithm compared to the other two algorithms. More concretely, the predicted absolute error decreases by 7.3% compared with the SVM algorithm and 32.4% compared with the BP algorithm when step 5.

### 6. Conclusions

In this chapter, the authors proposed to utilize the big data-based power generation forecasting techniques to obtain the short-term wind power forecasting results that assist the microgrid to implement energy management strategies. Simulation results validated the proposed algorithm and demonstrated that the optimal payoff of the microgrid is decreased due to the prediction error. The proposed genetic SAE algorithm is demonstrated to provide the most accurate predictions, which is helpful for energy management. In future work, we will emphasize on cooperative energy management among multiple microgrids based on the predictions of renewable power and electricity consumption.

### Author details

Zhenyu Zhou\*, Fei Xiong, Chen Xu and Runhai Jiao

\*Address all correspondence to: zhenyu\_zhou@ncepu.edu.cn

The State Key Laboratory of Alternate Electrical Power System with Renewable Energy Sources, School of Electrical and Electronic Engineering, North China Electric Power University, Beijing, China

### References

[1] Rifkin J. The Third Industrial Revolution: How Lateral Power is Transforming Energy, The Economy, and The World. New York: Palgrave Macmillan Trade; 2011

[2] Katz R, Culler D, Sanders S, Lutz K. An information-centric energy infrastructure: The Berkeley view. Sustainable Computing: Informatics and Systems. 2011;1(1):7–22

when Δ < 0 compared to Δ > 0. The reason is that the electricity prices of the utility and the

Figure 7 shows the MAPE value of three different algorithms including BP, SVM, and genetic SAE versus wind power forecasting step. The process of wind power forecasting based on historical data in current time is called step 1. By adding the prediction result to the historical data, the authors can obtain a new prediction result in next hour and the process is called step 2, and so on. A higher step means longer period of prediction, which presents lead to less precise predictions and high MAPE. From the simulation results, the authors found that MAPE increases as prediction step increases. Thus, we can come to the conclusion that the result becomes inaccurate as the step increases. Furthermore, the simulation results demonstrate the authors obtain a minimum prediction error by genetic SAE algorithm compared to the other two algorithms. More concretely, the predicted absolute error decreases by 7.3% compared with the SVM algorithm and 32.4% compared with the BP algorithm when step 5.

In this chapter, the authors proposed to utilize the big data-based power generation forecasting techniques to obtain the short-term wind power forecasting results that assist the microgrid to implement energy management strategies. Simulation results validated the proposed algorithm and demonstrated that the optimal payoff of the microgrid is decreased due to the prediction error. The proposed genetic SAE algorithm is demonstrated to provide the most accurate predictions, which is helpful for energy management. In future work, we will emphasize on cooperative energy management among multiple microgrids based on the pre-

The State Key Laboratory of Alternate Electrical Power System with Renewable Energy Sources, School of Electrical and Electronic Engineering, North China Electric Power

[1] Rifkin J. The Third Industrial Revolution: How Lateral Power is Transforming Energy,

The Economy, and The World. New York: Palgrave Macmillan Trade; 2011

dictions of renewable power and electricity consumption.

Zhenyu Zhou\*, Fei Xiong, Chen Xu and Runhai Jiao

\*Address all correspondence to: zhenyu\_zhou@ncepu.edu.cn

energy storage companies are higher when Δ < 0 compared to the case of Δ > 0.

6. Conclusions

228 Development and Integration of Microgrids

Author details

University, Beijing, China

References


[31] Saad W, Han Z, Poor H, Basar T. Game-theoretic methods for the smart grid: An overview of microgrid systems, demand-side management, and smart grid communications. IEEE Signal Processing Magazine. 2012;29(5):86–105

[17] Xiang Y, Liu J, Liu Y. Robust energy management of microgrid with uncertain renewable

[18] Khalid M, Savkin A. A method for short-term wind power prediction with multiple observation points. IEEE Transactions on Power Systems. 2012;27(2):579–586

[19] Zhang J, Wang C. Application of ARMA model in ultra-short term prediction of wind

[20] Yunus K, Thiringer T, Chen P. ARIMA-based frequency-decomposed modeling of wind speed time series. IEEE Transactions on Power Systems. 2016;31(4):2546–2556

[21] Kurian S, Krishnan S, Cheriyan E. Real time implementation of artificial neural networksbased controller for battery storage supported wind electric generation. IET Generation,

[22] Gu B, Sheng V. A robust regularization path algorithm for v-support vector classification. IEEE Transactions on Neural Networks and Learning Systems. 2017;28(5): 1241–1248 [23] Gu B, Sheng V, Tay K, Romano W, Li S. Incremental support vector learning for ordinal regression. IEEE Transactions on Neural Networks and Learning Systems. 2015;26(7):2546–

[24] Methaprayoon K, Yingvivatanapong C, Lee W, Liao J. An integration of ANN wind power estimation into unit commitment considering the forecasting uncertainty. IEEE

[25] Yang L, He M, Zhang J, Vittal V. Support-vector-machine-enhanced Markov model for short-term wind power forecast. IEEE Transactions on Sustainable Energy. 2015;6(3):791–799

[26] Hosseini-Asl E, Zurada J, Nasraoui O. Deep learning of part-based representation of data using sparse autoencoders with nonnegativity constraints. IEEE Transactions on Neural

[27] Thirukovalluru R, Dixit S, Sevakula R, Verma N, Salour A. Generating feature sets for fault diagnosis using denoising stacked auto-encoder. In: Proc. IEEE ICPHM'16; Ottawa,

[28] Jiang Q, Xue M, Geng G. Energy management of microgrid in grid-connected and stand-

[29] Xie S, Zhong W, Xie K, Yu R, Zhang Y. Fair energy scheduling for vehicle-to-grid networks using adaptive dynamic programming. IEEE Transactions on Neural Networks

[30] Yu R, Zhong W, Xie S, Yuen C, Gjessing S, Zhang Y. Balancing power demand through EV mobility in vehicle-to-grid mobile energy networks. IEEE Transactions on Industrial

alone modes. IEEE Transactions on Power Systems. 2013;28(3):3380–3389

generation and load. IEEE Transactions on Smart Grid. 2016;7(2):1034–1043

power. In: Proc. CSA'13; Wuhan China; 2013. pp. 361–364

Transmission and Distribution. 2015;9(10):937–946

Transactions on Industry Applications. 2007;43(6):1441–1448

Networks and Learning Systems. 2016;27(12):2486–2498

and Learning Systems. 2016;27(8):1697–1707

2556

230 Development and Integration of Microgrids

Canada; 2016. pp. 1–7

Informatics. 2016;12(1):77–90

