• Ei tuloksia

Computational intelligence for smart grid’s flexibility : prediction, coordination, and optimal pricing

N/A
N/A
Info
Lataa
Protected

Academic year: 2022

Jaa "Computational intelligence for smart grid’s flexibility : prediction, coordination, and optimal pricing"

Copied!
112
0
0

Kokoteksti

(1)

Dissertations in Forestry and Natural Sciences

TAHA ABD EL HALIM NAKABI

Computational intelligence for smart

grid’s flexibility

Prediction, coordination, and optimal pricing PUBLICATIONS OF

THE UNIVERSITY OF EASTERN FINLAND

(2)
(3)

Computational intelligence for smart grid’s flexibility

Prediction, coordination, and optimal pricing

(4)
(5)

Taha Abd El Halim Nakabi

Computational intelligence for smart grid’s flexibility

Prediction, coordination, and optimal pricing

Publications of the University of Eastern Finland Dissertations in Forestry and Natural Sciences

No 399

University of Eastern Finland Kuopio

2020

(6)

Grano Oy Jyväskylä, 2020

Editor in-Chief: Pertti Pasanen Editor: Matti Tedre

Sales: University of Eastern Finland Library ISBN: 978-952-61-3610-3 (print)

ISBN: 978-952-61-3611-0 (PDF) ISSNL: 1798-5668

ISSN: 1798-5668 ISSN: 1798-5676 (PDF)

(7)

Author’s address: Taha Abd El Halim Nakabi University of Eastern Finland School of computing.

P.O. Box 1627,

70211 KUOPIO, FINLAND

email: tahanak@uef.fi

Supervisors: Professor Pekka Toivanen, PhD University of Eastern Finland School of computing.

P.O. Box 1627,

70211 KUOPIO, FINLAND email: pekka.toivanen@uef.fi

Project Manager, Ph.D. Keijo Haataja University of Eastern Finland

School of Computing P.O. Box 1627

70211 KUOPIO, FINLAND

email: keijo.haataja@uef.fi

Reviewers: Professor Peter Palensky, Ph.D Delft University of Technology

Department Electrical Sustainable Energy Mathematics and Computer Science

Mekelweg 4, 2628 CD Delft, NETHERLANDS email: p.palensky@tudelft.nl

Professor Damien Ernst, PhD Liège University

Montefiore Research Unit

Quartier Polytech 1, Allée de la découverte n°10, 4000 Liège BELGIUM

email: dernst@uliege.be

Opponent: Professor Matti Lehtonen, PhD Aalto University

Department of Electrical Engineering and Automation Espoo, Finland

(8)
(9)

Nakabi, Taha Abd El Halim

Computational intelligence for smart grid’s flexibility. Prediction, coordination, and optimal pricing.

Kuopio: University of Eastern Finland, 2020 Publications of the University of Eastern Finland

Dissertations in Forestry and Natural Sciences 2020; 399 ISBN: 978-952-61-3610-3 (print)

ISSNL: 1798-5668 ISSN: 1798-5668

ISBN: 978-952-61-3611-0 (PDF) ISSN: 1798-5676 (PDF)

Abstract

The transition from fossil fuels to renewable energies require a

transformation of the electriciy grid’s infrastructure and management.

Smart grid has been a central concept to safely lead this transformation and improve the quality of energy supply. Flexibility is a fundamental feature for the operations of power networks, yet not directly acheivable by renewable energy resources due to their intermittent nature. Hence there is a need for alternative sources of flexibility such as energy storage and demand side management. Such elements can offer a considerable and cost effective flexibility to the grid, when combined with smart meters’

data and intelligent coordination algorithms.

This Thesis seeks to explore possible scenarios of demand flexibility and present novel algorithms for analysis, prediction, and coordination of various flexible components in the grid. The proposed scenarios show a great advantage of the demand flexibility and storage systems in the context of the Finnish power grid. The proposed coordination algorithms based on a variety of neural network architectures, outperformed

the existing methods and improved the cost efficiency, both for utility companies and customers.

(10)

Universal Decimal Classification: 004.032.26, 004.421, 004.8, 621.311.1

Library of Congress Subject Headings: Electric power distribution;

Smart power grids; Microgrids (Smart power grids); Artificial intelligence;

Computational intelligence; Neural networks (Computer science);

Algorithms; Supervised learning (Machine learning); Reinforcement learning; Mathematical optimization; Supply and demand; Markets;

Management; Cost effectiveness; Pricing

Yleinen suomalainen ontologia: sähkönjakelu; älykkäät sähköverkot;

mikroverkot; tekoäly; neuroverkot; algoritmit; koneoppiminen; optimointi;

kysyntä; joustavuus; sähkömarkkinat; johtaminen; kustannustehokkuus;

hinnoittelu

(11)

Acknowledgements

This Thesis is funded by Antti Wihuri Foundation to whom I am sincerely grateful.

My sincere thanks and gratitude go also to all those who helped me start and complete this Thesis and overcome the difficulties.

Many thanks to my parents and siblings who inspired and supported me to complete my studies and achieve my dreams.

Special thanks go also to my supervisors Pekka Toivanen and Keijo Haataja, who gave me valuable advice and constructive guidance that helped me in the completion of this research work.

Kuopio, November 4th 2020 Taha Nakabi

(12)

List of abbreviations

AI Artificial Intelligence

A3C Asynchronous Advantage Actor-Critic AMI Advanced Metering Infrastructure ANN Artificial Neural Network

DER Distributed Energy Resource DR Demand Response

DRL Deep Reinforcement Learning DSO Distribution System Operator ESS Energy Storage System LSTM Long-Short-Term Memory MDP Markov-Decision Process ML Machine Learning

RL Reinforcement Learning RNN Recurrent Neural Network

TCL Thermostatically Controlled Load TSO Transmission System Operator

(13)

List of original publications

This Thesis is based on data presented in the following articles, referrred to by the Roman Numerals I-IV.

I. T.A. Nakabi, K. Haataja, and P. Toivanen, “Computational Intelligence for Demand Side Management and Demand Response Programs in Smart Grids,” In Proceedings of BIOMA’2018 Int. Conf. on Bioinspired Optimization Methods and their Applications, pp. 320-327, May 2018, Paris, France.

II. T. A. Nakabi and P.Toivanen, “An ANN-based Model for Learning Individual Customer Behavior in Response to Electricity Prices,”

Sustainable Energy, Grids and Networks, vol. 18, 2019, doi: 10.1016/j.

segan.2019.100212.

III. T. A. Nakabi and P.Toivanen, “Optimal Price-Based Control of

Heterogeneous Thermostatically Controlled Loads Under Uncertainty Using LSTM Networks and Genetic Algorithms,” F1000Research 2019, 8:1619, doi: 10.12688/f1000research.20421.1

IV. T. A. Nakabi and P.Toivanen, “Deep Reinforcement Learning for Energy Management in a Microgrid with Flexible Demand,” submitted for second review to: Sustainable Energy, Grids, and Networks.

(14)

Author’s contribution

I. The Author has been the main contributor of this publication. All the literature review, analysis, interpretations, and writing has been done by the Author. Others have provided valuable guidance, supervision, or ideas.

II. The Author has been the main contributor of this publication. All of the data analysis, interpretation of results, and writing has been done by the Author. Others have provided valuable guidance, supervision, or ideas.

III. The Author has been the main contributor of this publication. All of the data analysis, interpretation of results, and writing has been done by the Author. Others have provided valuable guidance, supervision, or ideas.

IV. The Author has been the main contributor of this publication. All of the data analysis, comparisons, interpretation of results, and writing has been done by the Author. Others have provided valuable guidance, supervision, or ideas.

Throughout this dissertation, these publications will be referred to by P1- P4. The publications have been reprinted at the end of this dissertation by the permission of their copyright holders.

(15)

Table of contents

Abstract ... 7

Acknowledgements ... 9

1 Introduction ... 17

1.1 Research objectives and questions ... 19

1.2 Research methodology ... 22

1.3 Contributions ... 24

1.4 Structure of the dissertation ... 25

2 Power grid and electricity markets ... 27

2.1. Power grid components and stakeholders ... 27

2.2. Wholesale markets ... 30

2.3. Retail markets ... 32

3 Smart grid challenges and solutions ... 35

3.1 Renewable energies integration ... 35

3.2 Flexibility providers ... 36

3.2.1 Economic Energy Storage ... 36

3.2.2 Controllable Loads ... 37

3.2.3 Demand Response (DR) ... 38

3.2.4 Market-Based Balancing ... 39

3.3 Advanced metering infrastructure (AMI) ... 39

3.3.1 Smart Meters ... 39

3.3.2 AMI Architecture and Communication ... 40

3.3.3 Security and Privacy Issues ... 41

3.3.4 Security and Privacy Requirements ... 41

3.4 Microgrids ... 42

3.4.1 Typical Elements of a Microgrid ... 43

3.4.2 Control Hierarchy in Microgrids ... 43

3.4.3 Microgrid’s Energy Management System ... 44

4 Intelligent algorithms ... 47

4.1 Supervised learning ... 47

4.1.1 Least Squares Linear Regression ... 47

4.1.2 Support Vector Machines (SVMs) ... 48

4.1.3 Neural Networks ... 49

(16)

4.2 Unsupervised learning... 52

4.2.1 K-Means Algorithm ... 52

4.2.2 Self-Organizing Maps (SOMs) ... 53

4.3 Reinforcement learning (RL) ... 53

4.3.1 Markov-Decision Process (MDP) Formulation ... 54

4.3.2 Deep Reinforcement Learning (DRL) ... 55

4.4 Search and Optimization ... 56

4.4.1 Deterministic Optimization ... 57

4.4.2 Probabilistic Optimization ... 59

4.4.3 Robust Optimization ... 60

5 Novel solutions and practical experiments ... 63

5.1 Demand forecasting with regards to electricity prices and weather conditions ... 63

5.2 Thermostatically controlled loads management ... 64

5.3 Microgrid energy management ... 66

6 Conclusions and future work ... 69

7 Bibliography ... 73

(17)

LIST OF FIGURES

Figure 1: Power grid’s operations. ... 28 Figure 2: Electricity markets’ operations and stakeholders ... 29 Figure 3: Market clearing process ... 31 Figure 4: Architectural model of conventional energy meter and

smart meter. Figure is reproduced by the authors and

inspired from [23]. ... 40 Figure 5: Microgrid control architecture. Figure is reproduced by the

author and inspired from [39]. ... 44 Figure 6: Load forecast for shiftable price responsive appliances.

(NN results) ... 64 Figure 7: Load forecast for TCLs. (LSTM results) ... 64 Figure 8: TCL cluster control example. The upper graph shows the

distribution of the states of charge of the TCL cluster.

The green area indicates the comfort area where the indoor temperature is between 19°C and 24 °C. The lower graph shows the amount of energy allocated to the TCLs compared with the total energy generated. ... 65 Figure 9: The proposed microgrid architecture and the control

mechanisms used in the microgrid management system. .. 67 Figure 10: Outcomes of control signals from the DRL-based EMS

related to one day. ... 67

(18)
(19)

1 Introduction

Recent advances in artificial intelligence (AI) and machine learning (ML) are influencing many aspects of today’s society. The success of AI is a result of the availability of large amounts of data and high computational power.

The advances of AI technology can contribute to the next revolution in the most vital asset of the modern life: electricity. Massive amounts of electricity consumption and generation of data is made available thanks to the recently implemented metering infrastructure [1]. Therefore, AI and ML techniques can use this data and infrastructure to tackle the challenges of the new power grid allowing more integration of renewable energies, reducing carbon emission, saving generation costs, integrating electric vehicles, increasing network reliability, and offering better products to the final customers at lower prices.

With the increase of the electricity demand, the crucial role it plays in the modern life, and the environmental consequences of traditional energy resources, many challenges are facing today’s power network. Integrating renewable energy sources of intermittent and uncertain nature in a grid based on traditional on-demand energy generators, is one of the biggest challenges facing the grid. Unlike traditional, fossil fuel-based generators, most renewable energy resources are not flexible. In fact, the amount of energy generated by renewables depends, in most of the cases, on weather conditions or other parameters out of human control. Therefore, a high integration of renewables may undermine the power network’s ability to follow the vagaries of the continuous electricity demand and can lead to frequency disturbances and persistent blackouts. To ensure the continuity of normal and reliable operations in the grid, the transition to renewable energy resources must be implemented with caution, and the flexibility of traditional resources should be compensated with other forms of flexibility using innovative solutions involving all the actors in the power grid.

The power delivery from generators to consumers is a complex task that involves many actors and stakeholders. In fact, many countries have implemented a liberalized electricity market where the electricity supply

(20)

and demand are market driven [2]. Unlike traditional centralized power networks, liberalized markets are open for multiple actors generating, consuming, and trading power. The only monopoly in liberalized markets is the power transmission and the ownership of the electric grid, which is usually highly regulated. In this type of markets, all the operations are market-driven and therefore the improvements and innovative solutions for flexibility, reliability, and continuous supply/demand balancing should also follow the market mechanisms. Market-based solutions include market-based balancing, virtual power plants, strategic storage, and demand side management. Many of these solutions are implemented individually by market actors and therefore need to operate in highly uncertain environment. The decentralized and competitive nature of the liberalized electricity market makes the operations of each market actor rely on predictions and forecasts related to the availability of energy and the future demand. In many cases, mere forecasts do not give sufficient information to make optimal decisions that involve several parameters with complex dynamics. Additionally, the management of the operations is a continuous process and needs real-time decision making at every time step. For instance, electricity is traded in day-ahead and balanced in real-time, which requires continuous bids and asks of the right amounts of electricity for each time step of the near future. This kind of operations require accurate forecasts and predictions of the supply, demand, and prices, but also an automation of the bids and asks. The automation should consider the uncertainty of the electricity markets and take optimal decisions based on the real-time observations. This kind of automated systems cannot be achieved using explicit programming, expert systems, or business intelligence (BI) solutions because it involves optimal decision making in situations that were not expected by the human decision makers.

AI technology can be an answer to this challenge as it has shown the ability to “learn” hidden patterns or optimal solutions from historical data or from interactions with the environment through a trial-and-error process.

AI is a broad branch of computer science derived from the human endeavor to create intelligence similar to his own. Modern AI as a field of study has officially started with Marvin Minsky and John McCarthy in

(21)

1956, and defined AI as the attempt of building machines able to simulate human intelligence. The following two decades led to successful systems such as ELIZA [3] for natural language processing. After 1973, AI research has faced a lot of criticism related to its unfulfilled expectations and promises, which affected the funding for AI research and led to major refrains of its advances. The failure of AI research to fulfill the expectations is mainly related to the approach followed by early systems, which was based on expert systems, that is, a collection of rules which assume that human intelligence can be formalized and reconstructed in a top-down approach as a series of “if-then” statements [4]. Through the ups and downs periods, AI research took multiple paths in its attempt to achieve true AI, such as statistical methods and artificial neural networks (ANN).

However, in 1969 [5], ANN research refrained due to the lack of processing power. ANN made a return in 1990s with the emergence of the concept of “intelligent agent” [6], which has proven a better ability of reasoning in uncertain control problems compared to expert systems. In 2015 ANNs made a stronger come-back in the form of deep learning when AlphaGo, a program developed by Google, was able to beat the world champion in the board game Go. Today’s concept of AI has evolved to be mainly related to ANNs and deep learning instead of expert systems. AI programs are today present in everyday life and are the basis of image recognition algorithms used by Facebook, speech recognition algorithms used in smart speakers, and self-driving cars. New applications of AI algorithms are discovered on a daily basis in many fields and electricity networks are no exception.

Research in AI applications for smart grids is a promising opportunity for the flexible transition to renewable energies [7].

1.1 Research objectives and questions

The objective of this Thesis is to study potential sources of electricity demand flexibility as well as to explore, present, and develop new better variants of existing methods to manage the flexibility sources for optimal operations of the power network. We focus on residential

(22)

electricity demand and its responsiveness to prices and temperatures by analyzing users’ behavior using their consumption data. New and existing computational intelligence methods and algorithms are used to learn and analyze abstract representations of these behaviors.

It is of interest to evaluate the opportunities and challenges of flexiblity components, such as price responsive loads, thermostatically controlled loads (TCL), and energy storage systems, in the context of a power grid with high level of renewable energy penetration. In fact, one of the key elements in the planning of future power network is to empirically study the benefits of these technologies and concepts under different circumstances and scenarios. These analyses can help identify new prospects related to their implementation, coordination, and management in short and long term.

In a liberalized electricity market, it is important to take into consideration the economic benefits of these flexibility solutions and their competitiveness compared to the current situation. Therefore, a good starting point is to identify the costs and revenue streams using data related to energy generation, costs, and prices in different electricity markets. Once these parameters are identified, different scenarios of energy generation, consumption, and pricing should be designed to measure the value and cost of adding specific flexibilty components.

In addition to the evaluation of the flexibity components, it is important to study their control and coordination systems. In a power network with many generators, energy storage systems, controllable loads, and price responsive loads, it is essential to have efficient automatic management and real-time coordination between them. Such automatic systems should be able to handle high dimensional data and take real-time

decisions that enhance the performance and the profitability of the whole system. There are different varieties of management systems based on a variety of algorthims and concepts from statistics, optimization, and control literature. Hence the interest of evaluating and comparing the performance of these algorithms in the same context to identify their strengths, weaknesses, and suitability for the problem of flexibility components coordination and management.

(23)

Given these research elements, three questions have been laid out in this Thesis as follows:

RQ1. In a residential price-based demand response (DR) program, how can the flexibility and price-responsiveness be evaluated and predicted using historical consumption data and computational algorithms?

The question assumes that there is already a price based DR in place and that at least a fraction of the customers are somewhat ready to switch their consumption in response to price signals. It is understood that

residential price responsiveness requires customers’ awareness of the issues facing the power network and are less likely to participate actively in the DR programs. However, it is important to have the right tools and framework to quantify this engagement in order to target the different types of customers with different types of DR programs in order to increase the flexibility of the whole system.

RQ2. How can dynamic pricing mechanisms be combined with TCLs to enhance the flexibility and economic profitability of the system.

Thermostatically controlled loads present already a great deal of flexibiliy as they can use their thermal energy as a virtual storage system.

We are interested in investigating the added value of these loads if they are price-responsive in order to include them in DR programs. The economic evaluation considers both the utility companies’ profit as well as the end users’ electricity bills.

RQ3. What kind of control mechanisms and algorithms are suitable for an energy management system coordinating between several flexibility components in a power system with renewable energies as a main supply source?

It is of interest to perform a comparison of different control

mechanisms, algorithms, and methods of management, coordination, and control of flexibility components. One of the best testbeds for flexibility components is a microgrid relying essentially on renewable energies with a connection to the main grid. Such setup enables the evaluation of different scenarios using a variety of control mechanisms and algorithms, in order to find the best control mechanisms and build upon them efficient

(24)

coordination algorithms. This testbed’s result should also be compared to a traditional electricity supply scenario under the same circumstances of the electricity market and verify whether the flexibility components bring more value to the electricity grid.

1.2 Research methodology

The research questions have been tackled by setting up experiments using realistic simulations backed based on real data related to electricity production, consumption, prices, and costs as well as weather conditions and temperatures. This study follows a data-driven approaches to answer the above-mentionned questions and find new directions of the research.

The main methods used in this study are computational intelligence

methods, specifically neural networks, fuzzy logic, optimization algorithms, and deep reinforcement learning (DRL).

Answers to the research question RQ1 are studied in P2 where residential demand flexiblity is analyzed in the context of a price based DR program. An individual household is simulated using two models for shiftable and curtaillable loads respectively. The shiftable loads model describes a rational customer’s behavior scheduling their appliances according to electricity prices and their own comfort. The simulation is based on a multi-objective optimization algorithm simulating the trade off between the electricity bill and the comfort level of the customer. The second model describes the curtailable, price-responsive TCLs’ behaviour in response to outdoor temperatures. It uses two fuzzy-logic systems to simulate the dynamics of the system without having access to indoor temperatures. The two simulations are based on electricity prices from the day-ahead market and related temperatures in Finland for a period of one year. Two neural network architectures are implemented to learn the behaviour of these loads and their price elasticity from their historical data.

Results are evaluated and compared with state-of-the-art ML algorithms.

(25)

Research question RQ2 is studied in P2, P3, and P4 but mostly in P3, where a cluster of price responsive TCLs is responding to a dynamic

pricing. The problem is studied from the utility company’s perspective with regulation constraints that maintains the price into an acceptable range.

The problem is formulated as a Markov-decision problem and solved using an LSTM forecaster and a genetic optimization algorithm. The solution is economically evaluated by observing the utility company’s profit and the customers’ bills. In P4 the TCLs are modelled differently by including a backup controller maintaining the comfort level inside each house while the direct control signals are sent from a central controller. The controller would only observe their “state-of-charge” without having access to their dynamics and indoor temperatures. The control signals are coordinated with other variables such as prices, energy availability, and the state of storage systems using DRL approaches.

Research question RQ3 is studied in P1 and P4. In P1 a various computational intelligence approaches for demand side management are reviewed and categorized. The review presented in P1 aims at

introducing a comprehensive assessment of the state-of-the-art research in computational intelligence methods for demand flexibility. In P4 the focus is on DRL algorithms and their performances in the management of a multi-task flexibility coordination problem. The testbed is implemented to combine various flexibility components to maximize the flexibility of a microgrid with wind energy as a main resource. The simulated microgrid includes an energy storage system, a price-based DR program for residential loads, a cluster of TCLs, and a connection to the main grid.

Empirical experiments are based on real data from energy producers, retailers, electricity markets, transmission operator, and weather databases in Finland. State-of-the-art DRL algorithms are implemented in this testbed, compared, and improved upon. The best performing algorithm is compared to a theoretical optimal benchmark as well as a traditional electricity retailer using an economic evaluation.

(26)

1.3 Contributions

The research presented in this Thesis contributes to the existing literature in multiple aspects. First contribution is the empirical analysis of residential demand flexibility in response to dynamic pricing schemes. The novelty in this contribution is two-fold:

• The modelling approach considers individual residential users rather than aggregate loads forecasting. The new model considers the shift- able and curtailable loads in a single household. The learning is based on historical data of interactions between the user and the given prices.

• The ANN approach with two different architectures for learning the customer’s price flexibility using the historical data under uncertainty of indoors’ temperatures and dynamics. There was no previous works that tried to apply neural networks and ML methods to detect the dependencies between electricity price and demand in a price-respon- sive environment at the individual user level.

Second contribution comes from the novel concept of combining between price-responsiveness and TCLs as a flexibility component and their

empirical evaluation. Thermostatically controlled loads are present in three publications and studied from different angles. Their behaviour in response to prices, optimization of their pricing schemes, and their contribution to the flexibility of a microgrid are investigated.

Third contribution is a microgrid simulation based on realistic scenarios and real data from Finland. This microgrid model includes various flexibility components alongside the typical microgrid elements. This testbed is believed to be of great use for researchers in microgrids and enables testing and comparing different control algorithms.

Fourth contribution is a comprehensive and empirical comparison of state-of-the-art DRL algorithms for the energy management in the context of a microgrid with flexibility. The novelty resides in the implementation of both value-based and policy-based algorithms as well as the new variations of these algorithms which yielded better results.

(27)

1.4 Structure of the dissertation

This Thesis is based on publications P1-P4 and this summary. Following the introduction in Chapter 1, Chapter 2 presents a comprehensive description of the current state of power grids and electricity markets. Chapter 3 presents the concept of smart grid and discusses the opportunities and challenges related to the transition from the current state of the power grid to the smart grid. Chapter 4 presents the main computational

intelligence concepts and algorithms used for the smart grid’s analysis and optimization. The findings and use cases of P1-P4 are briefly presented in Chapter 5. Finally, Chapter 6 concludes the Thesis and sketches some new future research work ideas.

(28)
(29)

2 Power grid and electricity markets

The power grid is traditionally known as the infrastructure used to deliver electricity from suppliers to consumers. The operations related to this delivery include generation, transmission, distribution, and retailing.

These operations used to be considered as public services run by a single, often government owned, monopoly. However, many countries have opted for more liberal and deregulated markets since the 1990’s [8] by enabling different actors to handle these operations. Retail sales and electricity generation operations have been opened for free market competition whereas transmission and distribution operations are still performed by public or private organizations having national or regional monopolies. These actors interact with each other to insure a continuous and reliable supply of electricity to the consumers while making profit and being competitive on the electricity markets. Figure 1 depicts the various operations in today’s electric grid.

2.1. Power grid components and stakeholders

In a deregulated electricity market, several actors are engaged in the power grid buying and selling electricity as well as investing in power plants and transmission lines. The main actors in a deregulated electricity market are power producers, transmission system operator (TSO), distribution system operator (DSO), brokers, retailers, and consumers [9]. The operations of a power grid and the interactions between the different stakeholders are illustrated in Figure 2.

Producers: They specialize in producing electricity using single or multiple types of energy resources such as nuclear power, fossil fuels, biomass, hydro power, wind power, or solar power. The power producers invest in building power plants to provide the required capacity needed to meet the demand. The power producers generate their return on investment by selling the generated power in the wholesale markets and by selling regulation reserve capacities to the TSOs.

(30)

Figure 1: Power grid’s operations.

Transmission system operators: TSOs are responsible for the physical delivery and continuous balancing of the electricity supply and demand on a national level. TSOs own the transmission lines of high voltage electricity and are responsible for ensuring that the electricity is always available for consumers. TSOs provide ancillary services by buying capacity reserves for frequency and voltage regulations in real-time. They keep the balance by buying or selling the electricity in the balancing market and billing the

(31)

producers or the retailers responsible for the unexpected shortage or excess.

Distribution system operators: DSOs are local system operators that own a regional transmission system and operate similarly as TSOs but within a small scale. DSOs own the distribution grid of medium and low voltages and are responsible of maintaining the local power grid under normal operating conditions of voltage and frequency.

Figure 2: Electricity markets’ operations and stakeholders

(32)

Retailers: They are the electricity companies that act as the

intermediary between the wholesale market and the retail market. Their main role is to buy bulk amounts of electricity and resell it to small and medium sized consumers with an economically beneficial price. Retailers are competing in the retail market by offering competitive tariffs to customers. Retailers are also responsible of buying the right amount of energy in advance in order to avoid high expenses from the balancing market. Therefore, retailers need to make accurate predictions and load forecasting of their subscribed customers in order to estimate the right amount of electricity to order from the wholesale market. Retailers can also implement DR programs that involve customers in the balancing operations by offering incentives or dynamic prices for shifting their consumptions to meet the amount of electricity allocated in advance.

Traders/brokers: A trader acts in the wholesale market by buying the power from producers and selling it to retailers or buying power from a retailer and selling it to another retailer. Traders are usually the owners of the power when trading processes are taking place in the wholesale market. Contrastingly, a broker does not own the power but acts as an intermediary in the wholesale market. Brokers may be asked by a retailer or a large consumer to find producers ready to sell a given amount of power at a given time.

Consumers: They are the end users of electricity and they can be categorized as residential, commercial, and industrial consumers.

Residential and commercial consumers can only buy electricity from the retailers whereas industrial consumers, due to their large consumption, can also buy electricity in the wholesale market, either directly from the power producers or through brokers.

2.2. Wholesale markets

In the wholesale markets, bulk amounts of electricity are traded, typically in the order of Megawatts. Wholesale markets allow retailers, traders, brokers, and producers to buy and sell large quantities of energy for future

(33)

delivery. The trading is based on bids and asks on electricity amounts and prices. Nord Pool in Scandinavia or FERC markets in North America are examples of existing deregulated wholesale markets. Depending on how much in advance the electricity is traded, we differentiate 3 types of markets.

Day-ahead market: The energy is traded for the next 24 hours in a closed auction. The orders are matched following a market clearing process, as shown in Figure 3, demand and supply curves are constructed from bids and asks to determine the clearing price. The single price for each hour and each bidding zone is set where the curves for sell price and buy price meet, taking into account network constraints. Hourly clearing prices are then announced and individual results are reported to each buyer and seller [10].

Figure 3: Market clearing process

Intraday market: It works together with the day-ahead market to help secure the necessary balance between supply and demand by trading closer to the physical delivery within the intraday markets. Intraday market

(34)

is a continuous market, with around-the-clock trading until one hour before delivery, and in some cases, up until the delivery hour. In contrast to the day-ahead market, there is no clearing process in the intraday market. The prices are therefore set in a “pay-as-bid” process and the prices are assessed in continuous trading based on each transaction that is completed. In intraday markets, there are no fixed prices and the same product can have different prices depending on the time of the trade. [11]

Balancing market: TSOs must monitor the grid and maintain its

voltage, frequency, and power factor within very tight bounds by balancing the supply almost perfectly in real-time. Balancing markets serve this purpose by allowing reserve providers to offer up-regulation or down- regulation power bids on a specific hour. The up-regulating providers offer to sell energy to the grid by increasing production or decreasing consumption, whereas down regulating providers offer to buy energy from the grid by decreasing production or increasing consumption. The accepted bids are used by the TSO as necessary by order of price. The cheapest up-regulation bids are used first in case of energy shortage and the most expensive down-regulation bids are used first in case of energy excess. All the accepted bids are paid regardless of the actual activation of the resources. The up-regulating price corresponds to the most expensive up regulating bid used and the down regulating price correspond to the cheapest down regulating bid used [12].

2.3. Retail markets

The retail electricity market is the key link between the end users and the wider electricity system. It consists of competing retailers (suppliers) offering electricity supply contracts to consumers. The offered contracts include mainly consumption tariffs specifying the billing scheme and rates.

The retailers can also offer capacity control tariffs for flexible customers or electricity generation tariffs for customers with energy production (prosumers).

(35)

Consumption Tariffs

Retailers can offer different tariffs to attract customers and maximize their share of the retail market. Common tariff features include:

• Tiered rates where customers pay increasing prices per kW for in- creasing consumption tiers per day, week, or month.

• Season rates with fixed price for a whole season, usually more expen- sive in winter than in summer season.

• Time-of-use rates are specified per day or per week and they offer dif- ferent prices depending on the time of consumption. Night prices are commonly less expensive than day prices and peak hour prices.

• Dynamic rates allow suppliers to transfer the real-time cost of ener- gy to the end users using a variable price tariff. Dynamic prices are communicated to subscribed customers in advance and are based on the retailer’s interaction with the wholesale market and the forecast of supply and demand.

Capacity Control Tariffs

Retailers can also offer tariffs for controllable capacity, either with curtailable loads or storage systems in order to reduce the overall cost of the balancing market. Retailers may also auction this capacity in the balancing market to generate profit from up-regulation and down- regulation. The capacity control tariffs should specify the maximum curtailment or battery control ratios, the control timeslots, and the compensation of the customer’s inconvenience resulting from service interruptions or load shifting.

Electricity Generation Tariffs

Retailers can also buy the small amounts of electricity generated by the customers. The generation tariffs should specify the price of the power supplied to the grid using fixed or variable rates. Buying electricity from customers can also enhance local energy supply by transferring the generated power to the neighboring demand and avoiding electricity transmission costs.

(36)
(37)

3 Smart grid challenges and solutions

The concept of smart grid was first mentioned in [13] as a response to the challenges that encountered the North American power grid. Since then, various definitions of smart grid paradigm have emerged including advanced metering systems, integration of distributed and renewable energy resources, energy storage solutions, DR programs, automatic production and consumption control, and digitalization of the electricity market. As an example, Fox-Penner [14] defines smart grid as:

“Combining time-based prices with the technologies that can be set by users to automatically control their use and self-production, low- ering their power costs and offering other benefits such as increased reliability to the system as a whole”.

In this section, we summarize the main challenges related to the

modernization of the grid and the main efforts and solutions associated with the smart grid paradigm.

3.1 Renewable energies integration

Across the world, renewable energy sources are gaining support from policy makers as a response to climate change. The high global awareness of the shared risks facing the planet was reflected in the Paris Climate Accord signed by 197 countries in November 2016, in which, governments around the globe committed to push towards low carbon energies.

However, renewable energies face several barriers related mainly to investment costs, market entry, competition, and reliability challenges.

In fact, the power generation from solar farms and wind turbines is not generally aligned with peak electricity loads. A solar farm, for instance, will generate most of the power at midday whereas the demand peaks are at morning and evening hours. Additionally, given the intermittent nature

(38)

of renewable energy resources and the uncertainty of their generation, it is challenging to accurately predict their future generation. Therefore, maintaining the power balance under normal operating conditions in a grid with deep penetration of these resources is a critical challenge. More integration of renewable resources would increase the need for regulation capacity reserves and load balancing requirements. However, using

traditional fossil fuel generators to provide these reserves will decrease the net carbon benefit from renewables, reduce efficiency, and is economically untenable. Alternative solutions for flexibility can be implemented by introducing energy storage in the grid and enhancing the demand’s flexibility by involving the end-users in the balancing operations.

3.2 Flexibility providers

Flexibility is a key feature for a reliable power grid as it can smoothen the high volatility of supply and demand. Traditionally, flexibility is ensured by reserve capacities provided by fossil fuel generations with high carbon footprint and are economically inefficient. Smart grid paradigm has introduced many alternatives for flexibility listed as follows (see Sections 3.2.1-3.2.4).

3.2.1 Economic Energy Storage

Energy storage is one effective way of enhancing the flexibility of the PV systems and wind turbines. Energy storage systems (ESS) vary in size, technology, and deployment to answer to specific technical and

economic criteria. Small-scale systems can serve in low and medium power applications in isolated areas to feed emergency terminals, individual residential, or industrial consumers or community supplies. They can store energy in the form of chemical energy (batteries), kinetic energy (flywheel), compressed air, or hydrogen (fuel cells). Large-scale systems (hundreds of MW) serve in peak management in a large power network. It can also be used as a power-quality control and continuous balancing of the supply and demand in the grid. Large-scale ESS can store energy as a

(39)

gravitational energy (hydraulic systems), thermal energy, chemical energy (accumulators and flow batteries), or compressed air [15]. The deployment of ESS can take place in a centralized, community based, or individual manner. Large scale ESS, essentially pumped hydro storage, are already available in several regions for supplying the daily peak demand. Small- scale ESS, such as lithium batteries and fuel cells, need to be strategically deployed taking into consideration the economic value for adopting these systems. For instance, in the residential sector, the comparative study in [16] found out that community batteries are more effective and more economically convenient than individual household batteries. Hence the need for an energy policy to develop market mechanisms, which facilitate the deployment of community storage.

3.2.2 Controllable Loads

Controlling the consumption at certain periods of the day may offer a wide range of flexibility and market opportunities for the retailers. It offers a fast response to balancing signals and permits the design of a more reliable energy arbitrage strategy. The concepts of direct load control such as underfrequency and undervoltage load shedding schemes are already well established in the power systems. However, such load control schemes are disruptive to consumers and may cause many inconveniences to the end users. Alternatively, non-disruptive load control offers a considerable flexibility and economic benefit without major inconveniences to the end users. Non-disruptive control schemes consist of partially controlling specific residential, commercial, or industrial loads. Examples of non- disruptive controllable loads are dryers, freezers, air-conditioning systems, and water heaters, also referred to in this Thesis as TCLs (Thermostatically Controlled Loads). The nature of TCLs permits them to act as a thermal storage, which makes it possible to adjust their electricity consumption while maintaining an acceptable level of the users’ comfort. The idea of TCL flexibility relies on the principle that the temperature constraints specified by the user, can be fulfilled by different power trajectories. Finding the optimal trajectory that provides the required flexibility is the subject of several studies [17]–[19]. However, this problem requires real-time

(40)

information about the state of TCLs, their envelope temperatures, and their behaviors in response to temperatures’ dynamics. In most of the cases, this information is only partially available and requires qualitative or quantitative models to estimate it. Alternatively, it is possible to use model- free approaches to solve the problem of uncertainty and find near-optimal power trajectories as discussed in [20], [21] and in the publications of this Thesis. In P4 we proposed a direct control of a cluster of TCLs by the utility company managing a microgrid. However, the TCLs are equipped with a backup controller that maintains the temperatures in a comfort range specified by the user. In P2 and P3, the TCLs are price-responsive and the control mechanisms are based on a price-based DR program.

3.2.3 Demand Response (DR)

Demand response programs may offer a wide range of flexibility to the grid without harsh contracts of direct control and the inconveniences that can derive from it. The main objective of DR programs is to enable the users to participate in the electric system’s stability by reducing their loads in response to the power grid’s needs and economic signals.

DR programs can be divided into two categories: price-based DR and incentive-based DR [22]. In price-based DR, the consumer responds to the varying prices during the day or to price signals in peak hours to reduce his consumption or shift his loads from high price periods to lower price periods. In incentive-based DR, customers are given incentives to reduce their consumption in response to a signal about energy shortage in a certain period. DR participants can be residential, commercial, or industrial consumers. Unlike industrial consumers whose objective is to optimize their production costs and are therefore more likely to respond to price DR signals, residential and commercial consumers are less responsive to DR signals as they require the maintenance of their comfort levels. Therefore, residential and commercial DR programs must consider the comfort of the end users and their behavior at different times of the day. Additionally, the implementation of DR programs needs a communication infrastructure on which the power supplier would send DR signals. DR programs and methods are discussed in P1. In P2 we proposed a new method for

(41)

learning the residential customer’s behavior in response to a DR program and in P4, a price-based DR program is implemented and optimized for a microgrid’s energy management system.

3.2.4 Market-Based Balancing

The balancing market can also motivate retailers and suppliers to

balance their supply and demand as closely as possible through portfolio development, and to offer controllable capacities to the balancing market in order to achieve balance. Electricity suppliers, traders, and brokers can participate in the balancing market by offering up-regulation and down- regulation capacities to the TSO in return of economic benefits. A market- driven balancing approach can also encourage new players to enter the balancing market, such as private storage companies, virtual power plants, and electric vehicles aggregators.

3.3 Advanced metering infrastructure (AMI)

3.3.1 Smart Meters

Smart meters refer generally to the installation of intelligent metering system at residential, commercial, or industrial premises for real-time energy consumption reading. Figure 4 shows an architectural model of a conventional energy meter and a smart meter. Smart meters can support two-way communications between the energy supplier and consumers.

Bidirectional communication of data allows the collection of information regarding the electricity consumption values from the customer’s premises and receive information about electricity prices and control signals from the supplier. More advanced smart meters can monitor and execute control commands for home devices and appliances at the premises remotely or locally. Additionally, smart meters can support inter-premises communication, alternation between own generation, storage, and grid energy. Overall, smart meters represent the lower level of an AMI on which other communication layers are built to enable smart grid services.

(42)

Figure 4: Architectural model of conventional energy meter and smart meter. Figure is reproduced by the authors and inspired from [23].

3.3.2 AMI Architecture and Communication

In addition to smart meters, AMI includes the communication frameworks that collects and analyzes data from smart meters using two-way

communications between users and suppliers and gives intelligent

management of various power-related applications and services based on that data. Typically, AMI headend is located in the utility side and includes various components, such as geographic information system and meter data management systems (MDMSes). AMI collects data from smart meters and sensors with intervals of 15 minutes. With this rate, the collected data are voluminous and require advanced “Big data” management technologies [24] embedded in the MDMSes. Robust communication structure of the AMI can be achieved through several technologies, such as mesh [25], Ethernet [26], or cellular [27] network topologies.

(43)

3.3.3 Security and Privacy Issues

Security Issues

The implementation of AMI promises unprecedented levels of automation that would significantly increase the efficiency and reliability of the electric grid. However, such automation rises several security issues related to both communication networks and power grid. In the communication network, the issues of latency, bandwidth, data manipulation or

destruction, and unauthorized access should be handled to enhance the security of power grid and ensure its reliability, power quality, and stability.

For instance, since the power supply and demand balancing operations are based on instantaneous consumption data, the manipulation or inaccuracy of this data could create a fictitious grid imbalance leading to voltage variations that can create large-scale failures.

Privacy Issues

The high frequency of data collection from smart meters can rise several issues related to privacy of the consumers. In fact, the analysis of

consumption data can allow “consumer profiling” with an alarmingly high accuracy. For instance, consumer profiling can give information about the number of people living in the house, type of devices, duration of occupancy, and ability of security and alarming systems [28]. Therefore, the access to this data without the users’ consent is a serious matter that can rise legal issues and therefore should be prevented by the utility company.

3.3.4 Security and Privacy Requirements

Following the requirements developed by security domain experts in [29], security and privacy requirements include:

Confidentiality: In the AMI, the communications of consumption data must meet confidentiality requirements to protect the customer’s privacy and business information. At AMI headend, only authorized systems are permitted to access to specific customer’s information. Additionally, sharing the users’ data with third-party systems should follow the data privacy regulations by restricting the access to only authorized third parties

(44)

for clearly specified purposes and in compliance with applicable data protection law.

Integrity: The messages transmitted by the AMI system must be protected from any changes such as malicious modification, insertion, deletion, or replay. Cryptographic techniques can be used to ensure the integrity of the system and prevent cyber attackers from pretending they are authorized entities and issue commands to perform their attacks.

Availability: The AMI system must guarantee the accessibility of the data to any authorized entity at any given moment. The main availability requirement is to prevent denial-of-service attacks [30]. Additionally, AMI system should be immune to failures caused by interference cut cables, path degeneration, loss of bandwidth, network traffic, software problem, physical damage, or human tampering with the meter.

The security and privacy issues in AMI are complex matters and cannot be solved by a single solution. The authors in [31] present the threats to the security of AMI and then they propose some technologies as well as policies to improve the system’s security.

3.4 Microgrids

The concept of microgrid is based on the transition from centralized energy resources to distributed energy resources (DERs) that have low impacts on the environment and enhance the local grid autonomy and resilience against power outage. Microgrids are usually low-voltage networks with a limited local electricity supply and demand compared with the main grid. Microgrids can either operate in parallel with the grid, buying and selling energy through the electricity market, or autonomously, using local generation and storage [32]. Therefore, they offer technical and economic benefits, including system reliability, local energy delivery, and additional sources of capital investment for the DERs.

(45)

3.4.1 Typical Elements of a Microgrid

A microgrid is typically composed by DER, energy storage system, and local electric loads. A microgrid can have a connection to the main grid in the so- called point of common coupling managed by intelligent circuit breakers.

Distributed energy resources: The emerging interest in DERs stems from their potential to reduce the inconveniences of centralized energy production. In addition, DERs can provide the microgrid with high

autonomy, leading to less dependency on traditional, high-carbon-emitting energy resources. The local supply is typically based on renewables, such as wind turbines [33] or solar panels [34], and commonly backed up by an energy generator using a natural gas [35] or diesel engine [36].

Energy storage system: Since the generators are based on renewable energy sources, ESS are commonly used in microgrids to improve the reliability and efficiency of those generators. The ESSes are typically based on batteries and can either be distributed in the microgrid [37] or centralized [38].

Local electric loads: The power demand in a microgrid can be residential, commercial, or industrial demand with different degrees of flexibility. The electric loads must be supplied with priority order depending on the power availability. Controllable and price responsive loads can offer a wide range of autonomy to the microgrid when managed optimally.

Intelligent circuit breakers: They manage the interconnection between DER, ESS, local loads, and the main grid. Intelligent circuit breakers are crucial for real-time control and management of the microgrid.

3.4.2 Control Hierarchy in Microgrids

Microgrids are locally controlled entities that require multiple control levels, such as voltage and frequency regulation, load sharing, DER

coordination, and power flow control between the microgrid and the main grid. Therefore, microgrid control systems consist of three levels, namely the primary, secondary, and tertiary controls, as shown in Figure 5.

(46)

Figure 5: Microgrid control architecture. Figure is reproduced by the author and inspired from [39].

3.4.3 Microgrid’s Energy Management System

Energy management system (EMS) is a higher-level control system that maintains the energy reserve, optimizes the dispatch of local resources, and enhances overall system’s efficiency. We differentiate between two categories of EMS, namely, model-based EMS and model-free EMS.

(47)

Model-based EMS: In model-based approaches, an explicit model is used to formulate the dynamics of the microgrid and the different interactions between its components. The uncertainties are estimated using a predictor and the control problem is solved using a scheduling optimizer. Model predictive control is the most commonly and successfully used algorithm in the literature [40]–[42], consisting of repeated

optimizations of the predictive model over a progressing time period.

Model-based approaches rely heavily on domain expertise for constructing accurate models and parameters for a microgrid. Therefore, model-

based approaches are not transferable nor scalable, which leads to high development costs. Furthermore, if the uncertainties in the microgrid change over time, the model, predictor, and solver must be redesigned correspondingly, which significantly increases the maintenance costs.

Model-free EMS: Model-free or data-driven approaches require

identifying the optimal control strategy and uncertainties in the microgrid from its operational data. Learning-based methods which have been introduced in recent years as an alternative to model-based approaches, can reduce the need for an explicit system model, improve the EMS scalability, and reduce the maintenance costs of the EMS [43]. One of the most promising learning-based methods for EMS is the reinforcement learning (RL) paradigm [44] in which an agent learns the dynamics of the microgrid by interacting with its components. Several works have proposed successful implementations of RL-based EMSes in different microgrid architectures, either within a single agent [45]–[47] or multi-agent framework [48]–[51].

(48)
(49)

4 Intelligent algorithms

The implementation of smart grid technologies discussed in Chapter 3 and the automation of the electricity market discussed in Chapter 2 is increasingly generating massive amounts of data related to consumption, generation, electricity prices, and market data. The real-time nature of this data represents a big potential for energy management, grid balancing, and energy arbitrage, but also a significant challenge for data management, analysis, and interpretations. In this chapter we focus on the analysis, interpretation, and usage of the massive amounts of data to build insights that can be helpful for energy management, decision making, and automation of power systems. The focus of this Thesis is on data-driven and learning-based approaches, specifically ML and stochastic optimization algorithms for load analysis, load forecasting, and load management

considering electricity prices and individual users’ behaviors.

4.1 Supervised learning

Supervised learning algorithms aim at finding a mapping between inputs and outputs in a labeled dataset. The idea of supervised learning is that by learning the dependencies between some input and output features of training samples, the model would be able to generalize and predict the correct output given an input from unseen samples [52]. Supervised learning algorithms can be applied in regression problems, such as load forecasting, or supervised classification problems, such as customer classification and load profiling. Supervised learning algorithms include, but not restricted to, least squares linear regression, k-nearest neighbors, support vector machines, random forests, and neural networks.

4.1.1 Least Squares Linear Regression

Least squares linear regression is a method for linear regression’s parameters estimation. The hypothetic linear dependency between

(50)

dependent variables (inputs) and independent variables (output) modeled in a linear regression can be defined as a linear function:

(1)

Where y is the vector of values for the dependent variable, X is the matrix of independent variables and their values, β is the vector of parameters, and ϵ contains the residual errors. The objective is to solve the quadratic minimization problem defined as:

(2)

This minimization problem has a unique solution estimated as:

(3)

The estimated parameters are unbiased if the residual errors ϵ are

distributed randomly with zero mean and constant variance. Least squares linear regression has the advantage of being computationally simple and highly descriptive. However, the hypothesis of linear dependency between the inputs and outputs makes this method less capable to model data with complicated non-linear mapping.

4.1.2 Support Vector Machines (SVMs)

SVM algorithm is based on statistical learning theory described in [53]. In SVM algorithm, the objective is to define a decision boundary by finding an optimal hyperplane in feature space, which separates the input data points of different classes and recognizes patterns for classification and regression. We consider a binary classification problem with N m-dimensional training inputs labeled as for class 1 and for class 2. In the case of linearly separable data, we can determine the decision function as:

(51)

(4)

where w is an m-dimensional vector that defines the separating hyperplane, and b is a bias term. The classification of an input is determined by its position with regard to the hyperplane D.

The separating hyperplane is in the middle of the two hyperplanes with and . The distance between the separating hyperplane and the training data sample nearest to the hyperplane is called the margin. If the hyperplanes and include at least one training data sample, the hyperplane has the maximum margin.

The region {x | − 1 ≤ D(x) ≤ 1} is the generalization region for the decision function, which determines the generalization ability of the SVM.

The objective is to find the position of the optimal separating hyperplane, which gives the maximum margin [54].

Having a quadratic loss function with inequality constraints, even if the solutions are nonunique, the value of the objective function is unique [54].

Therefore, non-uniqueness is not a problem for SVM. This is one of the advantages of support vector machines over neural networks, which have numerous local minima.

SVM can also be used for data that is not linearly separable by using kernel functions, which map the original input space to a high-dimensional feature space, in which the data is linearly separable. In SVM, according to the need of classification, a kernel must be selected and the values of the kernel parameter and the margin parameter have to be determined.

4.1.3 Neural Networks

In this Thesis we focus mostly on neural networks for a variety of problems. The use of ANNs is justified by the ability of these models to perform classification or learn the mapping function between continuous multidimensional inputs and outputs given any degree of complexity. Deep neural networks are based on the combination of multiple processing layers to learn representations of data with multiple levels of abstraction.

They are obtained by composing simple, but non-linear modules. Each of these modules transform the representation at one level into a

(52)

representation at a higher and more abstract level. The combination of such transformations in a model can enable it to learn very complex functions [12]. In a fully connected ANN, all the neurons in one layer are connected to all the neurons in the previous and the next layers. These connections (called “synapses”) are represented by weights that determine the state of the network. The forward flow of the input vector goes through the hidden layers all the way to the output layer. The forward flow can be seen as a matrix multiplication where each layer’s input and output are vectors and the weights between the layers are matrices:

(5)

Where is the weight matrix between layer j-1 and j, is the output vector of layer j, is the bias vector in layer j, and f is the activation function.

Learning Process

The weight matrices are initialized with random values and are updated in each learning step using backpropagation. The objective is to minimize the error between the output of the ANN and the target vector in the training dataset. The key insight is that the gradient of the loss function with respect to the weights should be propagated backward from the output layer to the first layer. This gradient is computed in each layer by applying the chain rule for derivatives. The derivative (gradient) of the loss function with respect to a weight is computed by working backwards from the gradient with respect to the output of a node:

(6)

where L is the loss function usually computed as the squared Euclidean distance of the error. The most common optimization method used in ANN is gradient descent optimization, where the weights are updated in the opposite direction of the gradient as:

(53)

(7)

Where γ represents the learning rate of the algorithm that decreases in each step to ensure convergence. The backpropagation is applied repeatedly to propagate gradients through all nodes and update all the weights.

Neural Network Architectures

Different ANN architectures are used for different problems that go

beyond regression and classification. The most common ANN architecture is above-mentioned fully connected feed-forward architecture that can serve for regression using a linear activation function or for classification using a softmax activation function in the output layer. Other neural network architectures include but not restricted to:

• Convolutional Neural Networks (CNNs)

The architecture of a typical CNN includes series of convolutional and pooling layers followed by non-linear fully connected layers.

The convolution layers perform feature extraction from inputs with multiple arrays, such as 2D or 3D images. CNNs are typically used for image classification but they have many other applications, such as object detection, speech recognition, text recognition, natural language processing, and state feature extraction in DRL problems [56].

• Recurrent Neural Networks (RNNs)

In RNNs the information can flow in any directions in the hidden neurons.

The hidden neurons can receive inputs from the other neurons or from a previous version of themselves. This allows RNN to map an input sequence with multiple temporal elements into an output sequence

depending on all previous . RNN‘s hidden units maintain a ‘state vector’ that implicitly memorizes information about the history of all the past elements. Many variations of RNN exist in the literature, such as Long-Short-Term Memory (LSTM) networks, in which an explicit memory is added to learn long-term dependencies in the sequential inputs [57]. Typically, RNNs are used for tasks that include time series, speech recognition, and natural language processing. In P2 and P3 we used LSTM

(54)

to predict the behavior of TCLs given their historical behavior in response to temperatures and electricity prices.

4.2 Unsupervised learning

Unsupervised learning algorithms aim at discovering hidden patterns or dependencies in a given dataset. In contrast to supervised learning, unsupervised learning algorithms are typically used for the clustering of unlabeled data. In clustering algorithms, the aim is to group data samples that are as similar as possible compared to the rest of the data samples.

In the case of smart grid data analysis, unsupervised learning algorithms are used for load analysis to find patterns in the consumption data for the sake of anomaly detection or customers’ load profiling [58]. Several pattern recognition algorithms exist in the literature from which, and for briefly reasons, we present k-means algorithm and self-organizing maps.

4.2.1 K-Means Algorithm

In k-means algorithm, the aim is to partition a dataset of size into a predetermined number of clusters in which . The clusters are represented by cluster centroids, defined as the mean of all items in a cluster. The goal of K-means is to minimize the sum of the squared error over all K clusters which is a NP-hard problem. Thus K-means, which is a greedy algorithm, can only converge to a local minimum, even though recent study has shown that with a large probability K-means could converge to the global optimum when clusters are well separated [59].

Initially, the centroids are initialized randomly, and the data points are grouped by assigning them to the nearest centroid in terms of Euclidean distance. The centroids are then updated according to newly formed clusters by computing the mean of the cluster elements. This process is repeated until the centroids’ positions are unchanged. As a result of the Euclidean metric used in the distance of K-means, the algorithm finds spherical or ball-shaped clusters in data with ability to partition data with non-convex clusters. Many K-means variants are available in the literature,

Viittaukset

LIITTYVÄT TIEDOSTOT

Our current work overlaps with smart grid approach in that we plan the generation capacity and quantify the optimal investments related to RESs that are needed at the energy

We consider a smart grid equipped with two-ways commu- nication system (smart meters) that announces the electricity prices corresponding to the next 24 h. Based on these

Hossein Motlagh et al., 2020), these technologies in practice offer horizontal solutions in various activities of the energy sector; in power quality monitoring, smart grid

According to the Electric Power Research Institute (EPRI), Smart Grid is one that includes information and communication technology into every stages from

With today's technology DG may not maintain network voltage during loss-of-mains (LOM) situations. There must be a built in protection system preventing the DG unit from

Keywords Supervisory control and data acquisition (SCADA) systems Intrusion detection system (IDS) Industrial control system (ICS) Cyber-physical security Smart grid

This thesis focuses on the utilization of electricity consumption data from smart meters to improve the energy efficiency of buildings in a large portfolio.. This thesis was

This increased freedom in addition with the most important and potential incen- tives especially concerning network investments, services and long term development of the