The Merit Order Effect of Power in Portugal: Quantifying the effect of Wind Energy in the Spot Market prices through Agent-based Simulations

Joao˜ Bernardo Sequeira de Sa´

Thesis to obtain the Master of Science Degree in Electrical and Computer Engineering

Supervisors: Prof. Fernando Jorge Ferreira Lopes Prof. Joao˜ Jose´ Esteves Santana

Examination Committee

Chairperson: Prof. Rui Manuel Gameiro de Castro Supervisor: Prof. Fernando Jorge Ferreira Lopes Members of the Committee: Prof. Joao˜ Francisco Alves Martins

November 2016

Acknowledgments

I would first like to thank my thesis supervisors Professor Fernando Lopes and Professor Joao˜ San- tana, for always being available to provide important support, which was fundamental to the conclusion of the work here presented. I would also like to thank my friend Samuel Jacob for always providing good discussion topics during the years we shared at Instituto Superior Tecnico.´ Last but not least, I would like to thank my girlfriend Sara Pereira, for always being there for me when I needed.

Abstract

Renewable energy sources have become mainstream sources of energy. Motivated by ambitious international objectives and strong support policies, the installed capacities of tech- nologies has shown a large growth in recent years. This increase raises important questions relating to their impacts on Power Systems. The main objective of the present dissertation is to quantify the effect that the energy produced from renewable sources, specifically wind energy, has on the Iberian day-ahead spot market prices, explicitly those of Portugal. This effect is also known as the “Merit Order Effect” (MOE). The period considered was the first six months of 2016. The methodology applied to quantify the MOE relies on an agent-based simulation system, the MAN-REM tool. For this purpose an approach was developed to determine the spot market prices, based on a set of assumptions and published historical data from the Iberian electricity market (MIBEL). The final results show that has caused an average price reduction of 17 C/MWh during the aforementioned period. Also, one of the most common support mechanisms for renewable energy technologies is the feed- in-tariff (FIT), consisting in a guaranteed price for the sale of energy. There has been a large con- tention in regards to this mechanism, especially due to the costs that it implies for consumers. However, comparisons fail to take into account the spot market price difference introduced by renewable energy technologies. Thus, this dissertation proposes an alternative way to quantify the over-cost of FITs fi- nanced by consumers. The work performed allows us to conclude that this over-cost has a reduction of approximately 150 million euros, when the MOE of wind is considered.

Keywords: Agent-based simulation, Day-ahead spot market, Feed-in-tariffs, Merit order effect, MI- BEL, Renewable energy sources, Software agents, Wind power

iii

Resumo

As fontes de energia renovaveis´ tornaram-se fundamentais nos dias actuais. Objetivos interna- cionais ambiciosos e fortes politicas de apoio motivaram o crescimento da potenciaˆ instalada de tec- nologias de energia renovavel´ nos ultimos´ anos. Este rapido´ crescimento levanta algumas questoes˜ pertinentes relativas aos impactos causados no sistema. O principal objetivo da presente dissertac¸ao˜ e´ quantificar o efeito que as fontes de energia renovavel,´ especificamente a energia eolica,´ temˆ nos prec¸os da bolsa diaria´ de energia do mercado Iberico´ de electricidade (MIBEL), concretamente para o caso portugues.ˆ Este efeito e´ conhecido como o “Efeito da Ordem de Merito”´ (EOM). O per´ıodo es- tudado consiste nos primeiros seis meses de 2016. Para calcular o EOM fez-se uso de um sistema de simulac¸ao˜ multi-agente, o simulador MAN-REM. Nesse sentido, desenvolveu-se um metodo´ para determinar os prec¸os do mercado diario´ em bolsa, baseado em varios´ pressupostos, fazendo uso de dados do MIBEL. Os resultados finais do estudo efectuado mostram que a energia eolica´ causou uma reduc¸ao˜ media´ de prec¸os de 17 C/MWh durante o per´ıodo estudado. Um dos mecanismos mais comuns de apoio as´ energias renovaveis´ e´ a tarifa feed-in (FIT), que consiste num prec¸o garantido para a venda de energia. Este mecanismo tem sido muito discutido, es- pecialmente devido aos custos que impoe˜ aos consumidores. Contudo, muitas das comparac¸oes˜ feitas nao˜ levam em conta as diferenc¸as de prec¸o que as energias renovaveis´ introduzem no mercado. Nesse sentido, esta dissertac¸ao˜ propoe˜ uma forma alternativa de calcular o sobrecusto das FIT financiadas por consumidores atraves´ de tarifas do sistema. A analise´ feita permite concluir que este sobrecusto diminui aproximadamente 150 milhoes˜ de euros quando o EOM do vento e´ considerado.

Palavras-chave: Bolsa diaria´ de energia, Efeito da ordem de merito,´ Energia eolica,´ Fontes de energia renovaveis,´ Simulac¸ao˜ multi-agente, Tarifas feed-in

v

Contents

1 Introduction 1 1.1 Background and Motivation...... 3 1.2 Main Objectives...... 3 1.3 Contributions...... 4 1.4 Structure...... 5

2 Markets for Electrical Energy7 2.1 Market Fundamentals...... 9 2.1.1 Modeling Consumers...... 9 2.1.2 Modeling Producers...... 10 2.1.3 Aggregation of Market Agents and Market Equilibrium...... 12 2.2 Markets for Electrical Energy...... 12 2.2.1 Reorganization of the Electricity Sector and the Iberian Electricity Market..... 13 2.2.2 Electricity Pools...... 15 2.2.2.A Merit Order...... 17 2.2.2.B Daily and Intraday Market...... 19 2.2.3 Bilateral Trading...... 20

3 Renewable Energy Sources, the Impact of Renewable Generation on Market Prices, and Support Schemes for Producers 23 3.1 Evolution of Renewable Energy Technologies...... 25 3.1.1 Renewable Energy throughout the World...... 25 3.1.2 Renewable Energy Technologies in Portugal...... 27 3.2 Wind Power...... 28 3.2.1 Wind Power in the World...... 29 3.2.2 Wind Power in Portugal...... 31 3.3 Merit Order Effect...... 32 3.3.1 Merit Order Effect Explained...... 32 3.3.2 Main Methodologies and Results of Related Research...... 34

vii 3.4 Support Schemes for Renewable Energy Producers...... 37

4 Agent-based Systems and the MAN-REM Simulator for Energy Markets 41 4.1 Multi-Agent Systems and the JADE Software Platform...... 43 4.2 Agent-based Systems for Electricity Markets...... 46 4.2.1 AMES...... 47 4.2.2 MASCEM...... 48 4.3 The MAN-REM Agent-based Simulation Tool...... 48 4.3.1 System Overview...... 49 4.3.2 Graphical User Interface and Agent Communication...... 51 4.3.2.A Menu “Agents”...... 51 4.3.2.B Menu “Markets”...... 52 4.3.2.C Menu “Participants”...... 52 4.3.2.D Menu “Simulation”...... 53 4.3.2.E Contributions to the MAN-REM simulation tool...... 54

5 Quantifying the effect of Wind Energy in the Spot Market Prices through Agent-based Sim- ulations 55 5.1 Merit Order Effect...... 57 5.1.1 Preliminary Analysis...... 58 5.1.2 Key Indicators...... 58 5.2 Methodology Applied...... 60 5.2.1 First Approach: Supply-side bids based on a Regression Model...... 61 5.2.2 Second Approach: Supply-side bids based on the actual MIBEL Spot Market bids 68 5.3 Results and discussion...... 73

6 Conclusion 77 6.1 Results Summary...... 79 6.2 Methodology Limitations...... 79 6.3 Future Research...... 80

A MAN-REM Agent-based Simulation Tool: Graphical User Interface and Agent Communica- tions 87

B Results for First Approach 97

C Results for Second Approach 101

viii List of Figures

2.1 Typical demand curve [10]...... 10 2.2 Typical supply curve for decreasing returns to scale [10]...... 11 2.3 Point of Market Equilibrium [10]...... 12 2.4 Vertically integrated utility [10]...... 13 2.5 Portuguese electricity sector [15]...... 14 2.6 Aggregate supply and demand curves for a specific hour [20]...... 16 2.7 Aggregate supply and demand curves for a specific hour, showing balancing curves, with the adjusted supply curve in red and adjusted demand curve in beige [20]...... 16 2.8 Hourly prices for a day where market splitting can be observed [20]...... 17 2.9 Merit order of the supply function [24]...... 19 2.10 Daily and intraday market time horizons (based on [25])...... 20

3.1 Total installed capacity of renewable technologies in the world at the end of the last 9 years. Total also includes geothermal power, concentrating solar power and ocean power (based on data obtained from [3, 31–33])...... 26 3.2 Additions of renewable power capacity from 2004 to 2013 [3]...... 27 3.3 Total installed capacity of electrical energy production technologies in Portugal at the end of the last 15 years (translated from [34])...... 28 3.4 Portuguese Energy Mix in 2015 [36]...... 28 3.5 Total wind power installed capacity in the world at the end of the last 11 years [33]..... 29 3.6 Top 10 countries of wind power installed capacity [33]...... 30 3.7 Europe’s total wind power installed capacity by country, in GW, at the end of 2015 [38]... 31 3.8 Total wind power installed capacity in Portugal at the end of the last 15 years (based on data obtained from [41–43])...... 32 3.9 Merit order effect [24]...... 33

4.1 JADE agent management window...... 45

ix 4.2 JADE window for the “sniffer” service...... 46 4.3 MAN-REM simulation system overview, depicting some of the simulation environments and the main communication fluxes between agents and between the simulation system and users...... 49 4.4 UML class diagram of agents in the simulation environment...... 51

5.1 Hourly spot prices in the MIBEL, for a day with 58% of wind penetration versus a day with 5% wind penetration(hourly spot market prices taken from [67])...... 58 5.2 Supply and demand curves used in the first approach for 9 A.M. of February 5, 2016... 66 5.3 Real and simulated hourly spot market results for February 5, 2016 (obtained through the first approach)...... 66 5.4 Portuguese hourly wind power production on February 5, 2016...... 67 5.5 Comparison between regression data and results obtained (for February, using first ap- proach)...... 67 5.6 Supply and demand curves (before and after adjustments) published by OMIE, for 9 A.M. of February 5, 2016 (translated from [20])...... 68 5.7 Method used to determine the quantity bid of the demand-side agent, for 9 A.M. of Febru- ary 5, 2016 (edited from [20])...... 69 5.8 Supply and Demand Curves used in the Second Approach for 9 A.M. of 05/02/2016.... 71 5.9 Real and simulated hourly spot market results for February 5, 2016 obtained through the second approach...... 72 5.10 Hourly wind power production in Portugal and Spain on February 5, 2016...... 72 5.11 Gas daily reference prices for the first six moths of 2016 [70]...... 74

A.1 Main window of the MAN-REM simulation tool...... 88 A.2 Menus of the MAN-REM simulation system...... 89 A.3 Graphical interface for loading a GenCo agent...... 90 A.4 Graphical interface for loading a new RetailCo agent...... 91 A.5 “Pricing Mechanism” window...... 91 A.6 Graphical interface for choosing agents participating in the simulation...... 92 A.7 Graphical interface presenting the simulation results...... 93 A.8 Communication between agents...... 94 A.9 Complete communication process between agents during the simulation...... 95

B.1 Linear regression results for each of the first six months of 2016...... 98 B.2 Comparison between published load diagram by REN and the ones obtained through the first approach, for 05/02/2016...... 99

x B.3 Daily average spot market prices for the first approach...... 100

C.1 Daily average spot market prices for the second approach...... 102 C.2 Daily average spot market prices for the second approach, disregarding peak values... 103

xi xii List of Tables

2.1 Production costs overview (based on [21])...... 18

3.1 Breakdown of merit order effect literature methodologies and results...... 36 3.2 Renewable energy support policies of some relevant countries (taken from [33])...... 38 3.3 Monthly average values of Feed-in-tariffs payed to Special Regime Producers on the first six months of 2016 (based on [58])...... 39

5.1 Correlation between spot market hourly prices and production of a specific technology, for each of the first six months of 2016 (based on data obtained from [67] and [68])...... 62 5.2 Breakdown of agents participating in the simulation...... 64 5.3 Breakdown of Agents participating in the Simulation for the Second Approach...... 70 5.4 Simulation results and comparison...... 73 5.5 Actual FIT over-cost and the proposed over-cost...... 73 5.6 Quantification of the MOE...... 73

xiii xiv Acronyms

ACL Agent Communication Language

AID Agent Identification

DGEG Direc¸ao˜ Geral de Energia e Geologia

EDP Energias de Portugal

ERSE Entidade Reguladora dos Servic¸os Energeticos´

FIPA Foundation for Intelligent Physical Agents

FIT Feed-in-tariff

GenCo Generating Company

JADE Java Agent Development Framework

LMP Locational Marginal Price

MAN-REM Multi-Agent Negotiation and Risk Management in Markets for Electrical Energy

MEE Market for Electrical Energy

MIBEL Iberian Electricity Market (Mercado Iberico´ de Electricidade)

MO Market Operator

MOE Merit Order Effect

OMIClear Iberian Energy Clearing House

OMIE Spanish division of the Operador del Mercado Iberico´ de Energia, SA

OMIP Portuguese division of the Operador del Mercado Iberico´ de Energia, SA

PRE Special Regime Production (Produc¸ao˜ em Regime Especial)

xv REE Red Electrica´ de Espana˜

REN Redes Energeticas´ Nacionais

RES Renewable Energy Sources

RetailCo Retail Company

SMP System Marginal Price

SO System Operator

xvi 1 Introduction

Contents

1.1 Background and Motivation...... 3

1.2 Main Objectives...... 3

1.3 Contributions...... 4

1.4 Structure...... 5

1 2 The present chapter provides the background and motivation of this dissertation, discussing also the main objectives and contributions of this work and ending with a description of the structure of the dissertation.

1.1 Background and Motivation

The Market for Electrical Energy (MEE) has suffered large changes in it’s structure since the decade of 1980, with the transition from completely vertical utility companies to the introduction of competition in the production and commercialization of electrical energy, centered around a liberalized market [1]. These have introduced a lot of uncertainty and risk for both the supply and the demand side of the MEE, which in turn has led to the development of tools capable of simulating the interactions between the agents that participate in the trading of electrical energy, notably agent-based simulation platforms for MEEs [2]. Since the first oil crisis of the late 70’s, there has been some concern with the viability of a electrical energy sector that is solely dependent on production from convention thermal technologies, which allied with worries about the impact that production from these technologies has on the environment has led to a great effort worldwide to find alternative energy sources. This in turn has led to the definition of support policies that served as a boost to research and development into Renewable Energy Sources (RES) conversion technologies. One of the most notable examples of is wind power, which has shown a remarkable growth in installed capacity throughout the last ten years, being considered a mainstream technology nowadays [3]. As such, the impact that the large scale deployment of these technologies has had on the electricity sector is an important field of research. A special concern of recent studies is the impact that support policies might be having in the market and how they translate to consumers. The work done in this dissertation focuses on these issues, by using an agent-based software tool, the Multi-Agent Negotiation and Risk Management in Markets for Electrical Energy (MAN-REM) system, to study the impact that production from RES technologies, i.e. wind power, has had on the spot market prices and comparing this effect with the support mechanisms being applied to the aforementioned technology.

1.2 Main Objectives

The main objectives of this dissertation are the following:

• Study micro-economic principles that rule market mechanisms, especially those that relate to the day-ahead pool of the MEE;

3 • Study the principles of multi-agent based simulation and get acquainted with the MAN-REM system [4–7] and all it’s capabilities;

• Apply the System Marginal Price (SMP) pricing mechanism, developed by the team of the MAN-REM project to analyze the effect that RES supported by policy mechanisms, i.e. wind power, has on spot market prices;

• Develop a methodology to establish the volume and price bids of software agents participating on the day-ahead pool of the MEE, in a systematic fashion, through the analysis of historical market data from Iberian Electricity Market (Mercado Iberico´ de Electricidade)(MIBEL);

1.3 Contributions

This dissertation expands on previous work developed as part of the MAN-REM project, which in- volves the development of a simulation tool for the MEE 1. The focus of this tool is to allow for participants in the MEE to study and analyze the impacts that their choices will have on the market, providing a reli- able tool to market participants. Furthermore, it is intended that this tool will allow for studies on future changes to the market structure, presenting a opportunity to test the impact of new market designs, before their deployment. This dissertation also pretends to analyze the impacts that a large deployment of RES, specifically wind power, can have on the MEE spot market prices. As such, the main contributions arising from this dissertation are:

• Extension of the MAN-REM system by adding a new type of agent, the “Personal Assistant” agent, that manages the graphical interface and interacts with the user, redesigning the simulation envi- ronment;

• Implementation of the communications between all agents present in the MAN-REM system and the user via the new personal assistant agent;

• Analysis of the impact that electrical energy produced by wind power technologies can have on the day-ahead spot market prices of the MIBEL, in the first six months of 2016 and proposal of an alternative way to calculate the over-cost attributed to Feed-in-tariffs (FITs) being financed by consumers.

It is worth to mention that the work of this dissertation will serve as basis to a chapter of a new book edited by Prof. Fernando Lopes, supervisor of this thesis, to be published by Springer in 2017.

1Work developed as part of the MAN-REM project (FCOMP-01-0124-FEDER-020397), financed by FEDER through the COM- PETE - Programa Operacional Tematico´ Factores de Competitividade and by FCT - Fundac¸ao˜ para a Cienciaˆ e Tecnologia

4 1.4 Structure

The remainder of this dissertation is organized as follows. Chapter2 starts with an overview of the micro-economic principles that are considered fundamental to this work. The chapter moves on to describing the MEE, which is the main theme of this dissertation, discussing some of the recent developments in the field, and explaining two of the main market mechanisms, the electricity pool and bilateral trading. The MIBEL and some of it’s features are also characterized, since this is the MEE under analysis in this dissertation. Chapter3 deals with the growth being experienced in RES technology deployment, describing some recent developments and figures of the field, with emphasis on wind power technologies and the Por- tuguese case, which are central to this work. Furthermore, a discussion of the theoretical background which was the basis of this study is done, explaining the Merit Order Effect (MOE). Also, a review of the methodologies applied for it’s study in the relevant literature is presented with a a breakdown of the results. This chapter ends with a discussion of one of the drivers of the growth in RES deployment, namely the support policies being employed by countries worldwide, giving special attention to FITs. Chapter4 introduces the theme of agent-based simulation, describing some of the important features of these systems and focusing on the main software platform used to develop the MAN-REM system, the Java Agent Development Framework (JADE). One of the applications of agent-based simulation is to study the MEE. As such, a brief review of two of the most important software systems that have been developed for this purpose is presented. The chapter ends with a thorough description of the MAN-REM tool, presenting the extensions made during this work. Chapter5 presents the main research work done for this dissertation. The chapter begins with a preliminary study of the price reduction caused by wind power in the spot market prices, followed by a discussion of the key indicators used in the analysis of the MOE. The second section of this chapter deals with the main effort done in this dissertation, which was to develop a methodology to quantify the MOE for the Portuguese case. Two approaches were undertaken, since the first did not provide reliable results. A description of all the assumptions made and the simulation process is provided for each of each approach. The chapter ends with a detailed discussion of the results obtained. Finally, Chapter6 provides a summary of the results obtained, discusses the limitations of the methodology employed and provides a description of possible venues for future research. The remaining pages of this work present the bibliography used throughout this dissertation and the appendixes, where additional figures of the MAN-REM graphical user interface, the communication between agents and the results of Chapter5 are presented.

5 6 2 Markets for Electrical Energy

Contents

2.1 Market Fundamentals...... 9

2.2 Markets for Electrical Energy...... 12

7 8 This chapter provides some insights into market theory, which is central to what will be discussed throughout this work. In Section 2.1 some of the micro-economy principles that drive market theory can be found, giving special emphasis to concepts that will be used in this dissertation. Section 2.2 deals with the MEE in specific, providing background on recent developments of the organization of the electricity sector, making a description of the MIBEL structure and explaining the relevant mechanisms that are the subject of this study.

2.1 Market Fundamentals

To better understand the concepts of the MEE that will be discussed throughout this work, the present section discusses some of the basics of microeconomics that are considered essential. In micro-economy agents interact. Consumers and producers realize actions, determining the quantity of product that is produced and consumed. The price of a product is a real number that represents the values obtained in trade relations, having money value as it’s baseline [8]. A market can be defined as a mechanism where buyers and sellers interact, determining the price and the exchange of goods, services and assets [9]. Keeping these definitions in mind it can be assumed that there are two sides to any specific market. The supply side, in which producers and sellers are represented, and the demand side, comprised of consumers and buyers.

2.1.1 Modeling Consumers

The participation of a specific consumer on a market can be modeled through the “Demand Curve”, which represents the relationship between price and quantity for a certain product. Usually this curve is simplified by making the assumption that all other products besides the one being analyzed, are invariant in price and quantity [8]. The demand curve can be described as a representation of the quantity of product that a consumer is available to buy, for a given price. A typical demand curve is represented in Figure 2.1, where it can be noticed that the price decreases with the rise of quantity. This means that the higher the price, the less quantity a consumer will be available to acquire. It’s also important to take into account that the slope of the demand curve is highly dependent on the willingness a consumer has to acquire the product. This is represented through the elasticity of demand. For most commodities the quantity decreases with the rise of the price, with the slope defined by the elasticity coefficient, , as expressed by Equation 2.1[10]:

9 Figure 2.1: Typical demand curve [10].

∆q q  = ∆p (2.1) p where:

• ∆q is the variation of demand;

• q is the baseline demand;

• ∆p is the variation of price;

• p is the baseline price.

If a change in demand is lower than the consequent change in price, the commodity can be labeled as inelastic. The elasticity of demand depends largely on the availability of substitutes [10].

2.1.2 Modeling Producers

A certain producer’s participation in the market is represented through the supply function, which shows the relationship between price and quantity of product. This relationship has to take into account the variable and fixed costs of the producer. This being said, the main considerations a producer takes into account when defining it’s actions on the market bear in mind the following conditions [8]:

1. To guarantee sustainability of the producer in the short term, at least the variable costs need to be recovered through the sale of product;

2. To guarantee sustainability of the producer in the long term, the fixed and variable costs need to be recovered through the sale of product.

10 Figure 2.2: Typical supply curve for decreasing returns to scale [10].

The present work will concerned with markets that are treated as having decreasing returns to scale. This means that an increase in all inputs leads to a less than proportional increase in total output. In this kind of situation, sustainability of the producer can only be assured when the conditions expressed by Equation 2.2 are verified [8]:

¯ pj(qj) > cm(qj) > Caverage(qj) (2.2)

where:

• qj is the quantity of product j;

• pj is the price at which quantity qj of product j is sold at;

• cm(qj) is the marginal cost of producing quantity qj, specifically, what it would cost to produce one

more unit of product j when operating at point pj(qj) of the supply curve;

• C¯average is the average cost of producing quantity qj.

Taking the above into account, it can be assumed that the producer’s sustainability in the long term only is assured when the price at which the product is sold is simultaneously higher than the marginal and average costs for a specific quantity. Recognizing this, it’s possible to define the supply curve as representing the quantity of product that a producer is available to sell for a specific price. In Figure 2.2 the typical supply curve for a situation of decreasing returns to scale is represented. The price rises with the growth of quantity, which means that the higher the produced quantity, the higher the price the product needs to be sold at, so that sustainability can be assured.

11 2.1.3 Aggregation of Market Agents and Market Equilibrium

In a realistic scenario there are multiple producers and consumers for a given product. In such a situation the global supply and demand curves are obtained from the individual curves of each market agent. This is done by summing, or aggregating, the quantity of product for each price. As will be seen in the following section, there are markets where the offers for buying and selling are submitted through a central entity, the Market Operator (MO). This entity is responsible for the aggregation of all the offers, defining the supply and demand curves. [8] Whit the supply and demand curves characterized, it is possible to find the market equilibrium as the point of intersection between them, as is depicted on Figure 2.3. The red dot represents the intersection point, which is usually described as the point of static equilibrium for perfect competition. When the market operates at this point, the quantity that the consumers are willing to buy and the price they are prepared to pay corresponds to those the producer is willing to sell [8].

2.2 Markets for Electrical Energy

This work deals largely with the MEE, so after an introduction of important concepts of microeco- nomics on Section 2.1, this one deals with aspects that are more specific to this kind of markets. In the last two decades there have been a great number of changes in the design and operation of the electricity sector, as such a brief overview of these shall be made, accompanied by a description of the MIBEL, which was the subject of this work. Although electricity is dealt with like any other commodity, there are some important differences that make MEEs a special case. The most important difference is that the MEE is linked with a physical system, where supply and demand need to be balanced constantly or the system collapses. Another

Figure 2.3: Point of Market Equilibrium [10].

12 Figure 2.4: Vertically integrated utility [10]. important difference is that the energy a specific generator produces cannot be directed to a specific consumer, since all produced electrical energy is pooled in the grid and directed towards consumers [10]. Last but not least, electricity is a commodity that can’t yet be stored, at least not in a large enough scale to suppress all energy requirements [1]. Also it is important to keep in mind that products which are considered necessities or that have few substitutes are treated as having low elasticity [9], as has been seen on the previous section. This is es- pecially important on MEEs, where a common simplification made is treating the as demand completely inelastic [11]. This is an acceptable assumption, since most consumers don’t see real-time prices and rarely adjust demand in response to price fluctuations [12]. An understanding of the main types of markets that comprise MEEs is also deemed worthy, focusing on the electricity pool, which is the market type studied in this work. MEEs deal with a large number of agents on both the demand and supply side, since the sale of electricity is not restricted only to producers of electrical energy, and similarly, the end consumers are not the only buyers present on the market. For simplicity of notation, a supply side agent shall be called Generating Company (GenCo) and a demand side agent Retail Company (RetailCo).

2.2.1 Reorganization of the Electricity Sector and the Iberian Electricity Market

When the first power plant started it’s operation in 1882, it was thought that the best way to serve electrical energy necessities was to have the production of electricity near the consumers [1]. At this point in time it was considered that the most efficient way to operate the electricity sector was as a natural monopoly, where a regulated vertically integrated utility explored the production, distribution and commercialization of electrical power [12], as is represented in Figure 2.4, This was the common practice until transmission grids operating at alternate current became an

13 efficient way to transmit electricity through large distances. This allowed the exploration of more sources of electrical energy. The disintegration of production was then possible, making it a separate competitive market, leaving the distribution and transmission as regulated natural monopolies [12].

The Public Utility Regulatory Act of 1978 in the United States of America obliged monopolistic utilities to buy electrical energy from independent producers. In Portugal, the deregulation process began in 1988 with a law that allowed the independent production of electricity through renewable energy sources and co-generation. Despite this, only in 1995 did the reorganization of the sector truly begin [1]. By 1990 deregulation had become a common trend worldwide [12].

In 2006 the activities of commercialization and distribution were formally separated in Portugal, with the introduction of the retail market to the sector. To act as regulator of the electricity sector Entidade Reguladora dos Servic¸os Energeticos´ (ERSE) was established, with functions that comprise the stipula- tion of tariffs of access to the grid, among others [1]. The main aim of ERSE is to enforce the interests of consumers, especially in regards to prices, service quality and access to information [13]. Design, pro- motion and evaluation of Portuguese energy policy falls to Direc¸ao˜ Geral de Energia e Geologia (DGEG), part of the Portuguese public administration [14]. The “Last Resort Trader” figure was created to help with the transition of consumers to the liberalized market. This entity, represented by Energias de Por- tugal (EDP)-Servic¸o Universal, deals electrical energy through regulated tariffs. Figure 2.5 shows a scheme of the Portuguese electricity sector.

Figure 2.5: Portuguese electricity sector [15].

14 The integration of the Portuguese and Spanish electrical systems began in 1998. In 2007 the MIBEL was officially launched, acting as an electricity market at the Iberian level, promoting a step towards the full integration of the electrical energy system of Europe [16]. There are two main market systems available to agents participating in the MIBEL. They are the spot market, organized by the Spanish division of the Operador del Mercado Iberico´ de Energia, SA (OMIE), and the future/derivatives market, managed by the Portuguese division of the Operador del Mercado Iberico´ de Energia, SA (OMIP) and Iberian Energy Clearing House (OMIClear)[16]. OMIE acts on the Iberian Market asMO, managing the electricity pool. The Iberian electricity pool has a daily market and a intraday market. It’s operation started in 1998 in Spain, extending to Portugal when MIBEL was established. Prices fluctuate between 0 and 180 C/MW with more than 800 agents interacting daily. OMIE is responsible for over 80% of the electricity traded in both Portugal and Spain [17]. OMIP ensures the management of the future/derivatives markets promoting price references, sup- plying risk management tools and offering standardized contracts. This way participants can benefit from transparency, liquidity, anonymity and avoide interposition of the OMIClear[18]. OMIClear acts as a central counterpart, initially it started operation as clearing house for OMIP’s derivatives market, but later extended it’s scope to bilateral contracts. OMIClear acts as buyer to any seller and seller to any buyer for every contract it manages. This makes it an efficient tool to manage the usual sources of risk [19]. MIBEL’s system services and technical management are guaranteed by separate entities in both countries. In Portugal a concession is given to Redes Energeticas´ Nacionais (REN) to act as both manager of the national electricity transmission grid and System Operator (SO), coordinating between production plants and distribution. Red Electrica´ de Espana˜ (REE) acts in an equivalent way on the Spanish electricity system [16].

2.2.2 Electricity Pools

Since all electrical energy produced is pooled when delivered to the grid, trading electricity in a centralized way was seen as a natural market design for MEEs. The electricity pool, or spot market, is a systematic way to determine the system equilibrium. This process can be described by the following steps [10]:

• GenCos submit offers to sell electricity in the form of bids, with a price and a quantity;

• Similarly, RetailCos submit bids with the price and quantity of electricity they are willing to acquire;

• TheMO aggregates the GenCos bids in a increasing fashion, defining the supply curve, and the RetailCos bids in a decreasing fashion, creating the demand curve;

15 • The market equilibrium is found as being the intersection point between the supply and demand curves.

The point of equilibrium found through the electricity pool is called the SMP, and is defined as being the price of one additional megawatt-hour of energy. All market agents deal electricity at the SMP and not at the price of their original bid. This is seen as a way to ensure that producers submit bids that reflect their marginal price, ensuring market efficiency [10]. Figure 2.6 shows the results of the electricity pool operation. The demand curve is represented in blue and in orange the supply curve. The red dot represents the market equilibrium point, or SMP. Since the balance between electrical energy produced and consumed needs to be maintained in real time, there are circumstances where theSO needs to correct any imbalances, in order to ensure system integrity. This might lead to changes in the final price, as can be seen on Figure 2.7. Balancing curves for this hour can now be observed and it is noticeable that the adjustments made by theSO resulted in a change of the final price. This is the normal operating principle of a managed spot market, where the balancing function is entwined with the energy market [10]. In markets that are composed of multiple electrical systems, like the MIBEL, the interconnection power capacity between them is a constraint. When the market result leads to a situation where the interconnection capacity is exceeded, the SMP no longer applies. This situation is commonly called

Figure 2.6: Aggregate supply and demand curves for a specific hour [20].

Figure 2.7: Aggregate supply and demand curves for a specific hour, showing balancing curves, with the adjusted supply curve in red and adjusted demand curve in beige [20].

16 Figure 2.8: Hourly prices for a day where market splitting can be observed [20].

“Market Splitting”, where there are separate markets for each of the electrical systems where the inter- connections were maxed out. In this case, theMO has to find a new system equilibrium for each of these zonal markets. This is usually done by using the supply and demand curves of the respective zones and taking into account the amount of electrical power that transits the interconnection. The zone which has the lower price is said to be supplying energy to the one with the higher price [21]. In these situations instead of a SMP each of the zones has a Locational Marginal Price (LMP)[22]. A situation of market splitting on the MIBEL can be observed on Figure 2.8, where the hours sur- rounded in red show a noticeable difference in price between the two zones. It should also be mentioned that when a situation of market splitting occurs in the MIBEL a rent is paid to each of theSOs, so that they can invest on it’s increase. This is a means to ensure that the number of market splitting occurrences is decreased, leading to a more stable market and a better interconnection of the systems [21].

2.2.2.A Merit Order

To ensure market efficiency producers should make bids on the spot market that reflect their marginal costs [10], since economic efficiency requires marginal cost pricing [23]. For a specific power plant with installed power P , the total costs of the power plant, CT , can be expressed through Equation 2.3.

CT = CF + CV = P × C + c × W (2.3)

where:

• CF is the total fixed costs;

• CF is the total variable costs;

• C is the fixed cost per MW installed;

• c is the variable cost per unit of energy produced;

• W is the energy produced.

17 From CT and c, the average and marginal costs can be calculated through Equation 2.4 and Equa- tion 2.5 respectively.

C C¯ = T (2.4) average W

∂C c = T = c (2.5) marginal ∂W

This means that the marginal costs are actually the variable cost per unit of energy produced, which in the case of electrical energy can be assumed as equal to fuel costs [10]. It should be noted that long term sustainability of the GenCo is not guaranteed if electricity is always sold at it’s own marginal cost. Despite this it can be demonstrated that sustainability of the producer is guaranteed when energy is sold at the system marginal price, but only if the system is completely balanced. However this might not be the case in reality. To minimize total cost and ensure market integrity, the system should be composed of different technologies, where technologies with high fixed costs have low variable costs associated and vice versa [21]. This complementarity is expressed in Table 2.1. The shape of the supply is defined by the marginal costs of each technology present in the system. Figure 2.9 shows a typical supply curve, also called the merit order curve in MEEs. In the aforementioned figure it can be noticed the stepwise shape of the supply curve, where each of the steps represents a bid by a GenCo. They go from least expensive to most expensive, depending on the type of technology and fuel [24]. It’s easy to notice that technologies which were presented has having low fuel costs on Table 2.1, actually come at the bottom of the merit order curve, as expected. This is actually a fair assumption of the usual shape of the supply curve. Technologies such as wind, that have low marginal costs but high investment costs, come at the bottom of the curve, followed by nuclear and coal. At the top of the curve are gas-fired technologies, since they present the high- est marginal costs. Bids from hydro technologies are usually considered strategic and depend on the amount of water available, so they have no clear position on the merit order curve [24]. It’s important to note that the supply curve of a GenCo does not necessarily have the typical shape of a situation of decreasing returns to scale (as was shown in Figure 2.2). This is because the marginal costs of electricity producers are lower than their average costs. This represents one of the main differ-

Table 2.1: Production costs overview (based on [21]).

18 Figure 2.9: Merit order of the supply function [24]. ences between electricity markets and other regular markets. Despite this, the aggregate supply curve of a typical MEE shows a similar shape to a situation of decreasing returns to scale, since it is composed by different technologies with different marginal costs.

2.2.2.B Daily and Intraday Market

The daily market is considered the main electricity trading market of the Iberian peninsula. Market agents can submit bids until the deadline at 12 noon of the previous day [25]. This is sometimes called a “day-ahead market”. All authorized GenCos not bound by bilateral contracts are obliged to submit bids on the daily spot market. These bids are presented to theMO, who includes them in the matching procedure. The same is done for bidding RetailCos. The matching process in the MIBEL uses the Euphemia matching algorithm, which is the approved algorithm for all markets in the European Union [26]. This matching process takes into account the interconnection capacity and other bid conditions submitted by the market agents [27]. Once the daily market deadline has been exceeded, agents can still participate in six adjustment market sessions, which comprise the intraday market [25]. The purpose of the intraday market is to allow market agents to make adjustments to their position in the final daily schedule. Multiple bids are allowed for each of the GenCos and RetailCos participating, provided some conditions are verified. Agents can only make bids in the hours of the intraday market to which they already had made bids in the respective daily market or in those they have a bilateral contract. After the end of each session the MO matches all bids in a similar manner as was done for the daily market. No bids that wouldn’t comply

19 Figure 2.10: Daily and intraday market time horizons (based on [25]). with limitations set by theSOs are considered, to ensure system integrity [28]. An overview of the time horizons of both the daily and intraday market sessions can be seen on Figure 2.10. The duration of each session is shown in gray and the respective scheduling horizons are shown in color.

2.2.3 Bilateral Trading

Since electricity is a commodity with some special constraints (need of constant balance between supply and demand, no reliable means for large scale storage, etc.) the prices on electricity pools tend to be highly volatile. This has led to the introduction of alternative transaction methods such as bilateral contracts [1]. Bilateral trading is done in the form of contracts that involve two parties: a buyer and a seller. This type of transaction is usually free of any involvement, facilitation or interference of a third party. These contracts can also be considered as a good practice to reduce the risk exposure of all GenCos and RetailCos participating on the spot market. There are several types of contracts that can fall into the bilateral trading category, such as [10]:

• Forward Contracts: Both parties agree on the price and quantity of product to be transacted on a future date, where the price is derived from predictions made for the price at the specified delivery date. One of the parties will usually have a premium over the spot price, but the main objective of these contracts is setting a price to which both sides are agreeable to, preventing risk;

• Future Contracts: The same principle of forward contracts applies, but in this instance participation isn’t restricted to agents that produce or consume electricity, extending to speculators. These

20 market agents buy a forward contract at a specific price, hoping to sell it with a higher price before the delivery date, hedging a profit. The presence of speculators usually is seen as way to increase market liquidity;

• Options: Contracts in which physical delivery is conditional, usually involving a nonrefundable fee payed by the holder of the option when the deal is struck, and a further payment if delivery is exercised;

• Contracts for difference: Contracts that operate in parallel with the spot market. If on the date of delivery the price of the spot market is higher than the agreed to on the contract, the seller pays the difference to the buyer and vice versa, insulating both parties from fluctuations on the pool.

In the MIBEL bilateral contracts are managed by OMIP and OMIClear as already described in ?? [18]. Available products consist of future contracts, forward contracts, options and swaps [29] (equivalent to a strip of forward contracts, since multiple cash flows are exchanged, not all dependent on physical delivery of the commodity [30]).

21 22 3 Renewable Energy Sources, the Impact of Renewable Generation on Market Prices, and Support Schemes for Producers

Contents

3.1 Evolution of Renewable Energy Technologies...... 25

3.2 Wind Power...... 28

3.3 Merit Order Effect...... 32

3.4 Support Schemes for Renewable Energy Producers...... 37

23 24 This chapter gives the reader some insights into the recent developments related to RES and their exploration. In Section 3.1, a description of the growth of the sector is presented, starting with an International overview and then focusing on the Portuguese case. Section 3.2 deals with wind power in particular, which has been experiencing the largest growth in the past years. Again, some figures are presented, with the International case being shown first and then converging to Portuguese numbers and figures. The explosive growth of RES technologies, motivated by strong policies and support schemes, has brought forth a large effort from the scientific community to quantify the impact that introducing more renewable production has on the MEE. One of the most investigated ways to quantify the impact of RES on the MEE has to do with the so-called MOE. Section 3.3 discusses this effect, providing an explanation of important concepts and presenting a description of the main methodologies and results of related research. Even though the main principles of the MOE are presented in this section, more concepts that have to do with this effect shall be introduced in Chapter5. Finally, Section 3.4 discusses one of the main drivers of the RES exploration growth: support schemes for renewable energy producers. The reader is first presented with the International picture, focusing then on the Portuguese case, giving special emphasis to wind power support schemes, which is the focus of this work.

3.1 Evolution of Renewable Energy Technologies

In the last years there has been a large growth of the exploration of RES, which has been due to a number of important factors, notably ambitious international objectives and strong policy support schemes. This growth has not been balanced throughout the world, showing some disparities not only in how much capacity has been installed by each country, but also in regards to the technologies that have been chosen. Portugal shows a similar trend in the growth of RES technologies. The remainder of this section gives insights into the growth of the sector and also provides a picture of it’s present state.

3.1.1 Renewable Energy throughout the World

Recently, there has been a steady growth on the demand for renewable energy. By 2013, 19% of the global final energy consumption was provided by RES[3]. Renewable energy is comprised of technologies that can provide sustainable energy services in the form of electricity, transportation solutions and heating and cooling (the three end-user sectors). Nowadays, renewable energy technologies show a varying degree of technological and commercial

25 Figure 3.1: Total installed capacity of renewable technologies in the world at the end of the last 9 years. Total also includes geothermal power, concentrating solar power and ocean power (based on data obtained from [3, 31–33]).

maturity, but the relevant kinds of RES technologies are usually considered to be hydro power, wind power and solar power [15].

Out of the three end-user sectors, the one in which renewable energy share has grown the most has been the electricity sector [3]. This growth is depicted in Figure 3.1, where one can see that, even though hydro power has not shown a large variation since 2007, wind power and solar PV (Photo-voltaic) have seen a huge growth, with the former going from 94 GW of installed capacity, in 2007, to 433 GW, by the end of 2015, and the latter going from 7,6 GW to 227 GW of total installed capacity in the same time period [3, 33].

By 2004, the deployment and manufacturing of renewable energy technologies was mainly done in the United States of America, Europe and Japan, but as shown in Figure 3.2, this has changed, with China being the 1st country in renewable technology growth nowadays, having installed more than 200 GW of capacity from 2004 to 2014 [3].

In Figure 3.2, it’s also possible to observe that wind power is the leader in the installed capacity growth, from 2004 to 2014, largely due to contributions from China, Germany and the United States of America. Hydro had also a large growth from 2004 to 2007, when 205 GW of capacity were installed, but from then on less than 100 GW have been installed worldwide [3].

2015 has shown the largest global capacity addition to date, and today RES are considered main- stream sources of energy. The largest growth was in the electricity power sector, driven by several factors: cost-competitiveness of renewable technologies, dedicated policy initiatives, better access to financing, environmental concerns, growing demand for energy in developing and emerging economies, and the need for access to modern energy [33].

26 Figure 3.2: Additions of renewable power capacity from 2004 to 2013 [3].

3.1.2 Renewable Energy Technologies in Portugal

Renewable energy in Portugal has shown a similar trend to that of the rest of the world. In 2005, 87% of the energy consumed came from fossil fuels. Since then, policies promoting the reduction of emissions and the integration of RES to the electricity sector has led to a significant decrease in this figure [15].

The evolution of installed capacity in Portugal, from 2000 to 2015, can be seen in Figure 3.3. As in the international trend, wind power shows the largest growth. A significant reduction in the installed capacity of thermal power in the latter years of this period can also be noticed.

The electrical energy mix for 2015 is shown in Figure 3.4. Renewable energy was responsible for 30,7% of the total electrical energy consumption, and this figure grows to almost 50% when energy provided by large hydro power installations is also considered.

Another important figure is the annual utilization of installed capacity, which represents the number of hours that a power plant would need to operate at rated power to provide the same amount of energy. In regards to wind power, the annual utilization of the installed capacity was around 2300 hours, whereas for solar PV it was around 1750 hours. Both of these were, however, higher than for hydro (large and small), where it was around 1370 hours (calculations made using data presented in [35]).

27 Figure 3.3: Total installed capacity of electrical energy production technologies in Portugal at the end of the last 15 years (translated from [34]).

3.2 Wind Power

Wind Power is the RES technology that has shown the largest growth in installed capacity in the past few years. This is not only due to support policies but also to the great progresses made towards the maturity of the technology.

The growth seen in the installed capacity of wind power in recent years is a great example of the

Figure 3.4: Portuguese Energy Mix in 2015 [36].

28 Figure 3.5: Total wind power installed capacity in the world at the end of the last 11 years [33]. progress in the transition from fossil fuels to sustainable energy sources. This section gives some insights into important figures related to wind energy throughout the globe and also an analysis of the progress that has been going on in Portugal.

3.2.1 Wind Power in the World

The global installed capacity of wind power grew steadily during almost 20 years, with an increase of 270 GW during 10 years, from 2004 to 2014 [3]. In 2015, the increase in wind generation doubled that of the global electricity growth [37]. Although this tendency had a slight decline in 2013, due largely to the expiry of the United States Tax Credit (which lead to the fall of the United States of America from the 1st position of the largest global market for wind power to the 6th position in that year) [3], the next two years more than made up for it [33]. The progression of the total world installed capacity throughout the last eleven years is depicted in Figure 3.5, where the dip in added installed capacity of 2013 is clearly noticeable, followed by the two subsequent record years of 2014 and 2015, where more than 100 GW were installed. Even though the modern has it’s roots in Denmark, Germany and the United States of America, since 2004 the market has grown to almost every part of the globe. China is un- doubtedly the greatest example, having had it’s installed capacity doubled every year, from 2004 to 2010, making it the 1st country in total installed capacity in the world. Brazil, Canada, India and Mexico have also taken a big portion of the global market of wind conversion technologies [3]. The total installed capacity of the top 10 countries by the end of 2015, and the additions made in the same year, are depicted in Figure 3.6. China’s lead in respect to total and newly installed wind capacity is apparent, being responsible for almost half of the added capacity in 2015, making for a total of as

29 Figure 3.6: Top 10 countries of wind power installed capacity [33].

much as double of the United States of America, which is ranked 2nd, and more than the combined capacity of the whole European Union [33].

Although China is the leader in wind power deployment, it’s curtailment on wind farms has worsened in 2015, with almost 15% of wind power generated in this year being wasted, showing one of the serious challenges against wind power projects [37].

In regards to Europe, almost half of the newly installed capacity in 2015 was done in Germany and Denmark, due to the stability of the regulatory frameworks in these two countries. Despite this, the three countries with largest wind power capacity continue to be Germany, Spain and the United Kingdom. Still contributing to the growth of the wind industry in Europe are the additions made to offshore wind, which account for 24% of the newly installed capacity in the European Union, double that of 2014 [38]. The total installed capacities for the countries of the European union can be seen in Figure 3.7.

Wind power has become a mature technology and can now be considered a mainstream source of energy, having a huge impact in global decarbonisation. The reliability and cost-stability of wind power across a large number of markets has helped in establishing it as one of the lead technologies in the sector of RES, and it remains the most competitive way of adding new power generation, even when against conventional generation technologies. Nowadays, the challenges facing the growth of the wind power industry include ensuring reliable and cost-effective functioning of the overall energy system and contributing to energy security. But with technical and financial innovation driving down costs and improving the reliability of projects, integration of wind technologies into electricity systems will continue [37].

30 Figure 3.7: Europe’s total wind power installed capacity by country, in GW, at the end of 2015 [38].

3.2.2 Wind Power in Portugal

With the additions made in Portugal to wind power installed capacity throughout the last fifteen years, RES have currently a superior expression in electricity generation, when compared to conventional technologies, contributing to suppress 23% of the Portuguese demand in 2015 [39]. By adding 2,6 GW from 2007 to 2016, wind was the technology with the largest capacity growth in Portugal, even though solar PV showed the highest relative growth for the same period [40]. The evolution of wind power installed capacity in Portugal over the last 15 years is shown in Fig- ure 3.8, where the large growth from 2004 to 2011 is clearly depicted, with a slowdown being experi- enced in the next years. This being said, 2015 saw the total wind capacity rise above the 5 GW mark, with 200 MW under construction at that time and expected to be connected in 2016 [39]. Almost half of the Portuguese wind installed capacity is in the central region of the country, and when this number is combined with the capacity present in the northern region, the figure rises to 87%, making these two the prime regions in wind power production [40]. It’s also worth mentioning that, during the first three months of 2014, wind power had a larger contri- bution for the Portuguese energy mix than conventional and co-generation thermal units [44], with wind penetration reaching a daily average of 64%, on March 3, 2014. That same year had also one of the highest instantaneous penetration values, when wind power supplied 89% of total demand in December

31 Figure 3.8: Total wind power installed capacity in Portugal at the end of the last 15 years (based on data obtained from [41–43]).

28, slightly below the highest Portuguese historical value of 91%, in 2011 [45].

3.3 Merit Order Effect

There is a vast range of fields dealing with the analysis of the effects of integrating higher percentages of RES into the energy mix. Examples of this are how the power system behaves with the integration of more RES technologies, the impact that support policies have for both the consumers and producers and how electricity prices have been affected by the introduction of these technologies [24]. Research tends to be focused on the impacts of specific technologies, mainly wind power and solar PV, not only because these are the ones showing the highest deployment in recent years, but also in order to produce acute results. Another common theme is to focus on an individual country, since the great diversity of support policies, market mechanisms and even technology mixes, could lead to difficulties for analyses involving several countries. The work done for this dissertation focuses on finding the effect that wind power has on the MEE, specifically on the daily spot market prices, comparing this value with the amount of FITs directly sup- ported by consumers. This allows for an understanding on how much of this support mechanism is retrieved through the action of wind power in the MEE. In order to do this, one of the most common research avenues undertaken has to do with quantifying the MOE.

3.3.1 Merit Order Effect Explained

Since electricity is a commodity with no substitutes, the demand can be considered inelastic [9]. As such, changes in the supply can lead to changes in the price. This can be observed in Figure 3.9, where

32 Figure 3.9: Merit order effect [24]. a shift in the supply curve leads to a change in price from P1 to P2. As RES, i.e. wind power, has low marginal costs, it is normally bid into the daily spot market with prices as low as 0 C/MWh, entering at the lower part of the merit order curve. Thus, any increase in wind power production being added to the generation mix leads into a shift of the supply curve to the right. This is depicted in Figure 3.9, where the dark blue curve represents the situation with an higher level of wind, whereas the light blue curve the situation of low wind production. This means that periods with an high level of wind will usually have a lower price on the spot market. This is called the Merit Order Effect [24]. Since the support policies that are in place cause RetailCos to buy any RES that is injected to the grid, it can also be said that wind energy shifts the demand curve to the left by the same amount that it would shift the supply curve to the right. When considering demand as inelastic, the price at which the market finds it’s equilibrium point will be the same for both these approaches. It’s also interesting to note that, as long as the supply curve has a positive slope, any increase in wind production will lead to a decrease in the spot market price [46]. The MOE is usually referred to as the direct effect that RES have on spot market prices. Additionally, researchers have also established an indirect effect [11]. The indirect effect has to do with RES affecting MEE prices by reducing the price of emission al- lowances [11]. These are acquired by companies and establish the amount of emission gases their installations can produce over a certain period of time. This amount is based on an emissions cap set by regulatory agencies, that was decreased over time to reduce the total amount of emissions. Fur- thermore, emission allowances can be sold or traded, in what is commonly called a ”carbon market”, known as the Emissions Trading System in the European Union [47]. Since RES technologies produce

33 no emission gases, they contribute to lowering the demand for electricity produced by conventional ther- mal plants, effectively reducing the amount of emission gases and consequently decreasing the price of emission allowances in the carbon market. The value of the emission allowances affects the marginal costs of power plants, since it is a cost per unit of energy produced, and as such, the lower the price, the lower conventional GenCos will bid in the MEE, reducing spot market prices [11]. Although worthy of mention, the indirect effect falls outside the scope of the study presented in this dissertation.

3.3.2 Main Methodologies and Results of Related Research

In order to understand some of the methodologies being used to quantify the MOE, a review of the recent relevant literature is deemed worthy, with a special focus on the approaches and assumptions taken for the analysis. Sensfuss et al. [46] and Miera et al. [11] used MEE simulation to determine the hourly spot market price differences induced by RES. In both cases, a simulation of the spot market was done for two scenarios, one in which the RES technologies under analysis are considered in the bidding process and another in which they are not [11, 46]. The MOE is determined as the difference in prices of these two scenarios. Some of the assumptions taken in the methodology are as follows [11, 46]:

• GenCo price bids are based on variable and start-up costs determined from historical data of fuel prices and emission allowances;

• Demand is considered inelastic;

• All electricity consumed in the period under analysis is traded through the spot market;

• Rate of non-availability of power plants, dispatch of hydro plants, imports and exports are the ones actually observed on the period being analyzed.

Hannes Weigt [48] and McConnel et al. [49] applied a different methodology, based on a descriptive model of the MEE. Weigt establishes an optimization model for system cost minimization, considering marginal and start up costs, to calculate the hourly spot market prices. These costs are based on predetermined power plant efficiency values, combined with historical data of fuel prices and emission allowances. The production park used is composed of thermal and hydro plants, with a capacity higher than 100 MW. The model is then applied twice to find the hourly spot market prices, one time in which the demand considered is the one actually observed in the period and another with the demand volume reduced by the hourly wind input values. The MOE is obtained as the difference between the resulting prices. It is also important to note that Weigt analyzes both the direct and indirect effects wind power has on spot market prices [48]. McConnel et al. apply a similar methodology, although the approach

34 undertaken determines the MOE of additional levels of solar power installed capacity, as opposed to the MOE of the actual RES installed capacity in the period, as was done by Weigt. For this purpose, a preliminary solar radiation model is developed, to determine the total amount of potential solar power production. To model the supply side of the system, McConnel et al. use the actual published values of bids made by all participants in the spot market. Several scenarios are considered, in which the demand of the period is reduced by solar production of additional installed capacities, ranging from 0 to 5 GW. The MOE is determined as a function of the additional solar power capacity. [49]. One common methodology used in MOE research is applying regression techniques to determine MEE price differences introduced by RES. Examples include the works presented by Woo et al. [50], Tveten et al. [51], Cludius et al. [52] and Clo` et al. [53]. Woo et al. and Clo` et al. use very similar approaches. By finding the correlation between RES production and MEE prices and then applying regression, the influence that a specific penetration of renewable energy in the mix has in the spot market price can be determined. Accordingly, the MOE is then quantified by finding the effect that a marginal increase of 1 GWh to each RES technology supply would have on the spot market hourly prices [50, 53]. Tveten et al. and Cludius et al. also apply regression, although using a different approach. By analyzing historical data of spot market prices and production values, the price setting technologies are determined. Both studies concluded that conventional thermal technologies were the price setters. A regression model of the spot market price as a function of thermal production is then established, and this is used to determine the effect a greater amount of RES production would have on the spot market hourly prices, quantifying the MOE. It is also interesting to note that Tveten et al. and Cludius et al. disregard extreme prices that were observed for some hours, since these would have a negative influence in the final results [51, 52]. Recently, Azofra et al. [54,55] has presented an artificial intelligence technique to analyze the MOE. By using historical data of spot market prices and production values, a descriptive model of the price setting process is generated. Having the price setting model, several scenarios are analyzed to deter- mine the RES influence on the spot market prices. The two published studies vary in respect to the way the MOE is quantified and the technologies that were considered. The former [54] finds the wind power MOE by obtaining hourly spot market price differences between several scenarios, in which wind power installed capacity varies from 0% to 110% (100% being the actual installed wind power capacity on the study period) [54]. The second study [55] derives the MOE of both wind power and solar PV by using the descriptive model to find what the hourly spot market prices would have been if one of these technologies was taken out of the bidding process.

35 36

Table 3.1: Breakdown of merit order effect literature methodologies and results. A breakdown of the methodologies and results for all of the aforementioned works is presented in Table 3.1. It’s interesting to notice that the MOE of wind power is usually higher than that of solar power, which is undoubtedly due to the difference in installed capacities of both these technologies, with wind power having a much greater deployment rate presently. Some of these studies also compare savings due to the MOE of RES with the amount being financed by consumers through FITs. Sensfuss et al. [46] and Miera et al. [11] established that, for at least part of the period they analyzed, savings due to the MOE (the direct effect) were greater than the amount of FITs paid by consumers. Hannes Weigt [48] not only compares the direct effect of additional wind power on spot prices, but also takes into account the indirect effect, due to price reduction on emission allowances, reaching the conclusion that there is a slight surplus for consumers. Tveten et al. [51] established that savings from the MOE of solar power contributed with 23% of the total amount of FITs paid by consumers to producers with solar technologies during the analyzed period. Clo´ et al. [53] and Azofra et al. [54,55] reach similar conclusions, in that, although the financial volume of MOE due to wind power was greater than the amount paid through FITs by consumers, the opposite happened with solar power.

3.4 Support Schemes for Renewable Energy Producers

The growth seen in the exploration of RES has been highly dependent on the support policies that have been put into place [3]. By the end of 2015, 146 countries had some kind of support policy for renewable energy, removing barriers, attracting development, driving deployment, fostering innovation and encouraging greater flexibility in the energy infrastructure. With the “21st Conference of Parties of the Nations Framework Convention on Climate Change”, RES were established as a means to mitigate emissions and adapt to the impacts of climate change. Also, renewable energy and energy efficiency were considered fundamental to attain the future goals [33]. The support policy schemes used by some relevant countries can be observed in Table 3.2. Policy mechanisms have evolved in the last years, with policy instruments differentiated for each technology and the evolution of FITs [3]. These are a guaranteed price for the sale of electrical energy, with a value comprised of the sum of the following three components [56]:

• Avoided investment costs on new power plants;

• Avoided costs of transmission, operation and maintenance, including fuel costs;

• Environmental benefits.

The highest influence on the growth of this sector has been brought forth by the establishment of global objectives, such as reducing reliance in imported fuels, improving energy supply security, reducing

37 the environmental impact of the energy sector and encouraging industrial development [41], and the introduction of FITs, which nowadays exist in almost every country [3]. In regards to wind energy, a wide variety of support mechanisms have been developed and imple- mented since the late 1970s, including the aforementioned FIT, but also tax incentives, quota require- ments and trading systems [41]. There has been a large contention in regards to FIT support mechanisms, with the common argument being the high costs for consumers [51]. Despite this, to assess the cost that FITs have for consumers, the price reducing effect from RES should be considered [46]. Thus, the study of the MOE is fundamental to understand the true costs of FITs. Portugal has been a leading country in renewable energy policies, having achieved all of the commit- ments made at the Kyoto protocol and establishing the further target of having at least 31% of primary energy consumption coming from RES for 2020, higher than the 20% set by the European Union [56]. In 2015, the “Commitment to Green Growth” was established, laying down the objectives of the Portuguese energy sector for 2020. Some of the goals are [56]:

• Reach 31% renewable energy in gross end-consumer power consumption by 2020 and 40% by 2030;

• Reduce the renewable energy price between 30 to 40%;

Table 3.2: Renewable energy support policies of some relevant countries (taken from [33]).

38 • Increase self-consumption to 300 MW by 2020;

• Reduce public administration power consumption by 30%, in 2020, and 35% in 2030.

The main renewable energy support mechanism set by the Portuguese public administration is based on the obligation of EDP-Servic¸o Universal, the “Last Resort Trader”, to purchase all the energy pro- duced in the Special Regime Production (Produc¸ao˜ em Regime Especial)(PRE) at a FIT, and then selling it in the daily spot market. The additional cost between the hourly prices of the market and the FIT is supported by the electricity consumers through a global system tariff [57]. The Portuguese FIT for RES was originally conceived in 1988 as a mechanism with prices ranging from 40 to 50 Eur/MWh. In 1999, the legal framework suffered alterations, leading to an increase of the average value of the FIT to 80 Eur/MWh, by 2001 [56]. In order to attain future objectives, the Portuguese government established the “National Action Plan for Renewable Energies” in 2013. Some of the policy incentives set in place are intended to [56]:

• Promote the installation of solar thermal systems in the residential sector, swimming pools and sports facilities, and the renovation of dated solar thermal systems;

• Promote the installation of efficient energy systems in buildings and improve environmental perfor- mance fed by biomass for conditioning purposes;

• Streamline licensing procedures of renewable electricity plants;

• Grant incentives to power plants dedicated to forest biomass within a certain framework, through agreements with promoters of the plant;

• Promote the use of endogenous resources and waste for the production of biofuels.

The full policy support scheme of Portugal can be observed in Table 3.2, where a comparison with the schemes from other countries can also be made.

Table 3.3: Monthly average values of Feed-in-tariffs payed to Special Regime Producers on the first six months of 2016 (based on [58]).

39 Long run government support and a continuous pipeline of projects from 1990 to 2010 has helped establishing the wind power sector in Portugal. An example of this is the guaranteed FIT of 74 Eur/MWh valid for 15 years established by the Portuguese government [41]. After this period, since a Decree-Law of 2013, wind power producers are allowed an extension of the regulated tariffs through agreements with the Portuguese government, comprised of several options with different values [56]. ERSE publishes regularly the monthly average values of FITs paid to producers, and the values for the first six months of 2016 can be seen in Table 3.3. By observing the table, it’s interesting to note the RES support strategy taken by the Portuguese government, which varies greatly among each technol- ogy, with co-generation and urban waste technologies having the lowest FIT, and solar technologies the highest.

40 4 Agent-based Systems and the MAN-REM Simulator for Energy Markets

Contents

4.1 Multi-Agent Systems and the JADE Software Platform...... 43

4.2 Agent-based Systems for Electricity Markets...... 46

4.3 The MAN-REM Agent-based Simulation Tool...... 48

41 42 This chapter deals with agent-based simulators for liberalized electricity markets. Section 4.1 intro- duces the concept of “software agent” and describes some important features of the JADE software platform for developing multi-agent systems. Section 4.2 highlights the importance of agent-based sim- ulation tools for energy markets and describes two of the most important existing simulators: AMES and MASCEM. Section 4.3 introduces the MAN-REM simulator, describing some of its key features, including the graphical user interface, markets and the associated pricing mechanisms. This work has adopted an initial version of the MAN-REM simulator. During the process of under- standing and learning the capabilities of this tool, it was noticed that some changes could be made in order to improve the system. Thus, during the work of this dissertation the MAN-REM system was extended by adding a special type of agent, referred to as “personal assistant”. This type of agent manages the graphical interface of MAN-REM, interacting directly with the user through windows, and communicating with other agents through the exchange of messages. Thus, the personal assistant agent manages communications between the user and the active power agents. Also, communica- tions between the intelligent assistant agents and the active power agents were implemented during this work, that is, the methodology necessary to an effective communication between all the aforementioned agents.

4.1 Multi-Agent Systems and the JADE Software Platform

The systems that rely on the interactions between a great number of agents have a high level of complexity, since each agent has specific objectives, which can conflict with the objectives of other agents. As such, several agent-based systems have been developed to aid with the study of such large-scale complex systems, since they are capable of modeling the behavior of a large number of participants and their interactions [2]. An agent-based system is an artificial system that contains agents [2], which can be defined as special software components that have autonomy and work towards specific goals. Agents can interact with each other both directly, through communication, or indirectly, by acting on the environment, and can decide whether to cooperate or compete, in order to reach their goals [59]. Using agent-based systems is especially advantageous, compared with traditional, discrete event simulations, when modeling complex systems where participants, characterized by distinct roles, func- tionalities and behaviors, rely upon interactions with other entities to reach their goals [2]. The agent architecture is a fundamental aspect underlying the agent interactions and behaviour. Architectures can range from purely reactive, in which an agent only acts after receiving a specific stimulus, to deliberative, in which agents reason about their actions, such as the BDI (belief-desire- intention) architecture [59].

43 A key component of a multi-agent system is communication, since agents need to be able to both communicate between each other and with users, in order to cooperate, collaborate and negotiate. As such, some special communication languages have been developed for agent-based systems, which rely upon specific rules and conditions. FIPA ACL is one such language, which allows the use of different content languages and the management of conversations through some predefined and well established protocols [59]. Several software platforms for multi-agent systems have been developed. Examples include JADE [59], REPAST (Recursive Porous Agent Simulation Toolkit) [60] and OAA (Open Agent Architecture) [61]. JADE can be described as a software platform that provides functionalities for the realization of agent-based applications,using the JAVA programming language [59]. To allow for a vast range of applications, some design choices were made when developing JADE. These include making agents able to be autonomous, proactive and to communicate, in compliance with the Foundation for Intelligent Physical Agents (FIPA) regulations. FIPA is an international non-profit association created to develop standards for agent-based technol- ogy. The full objectives of FIPA have changed in various occasions, but by 2002 it’s mission statement read:

“To promote technologies and interoperability specifications that facilitate the end-to-end inter networking of intelligent agent systems in modern commercial and industrial settings (from [59])”

The three fundamental core-concepts of FIPA that were implemented in JADE are agent architecture, agent management and agent communication. Agent architecture in JADE is abstract, so that this software platform is easily adaptable to any application. This is done by essentially keeping key mechanisms abstract, like message transport and directory services. In order to achieve this, the architecture states some mandatory services ( e.g., the message transport), and some other optional services which can be implemented or disregarded according to the application being developed. Another fundamental aspect of JADE, which complies with the FIPA regulations, is it’s agent man- agement capabilities. The components of this management structure are:

• Agent Platform: Physical infrastructure in which the agents are deployed. The design of this platform is dependent of the application;

• Directory Facilitator: Provides a “yellow pages” service to other agents, which consists of an accu- rate and complete list of the agents present in the specific agent platform;

• Agent Management System (AMS): Responsible for managing the operation of the agent platform, dealing with the creation, deletion and migration of agents;

44 Figure 4.1: JADE agent management window.

• Message Transport Service (MTS): Service provided by the agent management system to trans- port messages between agents.

Each agent present in an agent platform is labeled by an Agent Identification (AID), so that it can be distinguished unambiguously. This label is also used as an address in messages, so that the message transport service can clearly identify the senders and recipients of any communication. In order to let users analyze the current state of their agent system, JADE presents a simple interface window, which is shown in Figure 4.1, where by navigating the tree on the left, one can see what agents are in which agent platform. The sub-window on the right shows information about the agent selected, in regards to it’s name, address, state and owner. In JADE, communication is done by means of a messaging service, in which every message com- plies with a set of rules and has a predetermined structure, as specified by FIPA-Agent Communication Language (ACL) principles [59]. FIPA-ACL is grounded on speech-act theory, which dictates that messages convey actions, or com- municative acts, also known as performatives, containing a set of 22 such acts. Some of the commonly used acts are inform, request, not understood and agree [59], which translate basic communication mechanisms. The format set by ACL rules is comprised of several fields, mainly [59, 62]:

• Sender: The AID of the agent sending the message, so that the message transport service is able to deliver any reply to the message being sent;

• Receiver: The AID of the agent to which the message is addressed, so that the message transport service is able to correctly deliver the message;

• Performative: Expresses the communicative intention, or what the sender expects to achieve through a message;

45 Figure 4.2: JADE window for the “sniffer” service.

• Ontology: the vocabulary of symbols used in the content and their meaning, helping agents to determine how the message should be dealt with;

• Content: the information the sender wishes to convey to the receiver.

One of the most important fields of any message is the performative, and as such FIPA has generated a complete library to which developers can refer when programming applications relying in the JADE platform [63]. To let users follow the evolution of the agent communication process, JADE provides a “Sniffer” service that tracks messages in a specific agent platform. This window is shown in Figure 4.2, having a tree on the left that allows users to choose which agents they want to analyze, and a depiction of the communications between agents being shown on the right part, where messages are labeled by their performative. Through this “sniffer” service, users are also able to see the messages that are being traded, by double-clicking on the particular communication they wish to inspect.

4.2 Agent-based Systems for Electricity Markets

Multi-agent systems have been deployed for a wide range of application, ranging from small sys- tems for personal assistance to large industrial applications, as in process control, system diagnostics, manufacturing, transportation logistics and network management [59]. As referred in the previous section, agent-based simulation tools are especially effective when deal- ing with systems that require large interactions between agents, and this is the case of the MEE[2]. Many agent-based systems have been developed to model the MEE, such has SEPIA, EMCAS, STEMS-RT,

46 NEMSIM, AMES [22] and MASCEM [64]. Each of these systems has a specific set of characteristics, and before going into the simulation tool worked upon in this dissertation, a review of two of the most important platforms is done in the following subsections.

4.2.1 AMES

The AMES (acronym for Agent-based Modeling of Electric Systems) test-bed is an agent-based sys- tem developed in the United States of America to model and study the growing complexity of wholesale electricity markets. AMES is a open-source software based on the JAVA programming language and the REPAST multi-agent software platform [22]. The architecture of this platform includes four key components, namely multiple Trader Agents, an Independent System Operator, two settlement processes and an AC-transmission grid. The trader agents include sellers and buyers of electrical energy who act in the wholesale market by submitting bids, composed of a volume of energy to trade and a price at which the trade will be realized. This bidding process is organized by an independent system operator, who aggregates offers and finds the point of equilibrium in a day-ahead settling process. In the AMES test-bed, trader agents have a geographical position, linked by an AC-transmission grid, which represents constraints to the system, since it has a limited capacity. After finding the market equilibrium, the independent system operator needs to assess the system reliability. If this equilibrium leads to a situation impossible to realize through the ac-transmission grid, an instance of congestion occurs. The independent system operator is responsible for disregarding any trading bids that can’t be realized due to the physical constraints imposed by the transmission grid, and finding a viable schedule for the day-ahead market, using a real-time market to settle any differences in supply and demand. This follows the basic principle of a managed spot market, where the independent system operator acts as both theMO andSO. The price found through this methodology is, in fact, the LMP and the independent system operator is basically a software component that solves a bid-based DC Optimal Power Flow problem, giving rise to price and volume results for each trader agent and also to the definition of any zonal market that is the product of congestion. This process is repeated for 24 successive periods, or hours, representing one day, and for a number of days as defined by the user. It should be noted that, although seller agents representing generation companies can make bids that reflect their marginal costs, they can also adapt and learn throughout a simulation. In this way they can hedge profits by either bidding a quantity lower than their installed capacity at a price equal to their marginal costs, or inversely, increasing the price bid and selling a quantity equal to their installed capacity.

47 4.2.2 MASCEM

MASCEM, short for Multi-Agent Simulator for Competitive Electricity Markets, is an agent-based market simulator developed in Portugal, which is able to simulate the wholesale trade of electrical energy through a day-ahead pool and by bilateral contracts, based on the OAA software platform [64]. The MASCEM system is comprised of different types of agents, whose description follows:

• Market Facilitator: Agent that coordinates the market and the interactions between agents, ensur- ing they are functioning correctly;

• Network Operator: Agent responsible for activities that deal with the security of the electrical sys- tem, analyzing the technical viability of the market results and thus acting as theSO;

• Market Operator: Manages operations of the pool mechanism, acting as theMO;

• Buyer: Agent that buys electrical energy through the wholesale market;

• Trader: Agent that acts as an intermediary between consumers and suppliers, acting as a retailer, broker, aggregator or marketer.

Pool simulation is done by allowing buyer and seller agents to bid the quantities of energy that they want to trade and the price at which they want to do so, for 24 consecutive periods. The market operator then organizes the submitted bids, finding the market equilibrium, and further communicating the results to the network operator who analyzes their viability, making the necessary adjustments by finding which bids don’t affect the system integrity. The simulation process ends with the market operator informing the participating agents of the results. Bilateral trading is simulated by enacting communication between seller and buyer agents so that an agreement between both parts can be reached. This communication represents a real world negotiation between the two parties, and is based on predetermined strategies, which are revised by each partic- ipating agent during the negotiation period. The agreements reached through negotiation need to be processed by allowing the network operator analyze their feasibility.

4.3 The MAN-REM Agent-based Simulation Tool

The MAN-REM simulation tool is an agent-based software application developed to simulate and study the participation of different entities in the MEE. It was developed using the JAVA programming language and the JADE platform. There are three main components of this simulation tool, namely a graphical user interface, a simulation engine and domain specific agents, which will be described in the following subsections [4–7].

48 Figure 4.3: MAN-REM simulation system overview, depicting some of the simulation environments and the main communication fluxes between agents and between the simulation system and users.

4.3.1 System Overview

An overview of the system architecture of the MAN-REM simulation tool is presented in Figure 4.3. There several agent types, namely:

• Personal Assistant: Agent responsible for managing the graphical user interface, handling commu- nication with users and acting as a buffer between the market operator and the agents participating in the simulations. This type of agent was implemented in the MAN-REM system as part of this work;

• Market Operator: Agent responsible for handling the simulation operations, i.e. running the pricing mechanism algorithms;

• GenCo Agents: Agents participating in the simulations, acting as sellers and/or producers of elec- trical energy;

• RetailCo Agents: Agents participating in the simulations, acting as buyers of electrical energy.

• Aggregator Agents: Agents participating in the simulations, acting as a counterpart to a coalition of consumers, buying electrical energy in the market;

• Consumer Agents.

49 Agents co-exist in a simulation environment, which is comprised of two sub-environments, one for spot market simulations and another for bilateral trading simulations [7]. Each of these environments is handled by the market operator through the “spot controller” and “bilateral trading controller” classes re- spectively, which involve the pricing mechanism methods (see below) and any other methods necessary to ensure that they function properly, and are called by an agent associated with the “Market Operator” class when simulations are prompted.

Users interact with the system through a personal assistant agent, who handles the graphical user interface and has some information of the agents active in the system. By using the system menus, users can add agents to the simulation platform, handle some of their information, and choose what agents can participate in a simulation. Users can also select which pricing mechanism will be applied when simulating the spot market or what type of negotiation will be simulated in the bilateral trading envi- ronment. When a simulation is prompted by the user, the personal assistant agent transmits a message to any participating agent so that the agents can either submit which offers they will make on the day- ahead/intraday market, or acknowledge which agent they will be negotiating with for a bilateral contract. After notifying the participating agents, the personal assistant agent notifies the market operator about the simulation that will take place, also transferring the necessary information for this process to start. After ending the simulation, the market operator handles a proposal to the personal assistant agent, who in turn shows the simulation results to the user, so that he/she can analyze and accept the outcome, in which case the personal assistant agent finally transmits the results to the participating agents.

Figure 4.4 shows a diagram of the main classes present in the MAN-REM system. Agents inherit from the abstract class “MAN-REM Agent”, having a set of goals to accomplish, which can be buying energy, selling energy or some other more complex goals, dependent on the simulation, and proactively choose actions that will allow for the completion of these goals, by analyzing the information that they have about themselves and the environment [7].

Spot market simulation using the MAN-REM system has two main pricing mechanisms available which are based on the marginal pricing theory. These are the SMP mechanism and the LMP mech- anism. The SMP mechanism was developed by the MAN-REM team and allows for the simulation of the spot market. Offers have two key variables, an energy volume and a price, and through this mechanism the market equilibrium can be found in a similar fashion to what has been explained in subsection 2.2.2[65]. The work developed in this dissertation relies solely in this pricing mechanism.

The LMP mechanism is based on the simulation algorithm present in the AMES test-bed, discussed in subsection 4.2.1, and while similar to the SMP mechanism, it allows for the simulation of the spot market while considering the constraints of a physical transmission system, being able to simulate con- gestion and market splitting [65].

50 Figure 4.4: UML class diagram of agents in the simulation environment.

4.3.2 Graphical User Interface and Agent Communication

An important component of the MAN-REM system is the graphical user interface. The main window of the system is presented in Figure A.1. Users can interact with the simulation environment through the menus in the top left corner. Four menus are available, and they are specific to each of the steps necessary to a particular simulation. These menus are presented in more detail in Figure A.2. A portrayal of each of these menus follows, showing the steps that need to be made in order to con- duct a day-ahead spot market simulation. Since during the work of this dissertation was communication protocol between the agents for spot market simulations had to be worked upon, this important feature of the system is also described in the next sections. The pictures discussed in the following sections can be found in Appendix A.

4.3.2.A Menu “Agents”

The simulation process starts by introducing the GenCo and RetailCo agents into the system, since the personal assistant and market operator agents are already present when the system is booted up. Figure A.3 shows the process of loading a GenCo agent into the system. Users can either load agents from a previously created database already present in the system files, with a set of fully de- scribed agents, or add new agents, by introducing the prompted information. The process of loading an agent is presented, since creating a new agent takes similar steps, but requires the introduction of the

51 information by the user. By selecting the load option in Figure A.2(a), users can indicate which type of agent they want to introduce. When this choice is made Figure A.3(a) pops-up, where the user can choose which of the agents of the set he/she wants to load. After this, Figure A.3(b) pop-sup, showing the basic information for this agent. The agent is loaded only after the user has reviewed and accepted the information pre- sented in this window. At this point the newly loaded agent sends a message to the personal assistant agent with some of it’s information, including the technologies available for production. This communica- tion process can be seen in Figure A.8(a), involving the “inform” performative. The next and final window of this loading process can be seen in Figure A.3(c), where the whole portfolio of electricity production technologies available for the agent is presented, with a full description of each of them. Loading a RetailCo agent takes similar steps, with the difference being mainly in the window related to the portfolio technology, which is not shown. Figure A.4 shows the windows for this loading process and the messagen marked as “3” in Figure A.8(b) shows the communication process that follows the task of loading a RetailCo agent.

4.3.2.B Menu “Markets”

The second step of a market simulation is to select the market and the pricing mechanism to be considered. Figure A.2(b) shows the menu used for this task. After selecting the “day-ahead market” option, the “pricing mechanism” window, presented in Figure A.5, pops-up. When the user decides on the pricing mechanism, the personal assistant agent communicates this choice to the agents present in the simulation environment. This communication process can be seen in Figure A.8(c), taking the form of the messages marked as “4” “5” and “6” involving the “inform” per- formative. When agents receive this message, the appropriate behaviors for the simulation taking place are activated.

4.3.2.C Menu “Participants”

The third step is to choose the agents to participate in the simulation. Selecting a GenCo agent or a RetailCo agent has the same steps, so only the process of choosing a GenCo agent is described below, with the corresponding windows being presented in Figure A.6. The options of the participants menu are shown in Figure A.2(c). After the user decides to consider a GenCo agent, the “GenCo data” window pops-up, as shown in Figure A.6(a). In this window, the user can choose which of the GenCo agents present in the environment he/she wants to consider in the simulation. When this is done, the “market info” window pops-up, as seen in Figure A.6(b). Here, the user can review the market being simulated, the pricing mechanism being used and the actions the

52 agent will perform. This window also allows for the user to select which business strategy the agent will use to define its bids. These strategies are based on scheduling algorithms that maximize profit based on the technologies the producer has available in the portfolio [7]. One such strategy available in the system was presented by Ghadikolaei et al. [66], which calculates the bids that maximize profits when the GenCo has a portfolio comprised of hydro, thermal and wind technologies. Users can also select a set of bids independent of the technology portfolio of each agent, which are already present in the system files, by selecting the “default strategy” option. This was the methodology applied in this dissertation, since the bids used by agents were determined by analyzing historical market data from MIBEL. The final window for this menu is the “producer offers”, that can be seen in Figure A.6(c). Here the user can review the bids that a particular agent will make in the present simulation. Figure A.8 shows the communications that result from choosing the participating agents. When the user presses “OK” in the “market info” window, the personal assistant agent sends a message to the selected agent informing that it will take part in the simulation. Since this message also contains the chosen strategy, this will prompt the agent to either run the strategy algorithm or load the offers from the data file. When this process has finished, the participating agent sends a new message to the personal assistant agent containing the bidding information, which leads it to pop-up the “producer offers” window. These communications can be seen in the Figure A.8(d), taking the form of the two messages marked as “7” and “8”, involving the “inform” performative. The same occurs when picking RetailCo agents, as can be seen in Figure A.8(e) through the messages marked as “11” and “12”.

4.3.2.D Menu “Simulation”

The menu for the final step in the simulation process is presented in A.2(d). The windows that pop-up by interacting with this menu can be seen in Figure A.7. After the user decides to start the simulation, the personal assistant agent sends a message to the market operator, which contains the pricing mech- anism being used and the bidding information necessary, prompting it to start the simulation process. After running the necessary procedures and obtaining the day-ahead market results, the market op- erator sends the results to the personal assistant agent. This communication process can be seen in Figure A.9, taking the form of the messages marked as “13” and “14”, sent between the personal assistant and the market operator agents, involving the “inform” performative. When the personal assistant agent receives the market results, the “spot market results” window pops-up. Users can navigate in this window by choosing the results that they want to see. In Figure A.7(a), the market prices for each of the 24 hours of the day-ahead simulation are presented. Figure A.7(b) shows the generation commitments, where users can see how much electrical energy is sched-

53 uled for the participating GenCo agents to sell, for each of the 24 hours. Finally, Figure A.7(c) presents the retailer results, which shows to users the amount of electrical energy that will be acquired by each of the RetailCo agents that took part in the simulation. These market results are communicated to the participants by the personal assistant agent after the user has given approval. This can be seen in Figure A.9, in the form of the messages marked as “15”, “16” and “17”, involving the “propose” performative.

4.3.2.E Contributions to the MAN-REM simulation tool

The personal assistant agent is now responsible for managing the windows discussed above. This makes the personal assistant agent in charge of all communication between the MAN-REM system and the user, one of the main objectives of this dissertation. Figure A.9 shows the whole communication process implemented in the MAN-REM system during this work. As intended, the personal assistant agent serves as a facilitator, handling communication between the active market agents and the market operator agent.

54 5 Quantifying the effect of Wind Energy in the Spot Market Prices through Agent-based Simulations

Contents

5.1 Merit Order Effect...... 57

5.2 Methodology Applied...... 60

5.3 Results and discussion...... 73

55 56 The large deployment of RES in the electricity sector has caused some concerns. One such concern is the impact that a higher share of renewable generation has on spot market prices. One of the main drivers in this growth are the support policies being employed in many countries. One such policy applied in almost every country is the FIT. There has been large contention in regards to this support mech- anism, especially due to the high costs that are attributed to consumers. Many of these discussions, however, do not take into account the effect that RES have on spot market prices. The work presented here quantifies the price difference that RES, specifically wind power, has on the spot market prices in the MIBEL. This price difference is the so-called MOE. Although this has been done previously for the specific case of Spain, to the best knowledge of the author, no studies were found for the Portuguese case. As such, the work developed in this dissertation tries to fill this MOE research gap. By quantifying the MOE, an adjustment to the amount directly financed by consumers through FIT can be made. This adjustment tries to provide a better understanding of the costs that FIT have for consumers. The objectives set for this study are to:

• Analyze the effect that RES supported by policy mechanisms, i.e. wind power, has on spot market prices;

• Develop a methodology to establish the volume and price bids of software agents participating on the day-ahead pool of the MEE, in a systematic fashion, through the analysis of historical market data from MIBEL;

Section 5.1 presents a brief summary of the MOE, which was discussed in detail in Section 3.3, followed by a preliminary analysis of the price reduction effect that wind power has caused in the spot market price. Furthermore, the key indicators used when analyzing the MOE are also presented here, building upon the introduction made in the aforementioned section. Section 5.2 discusses the method- ology developed to quantify the MOE of wind power for the Portuguese case. Two approaches were undertaken, since the first did not present reliable results, although being worthy of mention. Finally, Section 5.3 poses a discussion of the results obtained.

5.1 Merit Order Effect

Since RES have low marginal costs, they usually enter the market at the bottom of the supply curve, causing a shift of this curve to the right. Since the demand curve remains unchanged, this shift to the right of the supply curve causes a price reduction. This effect is called the MOE[24]. By analyzing the price reduction that wind power causes on the MIBEL daily spot market, this work tries to quantify the MOE of wind energy, for Portugal.

57 Figure 5.1: Hourly spot prices in the MIBEL, for a day with 58% of wind penetration versus a day with 5% wind penetration(hourly spot market prices taken from [67]).

5.1.1 Preliminary Analysis

Structural analysis are often used as a preliminary study of the MOE[24], by analyzing the existing correlation between market price and level of wind production [11]. With this in mind, data for daily spot market prices [67], and quantities of energy produced by each technology [68], for every day of the first six months of 2016 were obtained. Having the total amount of energy produced by all technologies, and consequently the quantity of energy produced by wind power, the ratio of wind power on the energy mix can be found, also known as “wind penetration”. However there are some other factors that should be taken into account, such as levels of electricity demand, hydro generation, unexpected unavailability of thermal plants and evolution of fuel prices [11]. In order to perform a preliminary analysis of the impact of wind power on the spot market, without having to take into account the aforementioned effects, two days with similar demand profiles, and in the same week were chosen. The hourly spot market prices for both of these days are presented in Figure 5.1. The line in blue represents the day with a wind penetration considered high (an average wind penetration of 58%) and the line in red shows prices for a day with a wind penetration considered low (average wind penetration of 5%). It is noticeable that a larger amount of wind power drives prices down, introducing an average difference in price between both days of approximately 30 C/MWh.

5.1.2 Key Indicators

Through simulation, the price of the daily spot market when generation from RES is disregarded, xh, can be obtained. By subtracting the real price, ph, the price difference that wind power causes in the market can be determined, quantifying the MOE. With these two prices, some other relevant indicators of the MOE can be established.

58 As discussed in ??, the “Last Resort Trader” purchases all energy produced by PRE and then sells in the spot market.The additional cost between the hourly prices of the market and the FIT is supported by the electricity consumers through a global system tariff [57]. Thus, the amount directly supported by users through FITs can be found using Equation 5.1:

t X OC = (FIT − ph)Wwindh (5.1) h=1 where:

• OC is the volume of FITs directly supported by consumers during period t, in C;

• t is the time period being analyzed, in hours;

• FIT is the average price of FIT, in C/MWh;

• ph is the hourly spot market price when RES production takes part in the energy mix, in C/MWh;

• Wwindh is the total energy produced by wind power technologies in Portugal during period t, in MWh.

OC represents the over-cost of the FIT that is directly financed by consumers through system tariffs. However, this over-cost does not take into account the spot market price reduction from wind power, since the price difference used is between the FIT value and the actual spot market price. As such, a new formula for the over-cost is proposed, where the price difference used is between the FIT and the spot market price without contribution from wind power. This proposed over-cost can be obtained through Equation 5.2:

t X OCprop = (FIT − xh)Wwindh (5.2) h=1 where:

• OCprop is the volume of FITs directly supported by consumers during period t considering the price reduction caused by wind power, in C;

• t is the time period being analyzed, in hours;

• FIT is the average price of FIT, in C/MWh;

• xh is the hourly spot market price when RES production does not take part in the energy mix, in C/MWh;

• Wwindh is the total energy produced by wind power technologies in Portugal during period t, in MWh.

59 Since the price difference that results from the MOE affects all participants of the spot market, a financial volume of the MOE can be obtained, through Equation 5.3[46]:

t X V = (xh − ph)dh (5.3) h=1 where:

• V is the financial volume of the MOE for period t, in C;

• t is the time period being analyzed, in hours;

• xh is the hourly spot market price when RES production do not take part in the energy mix, in C/MWh;

• ph is the hourly spot market price when RES production takes part in the energy mix, in C/MWh;

• dh is the total electricity demand, in MWh.

With the financial volume of the MOE, V , the impact that each MW of RES installed capacity has on the spot market price can also be determined through Equation 5.4[46]:

V S = (5.4) R

where:

• S is the specific value of the MOE, in C/MWh;

• V is the financial volume of the MOE, obtained through Equation 5.3;

• R is the total energy produced by RES in period t, in MWh.

5.2 Methodology Applied

In order to quantify the MOE, a methodology to obtain spot market prices has to be established. As was shown in Section 3.3, many such methodologies have been applied, relying heavily on assumptions to simplify the system, since the spot market prices vary according to several factors that are not easy to quantify. The work done relies upon an agent-based system, the MAN-REM tool, to simulate the participation of agents in both sides of the electricity spot market. Their participation is in the form of bids, composed of a volume of energy and a price. The system acts as theMO by aggregating offers from all of the participating agents, finding the market equilibrium point and notifying the market results to all agents.

60 The first step, in order to quantify the MOE, is establishing a systematic way to find the bids of each of the agents participating in the simulation. The work performed in relation to this aspect is presented below.

5.2.1 First Approach: Supply-side bids based on a Regression Model

This sub-section presents the first approach taken in order to determine the bids. The work done builds on the methodologies applied by Sensfuss et al. [46], Miera et al. [11] and Tveten et al. [51]. As was done for all of these works, historical data was used to study the market. This data includes:

• Hourly spot market prices and energy volumes traded for the first six months of 2016, obtained from Sistema de Informac¸ao˜ de Mercados de Energia [67], a online platform managed by REN, that presents all market results;

• Hourly quantities of energy produced by each technology in the first six months of 2016, obtained from Centro de Informac¸ao˜ , another online platform managed by REN, that presents all technical data regarding the Portuguese electricity transmission system [68];

• Installed capacities at the end of 2015, published by REN[35];

• Installed capacities of PRE technologies, published by ERSE[58].

To reduce system complexity, some assumptions had to be made. The first assumption taken in this approach is common to both Sensfuss et al. and Miera et al., which consists in considering demand as totally inelastic. Also, as done by Miera et al., all values of imports, exports and pumping are those actually observed in the period. As was done by Sensfuss et al., it was assumed that all energy produced in the period was traded through the spot market, since this approach relies upon the data published by REN, which includes all produced energy for the hour, not only the amount traded through the spot market. The demand side is then defined by a sum of quantities, as expressed by Equation 5.5:

SD = D + E − I + P (5.5)

where:

• SD is the demand used in the simulation;

• D is the sum of all energy produced, published in [68];

• E is the exports value (published in [68]);

• I is the imports value (published in [68]);

61 Table 5.1: Correlation between spot market hourly prices and production of a specific technology, for each of the first six months of 2016 (based on data obtained from [67] and [68]).

• P is the pumping value (published in [68]);

The demand side agents bid SD at the highest possible price (180 C/MWh in the MIBEL), actively ensuring that the demand is completely inelastic. With the demand side established, remains the task of describing the supply side. To do this, a similar approach as the one employed by Tveten et al. [51] was employed. By finding the correlation between spot market hourly prices and the quantity of energy produced by each technology, one can determine which of these are price setters in the market. This was done in a monthly fashion, to lower the effects of fuel price variations, seasonal variation in demand levels, and the effect hydro generation has on the spot market price. The results of these correlations are presented in Table 5.1, showing that the largest impact on price comes from thermal technologies, similar to the conclusions drawn by Tveten et al. [51] and Cludius et al. [52]. In the Portuguese case, it’s interesting to note that the greater correlation value is obtained when considering contributions not only from conventional thermal technologies, like coal and gas, but also from PRE thermal technologies. From Table 5.1, one can also notice the negative correlation between wind power production and spot market prices, which is the basis of the work being presented. Although there is a considerable correlation between hydro power production and the spot market prices, since this technology depends upon the availability of water, another assumption based on the work of Miera et al. [11] was applied, which consists in considering that the dispatch of hydro plants was the one observed in the period. In this way, considerations pertaining the prediction of water values are disregarded. Furthermore, solar and wind power production are also considered the same as the real production in the period (for similar reasons). Since thermal technologies have been established as the price setters, as was done by Tveten et al. [51], the relationship between a specific quantity of energy produced by these technologies and the price at which the spot market would find it’s equilibrium is determined, using least squares regression. Once again, this was done in a monthly fashion, to mitigate any secondary factors that impact the spot market price, and the results for this are presented in Appendix B(Figure B.1), where historical data of spot market hourly prices as a function of total thermal production is depicted in blue and the linear

62 function resulting from regression is shown in orange. With this preliminary work concluded, the agents participating in the simulation can now be defined. Since demand is considered as completely inelastic, only one RetailCo agent was considered, which bids the total amount of consumed energy in the period, determined through Equation 5.5, at the highest possible price of the market. The supply side was divided in terms of technology and installed capacity. Since the volume of RES technologies is the one observed for the period, three agents were defined for each technology. Namely, one agent for hydro power production with and installed capacity of 6000 MW, one agent for wind power production with an installed capacity of 4500 MW and one agent for solar power production with an installed capacity of 400 MW. These values were based on those published by REN, which were 6146 MW, 4826 MW and 429 MW, for hydro, wind and solar respectively. The price bids for these agents was set at 0 C/MWh. Although this is a good approximation for wind and solar technologies, which are remunerated through support policies, it is not so for hydro technologies. This approximation was done taking into account that bids from hydro are strategic and depend on the amount of water available, simplifying the simulation process, and also to guaranteeing that the simulated and real hydro dispatch is the same. The volume bids for each hour of the simulation were the ones published for the same period. Installed capacities for GenCo agents with thermal technologies were set at an arbitrary value of 500 MW, and the total amount of installed capacity for each technology were set as 1500 MW for coal, 4500 MW for gas-fired technologies, and 2000 MW for thermal PRE. The values for coal and gas- fired technology agents were based on those published by REN, which were 1756 MW and 4698 MW respectively. For thermal PRE agents, the total installed capacity was based on those published by ERSE[58], which was 1827 MW, the sum of Biogas, Biomass, Co-generation, Renewable Co-generation and Urban solid waste thermal plants installed capacities. Price bids for these agents were determined through the regression function established above, considering that thermal PRE producers bid with the lowest prices and gas-fired technologies bid with the highest prices. It was considered that the volume of the bids for GenCos with thermal technologies, was the same as their installed capacities. A breakdown of the agents used in the simulation system is shown in Table 5.2, with the installed capacity and technology of each agent and the price bids they used for each month.

63 64

Table 5.2: Breakdown of agents participating in the simulation. With the system used in the simulation completely defined it is now possible to simulate the daily spot market. This was done by simulating two scenarios, as was done by Sensfuss et al. [46] an Miera et al. [11]. The conditions of these scenarios were:

• Scenario A: The daily spot market is simulated considering all GenCo agents, to determine the benchmark case;

• Scenario B: The daily spot market is simulated without the participation of the wind power GenCo agent.

The price difference induced by wind power participation can be determined by subtracting the hourly spot market price obtained through scenario A from the one obtained through scenario B, effectively quantifying the MOE. To show an example of this simulation process, February 5, 2016 was chosen, since it presented a large variation in wind penetration. Figure 5.2 shows the supply and demand curves for 9 A.M. of this day, with scenario A in Figure 5.2(a) and scenario B in Figure 5.2(b). The shape of the demand curve is indicative of a situation where demand is completely inelastic. Also the shape of the supply curve is that of a typical electricity market, with the step-wise fashion. It should be noted that the first step of the supply curve, which corresponds to a price of 0 C/MWh, contains the bids from hydro, solar and wind power technologies. The main difference between both scenarios is noticed by a shift to the right of the supply curve when wind power production, the green portion of the supply curve in 5.2(a), is considered, which is the definition of the MOE. The results of the daily spot market for this day are presented in Figure 5.3, with the real results in blue, the simulated results for scenario A in green and those for scenario B in red. It’s noticeable that the simulated results for scenario A take a similar shape to the real results, although there is a noticeable difference in some hours. Comparing these results with the hourly time series of wind power production for the same day, shown in Figure 5.4, it is possible to notice that the price difference between scenarios follows the shape of wind power production, as was the objective. Another sign that the model used can simulate the real dispatch to some extent can be observed in Figure B.2, present in Appendix B, by seeing that the simulated load diagram, in Figure B.2(b), has a similar shape to that of the real load diagram of the period, as published by REN[68], in Figure B.2(a). Figure B.2(c) shows the load diagram for scenario B, where the increase in thermal production caused by disregarding wind power is noticeable. Finally, the results for the whole six month period being considered in this study are presented in Appendix B(Figure B.3). These results are presented in average values for each day, with the real market results in blue, the simulated results for scenario A in green, and simulated results for scenario

65 (a) Supply and Demand curves for scenario A.

(b) Supply and Demand curves for scenario B.

Figure 5.2: Supply and demand curves used in the first approach for 9 A.M. of February 5, 2016.

B in red. Although the results from this first approach were as expected ones, there are some drawbacks of the methodology employed. First, after the simulations were done, it was noticed that many of the results fell outside of the historical data used for the regression, as is depicted for the case of February in Figure 5.5. In orange is represented the function obtained through regression , in blue are the historical

Figure 5.3: Real and simulated hourly spot market results for February 5, 2016 (obtained through the first ap- proach).

66 Figure 5.4: Portuguese hourly wind power production on February 5, 2016.

data values used, and in red the results for scenario B. By observing this figure it’s noticeable that in a non negligible number of instances, results were outside the historical data values, which means that there is no fundamental data in which to base these values.

The second drawback is that only values for Portugal were considered and this also represents a flaw to the methodology, since Portugal is part of the MIBEL, and Spanish production has a considerable influence on the price setting mechanism.

As such, even though some interesting results were obtained through this approach, especially in what regards to scenario A, it was considered that any conclusions taken using it to quantify the MOE would not be significantly accurate. Thus, a second approach was established.

Figure 5.5: Comparison between regression data and results obtained (for February, using first approach).

67 5.2.2 Second Approach: Supply-side bids based on the actual MIBEL Spot Mar- ket bids

For this second approach, the methodology applied is loosely based on the works presented by Sensfuss et al. [46] and Miera et al. [11] once again, since the means to quantify the MOE still relies on simulating two scenarios of the daily spot market, but this time, instead of using regression to determine the bids of thermal producers, following the work of Tveten et al. [51], in order to correct the first drawback of the previous approach, the supply side is defined by the actual supply bids submitted to MIBEL, similar to what was done by McConnel et al. [49]. To do this, historical data was again used in order to define the simulation system. This data includes:

• Hourly spot market prices and traded energy volumes for the first six months of 2016, for both Portugal and Spain, obtained from [67];

• Hourly quantities of wind power production for the first six months of 2016, with Portuguese values obtained from [68], and Spanish values taken from REE[69];

• Hourly Price and Volume bids submitted for the daily spot market, published online by OMIE[20].

To exemplify the simulation process, the 5th of February of 2016 can be used once more. In Fig- ure 5.6, the supply and demand curves for 9 A.M., as published by OMIE, can be observed. This figure includes the curves aggregated by theMO, with the supply in orange and the demand in blue, and the same curves after theSO has made the necessary adjustments to guarantee the system integrity, with supply in red and demand in beige. It can be seen that this adjustment done by theSO has had a con- siderable effect on the final price, and even though for this specific hour the adjustments resulted in an actual demand bid value, this is not a rule, as can be seen in Figure 2.7(chapter 2), where the resulting price and quantity, after adjustments, was outside of the supply and demand curves aggregated by the MO.

Figure 5.6: Supply and demand curves (before and after adjustments) published by OMIE, for 9 A.M. of February 5, 2016 (translated from [20]).

68 Figure 5.7: Method used to determine the quantity bid of the demand-side agent, for 9 A.M. of February 5, 2016 (edited from [20]).

The objective of this approach is to quantify the MOE by simulation using an approximation as close as possible to the actual supply curve of the period, a methodology to determine the bids for the demand side that didn’t disregard the adjustments made by theSO needed to be established. With this in mind, the procedure applied is depicted in Figure 5.7. The first step is determining to what value of energy in the supply curve, the final hourly price corresponds to. This is represented through the red line of the figure, that intersects both the supply curve and the adjusted demand curve at the final price of 39 C/MWh, leading to the volume value of 37970 MWh. The demand curve used in the simulation is then the one seen in blue. This curve involves a single RetailCo agent bidding at the highest price, which in the MIBEL is 180 C/MWh, and with a volume of 37970 MW, determined in the aforementioned fashion. This ensures the assumption of a completely inelastic demand and that the adjustments made by the SO still apply.

There are at least 1000 agents participating in the daily spot market of the MIBEL thus, an approx- imation was made in order to simulate the market in a realistic and systematic way. As such, it was established that the supply side would be represented by 39 agents, with price bids growing from 0 C/MWh to 180 C/MWh, with an arbitrary increment of 5 C/MWh between each agent. The volume of the bids made by each GenCo agent is then the sum of all energy contained in the price intervals be- tween each of these agents in the following fashion: the volume bid of the agent whose price bid is 5 C/MWh is the sum of energies bid in the interval ]0; 5] C/MWh of the actual daily spot market. For the agent bidding at 10 C/MWh, the volume bid is the sum of all bids in the interval ]5; 10] C/MWh on the actual daily spot market, and so on for the remaining agents.

In order to correct the second drawback of the first approach, the whole daily spot market of the MIBEL is simulated in this second approach, i.e., not just the Portuguese side, since production by Spain has also a relevant impact on the prices. To do this, a special consideration had to be made for hours in which market splitting between the Portuguese and Spanish systems occurred. Since the main objective in this study is to quantify the MOE for the specific case of Portugal, then for hours in which

69 Table 5.3: Breakdown of Agents participating in the Simulation for the Second Approach. market splitting occurred in the actual daily spot market, it is considered that the same happened in the simulated market, and as such, only the Portuguese zonal market is simulated. In the remaining hours, both zonal markets are simulated. Table 5.3 shows a breakdown of the agents that comprise the simulation system. Since OMIE does not publish which technology makes each bid, it is impossible to determine in a foolproof way the position of each technology in the merit order curve, and as such, each of these agents does not represent a single technology as in the first approach, which takes away some of the “realness” of the simulation system. However, in order to mitigate this failing, since the position of wind power is known, it was deemed that the agent bidding with a price of 0 C/MWh would be separated in three agents, one which bids the quantity of energy produced by wind power in Portugal for the specific period, another one that bids the quantity produced by , and a third one that bids the remaining energy bid at 0 C/MWh. These values of wind power production were obtained from REN[68] and REE[69], as has already been mentioned. With the simulation system completely established, the MOE was quantified by simulating the daily spot market price in two scenarios:

• Scenario A: in which the volume of demand considered is the one established through Figure 5.7;

• Scenario B: in which the volume of demand considered is the one established through Figure 5.7 plus the value of the energy produced by wind power.

Figure 5.8 depicts both scenarios for 9 A.M. of February 5, 2016, with scenario A in Figure 5.8(a) and scenario B in Figure 5.8(b). Quantifying the MOE in this alternative fashion, where it is considered that wind power induces a shift to the left in the demand curve, instead of a shift to the right in the supply curve, can be done since it is considered that demand is totally inelastic, as was established by Sensfuss et al. [46]. This shifting of the demand curve is clearly visible in the aforementioned figures. It

70 (a) Supply and demand curves for scenario A.

(b) Supply and demand curves for scenario B.

Figure 5.8: Supply and Demand Curves used in the Second Approach for 9 A.M. of 05/02/2016.

is also interesting to note that the approximation made for the aggregation of GenCo agents still leads to a shape of the supply curve which is quite similar to the actual published supply curve, as was shown in Figure 5.7.

Results for all hours of February 5, 2016 can be seen in Figure 5.9, with the actual MIBEL results for the day shown in blue, the results of the simulation for scenario A in green, and for scenario B in red. It should be noted that the simulated curve for scenario A resembles very closely that of the real curve, proving that the methodology used is able to recreate the daily spot market. Also, by comparing the differences between scenario A and B, with the hourly wind power production profile presented in Figure 5.10, it is possible to ascertain that the methodology applied is able to quantify the price difference that would be induced by disregarding the wind power production, since it loosely follows the shape of the wind power production time-series, being higher in periods of high wind penetration and vice versa.

Finally, as was done for the first approach, average results for all days of the first six months of 2016 can be seen in Appendix C(Figure C.1). At this point, it was noticed that there were some extreme result values for scenario B that could lead to an overestimation of the MOE, as is observable in Figure C.1 in

71 Figure 5.9: Real and simulated hourly spot market results for February 5, 2016 obtained through the second ap- proach.

Figure 5.10: Hourly wind power production in Portugal and Spain on February 5, 2016.

the form of price peaks, especially those in May and December that led to a daily average price higher than 100 C/MWh.

A large amount of these peaks happen on hours where there was market splitting and wind power penetration was especially high for a short period. In these situations, thermal producers bid relatively high to guarantee that it is worthwhile if they do need to start-up, produce for a short amount of time and then shut-down.

To mitigate this effect, as was done by Tveten et al. [51] and Cludius et al. [52], these extreme values were disregarded. This was done by setting a ceiling value of 90 C/MWh, based on the highest value that was observed in the daily spot market for 2015, which was 85.05 C/MWh (falling in the ]85; 90] bidding interval of the GenCo agents). The number of hours that had to be disregard only amounted to 5% of the complete study period.

In Figure C.2 of Appendix C, the remaining hours of the six month period being studied, after the aforementioned approximation was made, are presented in the form of average daily spot market price results.

72 Table 5.4: Simulation results and comparison.

Table 5.5: Actual FIT over-cost and the proposed over-cost.

Table 5.6: Quantification of the MOE.

5.3 Results and discussion

Tables 5.4 to 5.6 present all results of the second approach. It should be noted that all these values are obtained after disregarding the hours with peak values. By analyzing Table 5.4 some considerations about the simulation methodology can be made. Firstly, it is noticeable that the average error between the simulation results of scenario A and the real market results is close to 2,5 C/MWh for the whole period. This is an acceptable error value, considering that the average market hourly prices were around 30 C/MWh, representing an average error of roughly 10%. It is also interesting to note that months with a higher average wind power penetration are not neces- sarily those in which the average price was the lowest, proving that there are several other factors that impact spot market prices. One such factor can be attributed to gas prices, which can be observed for the same six month period in Figure 5.11. In this figure it’s easy to see that months which presented high gas prices also had high electricity prices. Table 5.5 shows a comparison between the over-cost that is attributed to the FIT of wind power, OC

73 Figure 5.11: Gas daily reference prices for the first six moths of 2016 [70].

and the proposed over-cost when considering the price reduction due to wind energy, OCpro. These values were calculated through Equations (5.1) and (5.2) (3rd and 5th columns of Table 5.5). It was noted that the portion of the FIT financed by consumers through system tariffs amounted to roughly 460 million euros. However, this figure does not take into account the price reduction that is introduced by wind power. When this price difference is considered the difference between these figures is of approximately 150 million euros. This difference shows that the price difference caused by wind power on spot market prices should not be disregarded. Table 5.6 presents the results of all calculations made in regards to the MOE. By subtracting the hourly prices obtained through scenario B from those obtained in scenario A, the price difference that wind power introduces in the system can be established, quantifying the MOE. It is noticeable that this difference is higher for months with a higher average wind power profile, as would be expected. The results reached show that the price difference introduced by this effect has an average value of 17 C/MWh for the whole six month period of the study. January and February presented an average value of 25 C/MWh, the highest in the period. June however, presents an average value of 8 C/MWh, the lowest in the period. The financial value of the MOE, V , and the specific value of the MOE, S, can be obtained through Equations (5.3) and (5.4) respectively (3rd and 4th columns of Table 5.6). Due to a low wind power penetration, June is actually the month of the period which presented the lowest MOE financial value. By comparing V with OC, one can establish how much of the value of FITs being financed by consumers is recovered in the spot market through the MOE of wind power. When considering results for the whole period, V was determined as being approximately 390 million euros, and the OC obtained was roughly 460 million euros. It is noticeable that the difference between these values is relatively

74 small. It might seem strange to compare the two figures, since V is the product of a price difference with the whole energy transacted in the spot market and OC is the product of a price difference with the energy produced solely by wind power. However, it should be noted that this comparison is possible, since the MOE of wind power affects the whole spot market but the OC only relates to wind energy. Another good way to measure how much of the FIT is being recovered through the MOE is by comparing S with the difference between the average FIT paid by consumers minus the spot market price (4th collumn of Table 5.5). For the whole six month period, the former was approximately 59 C/MWh and the latter 66 C/MWh. It is noticeable that both these values are quite similar, with a difference of 7 C. It should be noted, however, that any analysis that tries to ascertain the benefit that a higher pen- etration of wind power has for consumers through a comparison between V and OC does not take into account any socioeconomic advantages that might arise from the deployment of RES technologies. These include the diversification of energy supply, enhancement of regional and rural development, cre- ation of a domestic industry and establishment of employment opportunities, which can also be seen as benefits for consumers [11]. Furthermore, it should be noted that the indirect effect of wind power in the spot market price was not determined, which could also provide a significant benefit for consumers.

75 76 6 Conclusion

Contents

6.1 Results Summary...... 79

6.2 Methodology Limitations...... 79

6.3 Future Research...... 80

77 78 This chapter provides the main conclusions resulting from the work performed in this dissertation and discusses some of the limitations of the methodology applied as well as it’s impact on the results obtained. Also, some future research avenues on the subject are presented.

6.1 Results Summary

The growing deployment of RES technologies and the policy support strategies being applied by countries worldwide has led to some interesting results in the MEE that are worthy of research. One such impact has to do with the MOE, which is the price reduction due to the RES being introduced into the market with prices as low as 0 C/MWh. To do this a multi-agent based system was used, the MAN-REM simulation tool. During the pro- cess of getting acquainted with the system and it’s capabilities it was noticed that the system could be improved by the addition of a new agent-type, the “personal assistant” agent. In order to do this, the graphical interface of the system and the communication protocols between agents had to be worked upon. Although this agent mainly manages the graphical interface right now, it is expected that in the future this will improve, allowing the user to assign tasks that will aid him/her during the simulation process. The present dissertation quantified the MOE for Portugal. The results reached show that the price difference introduced by this effect has an average value of 17 C/MWh for the whole six month period of the study. An analysis of some important indicators of the MOE was also provided. It was noted that the portion of the FIT financed by consumers through system tariffs amounted to roughly 460 million euros. This is the over-cost attributed to FITs. However, this figure does not take into account the price reduction that is introduced by wind power. When this price difference is considered, the over-cost is reduced by approximately 150 million euros.

6.2 Methodology Limitations

Studying the MEE involves several variables both internal and external to the system. In order to reduce the complexity of this system some simplifications needed to be made. Thus, the methodol- ogy applied in this dissertation to quantify the MOE is dependent on various assumptions, that might take away some reliability of the results obtained. As such, an analysis of the limitations that these assumptions provide to the methodology is important. The MOE is highly dependent on the shape of the market curves. Since the study relies in shifting either the demand curve or the supply curve, any differences between the curves in the simulation and the actual curves is a source of error. In the second approach used in this work, the supply curve

79 considered is a close representation of the actual supply curve. However, the simulated demand curve is quite different from the real one, since it was assumed that demand was completely inelastic. This undoubtedly provides a source of error to the simulated system. This approximation had to be made so that the corrections done by theSO to ensure system security were also taken into account. Another limitation of the system has to do with the peak values that had to be disregarded. Although this only meant omitting 5% of the hours in the period, the error this induces in the system is not negligible and further work should try to correct this limitation.

6.3 Future Research

Future research avenues include the following topics:

• Create more tasks for the “personal assistant” agent, allowing the user to assign important func- tions that will aid him/her during the simulation process;

• Quantify the MOE of wind power production in Portugal for a longer period, so that the whole impact that secondary effects such as fuel price variations, seasonal variations in the demand of electrical energy and variations in production of other RES can be disregarded;

• Quantify the MOE of other RES in Portugal, and establish an approach to predict the contributions that a further increase of RES in the energy mix will have in the aforementioned effect;

• Establish a methodology to determine the indirect effect of RES in the spot market prices, by quantifying the reductions they provide through emissions allowances.

80 Bibliography

[1] J. S. Paiva, Redes de Energia Electrica´ Uma Analise´ Sistemica´ , 3rd ed. IST Press, 2011.

[2] Z. Zhou, W. Chan, and J. Chow, “Agent-based simulation of electricity markets: a survey of tools,” Artif Intell Rev, vol. 28, pp. 305–342, 2007.

[3] C. Lins, L. Williamson, S. Leitner, and S. Teske, “The first decade: 2004 - 2014 - 10 years of renewable energy progress,” Renewable Energy Policy Network for the 21st Century, Tech. Rep., 2014, available online at: http://www.ren21.net/Portals/0/documents/activities/Topical%20Reports/ REN21 10yr.pdf, last accessed in October 2016.

[4] H. Algarvio, F. Lopes, and J. Santana, “Multi-agent retail energy markets: bilateral contracting and coalitions of end-use customers,” 12th International Conference on the European Energy Market, pp. 1–5, IEE, 2015.

[5] F. Lopes, H. Algarvio, J. Sousa, H. Coelho, T. Pinto, G. Santos, Z. Vale, and I. Prac¸a, “Multi-agent simulation of bilateral contracting in competitive electricity markets,” 25th International Workshop on Database and Expert Systems Applications, pp. 131–135, IEE, 2014.

[6] F. Lopes, H. Algarvio, and H. Coelho, “Agent-based simulation of retail electricity markets: Bilateral trading players,” 24th International Workshop on Database and Expert Systems Applications, pp. 189–193, IEE, 2013.

[7] D. Vidigal, F. Lopes, A. Pronto, and J. Santana, “Agent-based simulation of wholesale energy mar- kets: a case study on renewable generation,” 26th International Workshop on Database and Expert Systems Applications, pp. 81–85, IEE, 2015.

[8] J. Santana, Introduc¸ao˜ a´ Teoria da Microeconomia. IST Press, 2012.

[9] P. Samuelson and W. Nordhaus, Economics, 9th ed. McGraw-Hill/Irwin, 2010.

[10] D. Kirschen and G. Strbac, Fundamentals of Power System Economics. John Wiley & Sons, Ltd., 2004.

81 [11] G. Miera, P. Gonzalez,´ and I. Vizca´ıno, “Analysing the impact of renewable electricity support schemes on power prices: The case of wind electricity in spain,” Energy Policy, vol. 36, pp. 3345– 3359, 2008.

[12] S. Stoft, Power System Economics Designing Markets for Electricity. IEEE Press & WILEY- INTERSCIENCE, 2002.

[13] ERSE, “Portal erse,” Online, available at: http://www.erse.pt/eng/Paginas/ERSE.aspx, last ac- cessed in October 2016.

[14] DGEG, “A missao,”˜ Online, available at: http://www.dgeg.pt, last accessed in October 2016.

[15] R. Castro, Uma Introduc¸ao˜ as` Energias Renovaveis:´ Eolica,´ Fotovoltaica e Minihidrica, 2nd ed. IST Press, 2013.

[16] MIBEL, “Mibel,” Online, available at: http://www.mibel.com/index.php?mod=pags&mem=detalle& relmenu=9&relcategoria=1026&idpag=67, last accessed in October 2016.

[17] OMIE, “About our market,” Online, available at: http://www.omie.es/en/home/ markets-and-products/about-our-market, last accessed in October 2016.

[18] OMIP, “Profile,” Online, available at: http://www.omip.pt/OMIP/Perfil/tabid/63/language/en-GB/ Default.aspx, last accessed in October 2016.

[19] OMIClear, “Profile,” Online, available at: http://www.omiclear.pt/OMIClear/TermsOfUse/tabid/131/ language/en-GB/Default.aspx, last accessed in October 2016.

[20] OMIE, “Market results,” Online, available at: http://www.omie.es/files/flash/ResultadosMercado.swf, last accessed in October 2016.

[21] A. Garcia, J. Santana, M. Resende, and P.Verdelho, Sistema Eletrico´ - Analise´ Tecnico-econ´ omica´ . LIDEL, 2016.

[22] H. Li and L. Tesfatsion, “Development of open source software for power market research: the ames test bed,” Journal of Energy Markets, vol. 2, pp. 111–128, 2009.

[23] C. Cicchetti, J. Dubin, and C. Long, The California Electricity Crisis: What, Why, and What’s Next, 1st ed. Kluwer Academic Publishers, 2004.

[24] S. Ray, J. Munksgaard, P. E. Morthorst, and A.-F. Sinner, “Wind energy and electricity prices - exploring the ‘merit order effect’,” European Wind Energy Association, Tech. Rep., 2010.

82 [25] OMIE, “Electricity market - daily and intradaily,” Online, available at: http://www.omie.es/en/home/ markets-and-products/electricity-market/our-electricity-markets/daily-and-intradaily, last accessed in October 2016.

[26] ——, “Our electricity markets,” Online, available at: http://www.omie.es/en/home/ markets-and-products/electricity-market/our-electricity-markets, last accessed in October 2016.

[27] ——, “Electricity market - daily market,” Online, available at: http://www.omie.es/en/home/ markets-and-products/electricity-market/our-electricity-markets/daily-market, last accessed in Oc- tober 2016.

[28] ——, “Electricity market - intraday market,” Online, available at: http://www.omie.es/en/home/ markets-and-products/electricity-market/our-electricity-markets/intraday-market, last accessed in October 2016.

[29] OMIP, “Products,” Online, available at: http://www.omip.pt/MarketInfo/Produtos/tabid/76/language/ en-GB/Default.aspx, last accessed in October 2016.

[30] K. Shaik, Managing Derivatives Contracts: A Guide to Derivatives Market Structure, Contract Life Cycle, Operations, and Systems. Apress, 2014.

[31] J. Sawin and et al., “Renewables 2014 global status report,” Renewable Energy Policy Network for the 21st Century, Tech. Rep., 2014, available online at: http://www.ren21.net/Portals/0/documents/ Resources/GSR/2014/GSR2014 full%20report low%20res.pdf, last accessed in October 2016.

[32] ——, “Renewables 2015 global status report,” Renewable Energy Policy Network for the 21st Century, Tech. Rep., 2015, available online at: http://www.ren21.net/wp-content/uploads/2015/07/ REN12-GSR2015 Onlinebook low1.pdf, last accessed in October 2016.

[33] ——, “Renewables 2016 global status report,” Renewable Energy Policy Network for the 21st Century, Tech. Rep., 2016, available online at: http://www.ren21.net/wp-content/uploads/2016/05/ GSR 2016 Full Report lowres.pdf, last accessed in October 2016.

[34] APREN, “Potenciaˆ de ligac¸ao˜ a` rede dos centros electroprodutores (2000-2015),” On- line, available at: http://www.apren.pt/pt/dados-tecnicos-3/dados-nacionais-2/potencia-2/ potencia-de-ligacao-a-rede-dos-centros-eletroprodutores-2000-2015-3/, last accessed in Oc- tober 2016.

[35] REN, “Dados tecnicos´ technical data 2015,” Redes Energeticas´ Nacionais, Tech. Rep., 2016.

[36] APREN, “Produc¸ao˜ de electricidade por fonte em 2015,” Online, available at: http://www.apren. pt/pt/dados-tecnicos-3/dados-nacionais-2/producao-2/a-producao-de-eletricidade-em-portugal-3/ producao-de-eletricidade-por-fonte-em-2015/, last accessed in October 2016.

83 [37] GWEC, “Global wind report annual market update 2015,” Global Wind Energy Coun- cil, Tech. Rep., 2016, available online at: http://www.gwec.net/wp-content/uploads/vip/ GWEC-Global-Wind-2015-Report April-2016 19 04.pdf, last accessed in October 2016.

[38] G. Corbetta, A. Mbistrova, and A. Ho, “Wind in power 2015 european statistics,” European Wind En- ergy Association, Tech. Rep., 2016, available online at: https://windeurope.org/wp-content/uploads/ files/about-wind/statistics/EWEA-Annual-Statistics-2015.pdf, last accessed in October 2016.

[39] INEGI and APREN, “Parques eolicos´ em portugal - wind farms in portugal,” Instituto de Cienciaˆ e Inovac¸ao˜ em Engenharia Mecanicaˆ e Engenharia Industrial and Associac¸ao˜ Portuguesa de En- ergias Renovaveis,´ Tech. Rep., 2015, available online at: http://e2p.inegi.up.pt/relatorios/Portugal Parques Eolicos 201512.pdf, last accessed in October 2016.

[40] DGEG, “Renovaveis´ - estat´ısticas rapidas´ - nº 140 - junho de 2016,” Direc¸ao˜ Geral de Energia e Geologia, Tech. Rep., 2016, available online at: http://www.apren.pt/fotos/newsletter/conteudos/ renovaveis 1472834173.pdf, last accessed on October 2016.

[41] S. Shukla and S. Sawyer, “30 years of policies for wind energy lessons from 12 wind energy markets,” Global Wind Energy Council and International Renewable Energy Agency, Tech. Rep., 2012, available online at: https://www.irena.org/DocumentDownloads/Publications/IRENA GWEC WindReport Full.pdf, last accessed on October 2016.

[42] GWEC, “Global wind statistics 2014,” Online, available at: http://www.gwec.net/wp-content/uploads/ 2015/02/GWEC GlobalWindStats2014 FINAL 10.2.2015.pdf, last accessed in October 2016.

[43] ——, “Global wind statistics 2015,” Online, available at: http://www.gwec.net/wp-content/uploads/ vip/GWEC-PRstats-2015 LR.pdf, last accessed in October 2016.

[44] INEGI and APREN, “Parques eolicos´ em portugal - wind farms in portugal,” Instituto de Cienciaˆ e Inovac¸ao˜ em Engenharia Mecanicaˆ e Engenharia Industrial and Associac¸ao˜ Portuguesa de En- ergias Renovaveis,´ Tech. Rep., 2014, available online at: http://e2p.inegi.up.pt/relatorios/Portugal Parques Eolicos 201412.pdf, last accessed in October 2016.

[45] IEAWind, “Member country activities for portugal,” Online, available at: http://www.ieawind.org/ countries/portugal.html, last accessed in October 2016.

[46] F. Sensfuss, M. Ragwitz, and M. Genoese, “The merit-order effect: A detailed analysis of the price effect of renewable electricity generation on spot market prices in germany,” Energy Policy, vol. 36, pp. 3086–3094, 2008.

[47] European Commission, “The eu emissions trading system (eu ets),” Online, available at: http://ec. europa.eu/clima/policies/ets/index en.htm, last accessed in October 2016.

84 [48] H. Weigt, “Germany’s wind energy: The potential for fossil capacity replacement and cost saving,” Applied Energy, vol. 86, pp. 1857–1863, 2009.

[49] D. McConnell, P. Hearps, D. Eales, M. Sandiford, R. Dunn, M. Wright, and L. Bateman, “Retrospec- tive modeling of the merit-order effect on wholesale electricity prices from distributed photovoltaic generation in the australian national electricity market,” Energy Policy, vol. 58, pp. 17–27, 2013.

[50] C. Woo, I. Horowitz, J. Moore, and A. Pacheco, “The impact of wind generation on the electricity spot-market price level and variance: The texas experience,” Energy Policy, vol. 39, pp. 3939–3944, 2011.

[51] A. Tveten, T. Bolkesjo, T. Martinsen, and H. Hvarnes, “Solar feed-in tariffs and the merit order effect: A study of the german electricity market,” Energy Policy, vol. 61, pp. 761–770, 2013.

[52] J. Cludius, H. Hermann, F. Matthes, and V. Graichen, “The merit order effect of wind and pho- tovoltaic electricity generation in germany 2008–2016 estimation and distributional implications,” Energy Economics, vol. 44, pp. 302–313, 2014.

[53] S. Clo, A. Cataldi, and P. Zoppoli, “The merit-order effect in the italian power market: The impact of solar and wind generation on national wholesale electricity prices,” Energy Policy, vol. 77, pp. 79–88, 2015.

[54] D. Azofra, E. Jimenez,´ E. Mart´ınez, J. Blanco, and J. Saenz-D´ıez, “Wind power merit-order and fee-in-tarriffs effect: A variability analysis of the spanish electricity market,” Energy Conversion and Management, vol. 83, pp. 19–27, 2014.

[55] D. Azofra, E. Mart´ınez, E. Jimenez,´ J. Blanco, F. Azofra, and J. Saenz-D´ıez, “Comparison of the influence of photovoltaic and wind power on the spanish electricity prices by means of artificial intelligence techinques,” Renewable and Sustainable Energy Reviews, vol. 42, pp. 532–542, 2015.

[56] Macedo Vitorino & Associados, “Portuguese renewable energy sources: Overview,” Macedo Vi- torino & Associados, Tech. Rep., 2015, available online at: http://www.macedovitorino.com/xms/ files/20150908-Portuguese Renewable Energy Sources -Overview-.pdf, last accessed in October 2016.

[57] A. Brito and L. Neves, “The feed-in tariffs structure of renewable and cogeneration energy in portu- gal,” EDP-Servic¸o Universal, 2013.

[58] ERSE, “Pre - produc¸ao˜ em regime especial,” Online, available at: http://www.erse.pt/pt/ desempenhoambiental/prodregesp/Paginas/default.aspx, last accessed in October 2016.

85 [59] F. Bellifemine, G. Caire, and D. Greenwood, Developing Multi-Agent Systems with JADE. John Wiley & Sons, Ltd, 2007.

[60] N. Collier, “Repast: An extensible framework for agent simulation,” Natural Resources and Environ- mental Issues, vol. 8, no. 4, 2001.

[61] D. Martin, A. Cheyer, and D. Moran, “The open agent architecture: A framework for building dis- tributed software systems,” Applied Artificial Intelligence: An International Journal, vol. 13, pp. 91– 128, 1999.

[62] G. Caire, “Jade tutorial - jade programming for beginners,” Online, available at: http://jade.tilab.com/ doc/tutorials/JADEProgramming-Tutorial-for-beginners.pdf, last accessed in October 2016.

[63] FIPA, “Fipa communicative act library specification,” Online, available at: http://www.fipa.org/specs/ fipa00037/SC00037J.pdf, last accessed in October 2016.

[64] I. Praca, C. Ramos, Z. Vale, and M. Cordeiro, “Mascem: A multiagent system that simulates com- petitive electricity markets,” IEEE Intelligent Systems, vol. 18, pp. 54–60, 2003.

[65] D. Vidigal, “Comercializac¸ao˜ de energia em mercados em bolsa: Simulador multi-agente e analise´ do impacto da gerac¸ao˜ variavel´ nos prec¸os diarios,”´ Master’s thesis, Faculdade de Cienciasˆ e Tecnologia da Universidade Nova de Lisboa, 2015.

[66] H. Ghadikolaei, A. Ahmadi, J. Aghaei, and M. Najafi, “Risk constrained self-scheduling of hy- dro/wind units for short term electricity markets considering intermittency and uncertainty,” Re- newable and Sustainable Energy Reviews, vol. 16, p. 4734–4743, 2012.

[67] REN, “Prec¸os mercado spot - portugal e espanha,” Online, available at: http://www.mercado.ren.pt/ PT/Electr/InfoMercado/InfOp/MercOmel/Paginas/Precos.aspx, last accessed in October 2016.

[68] ——, “Estat´ıstica diaria´ - sen,” Online, available at: http://www.centrodeinformacao.ren.pt/PT/ InformacaoExploracao/Paginas/EstatisticaDiariaDiagrama.aspx, last accessed in October 2016.

[69] REE, “Pen´ınsula - seguimiento de la demanda de energ´ıa electrica,”´ Online, available at: https: //demanda.ree.es/movil/peninsula/demanda/total/2016-01-01, last accessed in October 2016.

[70] European Energy Exchange, “Natural gas daily reference price,” Online, available at: https:// www.eex.com/en/market-data/natural-gas/spot-market/daily-reference-price#!/2016/10/03, last ac- cessed in October 2016.

86 A MAN-REM Agent-based Simulation Tool: Graphical User Interface and Agent Communications

87 88

Figure A.1: Main window of the MAN-REM simulation tool. (a) Menu “Agents”. (b) Menu “Markets”.

(c) Menu “Participants”. (d) Menu “Simulation”.

Figure A.2: Menus of the MAN-REM simulation system.

89 (a) “Load Agent” window. (b) “New GenCo” window.

(c) “Generation Technology Portfolio” window.

Figure A.3: Graphical interface for loading a GenCo agent.

90 (a) “Load Agent” window. (b) “New Retailer” window.

Figure A.4: Graphical interface for loading a new RetailCo agent.

Figure A.5: “Pricing Mechanism” window.

91 (a) “GenCo Data” window. (b) “Market Info” window.

(c) “Producer Offers” window.

Figure A.6: Graphical interface for choosing agents participating in the simulation.

92 (a) “Market Price” tab of the “Spot Market Results” window.

(b) “Generation Commitments” tab of the “Spot Market Results” window.

(c) “Retailer Results” tab of the “Spot Market Results” window.

Figure A.7: Graphical interface presenting the simulation results.

93 (a) Communication between agents when (b) Communication between agents when loading a new GenCo agent. loading a new RetailCo agent.

(c) Communication between agents when (d) Communication between agents when pricing mechanism is selected. GenCo agents are introduced in the market.

(e) Communication between agents when RetailCo agents are introduced in the market

Figure A.8: Communication between agents.

94 Figure A.9: Complete communication process between agents during the simulation.

95 96 B Results for First Approach

97 (a) Regression results for January. (b) Regression results for February.

(c) Regression results for March. (d) Regression results for April.

(e) Regression results for May. (f) Regression results for June.

Figure B.1: Linear regression results for each of the first six months of 2016.

98 (a) Load diagram published by REN (translated from [68].)

(b) Load diagram obtained for scenario A.

(c) Load diagram obtained for scenario B.

Figure B.2: Comparison between published load diagram by REN and the ones obtained through the first approach, for 05/02/2016.

99 100

Figure B.3: Daily average spot market prices for the first approach. C Results for Second Approach

101 102

Figure C.1: Daily average spot market prices for the second approach. 103

Figure C.2: Daily average spot market prices for the second approach, disregarding peak values.