impact of wind turbines on power system stability

108
Impact of Wind Turbines on Power System Stability Gonzalo Cuevas Ezquerra Energy Technology, EPSH4-1036, 2019-06 Master Thesis S T U D E N T R E P O R T

Upload: others

Post on 15-May-2022

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Impact of Wind Turbines on Power System Stability

Impact of Wind Turbines onPower System Stability

Gonzalo Cuevas EzquerraEnergy Technology, EPSH4-1036, 2019-06

Master Thesis

ST

U

D E N T R E P O R T

Page 2: Impact of Wind Turbines on Power System Stability
Page 3: Impact of Wind Turbines on Power System Stability

Title: Impact of Wind Turbines on Power System Stability

Semester: 10th

Semester theme: Master Thesis

Project period: February 2019 - May 2019

ECTS: 30 ECTS

Group: EPSH4-1036

Participant: Gonzalo Cuevas Ezquerra

Supervisors: Zhou Liu

Page Numbers: 71

Signature:

Gonzalo Cuevas Ezquerra

SYNOPSIS:In this Master Thesis, with the objective of achievinga 100% Wind Energy penetration in the Power Systemof the Eastern Denmark, an iterative and user-friendlyalgorithm that analyses a system is created. Thisalgorithm provides the necessary tools to find theweakest areas of a system, and calculates differentscenarios for wind energy penetration. Before gettinginto the model of the East of Denmark, the algorithm istested and validated in a smaller grid, the IEEE 9-bussystem. The different simulations will give ideas andconclusions on how this wind energy implementationcould be made.

By accepting the request from the fellow student who uploads the study group’sproject report in Digital Exam System, you confirm that all group members haveparticipated in the project work, and thereby all members are collectively liablefor the contents of the report. Furthermore, all group members confirm that thereport does not include plagiarism.

Page 4: Impact of Wind Turbines on Power System Stability
Page 5: Impact of Wind Turbines on Power System Stability

Summary

This Master Thesis’ project tries to find if it is possible or not the implementation of 100%of Wind Energy in the Eastern Denmark Transmission System. In order to achieve this ob-jective an user-friendly algorithm is created, focused on the realisation of several load flowcalculations over a wide range of loads that will help on the study of the limits of the system,its voltage stability, and how an implementation of wind energy could be made.

The first chapter of the report starts with an introduction to the project to which the thesisis related, and describes the background of the study. It also describes the new challenges onthe Electrical Power System industry regarding Wind Power Energy. Throughout the chaptera brief introduction to the Electrical Power System of Denmark, and its division is made, andlater some key definitions such as power system stability and voltage stability, necessaries forthe understanding of the thesis, are explained. The chapter continues describing the problemdefinition and the main objectives; and finishes with an explanation of the methodology usedand the limitations found.

The second chapter’s title is Wind Power integration and voltage stability analysis, and givesan approach to the wind energy to one that is not familiar with it. It starts describing thedifferent generators that can be found on a wind turbine and the different categories in whicha Wind Turbine can be divided. Thus, the differences between fixed-speed and variable-speedwind turbines is made; and also between the pitch-regulated and stall-regulated wind turbines.

Next to it, the reasoning behind analysing the voltage stability is explained, and which kindof turbine is used for the analysis and why. Clarifying why the Doubly-Fed Induction Gener-ator (DFIG) is used and to which extent is studied lead to the end the second chapter.

On the third chapter the approach of the problem is explained. Before analysing the EasternDenmark Transmission System a smaller and common system is analysed, the IEEE 9-bussystem. Based on this system it is described the calculation procedure and the most impor-tant indexes to find the weakest area of the system. This ends up on the reasoning behindcreating an algorithm capable of changing the load and running load flow for this exact pur-pose. The way the algorithm works is detailed into three different steps, and a diagram ofhow the program works is also shown to finish the chapter.

The following chapter, Analysis of the IEEE 9-bus system, is the first chapter of analysis.Here the algorithm is tested to proof that it is reliable. To do so, the IEEE 9-bus system istried in many different scenarios based on four determinant factors. Each of the factors isanalysed in detail and some conclusions are obtained based on the results. In the end of thechapter, an statistical analysis is also made, giving another point of view that could be usefulfor reaching the objectives.

The fifth chapter finally analyses the Eastern Danish Power System, but before the anal-ysis the system is fully described and geographically represented. An approach of how theload of the system is calculated is presented, and finally the implementation of the wind en-ergy is precised. Assuming the system is not a real copy of the original system, and with the

v

Page 6: Impact of Wind Turbines on Power System Stability

purpose of making it realistic, the reactive power requirements of the Danish Grid Code aredescribed and implemented in the system. The chapter ends with three different analysis onthe system, pointing out the differences between them.

The final chapter is the Conclusion chapter, and apart from deliberating about the differentconclusions that can be obtained based on the thesis, it also gives a section for the possiblefuture work.

vi

Page 7: Impact of Wind Turbines on Power System Stability

Acknowledgements

This thesis would not have been possible without the help of my supervisor Zhou Liu, whooffered me the topic and gave me very interesting feedback. I am thankful to him for beingalways available and pleased to help.

Secondly, I would also like to highlight the guidance and suggestions from Professor ZheChen, who was always helpful and gave very valuable discussions.

Finally, I would like to thank Manuel Castillo, from DIgSILENT for creating with his teamthe model of the Eastern Denmark Transmission System. I feel also thankful to the companyDIgSILENT for giving the student license, without which the thesis would not have beenpossible.

vii

Page 8: Impact of Wind Turbines on Power System Stability
Page 9: Impact of Wind Turbines on Power System Stability

Contents

List of Figures xi

List of Tables xiii

List of Abbreviations xv

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Power System of Eastern Denmark . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.4 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.5 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.6 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.7 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Wind Power integration and voltage stability analysis 92.1 Wind Turbines depending on the generator . . . . . . . . . . . . . . . . . . . 9

2.1.1 Asynchronous Generators . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Synchronous Generators . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 Wind Turbines depending on the speed control . . . . . . . . . . . . . . . . . 122.3 Wind Turbines depending on the power control . . . . . . . . . . . . . . . . . 132.4 Power System Voltage stability and the Wind Turbine Power integration . . . 14

2.4.1 Voltage Stability Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 142.4.2 Reactive Power Capability of Wind Power . . . . . . . . . . . . . . . . 14

3 Implementation case of Wind Power in a System 173.1 Problem approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1.1 Calculation procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2 Calculation Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3 Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.3.1 First Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.3.2 Second Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.3 Third Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

4 Analysis of the IEEE 9-bus system 314.1 Case study on IEEE 9-bus system . . . . . . . . . . . . . . . . . . . . . . . . 31

4.1.1 First simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.1.2 Voltage Dependency of the Loads . . . . . . . . . . . . . . . . . . . . . 464.1.3 General Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

5 Eastern Denmark Power System 575.1 Introduction to the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.2 Analysis of the 2020 system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

5.2.1 Distribution of Load and Generation . . . . . . . . . . . . . . . . . . . 615.3 Problems on the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

ix

Page 10: Impact of Wind Turbines on Power System Stability

Contents

5.4 Implementation of Wind Energy . . . . . . . . . . . . . . . . . . . . . . . . . 625.5 System Possibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.5.1 Implementation Results . . . . . . . . . . . . . . . . . . . . . . . . . . 64

6 Conclusion 676.1 Further Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Bibliography 69

A Algorithm-related Information 73A.1 Details of the general information table . . . . . . . . . . . . . . . . . . . . . 73A.2 Main Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

A.2.1 DPL Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74A.2.2 MATLAB Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

x

Page 11: Impact of Wind Turbines on Power System Stability

List of Figures

1.1 Synchronous areas in Denmark. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Typical Electrical Power System Structure. . . . . . . . . . . . . . . . . . . . . . 6

2.1 Example of a typical SCIG wind turbine. . . . . . . . . . . . . . . . . . . . . . . 102.2 Example of a typical WRIG wind turbine. . . . . . . . . . . . . . . . . . . . . . . 102.3 Example of a typical DFIG wind turbine. . . . . . . . . . . . . . . . . . . . . . . 112.4 Example of a typical WRSG wind turbine. . . . . . . . . . . . . . . . . . . . . . . 112.5 Example of a typical PMSG wind turbine. . . . . . . . . . . . . . . . . . . . . . . 122.6 Diagram of a typical Wind Turbine. . . . . . . . . . . . . . . . . . . . . . . . . . 122.7 Power output comparison of stall regulated and pitch regulated control. . . . . . 132.8 All quadrants available in the DFIG converter. . . . . . . . . . . . . . . . . . . . 15

3.1 IEEE 9-bus system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2 Representation of the Active Power through a busbar. . . . . . . . . . . . . . . . 193.3 Representation of the Reactive Power through a busbar. . . . . . . . . . . . . . . 203.4 Schema of the initial tasks made by each of the two softwares. . . . . . . . . . . . 213.5 Differences between absolute and relative load change. . . . . . . . . . . . . . . . 223.6 Four different possibilities of Wind Energy penetration in the IEEE-9 bus system. 253.7 Example of file name, automatically saved . . . . . . . . . . . . . . . . . . . . . . 273.8 Three different options of wind energy implementation - IEEE 9-bus system. . . . 283.9 Function representing the number of possible combinations when implementing

DFIG on a system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.10 General diagram of the work flow of the codes. . . . . . . . . . . . . . . . . . . . 30

4.1 Voltages areas comparison between the three different locations. . . . . . . . . . . 334.2 Comparison of the active power flow within the implementation in three different

areas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.3 Comparison of the reactive power flow within the implementation in three different

areas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344.4 Comparison of the active power generated for each location. . . . . . . . . . . . . 354.5 Comparison of the reactive power generated for each location. . . . . . . . . . . . 364.6 Comparison of the active power losses for each location. . . . . . . . . . . . . . . 364.7 Comparison of the active power losses for each location. . . . . . . . . . . . . . . 374.8 Voltages areas comparison for different power factors. . . . . . . . . . . . . . . . . 374.9 Busbar Voltages comparison for different power factors. . . . . . . . . . . . . . . 384.10 Reactive Power Flow - Comparison for different power factors. . . . . . . . . . . . 384.11 Reactive Power Generation - Comparison for different power factors. . . . . . . . 394.12 Reactive Power Losses - Comparison for different power factors. . . . . . . . . . . 394.13 Active Power Losses - Comparison for different power factors. . . . . . . . . . . . 404.14 Voltages Areas - Comparison for gradual wind turbine increment. . . . . . . . . . 414.15 Reactive Power Flow - Comparison for gradual wind turbine increment. . . . . . 414.16 Reactive Power Generation - Comparison for gradual wind turbine increment. . . 424.17 Active Power Losses - Comparison for gradual wind turbine increment. . . . . . . 424.18 Reactive Power Losses - Comparison for gradual wind turbine increment. . . . . . 434.19 Voltages Areas - Comparison for wind power increment. . . . . . . . . . . . . . . 43

xi

Page 12: Impact of Wind Turbines on Power System Stability

List of Figures

4.20 Active Power Flow - Comparison for wind power increment. . . . . . . . . . . . . 444.21 Active Power Generated - Comparison for wind power increment. . . . . . . . . . 444.22 Reactive Power Generated - Comparison for wind power increment. . . . . . . . . 454.23 Active Power Losses - Comparison for wind power increment. . . . . . . . . . . . 454.24 Reactive Power Losses - Comparison for wind power increment. . . . . . . . . . . 464.25 Maximum Apparent Power before system collapse. . . . . . . . . . . . . . . . . . 484.26 Number of busbars with a voltage below 0.95 p.u.. . . . . . . . . . . . . . . . . . 484.27 Maximum Loaded Transformer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.28 Maximum Loaded Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494.29 Maximum Loaded Synchronous Generator. . . . . . . . . . . . . . . . . . . . . . 504.30 Maximum Loaded Wind Turbine. . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.31 Active Power Losses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.32 Reactive Power Losses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514.33 Most Loaded Line - Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . 514.34 Most Loaded Line before Collapse - Distribution. . . . . . . . . . . . . . . . . . . 524.35 Most Loaded Transformer - Distribution. . . . . . . . . . . . . . . . . . . . . . . 524.36 Minimum Voltage - Distribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . 534.37 Minimum Voltage before Collapse - Distribution. . . . . . . . . . . . . . . . . . . 534.38 Minimum Changing Voltage - Distribution. . . . . . . . . . . . . . . . . . . . . . 544.39 Details of the IEEE-9 bus system . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.1 Expected area covered by the DK2 Transmission System in 2020. . . . . . . . . . 575.2 2017 vs 2020 system representation in DIgSILENT. . . . . . . . . . . . . . . . . . 585.3 Yearly boxplot of the consumption in the area of DK2. . . . . . . . . . . . . . . . 605.4 Eastern Denmark Map - Distribution of Load and Generation. . . . . . . . . . . 615.5 Requirements for the delivery of reactive power in relation to the active power

level at UC on the different used categories . . . . . . . . . . . . . . . . . . . . . 635.6 Requirements for the delivery of reactive power in relation to UC on the different

used categories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635.7 Voltages Comparison - Eastern Denmark Transmission System . . . . . . . . . . 645.8 Reactive Power Flow Comparison - Eastern Denmark Transmission System . . . 645.9 Reactive Power Generated Comparison - Eastern Denmark Transmission System 655.10 Reactive Power Losses Comparison - Eastern Denmark Transmission System . . . 655.11 Active Power Losses Comparison - Eastern Denmark Transmission System . . . . 655.12 Reactive Power Generated Comparison - Eastern Denmark Transmission System 66

xii

Page 13: Impact of Wind Turbines on Power System Stability

List of Tables

4.1 Original Loads of the IEEE 9-bus system. . . . . . . . . . . . . . . . . . . . . . . 314.2 Original Generation of the IEEE 9-bus system. . . . . . . . . . . . . . . . . . . . 314.3 Load limits - Original IEEE 9-bus system. . . . . . . . . . . . . . . . . . . . . . . 324.4 List of exponents for the voltage dependency of loads. . . . . . . . . . . . . . . . 464.5 List of coefficients for the voltage dependency of loads. . . . . . . . . . . . . . . . 47

xiii

Page 14: Impact of Wind Turbines on Power System Stability
Page 15: Impact of Wind Turbines on Power System Stability

List of Abbreviations

DFIG Doubly-Fed Induction Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v

DPL DIgSILENT Programming Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

DSO Distribution System Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

EPS Electrical Power System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

HVDC High Voltage Direct Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

OHL Overhead Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

PE Power Electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

PMSG Permanent Magnet Synchronous Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

SCIG Squirrel Cage Induction Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

STATCOM Static Synchronous Compensator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

TSO Transmission System Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

UGC Underground Cables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

WRIG Wound Rotor Induction Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

WRSG Wound Rotor Synchronous Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

xv

Page 16: Impact of Wind Turbines on Power System Stability
Page 17: Impact of Wind Turbines on Power System Stability

Introduction 1This Master Thesis is focused on the analysis of the DFIG in the voltage stability of a powersystem. In particular, this Master Thesis is part of the COPE project [1], which analyses thepossibilities of wind power growth in the area of Copenhagen, Denmark.

Furthermore, the thesis analyses not only the penetration of DFIG for this particular sys-tem, but suggests a method that could be used for any other system.

This chapter describes the background of the study and the challenges that the world isfacing regarding Wind Power Energy. An introduction of the system that is used is made,together with a definition of the problem and the objectives. Finally, the methodology usedfor the thesis is described.

1.1 Background

The Electrical Power System (EPS) has its origin in England, at the end of the nineteenthcentury [2]. Since then, it has expanded throughout the most remote areas in the world andhas experienced different changes and developments. These comprises from changes on theway the power is generated, transported and consumed.

Traditionally, the generation of electricity has been made by the combustion of fossil fuelssuch as coal or natural gas. Such combustion generates, as is known, greenhouse gases thatare harmful for our ecosystems. These emissions are not the only ones contributing the globalgreenhouse gas, as the industry, the transport and other sectors contribute to this index.However, the world emissions produced by the electricity generation have reached nearly a50% of the total greenhouse gas emissions in 2014 [2]. Although this percentage is not evenlydistributed through the world and the evolution also changes depending on the location, thisfactor is very important to consider.

During the twentieth century the greenhouse gases were identified as a threat to the earth thathad to be controlled and therefore different countries agreed on taking measures to reducethe greenhouse emissions on the Kyoto Protocol (1997). However, the increase of demandand of population over the world make this reduction difficult to reach, and that is one of thereasons renewable energy is important.

Renewable energies are energy sources that can be used to produce electricity in a cleanway, without producing greenhouse gases. From the environmental point of view, this typeof energy is the best one for the electricity generation, but not all of the characteristics areadvantages. Denmark is one of the countries with a strongest commitment on the renewableenergy, especially on the wind energy since its geography position allows taking advantage ofthe wind [3].

1

Page 18: Impact of Wind Turbines on Power System Stability

1. Introduction

The Danish Energy System, in order to accomplish its objectives regarding the renewableenergy [4], needs to be very strong and powerful. Therefore, there have been many changesduring the last years in the EPS in the direction of having a safer and better system. Some ofthese changes are the interconnections made with the surrounding countries, various of themusing the High Voltage Direct Current (HVDC) technology, providing a constant electricityexchange between the countries [5]. These interconnections help with the development of thewind energy, an energy that is not predictable nor constant, and in cases of low wind, anotherenergy resources have to be used. Thus, having the possibility of getting this energy fromother countries makes the system stronger, giving also the opposite circumstance, using theexcess of wind to deliver this energy to the neighbouring nations. These links have broughtDenmark to be the European largest interconnector in terms of capacity relative to domesticelectricity consumption [6].

The system is constantly changing as new technologies appear into the market. For instance,HVDC allows the transportation of electricity through the sea in a more efficient way, which isa great advantage for offshore wind farms. Consequently, more than ten offshore wind farmsare already running and some more are planned to be part of the Danish Power System in thesubsequent years as it can be seen on Figure [7]. This quantity of wind power energy for acountry of the size of Denmark makes its power system unique, achieving days with 100% ofthe electricity generated by Wind Turbines, both offshore and onshore [8; 9; 10]. Nevertheless,the objectives for renewable energy become every year even more ambitious and the offshorecapacity is planned to increase almost seven times for 2040 [6]. These objectives are basedon policies not only from Denmark, but also from the European Union, although usually theDanish policies are more restrictive [4].

Another example of these policies from the Danish Government it is related with the visualimpact of the Overhead Lines (OHL), when already in 1995 there were written the guidelinesfor the new lines, so that every new line up to 100 kV had to be an Underground Cables (UGC)[11]. This became even more restrictive in 2008, with an idea to make even the new 400 kVlines as UGC [12].

In order to operate this complex system and have the perfect balance between generationand demand, Denmark has one single Transmission System Operator (TSO), Energinet, andmultiple Distribution System Operator (DSO) divided in different areas all over the country.

1.2 Power System of Eastern Denmark

The EPS in Denmark is divided into two synchronous areas, the Continental and the Nordicsynchronous area, connected by the Great Belt Power Link with an HVDC connection.Geographically, the Continental corresponds to the West of Denmark, and the Nordiccorresponds to the East islands. The West area is usually named as DK1, whereas the Easternone is called DK2. The area in which the project COPE takes place is the East of Denmark(DK1), and the extension of each of these is shown on Figure 1.1. Note that the map onlyshows the land locations, but it also comprises the cable connections between the two areasand the interconnections with Norway, Sweden and Germany, apart from the connection ofDK1 and DK2 and the offshore power plants that are in the different seas.

2

Page 19: Impact of Wind Turbines on Power System Stability

1.3. Definitions Aalborg University

Figure 1.1 Synchronous areas in Denmark.

The space of interest covers the highest demand in Denmark due to the concentration of pop-ulation in the capital, Copenhagen. It is also where the biggest power plant is established,Asnæs, a coal power plant with 1052 MW of installed capacity [13].

Apart from that, the renewable energy is increasing in the area, with a very challengingproject that it is estimated to be commissioned by 2020, Kriegers Flak. This project, alsocalled Combined Grid Solution, is going to be an offshore wind farm of 600 MW that willprobably be extended to another 600 MW by 2030. The peculiarity of this wind farm is thatwill be also the first offshore interconnection, linking DK2 with the North of Germany, partof the Continental synchronous area [6; 14].

Projects like Kriegers Flak will make some more changes in the system, as the power have tobe transmitted through the lines, and some of this lines that are currently OHL will also bechanged by UGC, and some more UGC lines will be built, as it is projected for 2024 [6].

1.3 Definitions

Before introducing the problem it is important to clarify two of the main concepts that willbe very important all over the thesis: power system stability and voltage stability. A PowerSystem is considered to be stable when it remains on a state of equilibrium under normaloperating conditions; but stability is also the ability that makes the system able to go backto an acceptable state after having loose its stability due to some disturbance [15].

In a system, there has to be a match between the generation and the load (plus the sys-tem losses), and this match has to be both in active and reactive power. The load is inconstant change causing disturbances on the system, and the system must be able to operatesatisfactory when these changes happen. This gets even more complicated with the introduc-tion of wind energy or solar energy in the systems as the generation is also changing based

3

Page 20: Impact of Wind Turbines on Power System Stability

1. Introduction

on the weather conditions, making the match between generation and load more difficult toachieve. But the load or generation changes are not the only disturbances that a systemexperiences, other like short-circuits in lines or when a device gets broken may also occur [16].

In a stable system, after these transient disturbances the system will get back to the sta-bility point and it will remain almost intact. If the system is unstable, the system may getuncontrollable, resulting in a decrease of the voltages that could lead to a partial or totalblackout. Here it stands out the importance of a stable power system, only possible with astrong protection system and a complex control of the generation systems that has to be wellcoordinated. The coordination could be the origin of a stability problem, which in most casesis due to a loss of synchronism in the generation, but it could also be due to a collapse of loadvoltage [16].

The power system stability can be classified in three big groups: rotor angle stability, fre-quency stability and voltage stability. Rotor angle stability is related to the capability ofthe synchronous machines of a power system to stay in synchronism; frequency stability, asit name suggests, is related to the ability of the system to keep the frequency as possible tothe steady frequency during steady state and during disturbances. Finally, voltage stabilityconcerns the ability of the system to keep steady voltages in all buses both in steady stateand after a disturbances.

This thesis is focused on voltage stability since rotor angle stability and frequency stabil-ity concern a more complex study that could be a second part of the study. It is importantto start the analysis of the voltage values under normal operation and then find the weakparts of a system and this is way the thesis is focused on the voltage stability. A stablesystem generally has its voltages levels around 1 p.u. unless a different value is wanted, anda lower value can be a symptom of instability. This low voltage is usually associated with thevoltage drop due to the active and reactive power flow through inductive reactances on thetransmission network.

Nevertheless, overvoltages are also a cause of voltage instability, for example when a trans-mission line is barely loaded and the generators have a limit for the reactive power absorbed.In such case, the excess of reactive power that is not absorbed could create voltage instability[15; 16].

Voltage stability is studied in the time domain depending on the duration of the disturbancesinto two subcategories: large disturbance voltage stability and small disturbance voltage sta-bility. Large disturbances have a duration that varies from few seconds to tens of minutesand are due to system faults, loss of generation or other very problematic issues; small dis-turbances can be changes on the load, which are of basically of steady state. Thus, the smalldisturbance is possible to be analysed by means of a static analysis [16].

In conclusion, by means of load flow analysis on steady state, is possible to analyse thevoltage stability for small disturbances and this is where the thesis will be focused. To do so,several indexes will be used to find the possible instability of the systems.

1.4 Problem Definition

Electrical Power Systems are recognised as the most complex system ever built by humans[17; 18], and therefore they depend on many things and it is very difficult to build them.

4

Page 21: Impact of Wind Turbines on Power System Stability

1.4. Problem Definition Aalborg University

Apart from that and due to its importance for our lives, it needs to be as much reliable,cheap, and environmentally friendly as possible.

Traditionally, the electricity generation has come from big power plants that were alwaysonshore and could be generating electricity at any time of the day. The introduction of re-newable energy has changed this and now the power systems have distributed generation,where there are many more generation points for the same power, as the generation is madein smaller quantities. It is also sometimes not only onshore, but offshore, having wind powerplants in the middle of the sea, with undersea cables connecting them to the onshore powersystem. However, the biggest change with the renewable energy, essentially with Wind Energyand Solar Energy, is the unpredictability of them, as it depends on the weather.

All of these changes make the systems even more complicated and more challenges come fromthe engineering point of view. Initially, the Wind Energy has been presented as a clean wayto generate electricity, but, of great value though that is, there are some technical issues thathave to be considered. These issues can be related to security, stability, energy quality, or theoperation of the system [19]. The one that will be described in this thesis is the stability issue.

The voltage stability issue is related to the reactive power and the power factor of the gen-erator of a Wind Turbine. Generally, when there is a voltage stability problem it is relatedwith a lack of reactive power in the system [19]. Thus, the voltage stability problems aremore likely to occur in a system with a high penetration of Wind Energy due to the limitedreactive power capability of wind energy generators.

Ideally, when replacing the traditional power plants by Wind Turbine, the system shouldkeep the same reactive power so that there is not a stability problem. But this is not alwaysthe case and it depends on the type of Wind Turbine that it is used. Apart from that, as thegeneration is distributed some new problems appear [20]:

5

Page 22: Impact of Wind Turbines on Power System Stability

1. Introduction

Figure 1.2 Typical Electrical Power System Structure.

• Wind Turbines in remote areas: for these turbines (usually offshore), even if theyhave an adequate reactive power control to regulate the voltage, this compensationcannot be made in the points where a power plant is disconnected.

• Voltage of Wind Farms: sometimes the turbines are connected to a lower voltagethan the one of the power plants, as it is illustrated in the example Figure 1.2 [21].This could be a problem with the tap changers, which are usually made to regulate thevoltage of one of the sides. In this way, the voltage regulation could not be possible ontransmission levels.

Apart from these, there are some rules depending on the countries which request the windturbines to be able to resist voltage drops up to a certain voltage and during a certain time.This was in the past only made by the synchronous generators, but the increase of wind tur-bines makes it necessary also for Wind Turbines. Some of these codes include that the windturbines should generate an extra reactive power when these drops occur, in order to help thevoltage to increase, similar to the synchronous generators when over excited.

As explained, these grid codes depend for each country, and the one concerning this the-sis is the Technical Regulation 3.2.5 for wind power plants above 11 kW [22], where all therequirements are detailed.

1.5 Objectives

The main objective of this thesis is to determine whether or not is possible to run a 100%wind power generation in the Eastern Danish Power System DK2. One of the key points willbe not only to understand the system and find a solution, but to find a way to analyse othersystems. In this way the procedure could be extrapolated to similar systems where similarchanges want to be made.

6

Page 23: Impact of Wind Turbines on Power System Stability

1.6. Methodology Aalborg University

Keeping this in mind, it is necessary to list the different objectives:

• Understanding the new challenges on the EPS regarding the installation of Wind PowerEnergy.

• Investigate new methods to easily understand how a big power system works.• Analyse solutions for making a 100% renewable grid be possible in the Eastern Denmark

Power System.

1.6 Methodology

Due to the complexity of a grid of the size of the EPS of the East of Denmark, it was initiallyconsidered a smaller system to find and efficient method for the further analysis of the biggergrid. The method concerns mainly two programs, MATLAB and DIgSILENT. DIgSILENTis used for load flow simulations via a designed algorithm that allows to run load flow severaltimes, while MATLAB is used for processing the results and as an easy interface for the userto select the desired simulations.

1.7 Limitations

The project is limited by the following points:

• All the analyses performed are considering only steady-state analysis.• Technical or dynamic analyses such as transient analysis has not been performed.• The simulations of the Eastern Denmark System are based on information from the

TSO Energinet, but it is assumed the results are not according to the reality.

7

Page 24: Impact of Wind Turbines on Power System Stability
Page 25: Impact of Wind Turbines on Power System Stability

Wind Power integration andvoltage stability analysis 2

Concerning the Wind Power Energy, it is necessary to introduce it for the sake ofunderstanding its implementation in a system. Although there are many different typologies,such as vertical-axis wind turbines or other unconventional wind turbines, this is focusedon horizontal-axis wind turbines, the most common ones. Also, in this introduction it isassumed that the reader has an idea of the different parts of a wind farm: one or severalwind turbines together connected to a substation with its protection system and with manylayout variations depending on the site. Starting from this point, the wind turbines will becategorised in different groups, depending on its speed control, power control and also on thetype of generator used inside the turbine.

2.1 Wind Turbines depending on the generator

This category is related to the electrical system of the turbine, and it has a wide number ofdifferent generators, both synchronous and asynchronous. A wind turbine can be equippedwith any kind of three-phase generator, sometimes with the help of a power electronicfrequency converter. However, there are some types of generators that are more commonin the wind turbines and here they will be explained.

2.1.1 Asynchronous Generators

The first group corresponds to the asynchronous or induction generators, which is the mostcommon type inside the wind turbines. It is less complex than the synchronous and it ischeap. The main problem of this generator is that in order to create a magnetic field, it needsto absorb reactive power, so the reactive power flows in the opposite way as the active power[23]. This may become an important issue when there is not enough reactive power to feedthe loads and the system can collapse. Nonetheless, this reactive power can come from thegrid or from a power electronic device, avoiding the previously mentioned problem.

There are two different rotor designs for asynchronous generators [24; 25; 26]:

• Squirrel-cage rotor: corresponds to the Squirrel Cage Induction Generator (SCIG)and this type is directly connected to the grid. These generators are used in fixed speedwind turbines, as they are designed to achieve the maximum efficiency at a certain windspeed, but sometimes are equipped with two windings so that it is possible to havemaximum efficiency for two different wind velocities. One of the main disadvantages isthat the relation between active power, reactive power, terminal voltage and rotor speedis constant and therefore an increase of active power supposes an increase of reactivepower consumption. In order to mitigate this, the SCIG are usually equipped withcapacitor banks that will compensate the reactive power. A diagram of this generator

9

Page 26: Impact of Wind Turbines on Power System Stability

2. Wind Power integration and voltage stability analysis

is shown in Figure 2.11

SCIG

GEAR

BOX

GRID

Figure 2.1 Example of a typical SCIG wind turbine.

• Wound rotor: corresponds to the Wound Rotor Induction Generator (WRIG), whichis an evolution of the SCIG. Within the group of wound rotor asynchronous generatorsthere are another two types:

– In the first one, the generator has an additional external variable resistance thatis attached to the rotor windings and is controlled by power electronics. Thisresistance allows to change the total rotor resistance giving a limited range tocontrol the speed, depending on the size of the external resistance. It is not a fixedspeed generator, neither a total variable speed generator, it is usually described aslimited variable speed generator. An example diagram is shown on Figure 2.2.

WRIG

GEAR

BOX

VARIABLE

RESISTANCE

GRID

Figure 2.2 Example of a typical WRIG wind turbine.

– The second one is the most relevant for this thesis since it will be focused on thistype. The DFIG is the most used generator in the wind industry, and it consistson a WRIG with the rotor windings connected to a AC-AC converter, typically aback-to-back converter. It is called doubly-fed since the stator voltage is appliedby the grid and the rotor voltage by the converter. It is a variable-speed generator,but again it is operates over a restricted range. The converter is, in turn, dividedinto two converters with different functions: the rotor side converter and the gridside converter. A common representation of this generator can be seen on Figure2.3.

1Note that all the diagrams are just a guide to follow the text and there are many elements missing inthem such as filters or soft-starters.

10

Page 27: Impact of Wind Turbines on Power System Stability

2.1. Wind Turbines depending on the generator Aalborg University

DFIG

GEAR

BOX

AC

DC

DC

AC

GRID

Figure 2.3 Example of a typical DFIG wind turbine.

The rotor side converter controls the active and reactive power output of theturbine, while the grid side converter keeps the DC link voltage at its set point. Themain advantage of the DFIG is that it can control the reactive power, and doesn’tneed to be magnetised from the grid. It has the possibility to deliver reactive powerto the grid, a great advantage compared to the previously mentioned generators.

2.1.2 Synchronous Generators

Synchronous generators are the most common ones for power plants but they are moreexpensive and complex than the asynchronous generators. On the other side, this kind ofgenerators don’t have the biggest disadvantage of the induction generators, as they do notneed a reactive magnetising current [25]. In the synchronous generators group there are alsotwo types [24; 25; 26]:

• Wound rotor: again this kind of rotor design appears in the synchronous generators, inthis case for the Wound Rotor Synchronous Generator (WRSG). In this case the statoris connected directly to the grid, while the rotor windings are supplied by DC. Therotor creates itself the exciter field, which rotates at synchronous speed. The rotationalspeed is determined by the grid frequency. Some of the manufacturers design it withoutthe need of a gear box and it is usually connected with a full scale frequency converterwhich has a similar role to the one of the DFIG. This generator allows variable speedoperation and it is represented on Figure 2.4.

WRSG

DC EXCITATION

GRID

AC

DC

DC

AC

Figure 2.4 Example of a typical WRSG wind turbine.

• Permanent Magnet Synchronous Generator (PMSG): this is a special kindof generator that substitutes one of the windings by permanent magnets, usually therotor windings. Its magnets provide a self excitation, making this kind of generator aninteresting choice and getting popular in the wind industry, with an increasing trend.It also sometimes does not have a gear box, but it usually needs a fully scale converter.

11

Page 28: Impact of Wind Turbines on Power System Stability

2. Wind Power integration and voltage stability analysis

It is an expensive technology because due to the high price of the permanent magnets.This last generator is represented on Figure 2.5.

PMSG

GRID

AC

DC

DC

AC

Figure 2.5 Example of a typical PMSG wind turbine.

2.2 Wind Turbines depending on the speed control

This category differentiates the generating system and leads to different types: fixed-speedand variable-speed wind turbines [24]. Before analysing both types an illustration of a generalwind turbine as a help to follow the text is shown in Figure 2.6 [27].

Figure 2.6 Diagram of a typical Wind Turbine.

• Fixed-speed wind turbines: these turbines are equipped with an induction generator(asynchronous machine), either wound rotor or squirrel cage, that is coupled to a fixedfrequency and rotates always almost at the same speed no matter the wind speed. Thiskind of turbine was the pioneering technology and was the most common one in the 80’sand 90’s due to its simplicity and reliability [24; 26; 25].

• Variable-speed wind turbines: it has become the most common type in the lastyears, but it is much more complicated than the fixed-speed. It is equipped eitherby asynchronous or synchronous generators and it is connected to the grid by a gridconverter, so the generation is not coupled to the system frequency. The purpose of thisconverter is to regulate the generator speed, since in this kind it is not constant, but itchanges depending on the wind speed [24; 26; 25].Therefore, variable-speed generators have much more electronics inside the turbine,making it more complex, expensive, but also controllable.

12

Page 29: Impact of Wind Turbines on Power System Stability

2.3. Wind Turbines depending on the power control Aalborg University

2.3 Wind Turbines depending on the power control

Within this specific group, there are two kind of performances depending on how the controlis made.

This control criteria is related to the fact that the turbines have to be designed to have abetter performance on certain wind speeds, and cannot maximise the power output for everywind speed. Depending on this control, these two groups are pitch-regulated wind turbines,and stall-regulated wind turbines.

• Pitch-regulated (active) wind turbines: they have a control system that varies thepitch angle (turn the blade along its axis) to reduce the torque produced by the bladesin fixed-speed Wind Turbines, or to decrease the rotational speed in variable-speed windturbines. It is continuously changing the angle (pitching) depending on the wind so thatthe output is as maximised as possible [26].

• Stall-regulated (passive) wind turbines: they have their blades designed so thatwhen wind speeds are high, the rotational speed or the aerodynamic torque, and thus thepower production, decreases with increasing wind speed above a certain value (usuallynot the same as the rated wind speed). This kind of turbines cannot change the angleof the blades and this power change is just depending on the design of the blade, whichwill act in different ways due to aerodynamic effects [26].

There is also a third type that is a combination of both types and it this turbines are calledActive Stall Controlled Wind Turbines. When taking a look at the output power of bothtypes, the differences can be seen on Figure 2.7 [28].

4.3 Principles of WECS Optimal Control 75

0

RatedwtP

v

RatedCut-in Cut-out

Pitch regulated

Passive stall

Figure 4.4. Comparison between passive-stall and active-pitch control features

4.3 Principles of WECS Optimal Control

This section is dedicated to the basics of WECS energy conversion optimization in the partial load regime.

4.3.1 Case of Variable-speed Fixed-pitch WECS

Control of variable-speed fixed-pitch WECS in the partial load regime generally aims at regulating the power harvested from wind by modifying the electrical generator speed; in particular, the control goal can be to capture the maximum power available from the wind. For each wind speed, there is a certain rotational speed at which the power curve of a given wind turbine has a maximum ( pCreaches its maximum value).

0

ORC

a)wtP

l:0

b)

ORC

wt*

l:

Figure 4.5. Optimal regimes characteristic, ORC: a in the l wtP: � plane; b in the

l wt: �* plane

All these maxima compose what is known in the literature as the optimalregimes characteristic, ORC (see Figure 4.5a – Nichita 1995). In the l wt: �*plane, the ORC is placed at the right of the torque maxima locus (Figure 4.5b).

By keeping the static operating point of the turbine around the ORC one ensures an optimal steady-state regime, that is, the captured power is the maximal

Figure 2.7 Power output comparison of stall regulated and pitch regulated control.

From Figure 2.7 it is important to describe some of the points. The cut-in wind speed is theminimum wind for which the turbine operates, and the Cut-out wind speed is the one wherethe turbine stops production in order to keep the turbine safe [25].

It is important to clarify that this classification only involves the power control and is in-dependent from other characteristics of the turbine.

Now that all the different categories of Wind Turbines have been presented, it is interestingto remember that in most cases the three categories are independent and almost any connec-tion between them is possible. For example, there are wind turbines that are pitch-regulatedvariable-speed generators, but also stall-regulated variable-speed generators; and both of themcan have the same kind of generator.

13

Page 30: Impact of Wind Turbines on Power System Stability

2. Wind Power integration and voltage stability analysis

As explained, this thesis is focused on the DFIG.

2.4 Power System Voltage stability and the Wind TurbinePower integration

The system is analysed in steady-state by means of the Power Flow Analysis. This analysisis used to get the magnitude and phase angle of the voltages of all the busbars in a systemtogether with the active and reactive power flowing in each of the lines [15].

Based on the different parameters of the system, and applying the Kirchhoff’s laws, a listof equations is considered. These equations can be formulated with a matrix called the ad-mittance matrix, which includes the inverse impedance (admittance) of the different elementsof the system. These equations will end up in a problem consisting in more variables thanequations, and therefore it is necessary to use an iterative method to calculate the solutions.The most used method is the Newton-Raphson method, and it is the method used by thesoftware DIgSILENT in which the thesis is based.

These techniques give a solution for a certain state of the system, but this state will changeas soon as any parameter changes on the system, and then the solution will not be validanymore. When one of these changes occurs on a system, the power system stability is tested;if the system cannot get back to its original state it is because the system is unstable, whileif it goes back to its initial state the system would be stable.

As it was explained on the first chapter, the concern here goes with the voltage stability.

2.4.1 Voltage Stability Analysis

Voltage stability is, as already explained, the ability of keep an acceptable voltage in steadystate and after a disturbance on the system. This disturbance may be, for example, a changeon the load demand. In such a case the system has to be able to make a similar change onthe generation while keeping the voltages without a big variation. The main problem here isusually related to the reactive power on the system.

Following the explained on Chapter 1, a system is usually described as voltage unstableif when in any of the buses of the system the voltage is increasing, the reactive power flow isdecreasing. On the other side, if all the buses of the system are increasing its power and atthe same time its reactive power is increasing, the system is stable [15].

Therefore, the voltage stability of a system can be analysed by looking at the V-Q curvesin steady-state analysis, which are very representative.

2.4.2 Reactive Power Capability of Wind Power

Relating the voltage stability with the wind power implementation, a system will be stable ifis capable of controlling the reactive power on its busbars. Thus, when implementing windturbines it is desired that the wind turbines have a certain reactive power capability.

The reactive capabilities of the wind turbines are very relevant, and after the analysis made onthe previous section, the DFIG was chosen to be the type of wind turbine used in the systemdue to its reactive power capabilities. If the turbine has a good reactive power capability it

14

Page 31: Impact of Wind Turbines on Power System Stability

2.4. Power System Voltage stability and the Wind Turbine Power integrationAalborg University

will have a similar behaviour to the traditional power plants, which are able to absorb andproduce reactive power depending on the needs of the grid at a certain moment in time. Inthis way, the implemented wind turbines will have to be able to exchange reactive power inboth ways or the system will collapse.

Furthermore, the DFIG has also a low initial cost and the converter necessary for a PMSG(which also has reactive power capabilities) needs a full power rating, while for a DFIG onlyneeds between a 25 and a 30% of the output power, making it not only cheaper but alsosmaller [29].

This converter used in the DFIG it is a four quadrant converter (see Figure 2.8), allow-ing the turbine to operate in all of the regions, in a way that it can generate and absorbreactive power. Hence, it is possible to have different power factors according to the momentand the load.

V

I

2º 1º

3º 4º

Figure 2.8 All quadrants available in the DFIG converter.

Also, one of the objectives of the COPE project is to run a 100% power electronics grid, whichcan be followed by the use of a DFIG, since it is a Power Electronics (PE) based technologythat does not use any passive filters such as a capacitor banks or shunt reactors. In case thesystem requires an additional reactive power source, it can be made by the connection of aStatic Synchronous Compensator (STATCOM) or any other PE device.

Another characteristic to take into account when thinking about the implementation of windturbines in a EPS is the availability of a certain spinning inertia. The inertia provides a smallenergy storage that absorbs possible changes in the system frequency and therefore it is veryimportant. With a high spinning inertia it is easier to keep constant the frequency in case ofa loss of generation, which can be normal for wind turbines [26].

Nevertheless, wind turbines have few or even none inertia at all, and therefore it is a veryimportant issue to take into account as it makes the EPS more vulnerable with more windturbines. For this reason, the grid codes are starting to request the new wind turbines tohave an inertia effect, which is possible with variable speed wind turbines if there is a controlfunction [26].

There are many other issues to take a look when connecting a wind turbine into the sys-tem, but in this thesis only the power flow is studied. Effects such as the inertia, injection ofharmonics, blackouts and many others will be reflected for future studies, and a deep studyof the power flow will be made instead.

15

Page 32: Impact of Wind Turbines on Power System Stability
Page 33: Impact of Wind Turbines on Power System Stability

Implementation case ofWind Power in a System 3

In this Chapter first of all is introduced how the problem is approached and the calculationprocedure; and secondly the algorithms used for the simulations are introduced together withthe IEEE 9-bus system. Finally, the first calculations and conclusions will be shown.It is important to understand that many different algorithms were written to get all the results,but there are two main parts: the simulation or calculation algorithms, and the algorithmsto process the data, as after a simulation many data is obtained.

3.1 Problem approach

Once an introduction of the different wind turbines has been made, now it is explained theneed of how a correct implementation has to be made in an EPS.

Since studying a big EPS with very long distances, a lot of substations and points of genera-tion is something complicated and difficult to understand and predict, it was decided that afirst approach to a smaller system was necessary. The IEEE 9-bus system was used as a firststudy and for a better comprehension of how to make the implementation of the wind energyin a bigger system.

The IEEE 9-bus system [30] is a simple system made up of 9 busbars with 3 loads and 3synchronous generators1. This system is represented on Figure 3.1.

1The details of the grid will be explained later as for this introduction to the problem is not necessary.

17

Page 34: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

G

2

G

3

G

1

Load C

Load ALoad B

Figure 3.1 IEEE 9-bus system.

The idea is to find a method to identify the weakest points of the system, and to comparethe conventional system with synchronous generators with a system with DFIG wind energypenetration on different ratios and different power factors.

To do so, it is important to explain how ’the weakest points of the system’ are defined.The weakest points will be the busbars where the voltage is further from its desired point,usually 1 p.u.. This index, a very simple one, can identify the voltage stability problems whichis the root cause of many problems over the system. A voltage far from its desired point itusually comes with higher losses, overloading of transformers and lines and so on as it will beseen in the analysis later.

Apart from that, two more indexes are used for finding the weakest points of the system.However, before explaining these two other indexes it is important to first proceed to how theanalysis is made.

3.1.1 Calculation procedure

The way the system is analysed is, as already explained, based on the load flow. Nonetheless,this analysis is not only made for one scenario, but for many different ones. This means thatsomething has to change in the system for each load flow calculation, otherwise the results willalways be the same. For this thesis, the change is on the load, making a load flow simulationfor each different load. For example, for the IEEE 9-bus system one set of simulation wasto start the simulations with a very low load and increase it step by step until the load isso high that the system is not prepared for it and the load flow cannot converge. The onlyparameter manually changed is the load, and the other parameters such as the generation isautomatically adapted by the simulation software DIgSILENT.

In this way, for the same system configuration, instead of having one load flow simulationthere are as many as wanted, depending on the initial load and the final load. Hence, theresults can be analysed as an evolution of the system depending on the load and the weakpoints can be identified and analysed throughout the different loads. Also, the operational

18

Page 35: Impact of Wind Turbines on Power System Stability

3.1. Problem approach Aalborg University

limits of the system are identified once the load flow cannot converge anymore.

Considering this system analysis, a comparison between the original system (based on syn-chronous generation) and the system with wind penetration can be made. The evolution ofthe voltages, the active and reactive power, the generation or the loading of the lines andtransformers can be evaluated and compared, giving a better interpretation of the results.

The IEEE 9-bus system is consequently the best way to initiate the calculations, as it ismuch simpler and the interpretation of the results is much easier. Also, as it is based on analgorithm, the errors can be found earlier in a small system than in big one. Besides that,this system is a three generator system, so some of the scenarios that can be compared arethe penetration of a 33%, a 66% or a 100% of wind generators in the system, and in threesteps it can be seen the evolution of the wind penetration problem.

Once the methodology has been introduced, the other two indexes used to find the weak-est points of the grid are defined. For both indexes it is used not only the data of one loadflow, but of two consecutive ones, same configuration with a different load. These two indexesdepend on the voltage change between the two steps (different loads), and a second variable.

In one of the cases, the other variable is the Active Power (P) that flows through the busbar,and it is calculated following the Equation 3.1:

dP/dV k =Pkn − Pkn−1

Vkn − Vkn−1

; ∀k, n ∈ R (3.1)

where ’k’ is the number of the busbar in the system, and ’n’ is the number of iteration, withas many iterations as desired. It is, then, the difference between two iterations (n and n− 1)of the active power through a busbar k. This index will help on identifying if the weak pointsare related to a big change in the active power of a busbar.

The active power in a busbar Pk is calculated as the total active power that flows throughthe busbar, as it is seen in Figure 3.2. In this Figure it can also be appreciated the voltageVk of the busbar, which is used in the calculation of Equation 3.1.

P

A

P

B

P

C

P

D

P

E

P

k

V

k

∠φ

Figure 3.2 Representation of the Active Power through a busbar.

The active power through a busbar is equal to the total active power coming to the busbar,also equal to the total active power leaving the busbar, as it can be seen in the Equation 3.2.

Pk = PA + PB + PD = PC + PE (3.2)

19

Page 36: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

Note that the Equation and the Figure are just a general representation and both will varyfor each busbar. Also, the arrows just represent the direction of the flow, which is not alwaysthe same for the same element, i.e. a line can be absorbing the power from that busbar or itcan also be sending the power to the busbar.

The last index is similar to the previous one, but in this case instead of the Active Power (P)there is the Reactive Power (Q), it follows Equation 3.3:

dQ/dV k =Qkn −Qkn−1

Vkn − Vkn−1

; ∀k, n ∈ R (3.3)

where ’k’ is the number of the busbar in the system, and ’n’ is the number of iteration, withas many iterations as desired. It is, then, the difference between two iterations (n and n− 1)of the reactive power through a busbar k. This index will help on identifying if the weakpoints are related to a big change in the reactive power of a busbar. Also, as it was definedin previous sections, if the voltage increases with the reactive power, the system is stable, butif it is not like this, it is unstable.

The procedure for calculating Qk is the same as for Pk, in this case it will be explainedwith a similar equation and a similar Figure for a better understanding. In this case, the ar-rows of Figure 3.3 does not represent the direction of the reactive power and are all representedall pointing the busbar.

Q

A

Q

B

Q

C

Q

XX

Q

XY

Q

k

V

k

∠φ

Figure 3.3 Representation of the Reactive Power through a busbar.

Thus, as the arrows do not indicate the direction of the power and are all pointing the busbar,the Equation that follow is Equation 3.4:

Qk =XY∑

i=A,B,...

Qi > 0 =XY∑

j=A,B,...

Qj < 0 (3.4)

The reactive power is calculated following the same principle as in Equation 3.2, but in thiscase if the direction of the power is unknown, it can be calculated following this Equation.The reasoning is the same, by summing the reactive power greater than zero (positive), it issummed the reactive power that goes to the busbar; while the reactive power smaller thanzero (negative) is the reactive power that leaves the busbar. The limit XY is just an example,as there can be as many letters as elements connected to the busbar.

In the end, with these three indexes the weakest points of the grid can be found, and itis easier to analyse the penetration of wind energy when comparing it with the original sys-tem. Apart from these indexes, the collapse of the grid once the load flow cannot convergeanymore, and the evolution of the different parameters over the load of the system provides

20

Page 37: Impact of Wind Turbines on Power System Stability

3.2. Calculation Algorithms Aalborg University

a good picture of the different possibilities and possible solutions when implementing windenergy.

Next to this, the algorithm used for doing the simulations and calculating the indexes isexplained.

3.2 Calculation Algorithms

The simulations are based on simple Load Flow calculations that can be easily made by thesoftware DIgSILENT. However, as the objective is not to analyse the Load Flow for one casebut for many cases, it was decided to create an algorithm that could be suitable for almostany kind of system and could perform several Load Flow calculations.

Following the idea of finding the weakest busbars described on the previous section, an inter-esting point would be to run Load Flow for many different Loads. With this purpose it wasdecided to create a DIgSILENT Programming Language (DPL) script which could calculateand extrapolate the Load Flow data to be later processed by another software. The DPLscript is based on a DIgSILENT programming language, and it is not very well known. Forthe sake of making it as simple as possible as well as user friendly, it was decided to use itwith a more common software as MATLAB is.

These software connection between DIgSILENT and MATLAB has been previously usedin the literature [31; 32] and here only an adapted code for the desired purpose has beenmade. Each software has assigned a list of tasks which were increased and improved along theelaboration of the thesis. Initially, the tasks for each software were the ones on Figure 3.4.Even if all the final tasks will be described later, it is interesting to understand the startingpoint as well as the evolution in order to familiarise with the process.

- Ask the user how manyLoad Steps are desired andhow the Load change has tobe.- Write the New Load in a'.txt'.- Wait for DIgSILENT tocalculate the Load Flow.- Process the Load Flowresults.

MATLAB

- Read New Load Valuesfrom file and define them asLoads.- Run Load Flow in theSystem.- Export data into a '.txt' file.

DIgSILENT

Connection File

Figure 3.4 Schema of the initial tasks made by each of the two softwares.

In Figure 3.4 is written ’Connection File’ between both boxes, which indicates the way bothprograms are synchronised. This is because the softwares are not made to be synchronised au-tomatically and the way to do it is by creating a Connection File, in which when, for example,MATLAB is working it will write a ’1’ on the file. Meanwhile, DIgSILENT will be readingthis file until there is not a ’1’ written in it anymore. This moment occurs when MATLABfinishes its task and therefore will change the ’1’ for a ’0’. Once this occurs, DIgSILENT willbe doing its tasks. This process allows both programs to work together, and everything isinside a loop that will be working until it reaches the Load limits, which have to be set bythe user when defining the Load.

21

Page 38: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

The algorithm can be divided into three steps:

• The first step is when the user runs both programs and is asked to pick from a lot ofoptions. These choices are only made in the beginning and cannot be changed once theprogram is running.

• The second step is once the choices have been made and then the algorithms are nowrunning Load Flow for each step. This step may take several minutes, but the progresswill be displayed on the screen.

• The third and last step is when the calculations have finished and the user is asked tosave the data acquired. The simulations are done and all the data is now available toprocess. Another script can be used in MATLAB to make plots or get information.

Now each of these three steps are detailed, explaining all the functions that were addedthrough all the algorithm elaboration.

3.3 Steps

3.3.1 First Step

In this step, many different functions were added, once there were found some needs into thesimulations that could be useful for a better performance. Between all the options, there areoptions for determine the load variation, the power factor of the load, which generators wantsthe user to be connected, or if the generators power is also desired to change with the load.

Load variation

This function was the first one implemented, and will determine the load steps of thesimulations. The parameters that have to be introduced by the user are:

• If all the loads want to be changed or only some of them. Almost all the simulationswere made changed all the loads together.

• If all the loads want to be changed with the same percentage, or if each of the loads willhave a different percentage.

• If the power factor of the loads wants to be kept as original, or a different one is wanted.• Which percentage wants the load to be changed, it can either be positive or negative.

The starting point will be the current load of the model when the script in DIgSILENTwas executed. The smaller the percentage is, the more number of steps you will needto find the collapse, but a better accuracy on the results and the variation you will get.

• If the percentage wants to be based on the initial load, or on the previous calculatedload. In other words, the step between loads can be always the same (absolute change),or the load step can be increasing with the load (relative change). Figure 3.5 shows arepresentation of how the load could change in both methods.

Figure 3.5 Differences between absolute and relative load change.

22

Page 39: Impact of Wind Turbines on Power System Stability

3.3. Steps Aalborg University

• The number of steps desired, which is translated into the number of simulations madeby DIgSILENT. It is recommended to write a high number of steps since the simulationwill stop if the system does not converge, and it is possible to know at which point thishappens.

• Finally, if the installed power of the DFIG wants to be incremented during thesimulations or kept constant. This will be detailed later.

Once defined, the algorithm will create a matrix with all the steps included in which each rowwill be a step that is going to be read by DIgSILENT.

Generation Connected

Following the idea of implementing Wind Turbines in the system, there has to be an easy wayto connect them without going into the model on DIgSILENT. For this reason the list of syn-chronous machines available in the system is displayed so the user can select which ones doeshe want to be connected into the system, and the same is done with a list of DFIG, pickingthe implementation wanted2. So far the DFIG have been introduced and it was also explainedthe idea to implement it into the grid. But once you have an original grid where you wantto implement Wind Turbines, it is necessary to define the model, power and other parameters.

For this general case, and due to the lack of information of the replacements, it was decidedto use the current locations of the power plants (synchronous generators) and place right nextto them the DFIG wind farms. In this way, for each conventional generation point there willbe a wind farm, but it is important to remember that this means that it will be placed there,but not connected, the possible connection is defined by the user when running the simulation.

The DFIG was always picked from DIgSILENT’s own library, which includes many elec-trical elements and very well defined. In order to get the most suitable option for each powerplant, the process was made as follows, generator by generator:

• First, the active power delivered by the original power plant was checked; in the case thegenerator is a slack bus, the power delivered by this generator has to be checked whenrunning simple Load Flow in the original model. In such a way is possible to calculatethe size the new DFIG.

• Once the wanted size is known, it is the time to adapt it with the available DFIG in thelibrary. This library does not have all the wanted sizes, and it is restricted to sizes from1 MW to 6 MW, which in most cases is not enough for replacing a power plant. Thenceit is necessary to add multiple DFIG, and the easier way is to put them in parallel, sothat the total power of the Wind Farm will be the sum of each wind turbine in parallel.To do so, DIgSILENT allows to select a number of parallel wind turbines and it is notnecessary to draw each parallel element.The size of the DFIG from the library was by dividing the power of the former powerplant by every possible power of the library. The result of these divisions closer to annatural number will become the number of DFIG in parallel and its capacity the chosenone. The reason for this is that the closer it is to a natural number, the closer the DFIGpower will be to the former power plant.

• Nevertheless, the model of the DFIG from the library apart from the generator, itincludes a low voltage busbar (0.69 kV), a transformer (0.69 kV - 20 kV) and severalcontrollers for the generator. It is therefore necessary to change also the power of the

2In favour of making it simpler, as the list of generators could be very big, they can be directly selectedall or none of the synchronous or DFIG

23

Page 40: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

transformer and probably the voltage rating of the transformer to adapt it to the grid.For the transformer size, the process is similar to the DFIG, as it is rated for the librarygenerator, the only change that is made is on the number of transformers in parallel,setting it to the same number as the number of DFIG in parallel.For the rating of the transformer, the low side is fixed to 0.69 kV, while the 20 kV busbarcan be adapted if the former power plant was connected to a similar but not exactlythe same voltage. For example, if the original busbar is at 17 kV, it is not a big changeto adapt the DFIG transformer to 17 instead of 20 kV.

• The last step could be, if desired, to change the name of the generator and make it assimilar as possible to the one of the power plant. This is made with the purpose ofassociating the position of the power plant and the wind farm that has been introducedfor the substitution, being easier to connect and disconnect them in the simulationswithout looking at the model on DIgSILENT.

Following these steps, the new Wind Turbines are ready for the simulation. Although thesimulation is ready, it is very important to make clear that the fact that there is a windfarm for every power plant, does not mean that both have to be connected. The objectiveis actually to avoid connecting in the same location both, but to increment gradually thepenetration, i.e. if a wind turbine is connected, the power plant of that position will have tobe disconnected and so on. This can be observed, as an example of the IEEE 9-bus systemof Figure 3.1, on Figure 3.6.

24

Page 41: Impact of Wind Turbines on Power System Stability

3.3. Steps Aalborg University

Figure 3.6 Four different possibilities of Wind Energy penetration in the IEEE-9 bus system.

Note that the percentages are not power based -as the power could be different from generatorto generator- but they are based on the number of generators (i.e. 33,3% is equal to 1 outof 3 generators). The generators connected are the ones with the continuous line, while thedisconnected ones are drawn with a dotted line.

A final observation based on the wind penetration has to be made, and it is related to anotherfunction implemented in the algorithm.It is the case of connecting 100% of wind turbines and no conventional generation. In thiscase, the simulation will be possible but there will be no load flow on the network, as theprogram is not able to complete the load flow with asynchronous generation, as it needs areference generator which is always a synchronous generator. There could be the case (notfor the IEEE 9-bus system) that the slack bus is not a synchronous generator but it is, forexample, an HVDC connection represented as an ’External Grid’. In those cases there willbe load flow in the system even though there is not synchronous generator and no modifica-tions are necessary when installing 100% wind turbines. Anyhow, for the case of no referencemachine or slack bus it is necessary to connect something to simulate the 100% wind energyimplementation.

In consequence, in order to have the 100% wind energy penetration there will have to be

25

Page 42: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

a small synchronous generation, and thus the wind energy penetration will not be that 100%anymore, but a little bit smaller. The problem is that, once the reference machine is con-nected, the power delivered by this machine will be so high compared to the DFIG and thepercentage of wind penetration will not be even close to 100%.

The solution suggested for this was to increase gradually the power of the DFIG togetherwith the load, also step-wise. This was found to reduce the active power delivered from thesynchronous generator to a small percentage, making the wind turbine generation close to thewanted 100%. This power is increased by changing the number of wind turbines in parallel3

and also the number of transformers in parallel associated to these wind turbines.

The number of parallel turbines will be reduced initially in the same ratio as it is the load,and will be incremented gradually with the same percentage as the load. It is of course con-sidered that these increments could end up in a non-integer number of elements in paralleland therefore this calculation is always rounded up to the next integer. On the same line, ifthe DFIG with the original load has only one turbine in parallel, it will not be reduced andwill be kept to one turbine in parallel. The software gives also the possibility to increment thenumber of elements in parallel from the beginning, asking the user for a possible shift thatwill increment the power of the turbines.

3.3.2 Second Step

In this step all the simulations on DIgSILENT are made based on the choices from the previousstep. Every step has been defined and now MATLAB will read through each step and send theinformation to DIgSILENT, which will change the parameters and run load flow until it doesnot converge anymore, or the steps have finished. Meanwhile, after every load flow simulation,MATLAB will process the data and save the most important parameters in different tablesthat can be later observed to see the changes.

Outline of the results

Tables for finding weak pointsAs explained in Section 3.1, three different indexes are used to find the weakest points of thegrid. Keeping this on mind, three different tables are needed to follow this evolution:

• One table contains all the voltages of every busbar of the system through every loadstep, making possible to see the voltage evolution of the weakest points.

• A second table contains all the Active Power Flowing in every busbar, again, every loadstep.

• The last table of this group has the all the Reactive Power that is flowing in everybusbar for every load step.

Generation tablesTwo different tables in this group, one for reactive power and one for active power generatedby each generator either synchronous or asynchronous. With the active power evolution ispossible to see if the implementation of wind turbines is making its work properly or the poweris coming mainly from the synchronous generators. The reactive power generated was proven,as it will be shown later, that shows the points where the load becomes critical for the system,even though it still works. In other words, although a system can converge its load flow with

3Remember this is a simulation and this is just a way to reproduce an increment of wind power that couldbe caused by many different reasons and reproduced in multiple ways.

26

Page 43: Impact of Wind Turbines on Power System Stability

3.3. Steps Aalborg University

a broad range of loads, it is design to work under certain expected conditions where its perfor-mance will be much better than when working under unexpected conditions. For example, asystem could work with a very high load but the voltages will be very low, and this is usuallybetter reflected in the reactive power generated (or absorbed). General information tableA table with information of generation, voltages or load is also created, which is detailed onthe Appendix.

Summary tableThe summary table gives information of the whole system and it is not divided by elements.It provides information about total generation, total load, and total losses (generation minusload); both for active and reactive power.

3.3.3 Third Step

The third and last step is when the user is asked to save the data. If desired, one file foreach of the previously described tables will be created and saved as ’.txt’ files. This file canthen be processed in software tools such as MATLAB or Excel. The names of the files areautomatically generated based on the options chosen on the First Step. As an example ofhow the name is assigned, Figure 3.7 shows a possible case of this4.

Num. of synchronous connected

Num. of DFIG connected

I/D depending on if the load increases or decreases

Matrix code of Synchronous Selection

Matrix code of DFIG Selection

DFIG power factor

1S_1WT_100LoadI_2_4_1PF.txt

Number of individual loads changed

Figure 3.7 Example of file name, automatically saved

On the figure there are two numbers explained as ’matrix code’ for synchronous/DFIGselection. This is a position code based on the different possibilities of connection for aDFIG. An example of this matrix code is shown on the next section as a way to understandit.

Auto-save

Considering the IEEE 9-bus system, where there are three synchronous generators plus threeDFIG, it has to be defined how the DFIG are implemented.

For example, for implementing a 33.3% of wind turbines there are three different optionsdepending on the location, and each option will make a big difference on the system as the

4When the number of individual loads changed is 100 it means that all of them all changed.

27

Page 44: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

location is completely different and so it is the power generated. Graphically, these threeoptions are shown on Figure 3.8.

Figure 3.8 Three different options of wind energy implementation - IEEE 9-bus system.

Based on this, if the file name would be, for example, 2S_1WT_100LoadI_095PF.txt, itwould say that 2 synchronous generators are connected, 1 DFIG is also connected, all of theloads are increasing, and the power factor of the DFIG is 0.95. However, this could be any ofthe options in Figure 3.8 and this has to be defined somehow. It was found a way to do so,by setting two different matrices (one for synchronous, one for DFIG) with all the possiblecombinations:

𝑺𝒚𝒏𝒄𝒉𝒓𝒐𝒏𝒐𝒖𝒔𝑪𝒐𝒎𝒃𝒊𝒏𝒂𝒕𝒊𝒐𝒏𝒔

𝑂𝑝𝑡𝑖𝑜𝑛𝐶 →𝑂𝑝𝑡𝑖𝑜𝑛𝐵 →𝑂𝑝𝑡𝑖𝑜𝑛𝐴 → ⎣

⎢⎢⎢⎢⎢⎡0 01 0

00

2 0 03 0 01 2 01 3 02 3 01 2 3⎦

⎥⎥⎥⎥⎥⎤①②③④⑤⑥⑦⑧

𝑫𝑭𝑰𝑮𝑪𝒐𝒎𝒃𝒊𝒏𝒂𝒕𝒊𝒐𝒏𝒔

𝑂𝑝𝑡𝑖𝑜𝑛𝐴 →𝑂𝑝𝑡𝑖𝑜𝑛𝐵 →𝑂𝑝𝑡𝑖𝑜𝑛𝐶 →

⎣⎢⎢⎢⎢⎢⎡0 01 0

00

2 0 03 0 01 2 01 3 02 3 01 2 3⎦

⎥⎥⎥⎥⎥⎤①②③④⑤⑥⑦⑧

Each of the indexes next to the matrix represent the matrix code which is saved in the nameof the files. Inside each row of each matrix there are three numbers (as many as genera-tors available) representing the number of the generators connected. Following Figure 3.7, inthat case the codes are 2 for the synchronous selection and 4 for the DFIG selection. Goinginto the rows of the matrices, the combination of synchronous generator for that case was[1 0 0], which means only G1 is connected; for the DFIG matrix, the fourth row corre-sponds to [3 0 0], which means only DFIG3 is connected. Therefore, for this hypotheticalcase there would be no generation at all in the busbar of the G2 or DFIG2.

However, it is worth mentioning that in a small system like this one the possibilities ofconnections are already many (eight, as it is seen on the previous matrix). These possibilitiesincrease exponentially with the number of generators connected, following the next equation:

f(x) = 2n (3.5)

28

Page 45: Impact of Wind Turbines on Power System Stability

3.3. Steps Aalborg University

being ’n’ the number of DFIG implemented.

In this way, a system with 100 generators will have 2100 possibilities of connections, a verylarge number whose possibilities cannot be analysed in a ’normal’ computer. A representationof this function can be seen on Figure ??, on the left for only 10 different generators, and theone on the right representing until 100. Therefore, this process of calculating the matrix andsaving it on the name of the file has been restricted to only 15 generators, and above thisnumber of generators the percentage of generators connected is written instead.

1 2 3 4 5 6 7 8 9 10

Number of generators

0

200

400

600

800

1000

1200

Num

ber

of p

ossi

ble

com

bina

tions

0 20 40 60 80 100

Number of generators

0

2

4

6

8

10

12

14

Num

ber

of p

ossi

ble

com

bina

tions

1029

Figure 3.9 Function representing the number of possible combinations when implementing DFIG ona system.

This approach will define the most important keys of the simulation in the name of the file,allowing a better classification of the files when post processing the data of several differentsimulations.

A final ’.txt’ table is saved, a ’Readme’ file with general written data of the simulations.The initial individual load, as well as the final, together with some information such as thepercentage used for the steps, the number of steps expected, and the number of steps achieved(all of them in case the load flow converges in every case). It automatically saves all thesedata, and asks the user if anything has to be added manually. Such a file could help on havinggeneral information of the simulation without having to process the files.

Although all the codes are on the Appendix, a general diagram of the codes can be observedin Figure 3.10.

29

Page 46: Impact of Wind Turbines on Power System Stability

3. Implementation case of Wind Power in a System

The informationof the system is

saved in files

MATLAB asksthe user aboutthe parameters

to change

These data ischanged on the

systemDIgSILENT runs

Load Flow

MATLAB readsthe results

The data isprocessed andsaved in tables

A list ofsimulation steps

is created

The 'n' step isfinished and next

step starts

Converge?

MATLAB

DIgSILENT

Yes No

The user isasked to save

the data

Are thesteps

finished?

Yes

No

END

Figure 3.10 General diagram of the work flow of the codes.

30

Page 47: Impact of Wind Turbines on Power System Stability

Analysis of the IEEE 9-bussystem 4

4.1 Case study on IEEE 9-bus system

Although the system was briefly introduced in the previous Chapter and described as an eas-ier alternative to the real DK2 system, it is important, before the first calculations, to fullydescribe the system.

As it has been shown on the different Figures of the system, it originally has three syn-chronous generators and three loads, connected in different busbars. The original load of thesystem can be read on Table 4.1.

Table 4.1 Original Loads of the IEEE 9-bus system.

Name Active Power (MW) Reactive Power (Mvar)Load A 125 50Load B 90 30Load C 100 35

Regarding the original generation, it follows Table 4.2, where the active power and the voltageare defined (PV buses) except from the active power of G1, which is the slack bus.

Table 4.2 Original Generation of the IEEE 9-bus system.

Name Active Power(MW)

Reactive Power(Mvar)

Voltage(p.u.)

Base Voltage(kV)

G1 N/A N/A 1.04 16.5G2 163 6,7 1.025 18G3 85 -10,9 1.025 13.8

Besides load and generation, there are three transformers (one per generator) which add upto a total of nine bus in the system, having four voltage levels in total: the ones from Table4.2 plus 230 kV, which is the voltage of the loads and the lines.

The characteristics of the lines, or the details of the generators, loads and transformers arenot considered necessary to be explained here, and therefore they are omitted. The next sec-tions will show the initial results of the different simulations made on the IEEE 9-bus system,considering it as a reference point to later understand the implementation on the real DanishEast System DK2.

31

Page 48: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

4.1.1 First simulations

In this section the initial simulations are explained. This involves a first simulation of theoriginal system (without wind energy penetration) by using the algorithms and a Load change.Once everything is connected, the algorithm will ask to choose the wanted parameters.

Starting from the load, as it is not a real system, it is not well known its design purposeand thus there is not a minimum expected load. Nonetheless, as the simulation here is alearning process, the broader is the load range, the better. Thus, it was decided to start froma very low load equivalent to the original one divided by then, and by a step of 1.1% of theinitial load, to increase until the system does not converge anymore. The initial load, originalload, and the last load before system collapse are shown in Table 4.3.

Table 4.3 Load limits - Original IEEE 9-bus system.

Name Parameter Initial Load Original Load Collapse Load

Load A Active Power (MW) 12.5 125 293.75Reactive Power (Mvar) 5 50 117.5

Load B Active Power (MW) 9 90 211.5Reactive Power (Mvar) 3 30 70.5

Load C Active Power (MW) 10 100 235Reactive Power (Mvar) 3.5 35 82.25

From the table we can clearly see that the original system will be able to operate with aload up to 2.35 times the original load. This does not mean that with such a high load theperformance of the system is reliable, but that the power flow converges. The performance ofthe system on the high load area will be presented later.

Keeping in mind the idea of the implementation of wind energy in the system, the origi-nal system will not be analysed in depth but its results will be always compared with theupcoming simulations. Amongst all the possible simulations on the IEEE 9-bus system, onlya few of them are going to be presented in this thesis, all of them with the same initial loaduntil the system collapses.

These simulations will be depending on several factors:

• Implementation of Options A, B and C, where wind energy is implemented on differentlocations of the system (see Figure 3.8). With the comparison between the three ofthem it will be seen the differences of implementing wind energy on different areas.

• Implementation of wind turbines with different power factors. In order to show howthis influences on the system it will be made on the grid with three DFIG connected.

• Implementation of one, two and three wind turbines; with the purpose of showing howthe difficulties increase on the system when increasing the wind power. Here it will bepicked randomly one of the options of the previous case (A, B or C) as a starting point.

• Implementation of an increasing DFIG power. On the system with three wind turbinesconnected, by increasing the power of the DFIG the power from the synchronousgenerator will be reduced. Comparing it with the simulation where the DFIG power isnot changed will show the influence of this on the synchronous generation.

Analysing these four groups of simulations will be the commencement of a deep understandingof the system and how a useful implementation have to be done in a system.

32

Page 49: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

Implementation in different areas

The first three simulations are all made by connecting two synchronous machines and onewind turbine, without increasing the power of the DFIG and with a constant power factor of1. The difference appears on the configuration of the connections, implementing the DFIG ineach of the three generation busbars.

The results obtained give information about the voltages of every busbar, active and re-active power flow, generated power, and many more data. Therefore, these information hasbeen carefully plotted by using MATLAB scripts with the idea to plot the most relevant andreadable information. A lot of emphasis has been given into making clear and easy to readfigures, since the differences between plots have to be noted straightforward.

Starting with the voltages, even though the system has only 15 busbars (counting the busbarsadded due to the implementation of DFIG) a plot with 15 different lines is difficult to analyseand differentiate between the lines. It gets even more complicated when these 15 busbars areanalysed in three different scenarios, so the solution found was to plot the area covered bythe voltages in each scenario. It is not the most accurate analysis, but it is an easy way tocompare visually the differences between the scenarios, as it can be seen in Figure 4.1.

0 100 200 300 400 500 600 700 800

Load (MVA)

0.65

0.7

0.75

0.8

0.85

0.9

0.95

1

1.05

1.1

1.15

Vol

tage

(p.

u.)

DFIG connected in G3DFIG connected in G2DFIG connected in G1Original System

Figure 4.1 Voltages areas comparison between the three different locations.

A few conclusions based on this Figure can already be obtained. For example, it can beseen that if the wind turbine is connected instead of the generator G1, the system’ area ofoperation becomes very small. For the other two DFIG positions the system can operate ina larger area, very close to the Original System in the case of implementing the wind turbinein G3. This is completely associated with the power delivered by each of the generators,as the biggest generator in the system is G1 (slack bus), while the smallest is G3. Anotherinteresting approach that has to be taken is that the maximum voltage is never below 1.03p.u., and the reason for this is on the slack bus, which is keeping the voltage value at itsbusbar for all the load range.

Apart from that, assuming that the system is wanted to operate with voltages between 1.05p.u. and 0.95 p.u., this area is very similar to the Original System when the DFIG is con-nected in the position of G2 or G3. Thus, from the voltage point of view, an implementationin one of these two nodes would not have a big impact on the system when operating with a

33

Page 50: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

load between 200 and 500 MVA.

It is also relevant from this figure that the system can converge with very low voltages suchas 0.7 p.u.. The busbars with the lowest voltages were always the same for all three cases.

Next to it, the Active and Reactive Power Flow on the system is analysed in Figures 4.2and 4.3 respectively. In this case, as the areas would not give enough information since it isimportant the total amount of power flow, only the area of the Original System is plotted,while the rest of the values are represented by dots.

0 100 200 300 400 500 600 700 800

Load (MVA)

0

100

200

300

400

500

600

Act

ive

Pow

er F

low

(M

W)

DFIG connected in G3DFIG connected in G2DFIG connected in G1Original System

Figure 4.2 Comparison of the active power flow within the implementation in three different areas.

Initially, the first figure shows that the active power flow is similar in the three cases, havingan ’outlier’ that has to be taken into account when looking at the rest of the plots. Generallythe active power flow looks very similar following the expecting, as this active power flowshould increase with the load. Nevertheless, in the first load steps there is a lot of activepower that decreases with the load. The reason for this can be that the load is so low for thesystem and there are a lot of active power losses.

0 100 200 300 400 500 600 700 800

Load (MVA)

0

100

200

300

400

500

600

Rec

tive

Pow

er F

low

(M

var)

DFIG connected in G3DFIG connected in G2DFIG connected in G1Original System

Figure 4.3 Comparison of the reactive power flow within the implementation in three different areas.

This second figure shows a very similar development of the reactive power flowing on thesystem for every scenario. It is noted that before collapse the reactive power increases expo-nentially in some of the busbars.

Before proceeding with the generation is important to remember the indexes presented onthe previous chapter: dP/dV and dQ/dV . Both indexes are also analysed but not plotted

34

Page 51: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

since it is a very noisy graph. However, when zooming in is possible to see changes in thesystem that are also reflected in other graphs. For example, when the power flow is close tozero is reflected on this index. Additionally, if sorted, it gives a list of the busbars very similarto the one of the voltages, with some exceptions.

The most relevant information that can be obtained from here is the sign of the index dQ/dV .When the result of this formula is positive means that both Q and V are either increasing ordecreasing; and if it is negative it means they go on the opposite way. This, translated intovoltage stability means that if the index is positive, the system would be stable and vice versa.

For the power generated, as in this case there are only three generators, it is useful to evaluatethe performance of each generator individually, scenario by scenario. Figure 4.4 represents theactive power generated divided by the three scenarios. Note that only one legend is includedthat covers the three plots, being G1, G2 and G3 just the positions of the generators.

0 100 200 300 400 500 600 700 800Load (MVA)

-200

0

200

400

600

Act

ive

Pow

er (

Mva

r)

DFIG connected in G3

0 100 200 300 400 500 600 700 800Load (MVA)

-200

0

200

400

600

Act

ive

Pow

er (

Mva

r)

DFIG connected in G2

0 100 200 300 400 500 600 700 800Load (MVA)

-200

0

200

400

600

Act

ive

Pow

er (

Mva

r)

DFIG connected in G1

G2 G3 G1 Original System

Figure 4.4 Comparison of the active power generated for each location.

In this Figure it can be observed the importance of the slack bus in the position of G2, as it isthe only generator that increases its power with the load. The other two generators keep itspower constant and equal to the rated active power. It’s so important G2 that it even acts asa motor instead of as a generator, absorbing the excess of active power in the system. This isclearly related to the previous plot of the power flowing in the system (Figure 4.2), relatingthe large amount of active power in the system with a low load to the fact that this generatoris absorbing all these power.

The next Figure shows the reactive power generated by the same generators.

35

Page 52: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

0 100 200 300 400 500 600 700 800Load (MVA)

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

DFIG connected in G3

0 100 200 300 400 500 600 700 800Load (MVA)

0

200

400

600R

eact

ive

Pow

er (

Mva

r)

DFIG connected in G2

0 100 200 300 400 500 600 700 800Load (MVA)

-200

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

DFIG connected in G1

G1 G2 G3 Original System

Figure 4.5 Comparison of the reactive power generated for each location.

As the DFIG power factor for these three scenarios was chosen to be one, Figure 4.5 shows inevery graph there is one generator (that corresponds to the Wind Turbine) with zero reactivepower generated. Once more, when the load is very low, the lines are underloaded generatinga lot of reactive power that is consumed by the synchronous generators.

Finally, the differences on the system losses is analysed, both for active (Figure 4.6) andreactive power (4.7).

0 100 200 300 400 500 600 700 800

Load (MVA)

0

10

20

30

40

50

60

Act

ive

Pow

er L

osse

s (M

W)

DFIG connected in G3DFIG connected in G2DFIG connected in G1Original System

Figure 4.6 Comparison of the active power losses for each location.

Between the options of connecting the Wind Turbine in G2 or G3 there is again not a bigdifference and neither it is with the Original System. Nevertheless, this difference on thelosses is appreciated on the position of the slack bus; but in this case, for a load lower thanaround 300 MVA, there is a favourable difference considering the active power losses are lowerin this case. After this point, the active power losses become much higher in this scenario.

36

Page 53: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 100 200 300 400 500 600 700 800

Load (MVA)

-200

-100

0

100

200

300

400

500

600

700

Rea

ctiv

e P

ower

Los

ses

(Mva

r)

DFIG connected in G3DFIG connected in G2DFIG connected in G1Original System

Figure 4.7 Comparison of the active power losses for each location.

For the reactive power losses the shape of the figure looks very similar with the same focus,the difference appears on the connection in G1.

In conclusion, the location of the new wind turbine is very determinant and can have alot of influence on the system. If the system is going to operate over a wide range of load,only the option of connecting the DFIG on G3 would be close to the Original System. Apartfrom that, the losses or the voltages would not have a big change with the exception of theextreme loads.

Implementation with different power factors

Considering that the wind turbines implemented are DFIG, which have a considerable reac-tive power capability, it is interesting to analyse the system with different power factors bothinductive and capacitive. Apart from this, the simulations are considered having one windturbine and two synchronous machines connected. In this case the wind turbine is connectedin G2, which is the one that had the second best results of the previous simulations, and itsrated power does not vary with the load.

Following the same procedure as in the previous simulations, the voltage is analysed hav-ing the different areas covered in Figure 4.8.

0 100 200 300 400 500 600 700 800

Load (MVA)

0.5

0.6

0.7

0.8

0.9

1

1.1

1.2

Vol

tage

(p.

u.)

Power factor 0.95 CPower factor 0.95 IPower factor 0.90 CPower factor 0.90 IPower factor 1.00 IOriginal System

Figure 4.8 Voltages areas comparison for different power factors.

It is observed that the capacitive power factor does not have a good impact, having a collapsein the system with a lower load than when there is an inductive power factor. The plot

37

Page 54: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

contains several spikes and voltage drops which are very interesting to analyse as there arecases where the system is working with at least one busbar with a voltage close to 0.5 p.u..With the purpose of clarifying this, a second plot that represents the voltage in each busbaris represented in Figure 4.9.

0 100 200 300 400 500 600 700 800

Load (MVA)

0.5

0.6

0.7

0.8

0.9

1

1.1

1.2

Vol

tage

(p.

u.)

Power factor 0.95 CPower factor 0.95 IPower factor 0.90 CPower factor 0.90 IPower factor 1.00 I

Figure 4.9 Busbar Voltages comparison for different power factors.

In this second figure the detail of the voltages busbar by busbar determines that the spikesthat happen with PF = 0.9 inductive and PF = 0.95 capacitive, plus the voltage drop withPF = 0.9 capacitive happen in all the busbars of the system at the same time, which couldbe related to some extent with the reactive power.

The way to prove these voltage drops and spikes it is to look at the reactive power flow-ing on the system, as it was analysed on the previous section. Figure 4.10 shows that thedisturbances appear exactly on the same load points for the same simulation, proving therelation between the voltage and the reactive power flowing. The active power flowing on thesystem is not analysed in depth as it naturally increases with the load.

0 100 200 300 400 500 600 700 800

Load (MVA)

0

100

200

300

400

500

600

Power factor 0.95 CPower factor 0.95 IPower factor 0.90 CPower factor 0.90 IPower factor 1.00 IOriginal System

Figure 4.10 Reactive Power Flow - Comparison for different power factors.

Following the relation between these two variables, the reactive power produced by each ofthe generators is plotted in Figure 4.11 for each of the power factors.

38

Page 55: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 200 400 600 800

Load (MVA)

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

Power factor 0.95 C

0 200 400 600 800

Load (MVA)

-200

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

Power factor 0.95 I

0 200 400 600 800

Load (MVA)

-200

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

Power factor 0.90 C

0 200 400 600 800

Load (MVA)

-200

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

Power factor 0.90 I

0 200 400 600 800

Load (MVA)

0

200

400

600

Rea

ctiv

e P

ower

(M

var)

Power factor 1.00 I

G1 G2 G3 Original System

Figure 4.11 Reactive Power Generation - Comparison for different power factors.

Recalling that the DFIG is connected in G2 (orange plot), it is relevant to see the differenceson this generator between the different power factors. As one would expect, the generator ab-sorbs reactive power when the power factor is capacitive, while generates when it is inductive.Besides that, here the spikes can be noticed again and they suppose an increase or decreasein the reactive power generated by the synchronous generators.

With the purpose of finding the reason of these fluctuations, the reactive power losses arerepresented in Figure 4.12, in this case without the showing the losses of the Original System.

0 100 200 300 400 500 600 700 800

Load (MVA)

-150

-100

-50

0

50

100

150

200

250

Rea

ctiv

e P

ower

Los

ses

(Mva

r)

Power factor 0.95 CPower factor 0.95 IPower factor 0.90 CPower factor 0.90 IPower factor 1.00 I

Figure 4.12 Reactive Power Losses - Comparison for different power factors.

The reactive losses appear to be very similar for inductive power factors whichever value theyhave; and the same occurs with the capacitive power factors. The fluctuations are reflected

39

Page 56: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

as load points with very high reactive losses whose origin is still unknown. As a continuationof this analysis the active power losses are shown on Figure 4.13.

0 100 200 300 400 500 600 700 800

Load (MVA)

4

6

8

10

12

14

16

18

20

22

24

Act

ive

Pow

er L

osse

s (M

W)

Power factor 0.95 CPower factor 0.95 IPower factor 0.90 CPower factor 0.90 IPower factor 1.00 I

Figure 4.13 Active Power Losses - Comparison for different power factors.

Once found that these points also appear on the active power losses, the simulations wereanalysed once more until it was found the origin of these outliers. Just before the load flowdoes not converge anymore, the transformers on the system got instantly overloaded from100% of its rated power to almost 200%. This leads to an increment on the losses, and thegenerators and lines get overloaded too, ending up in a collapse of the system.

All of these analyses for different power factors show that inductive power factors inducelower active power losses, more stable voltage levels and a broader load range to operate thancapacitive power factors.

Implementation of several wind turbines

Here the implementation of wind turbines will increase gradually, showing the differencesbetween 1 Wind Turbine 2 Synchronous Generators, 2 Wind Turbines 1 Synchronous Gen-erator, and 3 Wind Turbines 1 Synchronous Generator1. The first wind turbine is connectedin G2 with a power factor equal to 1, and the power capacity is not increased with the load.When having all the wind turbines connected, the synchronous generator that is going to beconnected is G1.

Once again the first thing is to take a look at the voltages of the different scenarios, rep-resented in Figure 4.14.

1Remember that the program needs a synchronous generator to be running for having load flow on thesystem.

40

Page 57: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 100 200 300 400 500 600 700 800

Load (MVA)

0.6

0.7

0.8

0.9

1

1.1

1.2

1.3

Vol

tage

(p.

u.)

1 DFIG and 2 Syn2 DFIG and 1 Syn3 DFIG and 1 SynOriginal System

Figure 4.14 Voltages Areas - Comparison for gradual wind turbine increment.

Noteworthy is the relatively high voltage for low load, being higher than in previous analyses.Also, in contrast to what it is expected, the system can perform over a wider range of loadswhen three wind turbines are connected than when only two are connected. The reason forthis is that the installed power is higher when having three wind turbines, since also the syn-chronous generator G1 is connected. Beyond that, there is nothing in particular that shouldbe analysed in detail from this plot.

Regarding the reactive power flow, nothing relevant is observed on Figure 4.15.

0 100 200 300 400 500 600 700 800

Load (MVA)

0

100

200

300

400

500

600

Rec

tive

Pow

er F

low

(M

var)

1 DFIG and 2 Syn2 DFIG and 1 Syn3 DFIG and 1 SynOriginal System

Figure 4.15 Reactive Power Flow - Comparison for gradual wind turbine increment.

It is very appealing to take a look at the reactive power produced generator by generator ineach of the three cases, because of the gradual increment. This is therefore represented inFigure 4.16.

41

Page 58: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

0 200 400 600 800

Load (MVA)

-100

0

100

200

300

400

500

600

Rea

ctiv

e P

ower

(M

var)

1 DFIG and 2 Syn

0 200 400 600 800

Load (MVA)

-100

0

100

200

300

400

500

600

Rea

ctiv

e P

ower

(M

var)

2 DFIG and 1 Syn

0 200 400 600 800

Load (MVA)

-100

0

100

200

300

400

500

600

Rea

ctiv

e P

ower

(M

var)

3 DFIG and 1 Syn

G1

G2

G3

G1

Original System

Figure 4.16 Reactive Power Generation - Comparison for gradual wind turbine increment.

A first consideration when looking at this plot has to be taken into account: there are twolabels in the legend with the name ’G1’; this is just a position of a generator, and in this casewhen 3 DFIG and 1 Synchronous are connected there will be two generators in the positionof G1, the DFIG in purple and the synchronous in blue. Leaving this consideration aside andgiven that the power factor is equal to 1, the reactive power generated has to be kept by onlyone synchronous generator in two of the cases.

In respect of the total active power losses, Figure 4.23 shows that the lowest losses are achievedwhen having 2 DFIG connected plus 1 synchronous machine.

0 100 200 300 400 500 600 700

Load (MVA)

2

4

6

8

10

12

14

16

18

Act

ive

Pow

er L

osse

s (M

W)

1 DFIG and 2 Syn2 DFIG and 1 Syn3 DFIG and 1 Syn

Figure 4.17 Active Power Losses - Comparison for gradual wind turbine increment.

The reactive power losses do not show a big difference between the three options as it can beappreciated on Figure 4.24.

42

Page 59: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 100 200 300 400 500 600 700

Load (MVA)

-150

-100

-50

0

50

100

150

Rea

ctiv

e P

ower

Los

ses

(Mva

r)

1 DFIG and 2 Syn2 DFIG and 1 Syn3 DFIG and 1 Syn

Figure 4.18 Reactive Power Losses - Comparison for gradual wind turbine increment.

Summarising, implementing wind turbines without reactive power capabilities seem to limitthe system to a small load range. Regarding the losses, no conclusions can be obtained basedon this analysis.

Implementation with an increasing power

As it has been stated several times, it is not possible to run the system with 100% of DFIGand a synchronous generator is needed to some extent. In order to make the contributionof this synchronous generator the smallest possible, the proposed solution is to gradually in-crease the capacity of the wind turbines together with the load. The impact of this change isanalysed in this section.

The scenarios analysed are with 3 wind turbines connected with a power factor of 1, andthe synchronous machine connected in G1. As in previous sections, the first analysis is madeon the voltage. The differences between the two possibilities is shown in Figure 4.20.

0 100 200 300 400 500 600 700 800

Load (MVA)

0.6

0.7

0.8

0.9

1

1.1

1.2

1.3

Vol

tage

(p.

u.)

Increasing PowerNOT Increasing PowerOriginal System

Figure 4.19 Voltages Areas - Comparison for wind power increment.

Concerning the voltage, when the power is increased, the system instead of improving it getsworse, having an area of operation that is smaller than when the power is not increased.

The differences between these two options are noted in the active power flow for each singlebusbar, as it can be seen on Figure 4.20.

43

Page 60: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

0 50 100 150 200 250 300 350 400

Load (MVA)

0

50

100

150

200

Act

ive

Pow

er F

low

(M

W)

Increasing Power

0 50 100 150 200 250 300 350 400 450

Load (MVA)

0

50

100

150

200

250

300

Act

ive

Pow

er F

low

(M

W)

NOT Increasing Power

Bus 1 Bus 10 Bus 11 Bus 2 Bus 3Bus 4 Bus 5 Bus 6 Bus 7 Bus 8Bus 9 LV LV(1) LV(2) LV(3)

Figure 4.20 Active Power Flow - Comparison for wind power increment.

When the power is incremented on the turbines it makes the whole system to increment thepower flow, busbar by busbar. The biggest change from one option to the other is on thereduction of power delivered by the synchronous generator, which in Figure 4.21 is representedin terms of active power.

0 50 100 150 200 250 300 350 400

Load (MVA)

-50

0

50

100

150

200

Act

ive

Pow

er (

Mva

r)

Increasing Power

0 50 100 150 200 250 300 350 400 450

Load (MVA)

-300

-200

-100

0

100

200

Act

ive

Pow

er (

Mva

r)

NOT Increasing Power

G1G2 DFIGG3 DFIGG1 DFIG

Figure 4.21 Active Power Generated - Comparison for wind power increment.

Following the desired goal, the power delivered by the synchronous generator is very close tozero, having an almost 100% of wind energy implementation. On the other hand, the reactivepower generated is defined in Figure 4.22.

44

Page 61: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 50 100 150 200 250 300 350 400

Load (MVA)

-200

-150

-100

-50

0

50

100

150

Rea

ctiv

e P

ower

(M

var)

Increasing Power

0 50 100 150 200 250 300 350 400 450

Load (MVA)

-100

-50

0

50

100

150

200

Rea

ctiv

e P

ower

(M

var)

NOT Increasing Power

G1G2 DFIGG3 DFIGG1 DFIG

Figure 4.22 Reactive Power Generated - Comparison for wind power increment.

The reactive power is absorbed on the first load points and is higher on the case of increasingthe power. This means that there is a need of a device that can absorb all this amount ofreactive power or otherwise the synchronous machine would have to be kept on the system.However, this amount can be reduced or incremented depending also on the power capabilitiesof the wind turbine.

The last observation is made on the losses, both active (Figure 4.23) and reactive (Figure4.24). The active power losses are largely reduced when the power of the turbine is increasedwith the load; the reactive power losses are almost in all the load range below zero, and thescenario of the power increased is even lower.

0 50 100 150 200 250 300 350 400 450

Load (MVA)

2

3

4

5

6

7

8

9

10

11

Act

ive

Pow

er L

osse

s (M

W)

Increasing PowerNOT Increasing Power

Figure 4.23 Active Power Losses - Comparison for wind power increment.

45

Page 62: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

0 50 100 150 200 250 300 350 400 450

Load (MVA)

-180

-160

-140

-120

-100

-80

-60

-40

-20

0

20

Rea

ctiv

e P

ower

Los

ses

(Mva

r)

Increasing PowerNOT Increasing Power

Figure 4.24 Reactive Power Losses - Comparison for wind power increment.

With all these, it can be concluded that the technique used to have a synchronous machine withpower close to zero is possible, but makes the system weaker. Thus, it has to be complementedwith other devices such as filters, or changing the power factor of the wind turbines.

4.1.2 Voltage Dependency of the Loads

This is a topic that has not been introduced until now but it could be relevant an analysis. Itis a very interesting topic related to the simulation software DIgSILENT. PowerFactory usesEquations 4.1 and 4.2 for a voltage dependency of the loads:

P = P0

(aP ·

(v

v0

)e_aP

+ bP ·(

v

v0

)e_bP

+ (1− aP − bP ) ·(

v

v0

)e_cP)

(4.1)

where,

cP = (1− aP − bP )

Q = Q0

(aQ ·

(v

v0

)e_aQ

+ bQ ·(

v

v0

)e_bQ

+ (1− aQ− bQ) ·(

v

v0

)e_cQ)

(4.2)

where,

cQ = (1− aQ− bQ)

By choosing the exponents eaP , eaQ, ebP and so on, the behaviour of the system can bedifferent. For example, if the values are 0, 1 or 2, they are related to a constant power,constant current or constant impedance behaviour, respectively [33]. The coefficients aP , bP ,aQ and bQ are freely chosen in order to give more or less impact to any of the parts of theequations.

This analysis will show the impact of changing this variables that usually are not changed ina model. It is therefore important to take a look at the first row of Table 4.4, which showsthe original exponents that correspond to Equations 4.1 and 4.2.

Table 4.4 List of exponents for the voltage dependency of loads.

Exponent e_aP e_bP e_cP e_aQ e_bQ e_cQInitial Value 0 0 1,6 0 0 1,8Final Value 0 0 1 0 0 1

46

Page 63: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

The other parameters missing are the ones of Table 4.5:

Table 4.5 List of coefficients for the voltage dependency of loads.

Coefficients aP bP cP aQ bQ cQInitial Value 0 0 1 0 0 1Final Value 0 0 1 0 0 1

By following these tables the active power equation of the original system results as follows:

P = P0

(0 ·(

v

v0

)0

+ 0 ·(

v

v0

)0

+ 1 ·(

v

v0

)1,6)

(4.3)

then,

P = P0 ·v1,6

v01,6(4.4)

while the reactive power, results as:

Q = Q0

(0 ·(

v

v0

)0

+ 0 ·(

v

v0

)0

+ 1 ·(

v

v0

)1,8)

(4.5)

then,

Q = Q0 ·v1,8

v01,8(4.6)

On the other hand, after the modification shown on Tables 4.4 and 4.5 the dependency onthe voltage changes to:

P = P0 ·v1

v01; Q = Q0 ·

v1

v01(4.7)

Note that the values are modified in all the loads at the same time. The parameters havebeen chosen so that there is not a big change on the equations and therefore the impact onthe system is unknown.

The results of these simulations shown that the impact of this exponents were insignificanton the system, making no appreciable differences in any of the plots.

4.1.3 General Comparison

After all the simulations have been performed and analysed on the previous sections, it is alsoimportant to compare all of them together and look into the results with another perspective.The created algorithm saves a large amount of data to be observed after the simulations, andsome of this data is not extracted directly from DIgSILENT, but modified in MATLAB. Thisincludes data related to the maximum loading of a line, transformer, generator, but also thenumber of busbars or transformers with a voltage or loading higher than some value. To beclear, makes the analysis simpler but less detailed, limiting the analysis to one variable thatrepresents a group of variables (e.g. the number of busbars above 1.05 p.u. instead of all thevoltages of every busbar). In this way, it is possible to compare all the analyses done untilnow in the same figure and obtain conclusions.

47

Page 64: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

As an starting point, Figure 4.25 shows the load before collapse in 15 different cases, in-cluding the ones done before.

One D

FIG C

onne

cted

in 3,

2 S

yn

1 DFIG

& 2

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P

1 DFIG

& 2

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P (2

)

1 DFIG

& 2

Syn

Con

necte

d, P

F=0.9

5C, N

OT Incr

easin

g P

1 DFIG

& 2

Syn

Con

necte

d, P

F=0.9

5I, N

OT Incr

easin

g P

1 DFIG

& 2

Syn

Con

necte

d, P

F=0.9

0C, N

OT Incr

easin

g P

1 DFIG

& 2

Syn

Con

necte

d, P

F=0.9

0I, N

OT Incr

easin

g P

1 DFIG

& 2

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P (3

)

1 DFIG

& 2

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P (4

)

2 DFIG

& 1

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P

3 DFIG

& 1

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P

3 DFIG

& 1

Syn

Con

necte

d, P

F=1.0

0I, I

ncre

asing

P

3 DFIG

& 1

Syn

Con

necte

d, P

F=1.0

0I, N

OT Incr

easin

g P (5

)

Origina

l Sys

tem

- Lo

ad D

epen

denc

y Cha

nged

Origina

l Sys

tem

0

200

400

600

800

Figure 4.25 Maximum Apparent Power before system collapse.

Here it can be seen that the original system is the one that can operate over a wider range,as it was found on the previous analyses. Apart from that, the ones that can operate close tothe same range are the ones where only one wind turbine is connected and the power factoris either 1 or inductive. On the other side, the range is much smaller when more DFIG areconnected and the power factor is capacitive. Note that some of the labels of the columnsinclude a number in parenthesis, which just means that are different configurations of thesame conditions, meaning the connections of the turbines are in different positions.

Another thing that is clarified when comparing all the simulations is that in every case thenumber of busbars with a voltage below 0.95 p.u. is almost constant until the collapse. Beforethe collapse this number increases abruptly in most of the considered scenarios as Figure 4.26shows. This could therefore be a signal that the system is close to the collapse when thisnumber increases.

0 100 200 300 400 500 600 700 800Load (MVA)

0

2

4

6

8

10

12

Num

ber

of b

usba

rs

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.26 Number of busbars with a voltage below 0.95 p.u..

The opposite occurs with the number of busbars above 1.05 p.u., which decreases with theload. The increase of the loading of lines, transformer and generators was also found onprevious sections to be a possible symptom of a load close to the collapse. With this on mind,

48

Page 65: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

Figure 4.27 presents a comparison of the maximum loading of the transformers for each ofthe cases.

0 100 200 300 400 500 600 700 800

Load (MVA)

50

100

150

200

250

300

Tra

nsfo

rmer

Loa

ding

(%

)

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.27 Maximum Loaded Transformer.

Not in every case, but in some of the cases the transformers which had an almost constantloading with the load, rapidly increase until the collapse occurs.The loading of the lines is also represented in Figure 4.28, showing a completely differentshape. The lines never keep the same loading for several scenarios, but are in a constantchange.

0 100 200 300 400 500 600 700 800

Load (MVA)

10

20

30

40

50

60

70

80

90

100

110

Line

Loa

ding

(%

)

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.28 Maximum Loaded Line.

Lastly, the loading of the generators is checked in Figures 4.29 and 4.30, for synchronousgenerators and DFIG, respectively.

49

Page 66: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

0 100 200 300 400 500 600 700 800Load (MVA)

0

50

100

150

200

Syc

hron

ous

Gen

erat

or L

oadi

ng (

%) One DFIG Connected in 3, 2 Syn

1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.29 Maximum Loaded Synchronous Generator.

Nothing related to the collapse can be observed from this graph, but it is interesting to pointout that the least loaded generation occurs when more wind turbines are connected.

0 100 200 300 400 500 600 700 800Load (MVA)

88

90

92

94

96

98

100

DF

IG G

ener

ator

Loa

ding

(%

)

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.30 Maximum Loaded Wind Turbine.

Regarding the wind turbines, the loading is kept constant in every case excepting when thepower factor is inductive, in which turbines the loading increases with the load. For thecapacitive power factor, the loading does not vary much but is higher than when the powerfactor is 1.

Finally, it is important also to compare the losses of all the configurations. Figure 4.31indicates the active power losses for each of the scenarios.

0 100 200 300 400 500 600 700 800Load (MVA)

0

5

10

15

20

25

30

35

Act

ive

Pow

er L

osse

s (M

W)

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal SystemOriginal System

Figure 4.31 Active Power Losses.

The active power losses do not vary much in general, tough is worth mentioning that thesmallest ones are with power factor equal to 1.Figure 4.32 plots the reactive power losses of the same simulations.

50

Page 67: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

0 100 200 300 400 500 600 700 800Load (MVA)

-200

-100

0

100

200

300

400

Rea

ctiv

e P

ower

Los

ses

(Mva

r)

One DFIG Connected in 3, 2 Syn1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (2)1 DFIG & 2 Syn Connected, PF=0.95C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.95I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90C, NOT Increasing P1 DFIG & 2 Syn Connected, PF=0.90I, NOT Increasing P1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (3)1 DFIG & 2 Syn Connected, PF=1.00I, NOT Increasing P (4)2 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, Increasing P3 DFIG & 1 Syn Connected, PF=1.00I, NOT Increasing P (5)Original System - Load Dependency ChangedOriginal System

Figure 4.32 Reactive Power Losses.

Although all over most of the load the reactive losses are very similar, it is very spread in thebeginning of the graph until the load is around is 300 MVA. At this point most of the scenarioshave the same amount of losses. This point is very relevant since at this point the loading ofthe synchronous machines is also the lowest (Figure 4.29). Following these arguments, thisload could be the optimal load for which the system has the best performance, even if somechanges are made. It is actually pretty related to the original load of the system, calculatedfrom 4.3.

S = P+j ·Q = (125+90+100)+j ·(50+30+35) = 315+j ·115 = 335.34∠20.06◦MVA (4.8)

Statistics

Finally, there are several statistics that can be obtained based on the simulations that havebeen made. With the help of the statistics it is possible to see more tendencies on the systemand find the weakest areas. These statistics are based on the data saved by the algorithm,focusing on the names of the busbars, lines and transformers.

It is essential to look at, for example, the line with the maximum loading of the systemat each load point. Combining all the scenarios and looking at the distribution gives an ideaof how the power flows through the system. Consequently, Figure 4.33 shows the distributionof the line with the maximum loading for all the previous simulations.

Line

1

Line

2

Line

3

Line

4

Line

60

200

400

600

800

1000

1200

1400

Num

ber

of ti

mes

Figure 4.33 Most Loaded Line - Distribution.

From the Figure it is clear that there are two lines that are the most loaded for every scenarioand load. Line 2 is by far the most loaded line for most of the simulations, and right after itcomes Line 1 but it is already the most loaded line only a half of the times. This covers allthe load steps that have been analysed, but it is also important to look only at the momentof collapse, shown in Figure 4.34.

51

Page 68: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

Line

1

Line

2

0

2

4

6

8

10

12

Num

ber

of ti

mes

Figure 4.34 Most Loaded Line before Collapse - Distribution.

This plot shows the distribution of the most loaded line in each of the simulations when run-ning load flow only at the last load point, right before the system collapses (and the load flowdoes not converge anymore). As it can be seen, the line with the highest loading most timeswas not Line 2 but Line 1. The conclusion here is that although throughout all the range ofloads Line 2 was the most loaded line, on the moment of collapse this position correspondsto Line 1. Nevertheless, before collapse neither Line 3, nor Lines 4 and 6 were never themost loaded, meaning that these lines can be discarded from the weakest areas. Once thestatistical analysis is finished the areas will be represented in a map of the grid.

Concerning the transformers, it is a little bit different from the lines. This is because sometransformers are connected between the whole system and the generators, so when a genera-tor is disconnected it will also be disconnected the transformer. However, taking a look intoFigure 4.35 with this considerations gives another interpretation of the results.

T1

Tr_G1_

DFIG

Tr_G2

Tr_G3

Tr_G3_

DFIG0

200

400

600

800

1000

Num

ber

of ti

mes

Figure 4.35 Most Loaded Transformer - Distribution.

Following these indications and looking at the plot it is difficult to obtain some conclusions,since the transformers Tr_G1_DFIG and Tr_G3_DFIG are not always connected and there-fore its impact is distorted. Moreover, the transformers that appear on the graph are on threedifferent areas, so it is difficult to determine any result.

The voltages are also analysed statistically and will help to find the weakest busbars of thesystem. Based on the previous analysis, the maximum voltage of the system will never bevery low as the slack bus will keep it high. As a result of this, the maximum voltage is notanalysed and thus the minimum voltage will be analysed. To do so, Figure 4.36 representsthe distribution of the minimum voltages for every load flow analysis.

52

Page 69: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

Bus 1

1Bus

2Bus

5Bus

6Bus

8 LVLV

(2)

0

200

400

600

800

1000

1200

Num

ber

of ti

mes

Figure 4.36 Minimum Voltage - Distribution.

In this graph there is clearly one busbar that is much more repeated than the rest, Bus 5,and there are two more busbars that are repeated about a third of Bus 5, Bus 11 and LV.The next step is to look at the busbars with the maximum load before the collapse, to seeif there is any relation between them. The distribution before the collapse is represented inFigure 4.37.

Bus 5

Bus 6

Bus 8

LV(3

)

0

2

4

6

8

Num

ber

of ti

mes

Figure 4.37 Minimum Voltage before Collapse - Distribution.

Again, Bus 5 leads the number of times in which is the busbar with the lowest voltage ofthe system, meaning that it is quite representative. On the contrary, Bus 11 and LV do notappear on this plot, which means that these busbars are not decisive on the moment of collapse.

Furthermore, in some cases the voltage of a busbar does not change with the load (e.g.a generator keeps it) and therefore its voltage could not be representative of a weakness. Bytaking out the busbars in which the voltage does not change from step to step, the distributionof the minimum voltages is plotted in Figure 4.38 showing the differences with Figure 4.36.

53

Page 70: Impact of Wind Turbines on Power System Stability

4. Analysis of the IEEE 9-bus system

Bus 1

1Bus

2Bus

4Bus

5Bus

6Bus

7Bus

8Bus

9 LVLV

(2)

LV(3

)0

200

400

600

800

1000

1200

1400

Num

ber

of ti

mes

Figure 4.38 Minimum Changing Voltage - Distribution.

This plot reveals what it was expected, Bus 5 is again on top of the list and this time withmore advantage to the next one. Some emphasis should be given to the fact that the busbarBus 11 almost looses its importance in this graph.

Now that the analysis has been concluded, Figure 4.39 shows a map of the grid with somedetail on the areas that have been discussed until now. Thereby is possible to make anassociation of the results with the system and obtain the final conclusions.

G~

G ~

G~G~

G ~

G~

Tr_G2

Tr_G2_..

G2_

DFI

G_6

MW

Tr_G3_DFIG

G3_

DFI

G_2

.5M

W

Tr_G

..

G1_DFIG_2...

Tr_G

1

Load A

Line

1

Line

6

G1

Line

5

Load B

T3

G3

Line 4

Load

C

Line 3

G2

Line

2

LV(3

)

LV(2

)

LV(1)

Bus

11

Bus 1

Bus

7

Bus 5

Bus 4

Bus 6

Bus

3

Bus

9

Bus

8

Bus

2

Bus 10

Tr_G2

Bus 5

Line 1

Line 2

Figure 4.39 Details of the IEEE-9 bus system

All the analysis lead to the same area of the system, so it can be understood as the weakestarea of the system. The busbar which is pointed has a load connected to it. This load corre-sponds to Load A, which is the biggest load of the system.

After looking at all of the results and trying different ways of implementation of wind tur-bines, it has been understood the difficulties of this implementation. It has to be highlightedthe importance of having the reactive power capability on the wind turbines and the results

54

Page 71: Impact of Wind Turbines on Power System Stability

4.1. Case study on IEEE 9-bus system Aalborg University

proof the importance of choosing DFIG for this implementation.

Although the analyses that have been made on this chapter are for a very small system,it is enough to understand the complexity of any power system. Creating the algorithm di-rectly for a big system would have been much more difficult and the insight of the simulationswould not have been understood. The developed algorithm has been validated with theseanalyses and now it can be used for a bigger and more complex system such as the EasternDenmark Power System. Nevertheless, the algorithm can always be improved and it is just ahelp for doing the simulations and getting the results in an organised way, but it is of greatimportance to make the right simulations and comparisons.

On the following chapter the algorithm is used for analysing the Eastern Denmark Trans-mission System.

55

Page 72: Impact of Wind Turbines on Power System Stability
Page 73: Impact of Wind Turbines on Power System Stability

Eastern Denmark PowerSystem 5

In this chapter it is analysed and described the model of the Eastern Denmark ElectricalPower System, also called DK2. This model is based on the prediction from Energinet onhow will it be the EPS in 2020 [34], with the inclusion of some new Wind Farms and somechanges from OHL to cables.

5.1 Introduction to the system

The data obtained from Energinet contains details of the 132/150/400 kV level, including dataabout the substations, lines, transformers, generation and load. With this data was thereforepossible to make a DIgSILENT model in which perform the different simulations. This modelwas made by the company DIgSILENT, which cooperated with the project in order to havethe most accurate model. A map of the expected grid of 2020 can be seen on Figure 5.1.

Figure 5.1 Expected area covered by the DK2 Transmission System in 2020.

It is clearly observed on the Figure that most of the lines are on the top right side, in thearea of Copenhagen, and that also most of the lines are cables instead of OHL, which is thebiggest change that is going to be made on the grid. This can be observed when comparingit with the 2017 model from DIgSILENT 5.2.

57

Page 74: Impact of Wind Turbines on Power System Stability

5. Eastern Denmark Power System

DIgSILE

NT

4 km

DIgSILE

NT

4 km2017 2020

Figure 5.2 2017 vs 2020 system representation in DIgSILENT.

Other particularities of this model are the great amount of sea connections. There are seaconnections on the top to Sweden, on the left to the Western part of the system (DK1), onthe right to the upcoming wind farm Kriegers Flak, on the lower part to some offshore windfarms, and also between the different islands of the area. It is worth mentioning that theinterconnections with Sweden, with DK1, and with Germany through Kriegers Flak cannotbe fully represented and therefore are substituted as nodes.

It is of course not an accurate model and many things can vary for 2020, but as a start-ing point for possible simulations it could be very useful and give an idea of the problems thatmay happen.

In the system there are a total of 132 busbars distributed basically in three voltage lev-els: 400 kV, 232 kV and 132 kV. There are some busbars with a lower voltage that rangesfrom 9 to 21 kV but are minor busbars to which no lines are connected, only generation orloads. These 132 busbars are divided into 101 substations, meaning that most of them haveonly one voltage level.

There are a total of 174 lines, most of them at 232 kV as it can be seen from Figure 5.2.Out of the 174, 142 are cables while only 32 are OHL. Regarding the line distances, 344,18km are OHL (a 14,26% of the total length) and 2068,84 km are cables (85,74% of the totallength). 74 of the lines have more than 10 km of length, and 7 of them are above 50 km,building up a strong and interesting power system to be studied.

Due to the high number of substations with only one voltage level, there are only 33 trans-formers in total in the grid, 5 of them 3-winding transformers and 28 2-winding transformers.

The generation is distributed through 94 different generators, including conventional powerplants1, offshore and onshore wind turbines, gas power plants, hydropower plants and solarpower plants. All together have a total active power of 2109,35 MW, which in reality is com-

1The nature of the power plants is unknown since it is not specifies in the data from Energinet.

58

Page 75: Impact of Wind Turbines on Power System Stability

5.2. Analysis of the 2020 system Aalborg University

plemented by the HVDC connections that add capacity to the system. Also, this generationwill depend on the weather conditions, making it higher or lower.

5.2 Analysis of the 2020 system

Following the procedure described on the previous chapter, the 2020 system can be analysedby doing Power Flow through different loads and see how does it behaves. With the datadownloaded from Energinet [34] it is possible to directly make a Power Flow analysis of thegrid but only for a certain load. As the purpose is to do the analysis over a wide range ofloads within a maximum and a minimum limit, it is necessary to find a possible range.

Apart from the expected 2020 system, it is possible to download from Energinet’s websitethe hourly electricity balance since January 2011 [35]. Even though it is divided by the areasDK1 and DK2 and not load by load, it is useful to look at the historical data of the system.It is possible to see the load distribution over the last eight years, providing a general pictureof how does it change. With the help of tools such as MATLAB or Excel some interestingstatistical results can be obtained to look at typical, possible or hardly common scenarios.

By looking at hardly common scenarios is possible to find the load limits for the later analysis.In statistics, the mean is used to see the average value of a set of data, the mode is used toknow the most common value, and the median is used to get the middle value that dividesthe data set into two halves: one with the highest numbers and the other one with the lowestones. However, none of these indexes give an idea of how the data is distributed, and themost common way to see the distribution is to plot the data. In a big database working witha plot of all the data is not very comfortable and therefore the statistical quartiles are usuallyused.

A quartile divides the data with three points forming four different groups of data. Eachof this quartiles is called first, second (or median) and third quartile: Q1, Q2 and Q3 re-spectively. As the median (Q2) was dividing the data into two groups with the lowest andhighest values, Q1 makes the same with the 25% of the lowest values, and Q3 with the25% of the highest values (leaving the 75% of the lowest values below this point). Thus, eachof the four groups contains a 25% of the values and the quartile is the point that divides it [36].

Although this is still not very representative of the distribution of the data it already cangive a very general picture of how the data is distributed. With this concepts it is possible todraw a boxplot which can be complemented with some other concepts like the whiskers andthe extreme values. A boxplot consists on a graphical representation of the quartiles Q1, Q2and Q3; and it is usually drawn with ’whiskers’, another two lines representing a superior andan inferior limit. These whiskers are calculated as Maximum = Q3 + 1, 5 ∗ (Q3 − Q1) andMinimum = Q1− 1, 5 ∗ (Q3−Q1). Additionally, the outliers can be represented and are thevalues above the Maximum or below the Minimum.

As the data from Energinet is available since 2011 until now, it was decided to make aboxplot for every year. The reason for this is that the demand shape is very similar from yearto year but it could show a tendency of increasing or decreasing demand. Also, the possibilityto show the outliers is very useful to realise if a very high (or very low) value is common inthe data set or not. Therefore, Figure 5.3 shows a boxplot of every year since 20112.

2Note that when this report was written the year 2019 was not finished and it is therefore notrecommendable to compare this measurement with the ones of previous years.

59

Page 76: Impact of Wind Turbines on Power System Stability

5. Eastern Denmark Power System

Figure 5.3 Yearly boxplot of the consumption in the area of DK2.

Based on this plot several observations can be made; for example, the median and the lowestvalues of each year are very similar, which means the hour with the lowest consumption isnever lower than around 900 MWh and is always around the same value. On the other side,when looking at the highest values here there is a variation. This variation is not much re-flected on the Q1 and Q3 (represented by the blue box), but it is represented on the maximumwhiskers and the outliers. It seems that having hours with a consumption of over 2400 MWh isvery unlikely and also looks like the consumption instead of increasing is decreasing a little bit.

Following this, the upper and lower limits of load for the simulations are established as 800MWh and 2600 MWh: values never achieved but possible options in an hypothetical extremescenario. It is important to remember that these limits are just a reference for the simulationsand are useful to see how the system behaves between these values, and what would happenif the load is out of them.

Nevertheless, the picked values belong to the whole area of DK2, and are not divided load byload. The proposed idea to implement it consists on dividing the total load by each individualload in the same way as it is divided on the data of the 2020 system from Energinet. This isnot proof to be the best configuration, but is the only one for which any data is available.

Starting with the model of 2020 from Energinet, the total active load of DK2 of this sys-tem is 2071 MW, while the total reactive load assigned is 537 Mvar. The distribution is notthe same for each individual load and neither it is the power factor, having in some of theloads a capacitive load (negative reactive power). It is notable that the load of this systemis between the expected one from the boxplots of Figure 5.3, perhaps a little bit high as it isnot represented inside any of the boxes, but the criteria of that load is unknown. The powerfactor of the total load is around 0,97, and therefore the new load limits for the reactive powerwill be:

Qmin = Pmin ∗ tan(arccos(PF )) = 800 ∗ tan(arccos(0.97)) = 207, 5 Mvar (5.1)

Qmax = Pmax ∗ tan(arccos(PF )) = 2600 ∗ tan(arccos(0.97)) = 674, 38 Mvar (5.2)

which are splited into a total of 63 loads.

60

Page 77: Impact of Wind Turbines on Power System Stability

5.3. Problems on the system Aalborg University

5.2.1 Distribution of Load and Generation

A representation of how the load and the generation is distributed geographically could beuseful for getting an idea of how the power is transmitted into the different areas. This hasbeen done using a similar method to the ’per unit’ method, with a base power that will de-termine the size of the markers that will then appear in a map. In such manner, the biggestgenerators or loads will have a bigger marker, while the smaller ones will be smaller in the map.

It is important to note that the marker size is not always proportional since it has beenlimited. Thus, if the generator or load power is lower than 1 MW the marker will have thesame size no matter which is the power; otherwise the markers would be so small that wouldnot be appreciated on the map of Figure 5.4.

0 200 400 600 800 1000 1200 1400 1600

0

200

400

600

800

1000

1200

1400

1600

1800

GenerationLoad

Figure 5.4 Eastern Denmark Map - Distribution of Load and Generation.

Following the expected, most of the spots are in the area of Copenhagen, in which also someof the biggest generation points are. The biggest generation point is not in this area but inthe middle of the sea, though. This big generation spot is not an offshore wind farm and itrepresents the interconnection with Sweden.

5.3 Problems on the system

The system has a lot of information missing such as isolated transformers or substations. Dueto a lack of information, these kind of problems cannot be solved and the system has beenleft with the original information. For example, most of the synchronous generators are setwith a reactive power equal to zero, which is not the expected.

Besides these problems and the uncertain information, it is essential to mention that in these

61

Page 78: Impact of Wind Turbines on Power System Stability

5. Eastern Denmark Power System

original conditions the system can be operated and its load flow converges.

The system’s generation and load rated power and positions on the map have been com-mented, and also the different voltage levels or the number of lines that constitute the wholesystem. In addition to these components, there are also a total of 27 different filters on thesystem, all of them R-L filters. All of them together represent a total installed power of2307.13 Mvar, which are variable since some of them have different steps.

Lastly, there are 6 station controls, all of them used to control the voltage in 6 differentsubstations. The station controls are commanded by synchronous generators that will laterbe replaced by wind turbines. When replaced, the control will not be possible anymore, soanother problem appears here. This problem has been solved by creating a new station controlthat controls the reactive power on the same substation.

5.4 Implementation of Wind Energy

The implementation of wind energy for the Eastern Denmark System follows the same proce-dure as for the IEEE 9-bus system, with some differences. It is worth remembering that thisimplementation does not suppose a real implementation, but a way to analyse a system andmany more considerations would have to be taken into account when doing a real and reliableanalysis. These factors have not been taken into account due to data and time limitations asit is explained in section 1.7.

Understanding this, most the power plants have been replaced by DFIG Wind power plants.However, as this is a tedious work and there are a total of 109 generators connected in thegrid, the generators with a power lower than 100 kW are not replaced, since its impact is verylow in the system. These generators constitute 35 of the total number of generators, of whichonly 8 are not wind farms.

Also, in order to make the wind implementation more real, it is meaningful to take a look atthe Danish Technical Regulations for wind power plants above 11 kW [22]. In this grid codethe wind power plants are divided into four different categories depending on the total ratedpower in the point of connection:

• A2. Plants above 11 kW up to and including 50 kW.• B. Plants above 50 kW up to and including 1.5 MW.• C. Plants above 1.5 MW up to and including 25 MW.• D. Plants above 25 MW or connected to over 100 kV.

Following this categorisation, our system comprises of 22 generators of Category B, 32 gener-ators of Category C, and 12 generators of Category D3.

Depending on these categories the technical regulations are various, but this report will onlyattend to the reactive power capabilities, since they will have an influence on the power flow.Each of the categories have assigned some requirements for the delivery of the reactive powerin relation to the active power level at UC . These requirements are again defined in theTechnical Regulations [22] by the graphs on Figure 5.5.

3Observe that the consideration of voltage over 100 kV is not considered as this system represents atransmission system and the power plants’ connection points are not known.

62

Page 79: Impact of Wind Turbines on Power System Stability

5.5. System Possibilities Aalborg University

0.5 1

P/Pn

-0.1

-0.05

0

0.05

0.1Q

/Pn

Category B

0.5 1

P/Pn

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

Q/P

n

Category C

0.5 1

P/Pn

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

Q/P

n

Category D

Figure 5.5 Requirements for the delivery of reactive power in relation to the active power level atUC on the different used categories

Apart from this, a second requirement regarding the voltage takes also importance in theCapability curve of the DFIG. This is specified in the Technical Regulations and representedin Figure 5.6.

-0.4 -0.2 0 0.2 0.4Q/P

n

0.85

0.9

0.95

1

1.05

1.1U

POC (p.u.)

Category C

-0.4 -0.2 0 0.2 0.4Q/P

n

0.85

0.9

0.95

1

1.05

1.1U

POC (p.u.)

Category D

Figure 5.6 Requirements for the delivery of reactive power in relation to UC on the different usedcategories.

As it can be observed, for category B there is not voltage specification.

5.5 System Possibilities

The Eastern Denmark Transmission System has been described as a very large and complexsystem and so it is its simulation. In this section the system is simulated with the original pa-rameters and no DFIG installed, and then it is simulated with all the wind turbines connectedwithout increasing its power. A third scenario is later considered with the same connections,but increasing the power of the wind turbines. Many more simulations could be made withdifferent power factors and different percentages of wind implementation, but it has not beenmade due to time limitations.

The following analyses are not considered a real development of the system for the reasonsalready explained (missing data, not enough simulations...), but they support the validation ofthe created algorithm for any system and gives a better approach to what a real transmissionsystem is, using real data from the Danish Technical Regulations and the TSO Energinet.

63

Page 80: Impact of Wind Turbines on Power System Stability

5. Eastern Denmark Power System

But that does not take away from the fact that the system is very interesting, with manydifferent devices, controls and OHL and UGC with real data.

5.5.1 Implementation Results

No Power Increment on the DFIG

The first results regarding the implementation without the increment are very curious, startingfrom the voltages. Figure 5.7 shows the voltages comparison between the original system andthe one with the wind turbines.

Figure 5.7 Voltages Comparison - Eastern Denmark Transmission System

From the voltage point of view, although there are some differences on the beginning, overallthere is not a big difference between the original and the one with the DFIG. It is interestingto see that in both cases the power flow converges for every load point, as it is between itsexpected operation area. The turbulences on the beginning of the graph could be because theload is so small and could experience disturbances on the system.

On the reactive power flow of the system it was not detected any big difference, as it isdetected on the active power flow of Figure 5.8.

800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800Load (MVA)

-500

0

500

1000

1500

2000

2500

3000

3500

Act

ive

Pow

er F

low

(M

W)

Wind Turbines Implemented - NO INCREASEOriginal System

Figure 5.8 Reactive Power Flow Comparison - Eastern Denmark Transmission System

The power that is flowing on the system is not constant with DFIG, but decreases with theload, while for the Original System is kept more or less constant. On both extremes of theFigure it is appreciated a little steepness, which reinforces the idea of the set limits for theload. It was fixed according to the expected values and the system performs better the further

64

Page 81: Impact of Wind Turbines on Power System Stability

5.5. System Possibilities Aalborg University

it is from the extremes.

Regarding the generation, the active power is almost the same for both cases since it dependson the load; but there is a difference on the reactive power generated as it is appreciated onFigure 5.9.

800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800Load (MVA)

-1000

-500

0

500

1000

Rea

ctiv

e P

ower

(M

var)

Wind Turbines Implemented - NO INCREASEOriginal System

Figure 5.9 Reactive Power Generated Comparison - Eastern Denmark Transmission System

In this case the reactive power generated is basically the opposite for each case; when theturbines are installed it is positive, while if no turbines are in the system, the generatorsabsorb this power. Both plots get closer while the load increments, getting closer to zero.This shape is similar on the reactive power losses as it can be seen on Figure 5.10.

800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800Load (MVA)

-2500

-2000

-1500

-1000

-500

Rea

ctiv

e P

ower

Los

ses

(Mva

r) Wind Turbines Implemented - NO INCREASEOriginal System

Figure 5.10 Reactive Power Losses Comparison - Eastern Denmark Transmission System

This losses are highly negative in both cases, specially on the Original System. Related to theactive power losses, it is expected to be higher with the wind turbines connected, followingthe previous analyses. It can be seen this reflected on Figure 5.11.

800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800

Load (MVA)

20

30

40

50

60

70

80

90

Act

ive

Pow

er L

osse

s (M

W)

Wind Turbines Implemented - NO INCREASEOriginal System

Figure 5.11 Active Power Losses Comparison - Eastern Denmark Transmission System

65

Page 82: Impact of Wind Turbines on Power System Stability

5. Eastern Denmark Power System

Power Increment on the DFIG

The other case selected, as it was announced, is the same but incrementing the installed ca-pacity of the DFIG together with the load. The results for these are also very similar to whatit was found in the previous chapter: the system is not able to operate in the whole range ofload and it collapses before it reaches 1800 MVA.

As there are already many plots it was considered not necessary to plot the voltages ofthis case, but these voltages are from the beginning much higher than in the Original System.Most of the voltages are above 1.2 p.u., showing the weakness of the system even with a lowload.

It is however displayed on Figure 5.12 the reactive power generated on the system, whichstarts being constant to rapidly increase until the collapse of the system.

800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800Load (MVA)

-800

-600

-400

-200

0

200

400

Rea

ctiv

e P

ower

(M

var)

Wind Turbines Implemented - INCREASEOriginal System

Figure 5.12 Reactive Power Generated Comparison - Eastern Denmark Transmission System

This is strongly related to the reactive power losses that are represented on Figure ??. Thesame jump on the plot occurs here: the generators have to generate more (or absorb less,in this case) reactive power because the losses are much higher now, probably due to someoverloaded transformers or lines.

The analyses finalised here, showing the robustness of the algorithm which with a few modi-fications can operate in any system. Similar conclusions to the ones obtained with the IEEE9-bus system can be obtained so far, the increment of power on the DFIG reduces the powerof the synchronous generators but gives other disadvantages to the system, making it weaker.Here, as the system is stronger, the impact of introducing a wind turbine is smaller and theperformance of the whole system does not change that much.

However, the most important part when making any change on the system, in this caseimplementing wind turbines, is to select the right parameters, since the impact could be huge.

66

Page 83: Impact of Wind Turbines on Power System Stability

Conclusion 6This chapter summarises the work carried out throughout the duration of the whole thesistogether with the conclusions. It gives in the end an idea of what the further work could be.

The thesis started with the objective of implementing 100% of wind power generation inthe Eastern Danish Transmission System. This objective was from the beginning limited tothe load flow analysis, and not other analysis out of the scope. As the project is part of abigger project, the idea was to make an useful work that could be continued and not restrictedto the thesis.

With the purpose of understanding how the implementation can be made, the initial testswere done on a simple power system published online, the IEEE 9-bus system. Keeping theidea of the implementation of the real system, it was decided to make an user-friendly al-gorithm to make the possible implementation. This code was created step by step, alwaysimproving it and adding new characteristics to complement it with the DIgSILENT analysis.

A power flow analysis is something very easy to make in a small power system with DIgSI-LENT, and also observe the results directly on the program. However, when the system wantsto be analysed in depth in order to understand it and find its weaknesses a lot of time shouldbe consumed. Thus, the algorithm starts with the idea of making this analysis in-depth in afast way and in an user-friendly way that would not induce errors on the analysis, and storeseverything in files that could be afterwards processed to see the results.

The algorithm was tested with the IEEE 9-bus system showing a good performance, withthe main advantage of making simulations much faster than manually. With this the IEEE9-bus system was analysed and its weakest points were found. Additionally, the 100% windenergy implementation was accomplished for a certain load range. The first conclusions werethen obtained in this chapter: the wind implementation can be made based on the load flowand for a certain load range; and the importance of the conditions decided for the wind tur-bine are crucial.

Once the IEEE 9-bus system was analysed and the first conclusions were obtained, the East-ern Transmission System of Denmark could be analysed. After getting the system (the modelwas created by DIgSILENT), it was time to be familiar with it and understand it even beforethe analysis. A system of this size is very complex and is very difficult to predict, so here itcame the importance of the algorithm.

The original system was analysed in order to fully understand it and only once it was com-prehended, the implementation of turbines was made. By following the recommendations ofboth my supervisor Zhou Liu, and Prof. Zhe Chen, the algorithm was used to make theimplementation of wind turbines. It is important to note that the algorithm does not makethe implementation of wind turbines, which is made manually, but the simulations once they

67

Page 84: Impact of Wind Turbines on Power System Stability

6. Conclusion

have been implemented.

In conclusion, two different areas are explored in the thesis: the understanding in depthof any system by the use of an user-friendly algorithm; and the implementation of the windturbines in a system. Regarding the first area, large systems such as the Transmission Systemof the Eastern of Denmark cannot be fully understood without the help of an algorithm.Moreover, the simulations have to be decided according to the results that one wants to ob-tain, and the analysis of the results is a key of the process. If the data is not processedaccurately, the conclusions can be wrong and will give a wrong picture of the system. On theother side, when looking at the right indexes conclusions may become fast.

On the other side, for the implementation of wind turbines it is not only important thedevice itself and its reactive capabilities, but the location of the turbine will make a differenceas it was proven. The environment in which the wind turbine is going to be installed is alsovery important before the implementation. The existing equipment on the system will definethe desired turbine, and this includes whether the lines are OHL or UGC, if there are passivefilters on the area, and so on. Both areas are related to each other, an analysis in depth ofthe original system has to be made before the implementation of the turbines.

The analysis made has to continue and many conclusions will depend on the further workthat is summarised on the next section.

6.1 Further Work

The analysis could be continued by following different paths:

• Analyse which way of implementation is more in line with the reality.• The system used would need more accurate information to have real results of the

performance of the system. Also, for wind turbine implementation, the locations andtypes of turbines are needed.

• The analysis is based only on the load flow and cannot conclude in a implementation ofwind energy. Therefore, dynamic analysis, transient and harmonic analyses have to bemade before concluding in a favourable implementation.

The first two can be made by using the algorithm presented on this thesis and adapting it topossible changes, and will depend on the available data. The last one can be performed byusing the same software tools or similar ones once the model is accurate.

68

Page 85: Impact of Wind Turbines on Power System Stability

Bibliography

[1] Z. Chen, Z. Liu, Y. Wang, W. Zhou, K. Ma, Z. Zhang, N. Gökmen, and C. L. Bak,Voltage Control and Protection for a Grid towards 100 Power Electronics and CableNetwork, Department of Energy Technology Std., oct 2017. [Online]. Available:https://www.et.aau.dk/research-programmes/wind-power-systems/activities/cope/

[2] J. Casazza and F. Delea, Understanding Electric Power Systems: An Overview of theTechnology and the Marketplace, ser. IEEE Press Understanding Science & TechnologySeries. Wiley, 2004. [Online]. Available:https://books.google.dk/books?id=z8GlVgTKiCEC

[3] State of Green, “Denmark: 100 per cent committed to wind energy,” State of Green,Tech. Rep., jan 2019.

[4] D. E. Agency, “Denmark’s energy and climate outlook 2018,”https://ens.dk/sites/ens.dk/files/Basisfremskrivning/deco18.pdf, Amaliegade 44, 1256Copenhagen K, Denmark, apr 2018.

[5] Energinet, “Nordic grid development plan 2017,” Online, jun 2017.

[6] ——, “Technical issues related to new Transmission Lines in Denmark,” Energinet,Tech. Rep., sep 2018.

[7] D. E. Agency, “Danish experiences from offshore wind development,” Danish EnergyAgency, Tech. Rep., mar 2017.

[8] P. Caughill, “Denmark just ran their entire country on 100% wind energy,” Futurism,mar 2017.

[9] A. Neslen, “Wind power generates 140% of denmark’s electricity demand,” TheGuardian, jul 2015.

[10] A. Jørgensen, “Storm på vestkysten: Danskernes elforbrug dækkes af vindmøller,”TV2.DK, mar 2016.

[11] A. H. Kristensen, Ed., Danish Policy on Underground Cabling of HV lines. DanishEnergy Agency, 2013.

[12] J. M. Birkebæk, Ed., Denmarks Cable Policy. Energinet, 2014.

[13] Energistyrelsen. (2017) El-produktion og transmission i danmark. [Online]. Available:https://ens.dk/sites/ens.dk/files/Statistik/el_produktion_og_transmission_2017_300dpi.pdf

[14] Energinet. (2018) Kriegers flak - combined grid solution. [Online]. Available:https://en.energinet.dk/Infrastructure-Projects/Projektliste/KriegersFlakCGS

[15] P. Kundur, N. Balu, and M. Lauby, Power System Stability and Control, ser. DiscussionPaper Series. McGraw-Hill Education, 1994. [Online]. Available:https://books.google.dk/books?id=2cbvyf8Ly4AC

69

Page 86: Impact of Wind Turbines on Power System Stability

Bibliography

[16] L. Grigsby, Power System Stability and Control, ser. The Electric Power EngineeringHbk, Second Edition. CRC Press, 2007. [Online]. Available:https://books.google.dk/books?id=8Jy6XfBBZvIC

[17] A. Kreimer, M. Arnold, and A. Carlin, Building safer cities: the future of disaster risk,ser. Disaster risk management series. World Bank, 2003. [Online]. Available:https://books.google.co.uk/books?id=GZG5x6SbeSAC

[18] I. Pérez-Arriaga, Regulation of the Power Sector, ser. Power Systems. SpringerLondon, 2014. [Online]. Available:https://books.google.co.uk/books?id=RPK8BAAAQBAJ

[19] H. Amaris, M. Alonso, and C. Ortega, Reactive Power Management of Power Networkswith Wind Generation, ser. Lecture Notes in Energy. Springer London, 2012. [Online].Available: https://books.google.co.uk/books?id=pdfZjWj0kHwC

[20] A. Arenas, P. Mediavilla, F. García, and P. Garcés, Estabilidad en los SistemasEléctricos de Potencia con Generación Renovable. OLADE, 2013.

[21] Wikipedia contributors, “Electrical grid — Wikipedia, the free encyclopedia,” 2019,[Online; accessed 10-April-2019]. [Online]. Available:https://en.wikipedia.org/w/index.php?title=Electrical_grid&oldid=888115070

[22] Energinet, “Technical regulation 3.2.5 for wind power plants above 11 kw,” Energinet,Tech. Rep., 2016.

[23] T. Wildi, Electrical Machines, Drives, and Power Systems. Prentice Hall, 2002.[Online]. Available: https://books.google.es/books?id=AtPpIgAACAAJ

[24] I. Munteanu, A. Bratcu, N. Cutululis, and E. Ceanga, Optimal Control of Wind EnergySystems: Towards a Global Approach, ser. Advances in Industrial Control. SpringerLondon, 2008. [Online]. Available: https://books.google.es/books?id=WwBjirAXql0C

[25] T. Ackermann, Wind Power in Power Systems. Wiley, 2012. [Online]. Available:https://books.google.es/books?id=y7430s86pQAC

[26] G. Abad, J. Lopez, M. Rodriguez, L. Marroyo, and G. Iwanski, Doubly Fed InductionMachine: Modeling and Control for Wind Energy Generation, ser. IEEE Press Series onPower Engineering. Wiley, 2011. [Online]. Available:https://books.google.es/books?id=JzvjOp8pY8QC

[27] T. R. E. H. UK. (2018) How does a wind turbine work? [Online]. Available: https://www.renewableenergyhub.co.uk/main/wind-turbines/how-does-a-wind-turbine-work/

[28] I. Munteanu, A. Bratcu, N. Cutululis, and E. Ceanga, Optimal Control of Wind EnergySystems: Towards a Global Approach, ser. Advances in Industrial Control. SpringerLondon, 2008. [Online]. Available: https://books.google.es/books?id=WwBjirAXql0C

[29] O. C. Onar and A. Khaligh, “Chapter 2 - energy sources,” in Alternative Energy inPower Electronics, M. H. Rashid, Ed. Boston: Butterworth-Heinemann, 2015, pp. 81 –154. [Online]. Available:http://www.sciencedirect.com/science/article/pii/B9780124167148000020

[30] P. Anderson and A. Fouad, POWER SYSTEM CONTROL AND STABILITY, 2NDED, ser. IEEE Press power engineering series. Wiley India Pvt. Limited, 2008.[Online]. Available: https://books.google.es/books?id=2BXOzA34qBkC

70

Page 87: Impact of Wind Turbines on Power System Stability

Bibliography Aalborg University

[31] F. Gonzalez-Longatt and J. Rueda, PowerFactory Applications for Power SystemAnalysis, ser. Power Systems. Springer International Publishing, 2014. [Online].Available: https://books.google.es/books?id=v7TzBQAAQBAJ

[32] N. Tabatabaei, A. Aghbolaghi, N. Bizon, and F. Blaabjerg, Reactive Power Control inAC Power Systems: Fundamentals and Current Issues, ser. Power Systems. SpringerInternational Publishing, 2017. [Online]. Available:https://books.google.es/books?id=4difDgAAQBAJ

[33] DIgSILENT, PowerFactory 2019 User Manual, DIgSILENT GmbH, Gomaringen,Germany, 2019.

[34] Energinet. (2019) Transmission system data. [Online]. Available:https://en.energinet.dk/Electricity/Energy-data/System-data

[35] ——. (2011, jan) Electricity balance. [Online]. Available:https://www.energidataservice.dk/en/dataset/electricitybalance

[36] A. Hayter, Probability and Statistics for Engineers and Scientists. Cengage Learning,2012. [Online]. Available: https://books.google.dk/books?id=Z3lr7UHceYEC

[37] J. Harlow, Electric Power Transformer Engineering, ser. The Electric PowerEngineering Hbk, Second Edition. CRC Press, 2007. [Online]. Available:https://books.google.dk/books?id=_r2O7D-rzBwC

71

Page 88: Impact of Wind Turbines on Power System Stability
Page 89: Impact of Wind Turbines on Power System Stability

Algorithm-relatedInformation A

A.1 Details of the general information table

Here there is a list of all the parameters given in the table created by the algorithm:

• Load: two columns per load, one for the active power and another one for the reactivepower. There is a row for each load step.

• Maximum Line Loading: name and loading of the line with the maximum loading. It isnot relevant for only one load step but it could be useful if the line with the maximumloading is always the same.

• Maximum Transformer Loading: name and loading of the transformer with themaximum loading. Again, could be relevant if it is always the same transformer.

• Transformers with a loading higher than 90%: amongst all the transformer, the oneswith a loading higher than a 90% are picked and summed up. It is another index thatcould be interesting for a big system with a very high number of transformers whereit is not easy nor fast to look at all the transformers’ loading. It can also show, as anevolution with the load, how the system gets overloaded.

• Transformers with a loading higher than 100%: same concept as the previous one, butin this case for transformers with a loading higher than 100%.The percentages 90% and 100% were chosen based on own criteria: a loading for 90%is not desirable for valley hours as the transformer will age quicker, but it is still a goodpercentage for peak hours. On the other side, 100% is a critical point and above it thetransformer is running over its rated power [37].

• Synchronous generator with the maximum loading: name and loading of the generatorwith the maximum loading.

• Synchronous generator with the maximum power: one for the maximum active powerand one for the maximum reactive power generated, independently. For the case of thereactive power, it is selected the maximum absolute value, which can be either positive(generated) or negative (absorbed).

• Synchronous generators with a loading higher than 90%: same concept as for thetransformers, in this case for the generators.

• Synchronous generators with a loading higher than 100%: idem.• Wind Turbine with the maximum loading, maximum active power, reactive power, wind

turbines with a loading higher than 90% and 100%: it is the same concept as beforeand therefore not explained.

• Maximum voltage (p.u.): maximum voltage in p.u. of the network and the name of thebusbar. Useful for following the evolution of the maximum voltage over the load.

• Second maximum voltage (p.u.): this index could be misleading as it is not the directlythe second maximum voltage, it is actually the maximum voltage that changes fromstep to step. This means that if a busbar keeps its voltage for two steps will not be partof this list, and the reason for this is that sometimes some busbars have a voltage that

73

Page 90: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

is fixed by a generator and therefore will never change, making it irrelevant.Additionally, in a column is written if there is a load or a generator connected to thisbusbar, and if so, its name. It will visually show if the weak points are related to thefact that a load or a generator is connected to those bars.

• dPdV (2nd max V) of the second maximum voltage: here is calculated the index ofdPdV of the busbar with the previous index (second maximum voltage). It is notcalculated with the original maximum voltage as the equation of this index (Equation3.3) includes the difference between the voltage on the busbar in two steps, which wouldbe zero.

• dQdV (2nd max V) of the second maximum voltage: same as before, in this case withthe reactive power ’Q’ instead of the active power ’P’.

• All the indexes already described for the maximum voltage, but in this case forthe minimum voltage: minimum voltage (p.u.), second minimum voltage, possibleconnection of load or generator, dPdV (2nd min V), dQdV (2nd min V).

• Busbars with a voltage lower than 0.95 p.u.: number of busbars with a voltage lowerthan 0.95 p.u., which is usually a critical number considered by the different TSO andDSO. A lower voltage is considered a problem.

• Busbars with a voltage higher than 1.05 p.u.: in this case is analysed the number ofbusbars above 1.05 p.u., which is usually the upper limit considered to be a problem.

All of these indexes that appear on this table can be modified as wanted and many more canbe added, but all of them together could give a general picture of the development in thesystem without going into plots and deeper analysis.

A.2 Main Codes

In this section the two main files of the algorithm are shown.

A.2.1 DPL Code

The first one is the first that has to be run, and it is run in DIgSILENT. It is DPL code.1 int i, sweep, i_err;2 int Balanced, inotopo;3 int year, leap_year;4 int originalStudyTime, studyTime;5 double APL, LAP,LRP,RPL,TotP,TotQ,TotALoad,TotRLoad;6 double V,U,Phi,Ploss,Qloss,TrafoLoad, LineLoad,TargetV;7 double a,ap,rp;8 double Qflow,Pflow;9 double synorDFIG,DFIGonoff, SynOnOff;

10 double P_MW,Q_MVAR,CurrentGen,GenLoading, CurrentWT,WTLoading;11 double WT_parallel;12 double e_aP,e_bP,e_cP,e_aQ,e_bQ,e_cQ;13 double error;14 double state,b,cosphi,parallel,IndorCap;15 string BusName, LineName,TrafoName, LoadName, GenName, WTName;16 object GenBar,LoadBar, WTBar;17 string GenBar2,LoadBar2, WTBar2;18 double LoadA_AP,LoadA_RP,LoadB_AP,LoadB_RP,LoadC_AP,LoadC_RP;19 object com, tset;20 object SumGrid, firstsort, o, p;21 set ALoads, s1, p1;222324 ClearOutput();2526 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2728 ! Here we read the number of synchronous generators and of DFIG in order to select

74

Page 91: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

29 ! in MATLAB which ones we want to be connected3031 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\ListOfSynchronous.txt’,’w’,1);32 s1 = SEL.GetAll(’ElmSym’);33 s1.SortToName(0);34 o = s1.First();35 while (o) {36 GenName = o:loc_name;37 fprintf(1,’%s’,GenName);38 o = s1.Next();39 }40 fclose(1);41 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\ListOfDFIG.txt’,’w’,1);42 s1 = SEL.GetAll(’ElmAsm’);43 s1.SortToName(0);44 o = s1.First();45 while (o) {46 GenName = o:loc_name;47 fprintf(1,’%s’,GenName);48 o = s1.Next();49 }50 fclose(1);51 ! Next to it, the actual load, which is always the original one52 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\ListOfLoads.txt’,’w’,1);53 s1 = SEL.AllLoads();54 s1.SortToName(0);55 o = s1.First();56 while (o) {57 LoadName = o:loc_name;58 P_MW = o:plini;59 Q_MVAR = o:qlini;60 fprintf(1,’%s\t%f\t%f’,LoadName,P_MW,Q_MVAR);61 o = s1.Next();62 }63 fclose(1);6465 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\ListOfTransformers.txt’,’w’,1);66 s1 = SEL.GetAll(’ElmTr2’);67 s1.SortToName(0);68 o = s1.First();69 while (o) {70 TrafoName = o:loc_name;71 fprintf(1,’%s’,TrafoName);72 o = s1.Next();73 }74 fclose(1);7576 ! The purpose is that now in MATLAB the desired generators are selected77 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!78 !! Here it is reading a file, until there is not a 1 written in it, the program79 !! cannot continue80 a = 1;81 while (a = 1){82 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\GeneratorControl.txt’,’r’,1);83 fscanf(1,’%d’,a);84 fclose(1);85 }86 !! Once MATLAB has finished setting which generators should be connected and87 !! which ones not, now the next code sets these generators ON or OFF8889 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\SynConnections.txt’,’r’,1);90 s1 = SEL.GetAll(’ElmSym’);91 s1.SortToName(0);92 o = s1.First();93 while (o){94 fscanf(1,’%f’,state);

75

Page 92: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

95 o:outserv = state;96 o = s1.Next();97 }98 fclose(1);99

100 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLABCODES\DFIGConnections.txt’,’r’,1);

101 s1 = SEL.GetAll(’ElmAsm’);102 s1.SortToName(0);103 o = s1.First();104 while (o){105 fscanf(1,’%f’,state);106 o:outserv = state;107 o = s1.Next();108 }109 fclose(1);110111 ! The load dependency is also set112 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\LoadDependance.txt’,’r’,1);113 s1 = SEL.GetAll(’TypLod’);114 s1.SortToName(0);115 o = s1.First();116 fscanf(1,’%f%f%f%f%f%f’,e_aP,e_bP,e_cP,e_aQ,e_bQ,e_cQ);117 o:kpu0 = e_aP;118 o:kpu1 = e_bP;119 o:kpu = e_cP;120 o:kqu0 = e_aQ;121 o:kqu1 = e_bQ;122 o:kqu = e_cQ;123 fclose(1);124125 ! Finally, the desired power factor of the DFIG is set126 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\DFIGcosphi.txt’,’r’,1);127 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\DFIGindorcap.txt’,’r’,2);128 fscanf(1,’%f’,cosphi);129 fscanf(2,’%f’,IndorCap);130 s1 = SEL.GetAll(’ElmAsm’);131 s1.SortToName(0);132 o = s1.First();133 while (o){134 o:cosgini = cosphi;135 o:pf_recap = IndorCap;136 o = s1.Next();137 }138 fclose(1);139 fclose(2);140141 a = 1;142143 while (a = 1){144 !! The next lines were added145 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\Communication2.txt’,’r’,2);146 fscanf(2,’%d’,b);147 fclose(2);148 if (b=1){149 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!150 !! Here the load is changed to the new one151 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\CurrentLoad.txt’,’r’,2);152 !fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\CurrentLoad2.txt’,’w’,1);153154155 !! Setting the new Loads156 s1 = SEL.AllLoads();157 s1.SortToName(0);158 firstsort = s1.First();159 while (firstsort){

76

Page 93: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

160 fscanf(2,’%d\t%d\t’,ap,rp);161 !fprintf(1,’%d\t%d’,ap,rp);162 firstsort:plini = ap;163 firstsort:qlini = rp;164 firstsort = s1.Next();165 }166 fclose(2);167168 !! Here the DFIG is changed to the new one169 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\CurrentDFIG.txt’,’r’,2);170171 !! Setting the new DFIG172 s1 = SEL.GetAll(’ElmAsm’);173 s1.SortToName(0);174 firstsort = s1.First();175 while (firstsort){176 fscanf(2,’%d\t’,parallel);177 firstsort:ngnum = parallel;178 firstsort = s1.Next();179 }180 fclose(2);181182 !! Finally the number of transformers in parallel is also changed183 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\CurrentTrans.txt’,’r’,2);184 s1 = SEL.GetAll(’ElmTr2’);185 s1.SortToName(0);186 firstsort = s1.First();187 while (firstsort){188 fscanf(2,’%d\t’,parallel);189 firstsort:ntnum = parallel;190 firstsort = s1.Next();191 }192 fclose(2);193194 ! Execute Load Flow195 ClearOutput();196 ResetCalculation();197 error = Ldf.Execute();198 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\Error.txt’,’w’,2);199 fprintf(2,’%d’,error);200 fclose(2);201 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!202 if (error = 1){203 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Communication.txt’,’w’,1);204 fprintf(1,’1’);205 fclose(1);206207 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\Couple.txt’,’r’,1);208 fscanf(1,’%d’,a);209 fclose(1);210 }211 else{212 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!213 !! Opening file to export results214 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Results1.txt’,’w’,0);215 fprintf(0,’%s\t%s\t%s\t%s’,’LoadName’,’Power_MW’,’Power_Mvar’,’Busbar’);216 !! Exporting Loads217 s1 = SEL.AllLoads();218 s1.SortToName(0);219 firstsort = s1.First();220 while (firstsort){221 LAP = firstsort:plini; ! Active Power of the Load222 LRP = firstsort:qlini:act; ! Reactive Power of the Load223 LoadName = firstsort:loc_name;224 ! It is quite difficut to access to the bus the generator is connected to225 ! The next 5 lines do this

77

Page 94: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

226 LoadBar = firstsort:r:bus1:e:cBusBar;227 p1 = LoadBar.GetConnectedMainBuses();228 p1.SortToName(0);229 p = p1.First();230 LoadBar2 = p:loc_name;231 fprintf(0,’%s\t%f\t%f\t%s’,LoadName,LAP,LRP,LoadBar2) ;232 firstsort = s1.Next();233 }234 fclose(0);235236 !! Exporting Voltages from Load Flow calculation237 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Voltages.txt’,’w’,1);238 fprintf(1,’%s\t%s\t%s\t%s\t%s\t%s\t%s’,’BusName’,’V_kV’,’U_pu’,’Phi’,’TargetV’,’Qflow’,’Pflow’);239240 s1 = SEL.AllBars();241 s1.SortToName(0);242 o = s1.First();243 while (o){244 BusName = o:loc_name;245 V = o:m:Ul;246 U = o:m:u1;247 Qflow = o:m:Qflow;248 Pflow = o:m:Pflow;249 TargetV = o:e:Vtarget;250 Phi = o:m:phiu;251 fprintf(1,’%s\t%f\t%f\t%f\t%f\t%f\t%f’,BusName,V,U,Phi,TargetV,Qflow,Pflow);252 o = s1.Next();253 }254 fclose(1);255256 !! Exporting all losses of each line and loading257 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\LineLosses.txt’,’w’,1);258 fprintf(1,’%s\t%s\t%s\t%s’,’LineName’,’Ploss’,’Qloss’,’Loading’);259 s1 = SEL.AllLines();260 s1.SortToName(0);261 o = s1.First();262 while (o){263 Ploss = o:m:Ploss:bus1;264 Qloss = o:m:Qloss:bus1;265 LineLoad = o:m:loading:bus1;266 LineName = o:loc_name;267 fprintf(1,’%s\t%f\t%f\t%f’,LineName,Ploss,Qloss,LineLoad);268 o = s1.Next();269 }270 fclose(1);271272 !! Exporting all losses of each transformer273 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Trafos.txt’,’w’,1);274 fprintf(1,’%s\t%s\t%s\t%s’,’TrafoName’,’Ploss’,’Qloss’,’TrafoLoad’);275 s1 = SEL.GetAll(’ElmTr2’);276 s1.SortToName(0);277 o = s1.First();278 while (o){279 Ploss = o:m:Ploss:bushv;280 Qloss = o:m:Qloss:bushv;281 TrafoName = o:loc_name;282 TrafoLoad = o:m:loading;283 fprintf(1,’%s\t%f\t%f\t%f’,TrafoName,Ploss,Qloss,TrafoLoad);284 o = s1.Next();285 }286 fclose(1);287288 !! Exporting info about synchronous generators289 !290 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Generators.txt’,’w’,1);291 fprintf(1,’%s\t%s\t%s\t%s\t%s\t%s’,’GenName’,’P_MW’,’Q_Mvar’,’GenBar’,’Current_kA’,’Loading’);292 s1 = SEL.GetAll(’ElmSym’);293 s1.SortToName(0);

78

Page 95: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

294 o = s1.First();295 while (o){296 state= o:outserv;297 if (state = 0){298 P_MW = o:m:P:bus1;299 Q_MVAR = o:m:Q:bus1;300 ! It is quite difficut to access to the bus the generator is connecte301 ! The next 5 lines do this302 GenBar = o:r:bus1:e:cBusBar;303 p1 = GenBar.GetConnectedMainBuses();304 p1.SortToName(0);305 p = p1.First();306 GenBar2 = p:loc_name;307 GenLoading = o:m:loading;308 GenName = o:loc_name;309 CurrentGen = o:m:I:bus1;310 fprintf(1,’%s\t%f\t%f\t%s\t%f\t%f’,GenName,P_MW,Q_MVAR,GenBar2,CurrentGen,GenLoading);311 }312 o = s1.Next();313 }314 fclose(1);315316317 !! Exporting info about wind turbines318319 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\WTurbines.txt’,’w’,1);320 fprintf(1,’%s\t%s\t%s\t%s\t%s\t%s\t%s’,’WT_Name’,’P_MW’,’Q_Mvar’,’GenBar’,’Current_kA’,’Loading’,’WT_parallel’);321 s1 = SEL.GetAll(’ElmAsm’);322 s1.SortToName(0);323 o = s1.First();324 while (o){325 state = o:outserv;326 if (state = 0){327 P_MW = o:m:P:bus1;328 Q_MVAR = o:m:Q:bus1;329 ! Same as for synchronous generators330 WTBar = o:r:bus1:e:cBusBar;331 p1 = WTBar.GetConnectedMainBuses();332 p1.SortToName(0);333 p = p1.First();334 WTBar2 = p:loc_name;335 WTLoading = o:m:loading;336 WTName = o:loc_name;337 CurrentWT = o:m:I:bus1;338 WT_parallel = o:ngnum;339 !fprintf(1,’%s\t%f\t%f\t%f\t%f\t%d’,WTName,P_MW,Q_MVAR,CurrentWT,WTLoading,WT_parallel);340 fprintf(1,’%s\t%f\t%f\t%s\t%f\t%f\t%d’,WTName,P_MW,Q_MVAR,WTBar2,CurrentWT,WTLoading,WT_parallel);341 }342 o = s1.Next();343 }344 fclose(1);345346 !! Exporting grid summary347 SumGrid = SummaryGrid();348 APL = SumGrid:c:LossP;349 RPL = SumGrid:c:LossQ;350 TotP = SumGrid:c:GenP;351 TotQ = SumGrid:c:GenQ;352 TotALoad = SumGrid:c:LoadP;353 TotRLoad = SumGrid:c:LoadQ;354355 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Summary.txt’,’w’,1);356 fprintf(1,’%s\t%s\t%s\t%s\t%s\t%s’,’TotalLosses_MW’,’TotalLosses_Mvar’,’TotalGeneration_MW’,’TotalGeneration_Mvar’,’TotalLoad_MW’,’TotalLoad_Mvar’);357 fprintf(1,’%f\t%f\t%f\t%f\t%f\t%f’,APL,RPL,TotP,TotQ,TotALoad,TotRLoad);358 fclose(1);359 }360 !! Sending signal to MATLAB361 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Communication.txt’,’w’,1);362 fprintf(1,’1’);

79

Page 96: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

363 fclose(1);364365 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\Couple.txt’,’r’,1);366 fscanf(1,’%d’,a);367 fclose(1);368 !! The next line was added369 }370 !!!!!371372 } ! End of main while373374 fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern Denmark\MATLAB

CODES\CurrentLoad.txt’,’r’,2);375 s1 = SEL.AllLoads();376 s1.SortToName(0);377 firstsort = s1.First();378 while (firstsort){379 fscanf(2,’%d\t%d\t’,ap,rp);380 firstsort:plini = ap;381 firstsort:qlini = rp;382 firstsort = s1.Next();383 }384 fclose(2);385386 EchoOn();

As it can be seen, it is a very large code in which many files are involved. The first functionof this code is to create files with the data of the system, that will be read by MATLAB.Then, once MATLAB reads the files and gets the information from the user, it goes back tothis DPL code, where it will run load flow and export the data.

The exported data is read by MATLAB and processed; then the next load flow is calcu-lated and so on.

A.2.2 MATLAB Code

This second file displays several menus to the user to make the desired choices, and alsoprocesses the data from DIgSILENT.

1 %% This program is made to analyse what happens in a DIgSILENT system when2 % the load is increased in steps. The program cannot be directly3 % extrapolated to other computers due to the need of the script on4 % DIgSILENT DPL, and the need of some files that are stored in this5 % computer.67 % The way it should proceed is as follows: first run the DPL code, and8 % after it, run this code. Once the calculations are finished, both9 % programs will stop

1011 % The program should be able to operate in any system, but some12 % changes and considerations should be taken into account.1314 %% Run Load Flow15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%16 %%% FIRST OF ALL, IT IS IMPORTANT TO KNOW THAT IN ORDER TO RUN %%%17 %%% LOAD FLOW SEVERAL TIMES, IT ALL HAS TO BE INSIDE A LOOP WHERE %%%18 %%% THE MAIN FILE IS Couple.txt THAT WILL HAVE WRITTEN EITHER -1 %%%19 %%% OR 1. WHEN A 1 IS WRITTEN, THE PROGRAM FINISHES %%%20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2122 %% Test conditions2324 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%25 %%% Here you can introduced the desired iterations and parameters %%%26 %%% for increasing the load as desired. %%%27 %%% Steps_Active = Write here the percentage you want to increase %%%

80

Page 97: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

28 %%% each load on the active part as a first step. %%%29 %%% Steps_Reactive = Write here the percentage you want to increase %%%30 %%% each load on the reactive part as a first step. %%%31 %%% Note that different steps will have different power factor. %%%32 %%% %%%33 %%% The increase can be either relative or absolute: relative would %%%34 %%% be an increase over the previous value, whereas absolute is an %%%35 %%% increase over the first value. It is changed by changing %%%36 %%% relative from 0 (absolute) to 1 (relative). %%%37 %%% %%%38 %%% N_Steps = number of times you want to increase this step, so %%%39 %%% how many times you want to run the Load Flow. %%%40 %%% %%%

%%%41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%42 %% Read the original Load43 %%%%% THE FIRST THING THE PROGRAM DOES IS TO READ THE ORIGINAL LOAD44 %%%%% IN ORDER TO KEEP THE MODEL AS IT WAS IN THE BEGGINING, AND ALSO TO45 %%%%% CALCULATE ALL THE LOAD STEPS BASED ON THE ORIGINAL LOAD46 Original_Load = fopen(’ListOfLoads.txt’,’r’);47 OLoad=textscan(Original_Load,’%s\t%f\t%f’);48 fclose(Original_Load);49 tableLoad=readtable(’ListOfLoads.txt’,’Delimiter’,’\t’,’ReadVariableNames’,false);50 tableLoad.Var2=strrep(tableLoad.Var2,’,’,’.’);51 tableLoad.Var3=strrep(tableLoad.Var3,’,’,’.’);5253 %% Read the transformers and the positions of the ones connected to a DFIG54 TrafosList = fopen(’ListOfTransformers.txt’,’r’);55 TrafosNames=textscan(TrafosList,’%s’);56 fclose(TrafosList);5758 DFIGTRpos=0;59 for i=1:size(TrafosNames{1},1)60 if strfind(char(TrafosNames{1}(i)),’DFIG’)>=161 DFIGTRpos=[DFIGTRpos, i];62 end63 end64 DFIGTRpos=DFIGTRpos(2:end);65 initialTrans=ones(size(TrafosNames{1},1),1);66 %% Selection of generators67 %%%%%% THE FOLLOWING SCRIPT DISPLAYS THE SYNCHRONOUS GENERATORS AND THE68 %%%%%% DFIG IN ORDER TO CHOOSE WHICH ONES DO WE WANT TO BE CONNECTED69 GeneratorsWanted;7071 % Now we send a signal to the other script to write the generators file72 DFIG_file = fopen(’GeneratorControl.txt’,’w’);73 fprintf(DFIG_file,’0’);74 fclose(DFIG_file);7576 % We wait some time for the DPL program to read it and we go back to the77 % initial 178 pause(0.5);79 DFIG_file = fopen(’GeneratorControl.txt’,’w’);80 fprintf(DFIG_file,’1’);81 fclose(DFIG_file);8283 %% Load dependency8485 Ldep=input(’Write a 1 if you would like to change the parameters of the load dependency: ’);86 if Ldep==187 disp(’Write all the values:’)88 e_aP=input(’e_aP = ’);89 e_bP=input(’e_bP = ’);90 e_cP=input(’e_cP = ’);91 e_aQ=input(’e_aQ = ’);92 e_bQ=input(’e_bQ = ’);93 e_cQ=input(’e_cQ = ’);94 else95 e_aP=0;96 e_bP=0;97 e_cP=1.6;98 e_aQ=0;

81

Page 98: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

99 e_bQ=0;100 e_cQ=1.8;101 end102 LoadDep=[e_aP;e_bP;e_cP;e_aQ;e_bQ;e_cQ];103 dlmwrite(’LoadDependance.txt’,LoadDep,’delimiter’,’\n’);104105 %% %%%%% HERE THE PROGRAM ASKS THE USER TO FULFILL THE CONDITIONS OF THE TEST106 hmuch = input(’Write here the percentage you will like to increment the first load: \n’);107 Steps_P = input(’If you would like to increment all the loads, write 1: \n’);108 if Steps_P == 1109 Steps_Active = hmuch.*ones(1,size(tableLoad,1));110 else111 Steps_Active = input(’Write a matrix of how much you want to increment each load: \n’);112 Steps_Active = hmuch.*Steps_Active;113 end114 powfac = input(’If you would like to keep the same power factor, write 1: \n’);115 if powfac == 1116 Steps_Reactive = Steps_Active;117 else118 powfac = input(’Write here the power factor you wish: \n’);119 Steps_Reactive = Steps_Active.*tan(acos(powfac));120 end121122 disp(’Write a 0 if you wish the percentage increase to be based on the’);123 disp(’first load value, or a 1 if you want it to be always calculated based on’);124 relative=input(’the last load value: \n’);125126 N_Steps = input(’Finally write the number of steps: \n’);127128 % Steps_Active = [10 0 10];129 % Steps_Reactive = [10 0 10];130 %131 % relative=0;132 %133 % N_Steps = 10;134 count=1;135 error=0;136 % When the next signal is written, then DPL can operate and run Load Flow137 Couple = fopen(’Couple.txt’,’w’);138 fprintf(Couple,’1’);139 fclose(Couple);140141 %% Change the load142 % Here the initial load is written and all the steps of the load are143 % written based on the conditions that the user has chosen144 AllSteps=[str2double(tableLoad.Var2’);str2double(tableLoad.Var3’)];145 AllSteps=AllSteps(:)’;146 % The rest of the steps is calculated as: P5 = P4*(1+increment/100) and the147 % same for Q. If the increment is chosen to be based on the initial load,148 % it is as follows: P5=P1*(1+increment/100);149 for i=1:N_Steps-1150 if relative==0151 if i==1152 AllSteps(i+1,1:2:end)=AllSteps(1,1:2:end).*Steps_Active;153 AllSteps(i+1,2:2:end)=AllSteps(1,2:2:end).*Steps_Reactive;154 else155 AllSteps(i+1,1:2:end)=(AllSteps(2,1:2:end)-AllSteps(1,1:2:end))*i+AllSteps(1,1:2:end);156 AllSteps(i+1,2:2:end)=(AllSteps(2,2:2:end)-AllSteps(1,2:2:end))*i+AllSteps(1,2:2:end);157 end158 else159 AllSteps(i+1,1:2:end)=AllSteps(i,1:2:end).*(1+Steps_Active/100);160 AllSteps(i+1,2:2:end)=AllSteps(i,2:2:end).*(1+Steps_Reactive/100);161 end162 end163164 % Once the staps are calculated, we calculate the DFIG change, if desired165 DFIGanswer=input(’Write a 1 if you want to increase also the DFIG power: ’);166 if DFIGanswer==1167 DFIGChange;168 else169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%170 %%%%%%%% IMPORTANT TO CHANGE THE PARALLEL %%%%%%%%%%%%%%%%%%%%%%%%%%%%

82

Page 99: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

171 % par=[29;27;34]; % Number of generators in parallel at the moment of the %ORIGINALLOAD172 parTropen=fopen(’InitialTrPar.txt’,’r’);173 formatSpec=’%f’;174 parTr=fscanf(parTropen,formatSpec);175 fclose(parTropen);176177 parDFIGopen=fopen(’InitialDFIGpar.txt’,’r’);178 formatSpec=’%f’;179 parDFIG=fscanf(parDFIGopen,formatSpec);180 fclose(parDFIGopen);181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%182 DFIGSteps=repmat(parDFIG,1,size(AllSteps,1));183 DFIGarray=DFIGSteps;184185 TrSteps=repmat(parTr,1,size(AllSteps,1));186 Trarray=TrSteps;187 end188 %% Here we load the options so then later is faster to load189 opts1=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Results1.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);190 opts2=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\LineLosses.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);191 opts3=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Trafos.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);192 opts4=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Voltages.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);193 % The synchronous generators will be only loaded if there are connected in194 % order to save time and resources for the script195 if sum(SynConnected)>0196 opts5=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\EasternDenmark\Generators.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);

197 end198 opts6=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Summary.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);199 % The same as in synchronous for the DFIG200 if sum(DFIGConnected)>0201 opts7=detectImportOptions(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\EasternDenmark\WTurbines.txt’,’NumHeaderLines’,0,’Delimiter’,’\t’,’DecimalSeparator’,’,’);

202 end203 %%204 while count ~= N_Steps+1205 % In order to run load flow we need a file to comunicate with DigSilent,206 % this file is called Communication.txt and it will have either a 1 or a 0,207 % depending on if MATLAB is running (1), or DIgSILENT (0)208209 % First thing is to create this file210 Communication = fopen(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\MATLAB

CODES\Communication.txt’,’w’);211 fprintf(Communication,’0’);212 fclose(Communication);213214215 %% Sending Load data to DIgSILENT216 % We are just interested in an specific row217 CurrentLoad=AllSteps(count,:);218 dlmwrite(’CurrentLoad.txt’,CurrentLoad,’delimiter’,’\t’);219220 CurrentDFIG=DFIGarray(:,count)’;221 dlmwrite(’CurrentDFIG.txt’,CurrentDFIG,’delimiter’,’\t’);222223 % We also need to change the number of transformers in parallel224 % initialTrans(DFIGTRpos)=CurrentDFIG;225 CurrentTr=TrArray(:,count)’;226 dlmwrite(’CurrentTrans.txt’,CurrentTr,’delimiter’,’\t’);227228 Com2=fopen(’Communication2.txt’,’w’);229 fprintf(Com2,’%d’,1);230 fclose(Com2);231 % Here you send a signal to DIgSILENT so that when there is a one in232 % the file it runs load flow, and when there is not it doesn’t do

83

Page 100: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

233 % anything234 % It needs a pause to DIgSILENT has time to read a 1 and runs LF and235 % right after MATLAB writes a 0 and then DPL will read a 0 and don’t236 % run LF237 pause(0.3);238239 Com2=fopen(’Communication2.txt’,’w’);240 fprintf(Com2,’%d’,0);241 fclose(Com2);242 %%243244 % Next thing is to load the file and see if DIgSILENT is working on it,245 % once DIgSILENT finishes its calculation, it will print a 1 on the file246 % and therefore the loop below will finish.247248 a = 0;249 while a == 0250 a = load(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\Communication.txt’);251 pause(0.8);252 end253 % If the load flow did not converge, DPL writes a signal on the file254 % ’Error.txt’, and if there is an error, MATLAB will stop the script255 error = load(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW LAPTOP\Eastern

Denmark\MATLAB CODES\Error.txt’);256 if error == 1257 disp(’No convergence in Load Flow!’);258 stepsmade = count;259 count = N_Steps+1; % The load flow finishes260 else261 %% Read output from DIGsILENT262 stepsmade = count;263 % Results1=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Results1.txt’,’Delimiter’,’\t’);264 % LineLosses=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\LineLosses.txt’,’Delimiter’,’\t’);265 % Trafos=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Trafos.txt’,’Delimiter’,’\t’);266 % Voltages=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Voltages.txt’,’Delimiter’,’\t’);267 % if sum(SynConnected)>0268 % Generators=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Generators.txt’,’Delimiter’,’\t’);269 % end270 % Summary=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Summary.txt’,’Delimiter’,’\t’);271 % if sum(DFIGConnected)>0272 % WTurbines=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\WTurbines.txt’,’Delimiter’,’\t’);273 % end274 Results1=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Results1.txt’,opts1);275 LineLosses=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\LineLosses.txt’,opts2);276 Trafos=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Trafos.txt’,opts3);277 Voltages=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Voltages.txt’,opts4);278 if sum(SynConnected)>0279 Generators=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Generators.txt’,opts5);280 end281 Summary=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\Summary.txt’,opts6);282 if sum(DFIGConnected)>0283 WTurbines=readtable(’C:\Users\admin\OneDrive - Aalborg Universitet\Master Thesis\NEW

LAPTOP\Eastern Denmark\WTurbines.txt’,opts7);284 end285 %% Process the data and create new file with all necessary data286287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%288 %%% First thing is to write a table with the data of the loads, DOESN’T %%%

84

Page 101: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

289 %%% MATTER HOW MANY LOADS YOU HAVE. It will write a table where for %%%290 %%% each iteration it will append one more row, adding the new load data%%%291 %%% The way this is written is as follows: two columns for each table, %%%292 %%% one for the active power and another for the reactive power. %%%293 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%294 Loads=[Results1.Power_MW’;Results1.Power_Mvar’];295 Loads=Loads(:)’; % The loads saved from DIgSILENT are now stored in this array296 % If it is the first iterarion, it creates the table from zero, if not, it297 % appends the new row.298 if count == 1299 for i=1:length(Loads)300 if mod(i,2)==0 % if it is even, means it is looking at the reactive power values301 str=char(Results1.LoadName(i/2)); % Change from cell to string302 str=str(~isspace(str)); % Take out the space so it can be a variable of a table303 str=strrep(str,’-’,’_’); % In case there is a ’-’ it will not work in a table,

therefore it is changes304 str=strcat(str,’_Mvar’); % Concatenate Mvar, to know that is the reactive power305 danishcaracters;306 loadtable=[loadtable,table(Loads(i),’VariableNames’,{str})];307 elseif i==1 % if it is odd, is looking at the active power values308 str=char(Results1.LoadName(i)); % Change from cell to string309 str=str(~isspace(str)); % Take out the space so it can be a variable of a table310 str=strrep(str,’-’,’_’); % In case there is a ’-’ it will not work in a table,

therefore it is changes311 str=strcat(str,’_MW’); % Concatenate MW, to know that is the active power312 danishcaracters;313 loadtable=table(Loads(1),’VariableNames’,{str});314 else315 str=char(Results1.LoadName((i+1)/2)); % Change from cell to string316 str=str(~isspace(str)); % Take out the space so it can be a variable of a table317 str=strrep(str,’-’,’_’); % In case there is a ’-’ it will not work in a table,

therefore it is changes318 str=strcat(str,’_MW’); % Concatenate MW, to know that is the active power319 danishcaracters;320 loadtable=[loadtable,table(Loads(i),’VariableNames’,{str})];321 end322 end323 else324 % In order to append a row, we have to create a table with the same325 % variable names326 loadtable=[loadtable;array2table(Loads,’VariableNames’,loadtable.Properties.VariableNames)];327 end328329330 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%331 %%% Second file to analyse is the Line Losses file, so far no %%%332 %%% calculation is made from this, but the loading of the most loaded %%%333 %%% line as well as its name is saved %%%334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%335336 % First we find the maxium and its position337 [value_max,row]=max(LineLosses.Loading);338 % We determine the names of the variables339 VarNames = {’LineMaxLoading’,’LineName’};340 % Then we create the table341 if count == 1342 linetable=table(value_max,LineLosses.LineName(row,:),’VariableNames’,VarNames);343 else344 linetable=[linetable;table(value_max,LineLosses.LineName(row,:),’VariableNames’,VarNames)];345 end346347 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%348 %%% The third file to analyse is the Transformer file. From this %%%349 %%% file we extract the most loaded transformer’s name and loading %%%350 %%% and also the number of transformers above 80% loading, and %%%351 %%% the number above 100% %%%352 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%353354 % First we get the maximum loaded transformer and its position355 [value_max,row] = max(Trafos.TrafoLoad);356 % Now we count the numbers of trafos with 80% or more loading357 ntrafos80 = sum (Trafos.TrafoLoad>=80);

85

Page 102: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

358 % Now we count the numbers of trafos with 100% or more loading359 ntrafos100 = sum (Trafos.TrafoLoad>=100);360 % We define the names of the variables (table headers)361 VarNames = {’TrafoMaxLoading’,’TrafoName’,’TrOver90’,’TrOver100’};362 if count == 1363 trafotable =

table(value_max,Trafos.TrafoName(row,:),ntrafos80,ntrafos100,’VariableNames’,VarNames);364 else365 trafotable =

[trafotable;table(value_max,Trafos.TrafoName(row,:),ntrafos80,ntrafos100,’VariableNames’,VarNames)];366 end367368 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%369 %%% Now the file of the generators is processed. It is one of the main %%%370 %%% files and therefore lot of data is taken from this file %%%371 %%% For example, the bars to which the generators are associated %%%372 %%% as it is important to see which buses get lower or higher voltage %%%373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%374 if sum(SynConnected)>0375 % First we take a look at the most loaded generator and its name376 [gen_max,row] = max(Generators.Loading);377 % Then we look at the number of generators with a loading higher than 80%378 ngen80 = sum(Generators.Loading>=80);379 % Also at the number of generators over 100%380 ngen100 = sum(Generators.Loading>=100);381 % Here it is taken the generator providing or absorving most active power382 [genMAP,row_MAP] = max(abs(Generators.P_MW));383 % Here it is taken the generator providing or absorving most reactive power384 [genMRP,row_MRP] = max(abs(Generators.Q_Mvar));385 % Here it is taken the generator absorving most reactive power386 % and it is taken the ones different from 0!387 [genABsRP,row_AbsRP] = min(Generators.Q_Mvar(Generators.Q_Mvar~=0));388389 genmatrix =

[gen_max,Generators.GenName(row,:),Generators.P_MW(row_MAP,:),Generators.GenName(row_MAP,:),Generators.Q_Mvar(row_MRP,:),Generators.GenName(row_MRP,:),ngen80,ngen100];390 VarNames =

{’GenMaxL’,’GenMaxL_Name’,’GenMaxActiveP’,’GenMaxActiveP_Name’,’GenMaxReactiveP’,’GenMaxReactiveP_Name’,’NumGenOver80’,’NumGenOver100’};391 % It is also calculated the number of generators with positive Q, but not392 % saved (it could be interesting for later analysis)393 ngenposQ = sum(Generators.Q_Mvar>0);394395 if count == 1396 generatorstable = cell2table(genmatrix,’VariableNames’,VarNames);397 else398 generatorstable = [generatorstable;cell2table(genmatrix,’VariableNames’,VarNames)];399 end400 end401 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%402 %%% In case we are using Wind Turbines, we use the code below %%%403 %%% with the same purpose as the one for synchronous generators %%%404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%405 if sum(DFIGConnected)>0406 % First we take a look at the most loaded WT and its name407 [WT_max,row] = max(WTurbines.Loading);408 % Then we look at the number of WT with a loading higher than 80%409 nWT80 = sum(WTurbines.Loading>=80);410 % Also at the number of WT over 100%411 nWT100 = sum(WTurbines.Loading>=100);412 % Here it is taken the WT providing most active power413 [WT_MAP,row_MAP] = max(WTurbines.P_MW);414 % Here it is taken the WT providing most reactive power415 [WT_MRP,row_MRP] = max(WTurbines.Q_Mvar);416417 WTmatrix =

[WT_max,WTurbines.WT_Name(row,:),WT_MAP,WTurbines.WT_Name(row_MAP,:),WT_MRP,WTurbines.WT_Name(row_MRP,:),nWT80,nWT100];418 VarNames =

{’WT_MaxL’,’WT_MaxL_Name’,’WT_MaxActiveP’,’WT_MaxActiveP_Name’,’WT_MaxReactiveP’,’WT_MaxReactiveP_Name’,’NumWTOver80’,’NumWTOver100’};419420 % Here it is taken the number of turbines in parallel of the421 % one providing most of the active power422 WTparallel = WTurbines.WT_parallel(row_MAP,:);423 WTmatrix = [WTmatrix,WTparallel];

86

Page 103: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

424 VarNames = [VarNames,{’WTMax_parallel’}];425426 % It is also calculated the number of WT with positive Q, but not427 % saved (it could be interesting for later analysis)428 nWTposQ = sum(WTurbines.Q_Mvar>0);429430 if count == 1431 WTtable = cell2table(WTmatrix,’VariableNames’,VarNames);432 else433 WTtable = [WTtable;cell2table(WTmatrix,’VariableNames’,VarNames)];434 end435 end436437 % Then two tables are added with the power generated by the WT and438 % the Synchronous machines439 % Here we create a table with all the active generation on each step440 PStep = sprintf(’P_MW_%d’,count);441 % Another one with all the reactive generation442 QStep = sprintf(’Q_Mvar_%d’,count);443 if count == 1444 VarName = {’GenName’,’BarName’,PStep};445 VarName2 = {’GenName’,’BarName’,QStep};446 if sum(SynConnected)>0 && sum(DFIGConnected)>0447 GenPhistory =

table(Generators.GenName,Generators.GenBar,Generators.P_MW,’VariableNames’,VarName);448 GenPhistory=[GenPhistory;table(WTurbines.WT_Name,WTurbines.GenBar,WTurbines.P_MW,’VariableNames’,VarName)];449450 GenQhistory =

table(Generators.GenName,Generators.GenBar,Generators.Q_Mvar,’VariableNames’,VarName2);451 GenQhistory =

[GenQhistory;table(WTurbines.WT_Name,WTurbines.GenBar,WTurbines.Q_Mvar,’VariableNames’,VarName2)];452 elseif sum(SynConnected)>0 && sum(DFIGConnected)==0453 GenPhistory =

table(Generators.GenName,Generators.GenBar,Generators.P_MW,’VariableNames’,VarName);454 GenQhistory =

table(Generators.GenName,Generators.GenBar,Generators.Q_Mvar,’VariableNames’,VarName2);455 else456 GenPhistory=table(WTurbines.WT_Name,WTurbines.GenBar,WTurbines.P_MW,’VariableNames’,VarName);457 GenQhistory =

table(WTurbines.WT_Name,WTurbines.GenBar,WTurbines.Q_Mvar,’VariableNames’,VarName2);458 end459460 else461 if sum(SynConnected)>0 && sum(DFIGConnected)>0462 Agentab2=table(Generators.P_MW,’VariableNames’,{PStep});463 Agentab2=[Agentab2;table(WTurbines.P_MW,’VariableNames’,{PStep})];464 GenPhistory = [GenPhistory,Agentab2];465466 Rgentab2=table(Generators.Q_Mvar,’VariableNames’,{QStep});467 Rgentab2=[Rgentab2;table(WTurbines.Q_Mvar,’VariableNames’,{QStep})];468 GenQhistory = [GenQhistory,Rgentab2];469 elseif sum(SynConnected)>0 && sum(DFIGConnected)==0470 GenPhistory = [GenPhistory,table(Generators.P_MW,’VariableNames’,{PStep})];471 GenQhistory = [GenQhistory,table(Generators.Q_Mvar,’VariableNames’,{QStep})];472 else473 GenPhistory = [GenPhistory,table(WTurbines.P_MW,’VariableNames’,{PStep})];474 GenQhistory = [GenQhistory,table(WTurbines.Q_Mvar,’VariableNames’,{QStep})];475 end476 end477 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%478 %%% Next, the file of the voltages is observed. Inside this, it is %%%479 %%% important to split by the busbar voltage, and look at the %%%480 %%% most significant voltage deviation %%%481 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%482 % Here we create a table with all the voltages on each step483 VStep = sprintf(’U_pu_%d’,count);484 % Another one with all the Pflow and Qflow485 QStep = sprintf(’Qflow_%d’,count);486 PStep = sprintf(’Pflow_%d’,count);487 if count == 1488 VarName = {’BarName’,VStep};489 voltageshistory = table(Voltages.BusName,Voltages.U_pu,’VariableNames’,VarName);

87

Page 104: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

490491 VarName = {’BarName’,QStep};492 Qflowhistory = table(Voltages.BusName,Voltages.Qflow,’VariableNames’,VarName);493 VarName = {’BarName’,PStep};494 Pflowhistory = table(Voltages.BusName,Voltages.Pflow,’VariableNames’,VarName);495 else496 voltageshistory = [voltageshistory,table(Voltages.U_pu,’VariableNames’,{VStep})];497498 Qflowhistory = [Qflowhistory,table(Voltages.Qflow,’VariableNames’,{QStep})];499 Pflowhistory = [Pflowhistory,table(Voltages.Pflow,’VariableNames’,{PStep})];500 end501 % Then we create a matrix with the highest and lowest voltage value with502 % its name503 [value_max,row_max]=max(Voltages.U_pu);504 [value_min,row_min] = min(Voltages.U_pu(Voltages.U_pu>0)); % Lowest value higher than 0505 BusMax = Voltages.BusName(row_max,:);506 BusMin = Voltages.BusName(row_min,:);507508 % As it could happen that the maximum voltage doesn’t change as it509 % is fixed by the synchronous generator, then the next lines take a510 % look at the maximum voltage that changes511 if count == 1512 VMax_second=value_max;513 VMin_second=value_min;514 BusPositionMax2 = row_max;515 BusPositionMin2 = row_min;516517 BusNameMax2 = Voltages.BusName(BusPositionMax2);518 BusNameMin2 = Voltages.BusName(BusPositionMin2);519 else520 % Think that this is taken in order to calculate dQ/dV and521 % dP/dV, so it also makes sense to calculate this maximum522 % voltage not only in a busbar that changes its voltage, but523 % also that changes its P and its Q.524 QChange = table2array(Qflowhistory(:,count+1))-table2array(Qflowhistory(:,count));525 PChange = table2array(Pflowhistory(:,count+1))-table2array(Pflowhistory(:,count));526 % Then we create a second array with the voltages that follow527 % these conditions528 Voltages_Qflowch = (QChange~=0);529 Voltages_Pflowch = (PChange~=0);530531 [Voltages_QPflowch,~] = find(Voltages_Pflowch==Voltages_Qflowch);532533 % The voltage difference on the same bus for two steps is534 % calculated535 VChange = table2array(voltageshistory(:,count+1))-table2array(voltageshistory(:,count));536 % It is then calculated the maximum and minimum voltage on the537 % buses that change the voltage from step to step and follow538 % the Pflow and Qflow conditions presented before539 if sum(VChange)==0540 BusNameMax2=’No Change’;541 BusNameMin2=BusNameMax2;542 else543 [VChangediff0,~] = find(VChange~=0);544 VMax_second=max(Voltages.U_pu(intersect(Voltages_QPflowch,VChangediff0)));545 VMin_second=min(Voltages.U_pu(intersect(Voltages_QPflowch,VChangediff0)));546547 BusNameMax2= Voltages.BusName(Voltages.U_pu == VMax_second);548 BusNameMin2= Voltages.BusName(Voltages.U_pu == VMin_second);549550 BusNameMax2=BusNameMax2(1);551 BusNameMin2=BusNameMin2(1);552 end553 end554555556 % Here we add an interesting parameter to look at the sensitivity557 % of the bus dQ/dV, and we do it for the bus with higher voltage,558 % and with the bus with lower voltage559560 % It is important to know that we might have a problem here because561 % the buses connected to the synchronous machines usually keep a

88

Page 105: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

562 % constant voltage with different loads, so the dQ/dV will be ’0’563 % Therefore, it is important to do the calculations with a564 % different one565 if count > 1566 Q2max = Q1max;567 % The calculations are made with BusNameMax2, which is the568 % Busbar with the maximum voltage that has also changed from569 % the previous step. If we want to calculate it with the570 % maximum voltage, use BusMax or BusMin571 Q1max = Voltages.Qflow(ismember(Voltages.BusName,BusNameMax2));572573 P2max = P1max;574 P1max = Voltages.Pflow(ismember(Voltages.BusName,BusNameMax2));575576 V2max = V1max;577 V1max = VMax_second;578579 dQdVmax = (Q2max-Q1max)/(V2max-V1max);580 dPdVmax = (P2max-P1max)/(V2max-V1max);581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%582 Q2min = Q1min;583 Q1min = Voltages.Qflow(ismember(Voltages.BusName,BusNameMin2));584585 P2min = P1min;586 P1min = Voltages.Pflow(ismember(Voltages.BusName,BusNameMin2));587588 V2min = V1min;589 V1min = VMin_second;590591 dQdVmin = (Q2min-Q1min)/(V2min-V1min);592 dPdVmin = (P2min-P1min)/(V2min-V1min);593 if sum(VChange)==0594 Q1max=0;595 P1max=0;596 dQdVmax=0;597 dPdVmax=0;598 dQdVmin=0;599 dPdVmin=0;600 end601 else602 Q1max = Voltages.Qflow(ismember(Voltages.BusName,BusNameMax2));603 P1max = Voltages.Pflow(ismember(Voltages.BusName,BusNameMax2));604 V1max = VMax_second;605 dQdVmax=0;606 dPdVmax=0;607 Q1min = Voltages.Qflow(ismember(Voltages.BusName,BusNameMin2));608 P1min = Voltages.Pflow(ismember(Voltages.BusName,BusNameMin2));609 V1min = VMin_second;610 dQdVmin=0;611 dPdVmin=0;612 end613 if isempty(dQdVmin)614 dQdVmin=0;615 end616 if isempty(dPdVmin)617 dPdVmin=0;618 end619620 if isempty(dQdVmax)621 dQdVmax=0;622 end623624 if isempty(dPdVmax)625 dPdVmax=0;626 end627 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%628 % Aditionally, it was found probably more interesting a dQ/dV and629 % dP/dV of the bus connected to the biggest load, as for sure it630 % will change the voltage and the power, and it then we can look at631 % this index for the whole load change at the same bus632633 % First of all, which is the maximum load

89

Page 106: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

634 [MaxMVA,rowMaxMVA]=max(Results1.Power_MW.^2+Results1.Power_Mvar.^2);635 MaxLoad=Results1.LoadName(rowMaxMVA);636 % And its busbar637 MaxLoadBusbar=Results1.Busbar(rowMaxMVA);638 % And the voltage in this busbar639 VMax_Load=Voltages.U_pu(ismember(Voltages.BusName,MaxLoadBusbar));640 if count > 1641 Q2Load = Q1Load;642 % The calculations are made with BusNameMax2, which is the643 % Busbar with the maximum voltage that has also changed from644 % the previous step. If we want to calculate it with the645 % maximum voltage, use BusMax or BusMin646 Q1Load = Voltages.Qflow(ismember(Voltages.BusName,MaxLoadBusbar));647648 P2Load = P1Load;649 P1Load = Voltages.Pflow(ismember(Voltages.BusName,MaxLoadBusbar));650651 V2Load = V1Load;652 V1Load = VMax_Load;653654 dQdVLoad = (Q2Load-Q1Load)/(V2Load-V1Load);655 dPdVLoad = (P2Load-P1Load)/(V2Load-V1Load);656 if sum(VChange)==0657 Q1Load=0;658 P1Load=0;659 dQdVLoad=0;660 dPdVLoad=0;661662 end663 else664 Q1Load = Voltages.Qflow(ismember(Voltages.BusName,MaxLoadBusbar));665 P1Load = Voltages.Pflow(ismember(Voltages.BusName,MaxLoadBusbar));666 V1Load = VMax_Load;667 dQdVLoad=0;668 dPdVLoad=0;669670 end671672 % Here it is checked if the busbar with the highest or lowest value is673 % connected to a generator or to a load674 if sum(SynConnected)>0675 % If at least one synchronous machine is connected676 [answerGenMax,positionGenMax] = ismember(BusMax,Generators.GenBar);677 [answerLoadMax,positionLoadMax] = ismember(BusMax,Results1.Busbar);678 [answerGenMin,positionGenMin] = ismember(BusMin,Generators.GenBar);679 [answerLoadMin,positionLoadMin] = ismember(BusMin,Results1.Busbar);680681 answer=[answerGenMax,answerLoadMax,answerGenMin,answerLoadMin];682683 % If at least one synchronous AND ONE DFIG are connected684 if sum(DFIGConnected)>0685 [answerDFIGMax,positionDFIGMax] = ismember(BusMax,WTurbines.GenBar);686 [answerDFIGMin,positionDFIGMin] = ismember(BusMin,WTurbines.GenBar);687 answer=[answer,answerDFIGMax,answerDFIGMin];688 end689690 for i=1:length(answer)691 if answer(i) == 1692 if i == 1693 finanswer{i} = char(Generators.GenName(positionGenMax));694 elseif i == 2695 finanswer{i} = char(Results1.LoadName(positionLoadMax));696 elseif i == 3697 finanswer{i} = char(Generators.GenName(positionGenMin));698 elseif i == 4699 finanswer{i} = char(Results1.LoadName(positionLoadMin));700 elseif i == 5701 finanswer{1} = char(WTurbines.WT_Name(positionDFIGMax));702 else703 finanswer{3} = char(WTurbines.WT_Name(positionDFIGMin));704 end705 else % If no Generator at all is connected

90

Page 107: Impact of Wind Turbines on Power System Stability

A.2. Main Codes Aalborg University

706 finanswer{i} = ’No’;707 end708 end709 matrixvoltages =

[value_max,BusMax,VMax_second,BusNameMax2,dQdVmax,dPdVmax,finanswer(1),finanswer(2)];710 VarNames =

{’MaxV_pu’,’MaxBusName’,’Max2ndV_pu’,’Max2ndBusName’,’dQdV_max2’,’dPdV_max2’,’IsGenConnected1’,’IsLoadConnected1’};711 matrixvoltages=[matrixvoltages,value_min,BusMin,VMin_second,BusNameMin2,dQdVmin,dPdVmin,finanswer(3),finanswer(4)];712 VarNames =

[VarNames,{’MinV_pu’,’MinBusName’,’Min2ndV_pu’,’Min2ndBusName’,’dQdV_min2’,’dPdV_min2’,’IsGenConnected2’,’IsLoadConnected2’}];713 else714 matrixvoltages = [value_max,BusMax,VMax_second,BusNameMax2,dQdVmax,dPdVmax];715 VarNames = {’MaxV_pu’,’MaxBusName’,’Max2ndV_pu’,’Max2ndBusName’,’dQdV_max2’,’dPdV_max2’};716 matrixvoltages=[matrixvoltages,value_min,BusMin,VMin_second,BusNameMin2,dQdVmin,dPdVmin];717 VarNames =

[VarNames,{’MinV_pu’,’MinBusName’,’Min2ndV_pu’,’Min2ndBusName’,’dQdV_min2’,’dPdV_min2’}];718 end719 % It is also added the number of busbars with a voltage higher than 1.05720 % and lower than 0.95 and merge with before’s matrix721 nbars095=sum(Voltages.U_pu<=0.95);722 nbars105=sum(Voltages.U_pu>=1.05);723 matrixvoltages=[matrixvoltages,nbars095,nbars105,dQdVLoad,dPdVLoad];724 VarNames = [VarNames,{’BarsBelow095’,’BarsOver105’,’dQdV_MaxLoad’,’dPdV_MaxLoad’}];725 if count == 1726 voltagestable = cell2table(matrixvoltages,’VariableNames’,VarNames);727 else728 voltagestable = [voltagestable;cell2table(matrixvoltages,’VariableNames’,VarNames)];729 end730731 %% Finally, a table that accumulates the summary of the different732 % tests is stored733734 if count > 1735 summarytable = [summarytable;Summary];736 else737 summarytable = Summary;738 end739 %%740741 fprintf(’Iteration %d finished.\n %d iterations left.\n’,count,N_Steps-count);742743 count = count + 1; % A counter is made to know in which iteration are we744 % There is the option also to define your own matrix with the desired load745746 end747 end748 %% Join all the tables in one table, depending on what it is connected749 if sum(DFIGConnected)>0 && sum(SynConnected)>0750 finaltable = [loadtable,linetable,trafotable,generatorstable,WTtable,voltagestable];751 elseif sum(DFIGConnected)>0752 finaltable = [loadtable,linetable,trafotable,WTtable,voltagestable];753 elseif sum(SynConnected)>0754 finaltable = [loadtable,linetable,trafotable,generatorstable,voltagestable];755 end756 %% Finish the simulation757 % Once the iterations have finished, the program finishes and sends a758 % signal to DIgSILENT, but before sets the load back to its initial value759 OLoad=AllSteps(1,:);760 dlmwrite(’CurrentLoad.txt’,OLoad,’delimiter’,’\t’);761762 pause(0.2);763764 Com2=fopen(’Communication2.txt’,’w’);765 fprintf(Com2,’%d’,1);766 fclose(Com2);767768 Couple = fopen(’Couple.txt’,’w’);769 fprintf(Couple,’%d’,0);770 fclose(Couple);771 disp(’End of the simmulations’)772773 Com2=fopen(’Communication2.txt’,’w’);

91

Page 108: Impact of Wind Turbines on Power System Stability

A. Algorithm-related Information

774 fprintf(Com2,’%d’,0);775 fclose(Com2);776 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%777 %% In order to save the file, the next Script is executed778 % It asks if you want to save the file, if you want779 SaveFile;

92