You are on page 1of 116

Universitt Karlsruhe (TH)

Institut fr Elektroenergiesysteme und Hochspannungstechnik


Institutsleitung: Prof. Dr.-Ing. Thomas Leibfried

Diplomarbeit

Validity of RMS Modelling in concept studies


Malte Hof

Start: 01.05.2008
End: 31.10.2008

University advisor: Prof. Dr.-Ing. Thomas Leibfried


On-site advisor: Dr. Peter Nielsen
Host organization: Vestas Wind Systems A/S

Eidesstattliche Erklrung

Hiermit erklre ich an Eides Statt, dass ich die


vorliegende Diplomarbeit zum Thema

Validity of RMS Modelling in concept studies

selbstndig und ohne unzulssige Hilfe angefertigt habe.

Die verwendeten Literaturquellen sind vollstndig aufgefhrt.

rhus, den 31. Oktober 2008

Malte Hof

Contents
1 Introduction
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6
6
8

Vestas Simulink load flow library (VSLFL)

2 Vestas Simulink load flow solver library (VSLFL)


2.1 Description . . . . . . . . . . . . . . . . . . . .
2.1.1 General . . . . . . . . . . . . . . . . .
2.1.2 Algebraic loops . . . . . . . . . . . . .
2.1.3 Problems . . . . . . . . . . . . . . . . .
2.1.4 Issues to solve . . . . . . . . . . . . . .
2.2 Theory . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Shunt impedance . . . . . . . . . . . .
2.2.2 Series impedance . . . . . . . . . . . .
2.2.3 Cable . . . . . . . . . . . . . . . . . . .
2.3 Redesigns . . . . . . . . . . . . . . . . . . . .
2.3.1 Cable model I . . . . . . . . . . . . . .
2.3.2 Cable model II . . . . . . . . . . . . . .
2.3.3 Cable model III . . . . . . . . . . . . .
2.3.4 Cable model IV . . . . . . . . . . . . .
2.4 Conclusions . . . . . . . . . . . . . . . . . . .
2.4.1 Problems . . . . . . . . . . . . . . . . .
2.4.2 Results . . . . . . . . . . . . . . . . . .

II

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Simulink load flow (SLF)

3 SLF -General specifications


3.1 Motivation . . . . . . . .
3.2 Design requirements . .
3.3 Description . . . . . . . .
3.4 Quick guide . . . . . . .

10
10
10
11
12
12
12
13
14
15
18
18
20
21
23
23
23
25

26
.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

4 Theory

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

27
27
27
28
29
30

Contents
4.1 Nodes and lines . . . . . . . . . .
4.1.1 Example . . . . . . . . . .
4.2 Node Admittance Matrix (NAM) . .
4.2.1 Current flow in the example
4.2.2 NAM definition . . . . . . .
4.3 Node types and abbreviated NAM
4.3.1 Power flow in the example
4.3.2 Node types . . . . . . . . .
4.3.3 Abbreviated NAM (ANAM)

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

30
30
33
33
35
36
36
37
38

5 Branch blocks
5.1 General . . . . . . . . . . . . . .
5.1.1 Branch orientated view . .
5.1.2 Branch block properties . .
5.1.3 NAM and Y0V templates .
5.1.4 Mini NAM . . . . . . . . .
5.2 RLC impedance . . . . . . . . . .
5.2.1 Nominal ratings . . . . . .
5.2.2 Equivalent circuit . . . . .
5.2.3 Equivalent circuit quantities
5.2.4 Per unit values . . . . . . .
5.2.5 NAM and Y0V . . . . . . .
5.2.6 Mini NAM . . . . . . . . .
5.2.7 Simulink mask . . . . . . .
5.3 Overhead line . . . . . . . . . . .
5.3.1 Nominal ratings . . . . . .
5.3.2 Equivalent circuit . . . . .
5.3.3 Equivalent circuit quantities
5.3.4 Per unit values . . . . . . .
5.3.5 NAM and Y0V . . . . . . .
5.3.6 Mini NAM . . . . . . . . .
5.3.7 Simulink mask . . . . . . .
5.4 Cable . . . . . . . . . . . . . . . .
5.4.1 Nominal ratings . . . . . .
5.4.2 Equivalent circuit . . . . .
5.4.3 Equivalent circuit quantities
5.4.4 Per unit values . . . . . . .
5.4.5 NAM and Y0V . . . . . . .
5.4.6 Simulink mask . . . . . . .
5.4.7 Mini NAM . . . . . . . . .
5.5 Transformer . . . . . . . . . . . .
5.5.1 Nominal ratings . . . . . .
5.5.2 Equivalent circuit . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

42
42
42
44
46
47
48
49
49
50
51
51
53
54
54
54
55
55
55
55
56
57
57
57
58
58
59
59
60
60
61
61
62

Contents
5.5.3
5.5.4
5.5.5
5.5.6
5.5.7
5.5.8
5.5.9

Equivalent circuit quantities . . .


Derivation of the NAM . . . . . .
Per unit values . . . . . . . . . .
Template elements identification
NAM and Y0 . . . . . . . . . . .
Mini NAM . . . . . . . . . . . .
Simulink mask . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

62
63
64
66
67
68
69

6 Implementation
6.1 Simulink blocks . . . . . . . . . . . . . .
6.1.1 Init block . . . . . . . . . . . . . .
6.1.2 Branch blocks . . . . . . . . . . .
6.1.3 Node blocks . . . . . . . . . . . .
6.2 Matlab functions . . . . . . . . . . . . . .
6.2.1 Data library (cableLibrary.m )
6.2.2 Initialization (init.m ) . . . . . .
6.2.3 Node monitoring (nomon.m ) . . .
6.2.4 Solver (solver.m ) . . . . . . . .

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

70
70
70
72
73
75
75
76
78
82

7 Applications
7.1 University script benchmark .
7.2 Three turbines benchmark .
7.2.1 Comparison . . . . .
7.3 Half base case benchmark .
7.3.1 Error considerations .
7.3.2 Using exported data .
7.4 PQ chart translation . . . . .
7.5 Wind park compensation . .
7.6 Conclusions . . . . . . . . .
7.7 Future research suggestions

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

88
88
89
92
92
93
97
98
102
104
104

8 Appendix
8.1 Per unit system . . . . .
8.2 Notation . . . . . . . . .
8.3 Abbreviations . . . . . .
8.4 Synonymous used terms
8.5 Matlab files . . . . . . .
8.6 Literature . . . . . . . . .
8.7 Images . . . . . . . . . .

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

.
.
.
.
.
.
.

106
106
107
108
109
109
109
110

.
.
.
.
.
.
.

.
.
.
.
.
.
.

1. Introduction
1.1. Motivation
Since the Renewable Energy Acts were first passed in Europe (Denmark 1981, Germany
1991, Spain 1993) energy produced from wind has sharply increased in an European and
worldwide scale. The total actual amount of installed wind energy power is approximately
90 GW worldwide and approximately 60 GW in Europe. Within the European Union, there
is currently 32 GW of installed power in Germany, which is provided by 20.000 wind turbine
generators (WTGs). According to technical literature, worldwide installed wind energy power
is expected to continue increasing. This is especially true in Europe. Large offshore wind
farm installations in the North and Baltic Sea will contribute to this development.
WTG technology is rapidly advancing. In 1983 WTGs had a rotor diameter of around 15 m
and a nominal power of approximately 55 kW. The most recent Vestas production model,
the V-90, has a rotor diameter of 90 m and a nominal power of 2 or 3 MW. Whilst the WTGs
are themselves increasing in size, so too are the wind farms. This combination of increased
turbine power and farm size means that current wind farms have power ratings in the order
of hundreds of MW and are considered as wind power plants (WPPs). As an example,
the danish offshore WPP Horns Rev has 80 WTGs (V-80, 2 MW) and therefore an installed
power of 160 MW. The planned offshore WPPs in the north and baltic seas are expected to
have installed power values of several hundred MW.1
Even without these future WPPs, wind energy already constitutes 7,2 % of electrical energy
production in Germany. With this significant energy production from wind come a number of
new requirements. Todays challenge for WPPs is not just to produce energy as efficiently as
possible, but also to contribute to electrical grid stability in various ways. There are different
regulations for contribution to grid stability. These regulations are formulated by the grid
operating companies in their grid codes.

All numbers from Bundesverband Windenergie e.V.


(http://www.wind-energie.de/de/statistiken)

1. Introduction
To fulfill these requirements, sophisticated WPP controllers are needed. In this context, special models are needed for use in power system simulation tools. These models are needed
to investigate individual turbine and whole WPP characteristics during special modes of
operation. There is a wide range of models, ranging from aggregated but fast WPP models, to very detailed ones that include the electrical and aerodynamic behavior of individual
turbines.
One major task of the Vestas Power Plant department, where this thesis was written, is
developing these WPP controllers and associated models. To develop a new model, a common approach in the power plant department is to design a prototype in Simulink and test
it in this environment. Simulink, which is based in Matlab, is a standard application for simulating and analyzing technical systems. The advantage of prototyping wind power related
models in Simulink is the openness and graphical interface of this application. Every aspect
of a first model can be controlled and quickly modified. The ability to create Bode plots or
Pole-Zero graphs are provided and are especially suited for the analysis of control system
models. After the prototyping phase the model is implemented in engineering programs like
PowerFactory or PSS/E, which are also used by customers and grid operating companies.
These programs offer the specific power engineering features for tasks such as fault current
calculations or load flow analysis. Because model properties are easily viewed and modified in the Simulink environment it would be advantageous to also perform some of these
standard power engineering studies within that environment. In this way, the performance
of a model could be directly validated during prototyping. Simulink has broad general functionalities, but not a special one for a load flow analysis. However there are possibilities
to create a custom made Simulink environment for this purpose, especially in combination
with Matlab. This thesis discusses ways and methods to perform a WPP related load flow
analysis in Simulink.

1. Introduction

1.2. Foreword
This document consists of two major parts. The first part discusses some improvements
of the Vestas Simulink load flow library (VSLF). The second part describes the Simulink
load flow environment (SLF). The VSLF was already present and in use in Vestas when
this thesis was started. The SLF is a complete rework of a Simulink based load flow by the
author of this thesis.
The mathematical and general notations used throughout this document follow common
practice. Since there are some differences between American, Danish and German electrical engineering notation, an overview can be found at section 8.2 on page 107.
At this point, the author would like to thank Mr. Peter Nielsen for offering and mentoring
this thesis in a profound and constructive way. Further thanks go to Mr. Jorge Martinez
Garcia and Mr. Ignacio Leon Alonso for all the informal discussions and professional advice. Sincere thanks are given to Ms. Francesca Costigan for correcting the English spelling
mistakes.

Part I.

Vestas Simulink load flow library


(VSLFL)

2. Vestas Simulink load flow solver library


(VSLFL)
The Vestas Simulink load flow library (VSLFL) was an existing implementation when this
thesis was started. Originally, this implementation was intended to replace another Matlab
load flow tool, the Vestas Power System Analysis Tool (VPSAT). The VPSAT has shown a
long execution time (within the scale of hours) and therefore VSLFL was created. Use of
VSLFL has significantly reduced execution time amount and is used in the daily work of the
department. However, VSLFL has also inherited some problems and these are the initial
starting point of this thesis. This chapter documents a basic description and theory of the
VSLFL and the attempts to improve it. For the full description of the VSLFL please refer to
document [3].

2.1. Description
2.1.1. General
VSLFL is a pure Simulink implementation. This means there is no written code, but a library
of models that use generic Simulink blocks. Models of the VSLFL are, for example, cable or
transformer branches.
Actually VSLFL contains a complete set of branches, like transformers or cables to perform
a load flow analysis for a wind power plant related circuit. For investigation and improving,
the focus is on the cable branch. This branch was chosen as an exemplary block because it
is not as complicated as the transformer branch. However still load flow calculations are still
not as simple as, for example, a single impedance. Therefore the cable branch is considered
as a good base case to study some VSLFL properties.
One advantage of pure Simulink is that different program sections can quickly be seized
and modified. On the other hand, expressing basic math operations with individual Simulink
blocks results in a large amount of blocks which are sometimes hard to overview. This
is especially true in combination with goto blocks. One feature of Simulink is to express

10

2. Vestas Simulink load flow solver library (VSLFL)


equations by back looping a blocks output. When a blocks output is directly (without a time
delay) back looped, this is called an algebraic loop in Simulink. The VSLFL is based on
algebraic loops, therefore a short description to these loops is given below.

2.1.2. Algebraic loops

Figure 2.1.: The quadratic equation x 2 12 x + 35 = 0 expressed in Simulink.


In figure 2.1 the algebraic loop is highlighted in red. When the simulation is executed a
solution is found by iteration at simulation time zero. The solution which is found depends
on the starting guess, which can be specified with the initial condition block. Here, the
second solution x2 = 5 is not found.
In general, algebraic loops are detected and solved numerically by the Simulink solver before
the simulation time starts. By inserting a time delay block, an algebraic loop can be broken.
The loop longer exists. By doing so, a solution of the equation is reached at some point
during the simulation. The difficult task is then to determine the time point when the result
becomes stable. This is especially required for computing successive load flow analyses
and changing input variables.

11

2. Vestas Simulink load flow solver library (VSLFL)

2.1.3. Problems
The following problems were documented:
There were cases documented when Simulink was unable to solve the algebraic
loop(s) and displayed an error. After some minor changes to the input data, there
was no error when the simulation was executed again.
Implementation of complex calculations with generic Simulink blocks was sometimes
hard to overview. At some places, numerous addition or subtraction blocks in combination with gotos were used. Also some constant parameters were calculated at each
time step.

2.1.4. Issues to solve


In coordination with the advisor at Vestas, the following tasks were fixed:
Change the implementation in such way, that the KLMN constants of the cable branch
(equation (2.2.14)) are only calculated once, and not every time step.
Make the implementation more clear and maintainable.
Find a method to avoid the error when Simulink is unable to solve the algebraic loops.

2.2. Theory
The VSLF concept uses two main connecting lines between branches. These lines carry
the actual values for active/ reactive power and voltage/ voltage angle. By using complex
values, there are two connecting lines: one for apparent power S , and the other for a complex voltage U . The SLF Simulink blocks considered have always two inputs (U 2 and S 1 )
and two outputs (U 1 and S 2 ). The input values of a block are considered to be known or
calculated by a foregoing block. Variables with index 1 are typically assumed to be at the
WTG side (power known, voltage unknown), and values with index 2 are assumed to be on
the grid side (power unknown, voltage known). This theory section describes how the VSLF
branches modify the values of the U and S lines.

12

2. Vestas Simulink load flow solver library (VSLFL)

2.2.1. Shunt impedance

S1

S2

C
2

Figure 2.2.: Shunt element. This component is only used in conjunction with the cable
branch. Therefore the capacitance is set to C2
.

The two lines, connecting all blocks, are apparent power S and voltage U . Voltage is
assumed to be unaffected by a capacitive shunt element. Considering power, a shunt capacitance element can be considered as a reactive power (Q) source.

The admittance of
the shunt element is:

Y = j

C
2

The var production S of


the shunt element is:

S = U IY
Power balance is:
Using (2.2.1) in (2.2.2):

S = |U |2 Y

(2.2.1)

S 2 = S 1 S

(2.2.2)

S 2 = S 1 |U |2 Y

Modifications

Voltage value:
No modification

13

(2.2.3)

2. Vestas Simulink load flow solver library (VSLFL)


Power value:

S 2 = S 1 |U |2 Y

(2.2.4)

2.2.2. Series impedance

I1

I2

U1

U2

Figure 2.3.: Series impedance with RL elements

I 1 Z Ser i es = R + jL
U1

I2

U2

Figure 2.4.: Series impedance with an impedance

The series impedance branch from figure 2.3 consists of a ohm resistance R and an inductance L. Both elements form the series impedance Z in figure 2.4.

Using Kirchhoffs voltage law in figure 2.4:

U1 =Z I +U2

14

2. Vestas Simulink load flow solver library (VSLFL)


Expressed with apparent power instead of current:

U1 =Z

S1
U1

+U2

(2.2.5)

The power loss over the impedance can be described by S :

S 2 = S 1 S
Rewritten:

S2 = S1

|U 1 U 2 |2
Z

(2.2.6)

Modifications

Voltage value:

U1 =Z

S1
U1

+U2

(2.2.7)

Power value:

S 2 = S 1 S

(2.2.8)

2.2.3. Cable

I1

U1

I2

C
2

C
2

Figure 2.5.: Cable -equivalent circuit

15

U2

2. Vestas Simulink load flow solver library (VSLFL)


In figure 2.6 the cable capacitance C is split up to both ends of the -equivalent circuit. This
is the usual approach. However, for defining the corresponding shunt admittances, there are
two equivalent ways. The VSLFL documentation [3], defines Y = jC and each of the two
shunt admittances as 2 Y . Since this chapter describes some VSLFL aspects, the same
definition is used here. In the second part of this document, the two shunt impedances will
C
each be defined as Y Shunt = j 2 . The use of this definition allows a single variable for the
shunt admittance.

I1

Z = R + jL
IZ
I S1

U1

I2
I S2

2Y

2Y

U2

Y = jC

Figure 2.6.: Cable equivalent circuit with impedance Z and shunt admittances 2 Y .
The goal is now to get a matrix expression with U 1 and I 1 on the left side and U 2 and I 2
on the right side. Then one can partially inverse the matrix equation for the second line, and
obtain an expression with U 1 and I 2 on the left side.

Using Kirchhoffs laws in figure 2.6:

U1 =ZIZ +U2
= Z (I 2 + I S2 ) + U 2

= Z (I 2 + 2 Y U 2 ) + U 2

= (2 Z Y + 1) U 2 + Z I 2

16

(2.2.9)

2. Vestas Simulink load flow solver library (VSLFL)

For the currents of figure 2.6 one can write:

I 1 = I S1 + I Z
= 2 Y U 1 + I 2 + I S2

=2Y U1+I2+2Y U2

Inserting (2.2.9) for U 1 :

I 1 = 2 Y [(2 Z Y + 1) U 2 + Z I 2 ] + I 2 + 2 Y U 2

= Y (4 Z Y + 2) U 2 + 2 Z Y I 2 + I 2 + 2 Y U 2

= (4 Z Y + 4) Y U 2 + (2 Z Y + 1) I 2

(2.2.10)

Equations (2.2.9) and (2.2.10) can now be rewritten in matrix notation:

U1
I2

  
(2 Z Y + 1)
Z
U2

I2
4ZY +4 2ZY +1

  
A B
U2

C D
I2

With substitutions ABCD:

U1
I2

(2.2.11)

In [3] matrix (2.2.11) is partially inversed by using again Kirchhoffs laws. Another possibility
is to use the rules for partial matrix inversion from [1], page 248. In both approaches the
result for the KLMN substitutions is the same.

Second row (pivot row) of (2.2.11) is now inversed:

U1
I2

With KLMN substitutions:

U1
I2

BC
A D
=
C
D

B
 
D
U2
1
I1
D

!  
U2

I1
M N
K

I 1 expressed with voltage and current:


!
!
U1
K L
=

I2
M N

17

 U 2
S1
U1

(2.2.12)

(2.2.13)

2. Vestas Simulink load flow solver library (VSLFL)


Modifications

Voltage (and current) value:

U1
I2

M N

 U 2
S1
U1

(2.2.14)

Power value:

S 2 = U 2 I 2

(2.2.15)

2.3. Redesigns
At the beginning of this thesis some VSLFL models were rebuilt by using different Simulink
features. The idea was to learn more about general Simulink attributes and why the problems which were mentioned occur. Another task was to improve some aspects of the models. For example, the cable model calculated the constants KLMN not only once, but every
time when the block was executed. Another issue was to improve traceability of the implementation. Some VSLFL blocks use up to three layers with numerous blocks and goto
commands.

2.3.1. Cable model I


The approach is to use two shunt elements and a line impedance model for obtaining the
complete equivalent circuit. The individual elements are connected to each other according to the known/unknown values.

Figure 2.7.: Cable model I in Simulink

18

2. Vestas Simulink load flow solver library (VSLFL)


In this figure the advantage of the VSLFL concept can be seen. Unknown values (red
outputs) for an individual element can be back looped to an input of another block. In this
way only the two known values at the very beginning of the cable (S1) and the very end
(U2) are specified. The unknown values for U1 and S2 are calculated iteratively by Simulink
before the simulation time starts. (When the user has clicked the start simulation button).
For the shunt impedance model, the input voltage is fed directly through towards the output.
The output apparent power is calculated according to (2.2.4). In Simulink this takes place
as in the figure below.

Figure 2.8.: Shunt impedance element of Cable model I

Voltage and power losses of the series impedance element are calculated according to
(2.2.8) and (2.2.7). Equation (2.2.7) solved for U 1 results in a quadratic expression. Under
the assumption that the voltage drop is not too high, only the solution close to U 2 is of
interest and used as an initial guess. The Simulink Block algebraic constraint can only
handle inputs of type real. Therefore one algebraic constraint block iterates the and
another the part of the voltage U 1 . After this, U 1 is inserted in (2.2.8) to determine the
other unknown value S 2 . Figure 2.9 shows the resulting Simulink block diagram.

19

2. Vestas Simulink load flow solver library (VSLFL)

Figure 2.9.: Series impedance element of Cable model I

2.3.2. Cable model II


This approach uses equations (2.2.14) and (2.2.15) to calculate the unknown values. Again,
the iterating part needs to be split up into real and complex parts. This models uses complex
matrix values in the lines between the blocks and iterates U1 I2 in form of a vector. After the
iteration, S 2 is calculated by using equation (2.2.15). The constants KLMN are calculated
only once by the initialization function of the Simulink mask. (Figure 2.10 is actually the
underlying subsystem of the top level block.)

20

2. Vestas Simulink load flow solver library (VSLFL)

Figure 2.10.: Cable model II in Simulink

2.3.3. Cable model III


Here 2.2.14 is also solved for U1 and I2 . The difference is the applied Simulink equation
solving functionality. Instead of an algebraic constraint solver, Cable model III uses an Embedded Matlab function block. This block allows use of a limited set of Matlab commands
inside the Simulink environment. Here, the Matlab fsolve command is used to solve the
equation system.

21

2. Vestas Simulink load flow solver library (VSLFL)

Figure 2.11.: Cable model III in Simulink

In the following, the code of the embedded Matlab block from figure 2.11 is shown. Unfortunately the fsolve command is not included in the command set of the embedded Matlab.
Thus, it is necessary to call out from the embedded Matlab function for a real (so called
extrinsic) Matlab function.
1
2
3
4
5
6
7

function [U1,I2]= fcn(K,L,M,N,S1,U2)


% This block supports an embeddable subset of the MATLAB language.
% See the help menu for details.
eml.extrinsic('solver', 'func') %Declare functions as extrinsic.
solution=solver(K,L,M,N,S1,U2);
U1=solution(1);
I2=solution(2);

The code of the extrinsic Matlab function is:


1
2
3
4
5
6
7

function [solution]=solver(x0,K,L,M,N,U2,S1 )
options=optimset('Display','iter','NonlEqnAlgorithm',...
'lm', 'TolFun', 1e10,'Diagnostics', 'on'); %Output style options.
[x,fval,exitflag,output]=fsolve(@(x) func(x,K,L,M,N,U2,S1) ,x0,options);
%fsolve call.
solution=[x(1), x(2)]; %Building solution array.
%endfunction

Using the fsolve command requires by default another function which expresses the equation to be solved. This function (func ) is also declared as extrinsic. The code of this
function is:

22

2. Vestas Simulink load flow solver library (VSLFL)


1
2
3

function F = func(x,K,L,M,N,Ur,Ss)
F= x [K L; M N] * [Ur; conj(Ss/x(1))];
%Solution Vector is x=[x(1);x(2)]=[U1;I2]

By using written code, the implementation becomes short and overview is possible. The
disadvantage is, that two (very short) extra Matlab files are required.

2.3.4. Cable model IV


The cable model IV also uses the Matlab fsolve command. Instead of an embedded
Matlab block, it uses a Level-2-M-file S-function block, or just S-function block. The Sfunction block offers the possibility to design a new Simulink block by directly describing the
input/output parameters and the block behavior in Matlabs m-programming language. The
block view is just the generic Simulink S-function block and not shown here.

2.4. Conclusions
2.4.1. Problems
Algebraic loops
Algebraic loops are identified as significant problem. In general, these loops are critical.
Simulink outputs by default a warning when they occur. The selected Simulink solver is
responsible to solve the equation system that corresponds to the algebraic loop. By using
the Simulink command line debugger, it is possible to track the single iterations when the
loop is solved. Theoretically convergence and other problems could be investigated in this
way. Practically, this proves to be a complex task. Simulink can use plenty of different
solvers, each with numerous options. Investigating and especially understanding, these
mathematically sophisticated solvers is a time consuming and difficult venture. Another
issue here is the consideration that, even if a root cause could be identified, it may be found
to rely on Simulink behavior which is unchangeable.
Figure 2.12 shows two cable branches stick together. Such an arrangement could, for example, be used to model a long cable. An apparent power input is given by two constant
blocks. The known voltage is U2 on the second cable block element. Unknowns are U1 on
the first cable element (=beginning of the whole cable) and S2 on the second cable element
(=end of the whole cable). This model contains an algebraic loop which is highlighted by

23

2. Vestas Simulink load flow solver library (VSLFL)


Simulink in red. It should be noted that the loop contains both cable branches. When this
example is extrapolated to a larger circuit, the algebraic loop contains more and more elements. The more elements an algebraic loops contains, the more complex is the resulting
equation system.
As a general tendency, it seemed that the Unable to solve algebraic loop errors occurred
more often when there were more branches. This behavior could be explained by the size of
the algebraic loop and the resulting increased complexity of the equation system. Algebraic
loops and their increased complexity when there are more branches in the circuit, is an
inherent problem of the VSLFL approach.

Figure 2.12.: Two cables branches sticked together


Algebraic loops can be broken by inserting a delay block into the loop. The loop becomes
then no more existent and a dynamic solution is reached during the simulation. The problem is now to determine when a solution is reached. This is especially important when
successive load flow calculations are automatically performed inside a simulation. The arrangement from figure 2.12 would then have, for example, a ramp block on one input. Until
the VSLFL blocks reach a stable value, and are therefore ready for the next load flow, it
would be necessary to freeze the input coming from the ramp block in some way. Another
aspect is that debugging and tracking results in large systems with numerous delay blocks,
all influencing each other, becomes close to impossible.

24

2. Vestas Simulink load flow solver library (VSLFL)


Initial guess
A common practice for load flow calculations is to assume that the voltage drop is not too
high and to choose the known voltage as an initial (voltage) guess. In [2], such a guess,
is named as flat start. For the VSLFL, the algebraic constraint solver and the initial guess
block offers the opportunity to provide an initial guess to the Simulink solver. Unfortunately, it
is not possible to access the initial guess field of the algebraic constraint block during runtime
of a simulation. This would again be especially useful for successive load flow operations.
When the input values are close to each other, it would be more suitable to use the last
result as an initial guess, rather than performing a flat start each time.

2.4.2. Results
Some improvements were made on the existing implementation. Further on, algebraic loops
were identified as the main critical point and source of errors. It was not possible to eliminate
these loops, as the VSLFL library is based on them. Detailed tracking iterations of the
Simulink solver by using the Simulink debugger was stopped after a certain time. This was
due to the time consuming nature of the complicated solver theory and uncertain outcomes.
Breaking the loops by using delay blocks resulted in untraceable behavior and was not
considered as a solution.

25

Part II.

Simulink load flow (SLF)

26

3. SLF -General specifications


3.1. Motivation
After encountering the described problems with the VSLFL, the decision was taken to do
a complete redesign of a Simulink based load flow from scratch. Following the common
load flow analysis approach seemed promising. Simulink is based on Matlab, which is a
standard tool for matrix calculations. Thus, special commands for fast matrix calculations
are provided. A Simulink based load flow program in the common matrix style could take
advantage of these functionalities.

3.2. Design requirements


The following requirements were fixed in agreement with the advisor at Vestas:
Easy to use Simulink user interface.
The user should be discharged from any matrix handling.
Giving results in acceptable computation time.
The benchmark is to perform 3000 successive load flow calculations for the 100 MW,
50 turbines base case in a maximum time of 5 min. The number of 3000 load flow
operations results from the requirement to track 30 s grid events with a resolution of
10 ms.
Usable for 50 and 60 Hz grid environments.
Maintainable code by following the Matlab programming style guidelines defined in [4].

27

3. SLF -General specifications

3.3. Description
The load flow approach explained in this document part is named Simulink load flow (SLF).
Basically, the SLF consists of a Simulink part and a Matlab part. The Simulink part can be
divided into the main categories, nodes and branches. The Matlab part includes five files
which need to be in the Matlab working directory. The files are named init.m , nomon.m
, solver.m , cableDataLibrary.m and export2Excel.m . These files provide the
load flow functionality to the circuit created in Simulink. Another file allSlfResults.xls
contains a data frame when the export to Excel option is chosen. This file should be in the
Matlab working directory. If not present, this file will be created by Matlab. However the
symbol and unit frame for the exported data is then not provided. It should be noted, that
exported data already existing in the Excel file will not be deleted first, but only overwritten.
The Simulink circuit is created by using the node and branch blocks provided. The Matlab
part is working behind the scenes. In normal operation the user only runs the Simulink part
and the Matlab functions are called by Simulink blocks or other Matlab functions.
The SLF can operate in two modes. One is called single load flow mode and the other is
named successive load flow mode. In single load flow mode a single load flow analysis
is performed. As an option, additional results, such as branch currents, can be exported
to Excel in this mode. In successive load flow mode the SLF calculates successive load
flows for changing input variables. Input variables can, for example change when an active
power set value is given by a Simulink ramp block. In successive load flow mode, outputs
can not be exported to Excel. The standard Simulink result view of node voltages and
Slack node power is provided in both cases. After each load flow analysis information about
convergence and iteration numbers are displayed in the Matlab command window.
The normal use of SLF is briefly explained. First the user arranges node and branch blocks
and adds the connections between them in Simulink. Second, the user enters the branch
data in the branch masks and specifies the input parameters of the nodes. The init block
(per default in red color) allows control of some simulation settings. After this is done, the
Simulink simulation can be started in the normal way and load flow results are calculated
and displayed in Simulink.

28

3. SLF -General specifications

3.4. Quick guide


Per default block background colors are yellow, green, dark green and blue for the
Slack node, PQ and passive PQ nodes (bars), ground nodes and branches. These
colors are identification colors. The identification color is used by the SLF to identify
circuit elements. Therefore these color values are only allowed for the mentioned
blocks. Unused SLF blocks within the simulation should be deleted or set to another
background color. The name of the init block (init) may not be changed since this
name is used to access it.
Node blocks must always alternate with branch blocks. Circuits must be closed by
node blocks. In the following rule of thumb the Slack node (yellow) is considered as
a green node. In default block color, green blocks (nodes) must be followed by blue
blocks (branches) and vice versa. Green blocks must be on the outer borders of the
circuit.
Branch blocks have a defined left and right side, signified by capital, respectively small
letters on the block. Thus, in a Simulink circuit with transformers, the voltage level is
meant to rise from the right to the left screen side. It is recommended to keep this
defined orientation of the branch blocks and avoid rotating them.
Only branch and node blocks are allowed in a circuit. The SLF ignores blocks around a
circuit as long, as they are are not in one of the above mentioned identification colors.
It is not allowed to add additional inputs/outputs for branch blocks whereas for node
blocks this is permitted.
There must be exactly one Slack node in the circuit.

29

4. Theory
In this chapter, a brief example is used to derive the necessary equations for a load flow
study. Equations and content of this chapter are orientated on [1].

4.1. Nodes and lines


4.1.1. Example

Figure 4.1.: Single phase diagram of a small windfarm

Here a typical layout of a small wind farm is shown. The transformer close to the turbines is
the WTG 690 V/22 kV transformer, which is,for Vestas turbines, located inside the nacelle.
The transformer close to the grid symbol is the medium/high voltage transformer at the point
of common coupling (PCC). Turbines and PCC transformer are connected with medium
voltage cables. The transmission network is assumed to be balanced and with the same
impedance at all three phases. This allows the representation as a single phase circuit like
the one shown. The red framed area in figure 4.1 will now be specially considered and
cut out of the rest of the diagram. Also, the cable graphic symbols are replaced by their
equivalent circuits.

30

4. Theory

C
2

C
2

Figure 4.2.: Equivalent circuit of the red boxed area in figure 4.1

This equivalent circuit can be interpreted as a mathematical graph. A mathematical graph


consists of two basic elements, nodes and connecting lines. In figure 4.2 nodes are the
white filled circles and lines are represented by the impedances. This figure is now modified
for obtaining a more convenient form.

Modification of the equivalent circuit


Whenever possible admittances are combined.
Impedances Z are replaced by admittances y in per unit values.
Nodes connected to ground are always numbered by zero.
The rest of the nodes are numbered consecutively starting from one.

31

4. Theory

y 12

y 23

y 10

y 20

y 30

Figure 4.3.: Modified graph of figure 4.2

In the following analyses, single phase circuits will always be considered in the form as
shown in figure 4.3. In this figure some properties of the modified graph can be observed.

Properties of the modified Graph


The graph is closed and every line has a node on each end.
When following a path through the graph, a node and a line occur will always occur
alternately.
A mathematical graph can be described either by a drawing or by its adjacency matrix. When
a drawing of a graph has n nodes, the corresponding adjacency matrix has the size n n.
The content of the adjacency matrix expresses the dependences of the nodes to each other
and to themselves. There is not just one adjacency matrix, several laws of how to build this
matrix are possible. In this document, only one adjacency matrix is used. This adjacency
matrix will be called Node Admittance Matrix (NAM). The law for building the NAM is derived
in the following.

32

4. Theory

4.2. Node Admittance Matrix (NAM)


4.2.1. Current flow in the example
The turbines from figure 4.1 can be interpreted as current sources:

i Gr i d

i W T G1

i W T G2

y 12

u1

y 23

y 10

y 20

u2

i W T G3

y 30

u3

Figure 4.4.: Example circuit with voltages and currents.

In our small wind farm arrangement from figure 4.1, current is usually flowing in the direction
as displayed above. Arrows for currents make the most sense for real currents I , that do
not include an imaginary part. A sign convention for a complex current I has to be made by
making an agreement for the currents real and imaginary part. For later on using Kirchhoffs
current law without the need to split up a complex variable I into and parts, the sign
agreements for (I ) and (I ) must be equal.

(I ) flowing into a node:


(I ) flowing into a node:

positive sign.
positive sign.

(I ) flowing out of a node:


(I ) flowing out of a node:

negative sign.
negative sign.

33

4. Theory
The currents can be combined and named after the nodes number.

i 1 = i W T G 1 i Gr id

(4.2.1)

i 2 = i W T G2

(4.2.2)

i 2 = i W T G3

(4.2.3)

This results in the following figure.

i1

i2

y 12

u1

y 10

y 23

y 20

u2

i3

y 30

u3

Figure 4.5.: Example with voltage and combined currents.

Applying Kirchhoffs current law on each node in figure 4.5 is used to derive the corresponding NAM:

i 1 = u 1 y 10 + (u 1 u 2 ) y 12

i 2 = u 2 y 20 + (u 2 u 1 ) y 12 + (u 2 u 3 ) y 23
i 3 = u 3 y 30 + (u 3 u 2 ) y 23

(4.2.4)
(4.2.5)
(4.2.6)

Extending these equations gives:

i 1 = u 1 y 10 + u 1 y 12 u 2 y 12

(4.2.7)

i 3 = u 3 y 30 + u 3 y 23 u 2 y 23

(4.2.9)

i 2 = u 2 y 20 + u 2 y 12 u 1 y 12 + u 2 y 23 u 3 y 23

(4.2.8)

Factoring out u and regrouping:

i 1 = (y 10 + y 12 ) u 1 y 12 u 2

i 2 = (y 12 ) u 1 + (y 20 + y 12 + y 23 ) u 2 + (y 23 ) u 3
i 3 = (y 23 ) u 2 + (y 30 + y 23 ) u 3

34

(4.2.10)
(4.2.11)
(4.2.12)

4. Theory
In matrix notation:



i1
y 10 + y 12
y 12
0
u1
i 2 = y 12

y 20 + y 12 + y 23
y 23
u 2
0
y 23
i3
y 30 + y 23
u3

(4.2.13)

4.2.2. NAM definition


The matrix containing the admittances in (4.2.13) is an adjacency matrix which refers to the
graph. This adjacency matrix is called the Node Admittance Matrix, or just NAM. Comparing
the NAM from (4.2.13) to its graph from figure 4.7 reveals the rule for building the NAM.
The admittances leading to the ground node (index 0) will be of special interest later. These
admittances are collected in a separate Vector called Y0 , Y0V Vector or just Y0V.
Definition 1: Setting up the NAM and Y0V

Assumed is a graph with the highest node number n. The NAM is then a n n matrix
with elements NAM ab . Also Y0 is a n 1 vector with elements Y0a . Indexes a, b are
node numbers with (1 a, b n).

Diagonal and non diagonal elements in the NAM are described by:

NAM ab =

n
X

(Y

a=1

a0

+Y

ab )

if a = b
(4.2.14)

a6=b

ab

if a 6= b

Elements of the Y0V are described by:

Y 0a = Y

(4.2.15)

a0

In spoken words, (4.2.14) and (4.2.15) can be rewritten:


Diagonal elements in NAM :

Sum of all admittances leading to this node.

Non diagonal elements in NAM:

Negative connecting admittance.

Element in Y0V:

Admittance leading to ground for this node

35

4. Theory

4.3. Node types and abbreviated NAM


4.3.1. Power flow in the example
With the feed-in current and voltage given at each node, the feed-in power can be defined:

s Gr i d

s W T G1

s W T G2

y 12

u1

y 10

y 23

y 20

u2

s W T G3

y 30

u3

Figure 4.6.: Example circuit with voltages and apparent power values

Since the voltage values u in figure 4.6 and 4.5 are equal, one can define a sign convention
for power flow. The power flow sign convention is based on the current flow sign convention
and P = U I cos or respectively Q = U I sin . The angle is the phase shift between
voltage and current.
Active power P flowing
Reactive power Q flowing

into a node:
into a node:

positive sign on P .
positive sign on Q.

Active power P flowing


Reactive power Q flowing

out of a node:
out of a node:

negative sign on P .
negative sign on Q.

Power arrows starting at the same node can be combined and named after the node.

s 1 = s W T G 1 s Gr id

(4.3.1)

s 2 = s W T G2

(4.3.2)

s 3 = s W T G3

(4.3.3)

36

4. Theory
This results in the following figure:

S1

S2

y 12

u1

y 23

y 10

y 20

u2

S3

y 30

u3

Figure 4.7.: Example circuit with voltages and combined apparent power values

With the power on each node this gives:



0
s1
u1 0
i1
s 2 = 0 u 2 0 i 2
0
0 u3
s3
i3

(4.3.4)

Inserting (4.2.13) into (4.3.4):




s1
u1 0
0
y 10 + y 12
y 12
0
u1

s 2 = 0 u 2 0 y 12
y 20 + y 12 + y 13
y 23
u 2
s3
y 30 + y 23
u3
0
0 u3
0
y 23
(4.3.5)

4.3.2. Node types


The variables in (4.3.5) and per node are:

37

4. Theory

Active Power
Reactive power
Voltage magnitude
Voltage angle

P
Q
|U|

For each node two variables are always specified and two variables are unknown. The node
is named depending on the specified variables.
Node name

Known

Unknown

Slack node
PQ node
PV node

U,
P, Q
P, U

P, Q
U,
Q,

Table 4.1.: Node types

4.3.3. Abbreviated NAM (ANAM)


If equation (4.3.5) needs to be solved for voltage values, the result is a quadratic equation
system. A nonlinear equation system can in most cases not be solved discretely. The
solution for this is to apply an iterative method. Most iterative methods require the inversion
of the NAM. However, at this point another problem occurs. In power transmission systems,
the admittances leading to ground (y a0 in the NAM) are usually very small. For a first
attempt to inverse the NAM from (4.2.13) they are therefore neglected.



y 12

y 12
0


det(nam ) = y 12 y 12 + y 13 y 23

0
y 23
y 23

(4.3.6)

= y 12 (y 12 + y 13 )y 23 y 23 y 23 y 12 y 23 y 12 y 12

= y 12 y 12 y 23 + y 12 y 13 y 23 y 23 y 23 y 12 y 23 y 12 y 12
=0

A matrix with a determinant equal to zero is singular and cannot be inversed. With respect
to the admittances leading to ground, the NAM becomes invertible. However, in power
transmission networks these values are very small, the matrix is still close to singular. Calculations made with a close to singular matrix generates a warning in Matlab because such
a calculation includes large errors on the result. Additionally the power losses in the system

38

4. Theory
are not known a priori, therefore at least one node with an undefined power must be in the
system. Such a node is known as a Slack node.
From the electrical point of view, the Slack node can be considered as an infinite PQ source
(huge power plant), which delivers or receives missing or excessive PQ power for a circuit.
The Slack node balances power values of the circuit in such a way that the sum of PQ
values for all nodes (including Slack) plus the PQ losses for all circuit branches is zero.
Mathematically the Slack node helps to avoid a singular, or close to singular NAM.

Equation (4.2.13), which contains the close to singular NAM, is:


y 10 + y 12
y 12
0
u1
i1
y 12
y 20 + y 12 + y 23
y 23 u 2 = i 2
0
y 23
y 30 + y 23
u3
i3
Written generalized:


y 11 y 21 y 13
u1
i1
y 21 y 22 y 23 u 2 = i 2
y 31 y 23 y 33
u3
i3

(4.3.7)

The Slack node is now assumed to be the first node. This corresponds to the first row in
the NAM of (4.3.7). This line will be taken out of the equation system and used after the
remaining system has been solved.




 
u1
y 21 y 22 y 23
i1

u2 =
y 31 y 23 y 33
i2
u3

(4.3.8)

For inversion, a matrix has to be square. From (4.3.8) a square matrix can be built by
transferring the products with u1 on the right side of the equation system.

    



y 22 y 23
u2
i1
y 21

=
u1
y 23 y 33
u3
i2
y 31

39

(4.3.9)

4. Theory
This equation can be further split up into the systems admittance elements. In (4.2.13) the
sum of a row in the NAM is the admittance leading to ground for this node. Thus, one can
write:

y 21 + y 22 + y 31 = y 20

(4.3.10)

y 31 + y 32 + y 33 = y 30

(4.3.11)

y 21 = y 20 y 22 y 23

(4.3.12)

Rearranged:

y 31 = y 30 y 32 y 33

(4.3.13)

Insert (4.3.12) and (4.3.13) in (4.3.9) gives:


y 22

y 32


    
y 22 y 23
u2
i1

=
u1
y 32 y 33
u3
i2

  
  
y 23
u2
y 22 y 23
i1

u1
=
u1
y 33
u3
y 32 y 33
i2

 
  
y 22 y 23
u2u1
i1

=
u1
y 32 y 33
u3u1
i2



y 20 y 22 y 23

y 30 y 32 y 33


y 20

y 30


y 20

(4.3.14)
y 30

or

nam n1 (un1 uSlack ) = in1 u Slack y0

(4.3.15)

Equation (4.3.15) contains the following variables:

nam n1 Abbreviated NAM.


Compared to the NAM, the row and column corresponding to the Slack node are
missing.

un1

Abbreviated voltage vector of all nodes.


Compared to the complete voltage vector, the voltage of the Slack node is missing.

40

4. Theory

uSlack

Vector with the Slack voltage in all positions of the vector.


This has the same size as the vector un1 .

in1

Abbreviated current vector of all nodes.


Compared to the complete current vector, the current of the Slack node is missing.

u Slack

Slack node voltage.

y0

Vector of all impedances leading to ground for each node except the Slack node.

The Slack node has a specified voltage and is able to hold this voltage in all cases. The
power loss over the Slack nodes ground impedance is constant. The value of the Slack
node ground impedance does not affect the voltages of the other (not Slack node type)
nodes. The Slack node ground impedance is of importance when the current flowing into
the Slack node is calculated. The current of the Slack node can be calculated from the row
in the NAM, that corresponds to the Slack node number. The voltages u 2 and u 3 are known
from the preceding calculation:

y 11 y 12 y 13


u1
u 2 = i 1
u3

(4.3.16)

or

(Slack node row in nam ) u = i Slack

(4.3.17)

The abbreviated NAM from (4.3.15) is no longer close to singular and can therefore be inversed. Inversing the ANAM is necessary for calculating the values in (4.3.5) by a numerical
method. The numerical methods for solving equation (4.3.5), applied by the SLF are the
current iteration algorithm and the Newton Raphson method. Both algorithms are presented
at section 6.2.4 on page 82.

41

5. Branch blocks
In this chapter the available branch blocks of the SLF are described. Branch blocks are,
for example, cables or transformers. Firstly, the element is presented in a general way by
describing the nominal ratings and the used equivalent circuit. Secondly, the operations on
the NAM and Y0V are explained. Finally, there is a screen shot showing the branch blocks
mask in Simulink. Two ideas of the author are explained in this chapter. One is the branch
orientated view and the other is using templates for each branch to set up the NAM and Y0V.
Both ideas are used in practical programming. In the authors opinion they help to reduce the
programs complexity and make its operation clearer. A side effect of the template approach
is another way to derive the Y0V modification for the transformer. 1

5.1. General
5.1.1. Branch orientated view
A common way of setting up the NAM by hand is to look at one node and calculate the sum
of the admittances connected to it. Then the NAM diagonal element for this node is known
and entered into the NAM. After this, one can look at each impedance between the node and
its neighbor nodes and make the NAM modification for non diagonal elements. Then, the
considered node is changed until the complete NAM is built. Figure 5.1 and equation (5.1.1)
illustrate this approach for three nodes. First, node 1 is considered and NAM modifications
are made. Then node 2 and node 3 are surveyed and NAM modifications are made for
these nodes.

In [1] the transformer Y0V modification is derived from equation (4.3.15) on.

42

5. Branch blocks
replacements
1

y 10

y 12

y 23

y 20a

y 20b
0

y 30

Figure 5.1.: Node orientated approach for setting up the NAM

y 10 + y 12
y 12
0
y 12 + y 20a + y 20b + y 23
y 23
nam = y 12
0
y 23
y 30 + y 23

(5.1.1)

In fact, an earlier version of the SLF worked by this node orientated view approach. However, the resulting code became obscure and over complicated. Several nested loops were
implemented and recursive programming was used. Eventually the program worked, however it was almost impossible to retrace results.2 Therefore, the concept was changed. The
approach described here was chosen in order to benefit from one of the graphs properties.
A node block can have more than one branch block connected to it. However, a branch block
is always connected to exactly two node blocks. In the SLF arrangement these two neighbor
nodes are located at the left and right side of a branch. Therefore, it is more suitable for an
algorithm to look first at a branch and detect the two neighbor nodes of this branch. The
arrangement and values for the admittances inside the branch are known, and with the detected neighbor nodes of the branch, the NAM and Y0V modification can be made. Now one
looks at the next branch and the steps are repeated. If this is done for all branches the result
is the complete NAM and Y0V. This approach embodies the idea of Branch orientated view.
The implementation of this approach reduced the programming complexity significantly. Figure 5.2 and equation (5.1.2) illustrate the approach for the three node example. First the left
cable branch is surveyed, and then the right one.

43

5. Branch blocks

y 10

y 12

y 20a

y 23
y 20b

y 30

Figure 5.2.: Branch orientated approach for setting up the NAM

y 10 + y 12
y 12
0
y 12 + y 20a + y 20b + y 23
y 23
nam = y 12
0
y 23
y 30 + y 23

(5.1.2)

5.1.2. Branch block properties


Position
In this chapter, the location of the presented branch block is always assumed between the
node j on the left side and node k on the right side. The variables j and k are placeholders
for two successive node numbers with j = k + 1 and j, k > 0 (no ground nodes).

A short description of this early version:


First the program was called for a start node. The outputs were all the admittances connected to this start
node. Then the program was called recursively again for all these admittances. This gave the neighbor
nodes of the starting node and the starting node again. Now all the neighbor nodes of the starting node and
the admittances between the neighbor nodes and the starting node were known. With this information, the
modification in the NAM and Y0V could be made for the starting node. Then the starting node was changed
and the procedure was repeated. This continued until every node had been the starting node once. The
disadvantage of this implementation is that the number of admittances connected to the node can vary. It
must be ensured that all the connections leading away from the node, which is being examined in the loop,
are checked. Therefore, nested loops will occur in an implementation. The recursive call of the program
makes the program code short. However, in combination with the nested loops it remains obscure and
difficult to maintain. Later in the development of the program, there were some difficulties with unnecessary
double NAM modifications and the general readability of the code.

44

5. Branch blocks
General branch
Since a branch includes two non-ground nodes 3 , three positions for admittances of a branch
are possible:
Between node j and the ground node (number zero).
An admittance y j 0 , leading to ground .
Between node k and the ground node (number zero).
Another admittance leading to ground .
Between node k and node j .
A connecting admittance y j k .

y jk = y kj

y j0

y k0

Figure 5.3.: All possible admittances of a branch.

Normally, the size of the NAM for one branch is a 2 2 matrix. If the connecting admittance
y j k is not present, node j and k are the same node. The NAM of such a branch is then
reduced to a 1 1 matrix. If an admittance leading to ground (index 0) is missing, the value
of this admittance in the NAM and Y0V is zero.

Except shunt RLC impedance.

45

5. Branch blocks
Multiple branch blocks -respecting present elements
Usually, more than one branch block is connected to the same node. When several branches
modify the NAM and Y0V, possible already present elements in the NAM and Y0V must be
respected.
Non-diagonal elements in the NAM correspond to connecting admittances. Each branch
has only one connecting admittance between its nodes. Therefore, the case of an already
present non-diagonal NAM element cannot occur. Diagonal elements in the NAM and the
Y0V include admittances leading to ground. In contrast to connecting admittances, these
admittances can share the same node for two different branches. Therefore, elements which
may already be present must be considered when the diagonal elements of the NAM and
the Y0V Vector are built.
An already present element y (1) can be respected by using the notation y () = y (1) +y .
Variable y (1) is the already present element, y is the value that should be registered and
y () is the resulting new element of the NAM or Y0V. Before registering any values, the
NAM is initialized by a n n matrix of zeros, and the Y0V by a n 1 vector of zeros (n is the
highest node number). An expression such as y () = y (1) + y is easily written in Matlab
as y=y+yRegister .

5.1.3. NAM and Y0V templates


Each branch element uses a template for modifying the NAM and Y0V vector. The main
advantage of using templates is that they are easy to program. Together with the Branch
orientated view, the resulting code is clear and maintainable. The definition for building the
NAM and Y0V was determined on page 35. Applying this definition to the general branch of
figure 5.3 results to the templates below, which are valid for all branch blocks presented in
the following.

Template for branches with connecting admittance:

... ...
...
. . . y () y ()

jj
jk
nam =

()
()
. . . y kj y kk
... ...
...


...
...
...

(1)
. . . . . . y jj
+ y j0 + y jk
=

. . . . . .
y kj
...
...
...

46

...
y jk
(1)

y kk

+ y k0 + y kj
...

...

. . .

. . .
...

5. Branch blocks

...
...
() (1)

+ y j0
y j0 y j0

y0 =
=

()
(1)
y k0 y k0
+ y k0
...
...

(5.1.3)

Template for branches without connecting admittance :

... ... ...


...
...
...

nam = . . . y jj() . . . = . . . y jj(1) + y j0 . . .


... ... ...
...
...
...


...
...
() (1)

y0 = y j0
+ y j0
= y j0
...
...

(5.1.4)

5.1.4. Mini NAM


A standard SLF load flow analysis gives the voltages at all PQ nodes, where power is added
to the circuit, and the power value at the Slack node, where the resulting power is delivered
towards the grid. Nodes are an abstract construct; in contrast to branches they do not exist
physically. Since branches represent electrical utilities, another point of interest within a load
flow analysis could be currents or power losses of individual branches. In single load flow
mode the SLF can compute these results and export them to Excel. Branch currents are
then calculated by a concept called Mini NAM.
When the complete NAM is multiplied by all node voltages, the result is a current vector
for all nodes. This vector describes the total current sum at the nodes. In case of several
branches connected to the same node this vector can not be used to get individual branch
currents. The SLF iterates the complex voltages for each node. The idea is now, to consider
a branch isolated from the rest of the circuit. When a NAM for single branch (Mini NAM) is
multiplied with the voltages at each end of the branch, the result is the current flowing in and
out of the branch.
Example: Figure 5.4 shows the equivalent circuit for the cable branch. The branch is here
considered isolated, but is assumed to be cut out from a larger circuit. After the load flow
analysis the voltages u 1 and u 2 are known. Together with the branches Mini NAM it can be
written for the currents:

47

5. Branch blocks

y Ser i es

i1

u1

y Shunt

y Shunt

i2

u2

Figure 5.4.: Cable branch equivalent circuit.


y Shunt + y Ser ies
y Ser ies

y Ser ies
y Shunt + y Ser ies

    
u1
i1

=
u2
i2

(5.1.5)

With the currents at each side, power values at each side can be calculated. The results
could e.g. be used to get the power losses.

s 1 = u 1 i 1
s 2 = u 2 i 2

s = |s 1 s 2 |
The Mini NAM is always a 2 2 matrix, which is saved separately for each branch block.
In the following NAM modifications, Y0V modifications and Mini NAM are shown for each
branch type.

5.2. RLC impedance


This branch imposes a basic RLC impedance. The branch can be used as a series impedance
or, together with the ground node block, as a shunt impedance. To use the RLC impedance
as a shunt, the user connects one end with a normal node and the other with the ground

48

5. Branch blocks
node block. If the branch should be a series impedance it is connected as usual between
two normal nodes. Default background color is green for the normal node block and dark
green for the ground node block. NAM modification, Y0V modification and MiniNAM are
different for these two switching possibilities but the branch used is the same.
Since a shunt impedance is the only branch without a connecting admittance, its treatment
is slightly different from the rest of the branches. The shunt branch is connected between
a non-ground node and a ground node. This results in a scalar 1 1 matrix for the NAM,
which is not covered by template (5.1.3) but by template (5.1.4). In fact template (5.1.4)
is only used for the shunt RLC impedance branch. In addition, the ground node block is
introduced. This block is only allowed to be used for building a shunt RLC impedance.
The ground node block tells the SLF that one neighbor node of a shunt impedance has the
number zero (ground node number). When the NAM modifications are made for a shunt
impedance, the neighbor node number zero is detected and NAM and Y0V modifications
are made by using template (5.1.4). For a series RLC impedance (and all other branch
blocks), template (5.1.3) is used to modify the NAM and Y0V vector.

5.2.1. Nominal ratings


R

Resistance in /km

Inductance in mH/km

Capacitance in F/km

5.2.2. Equivalent circuit


Series RLC impedance

C
k

Figure 5.5.: Series RLC impedance equivalent circuit.

49

5. Branch blocks
Shunt RLC impedance
j

L
C
0

Figure 5.6.: Shunt RLC impedance equivalent circuit.

5.2.3. Equivalent circuit quantities


The admittance of the preceding RLC equivalent circuits is the same whether for a series
or a shunt impedance. For the sake of completeness, it is shown two times with different
indexes (shunt and series) .

Series RLC impedance

Resistance R
Inductance L
Capacitance C

Ser ies

1
R+j L+

Shunt RLC impedance

50

1
(jC)

(5.2.1)

5. Branch blocks
Resistance R
Inductance L
Capacitance C

Shunt

1
R+j L+

1
(jC)

(5.2.2)

5.2.4. Per unit values


Reference voltage URef is the nominal voltage of the grid part where the RLC impedance
branch is located.

Series RLC impedance

y Ser ies =

YL
YL
= U2
YRef
Ref

(5.2.3)

SRef

(5.2.4)

Shunt RLC impedance

y Shunt =

YL
Y L
= U2
YRef
Ref

(5.2.5)

SRef

(5.2.6)

5.2.5. NAM and Y0V


Series RLC impedance
The series RLC branch has a connecting admittance and therefore template (5.1.3) is used.

51

5. Branch blocks
Template elements:

y jk = y kj = y Ser ies

(5.2.7)

y j0 = y k0 = 0

(5.2.8)

NAM modification:

...
...

(1)
+ y Ser ies
. . . y jj
nam =

. . .
y Ser ies
...
...

...
y Ser ies
(1)

y kk

+ y Ser ies
...

...

. . .

. . .
...

(5.2.9)

Y0V modification:
(No modification)

...

(1)
y j0

y0 =
(1)
y k0
...

(5.2.10)

Shunt RLC impedance


The shunt RLC branch has no connecting admittance and therefore template (5.1.4) is used.

NAM modification:

...
...

nam = . . . y jj(1) + y Shunt


...
...

...

. . .
...

(5.2.11)

Y0V modification:

...
(1) + y Shunt
y0 = y j0

...

52

(5.2.12)

5. Branch blocks

5.2.6. Mini NAM


Series RLC impedance

Mi ni Nam =

y Ser ies
y Ser ies

y Ser ies
y Ser ies

(5.2.13)

Shunt RLC impedance


Since the shunt RLC impedance is the only branch type without a connecting element, its
MiniNam is slightly special from the rest of the branches. A shunt impedance is build in the
SLF environment by adding a ground node block (default color dark green) to one side of
a RLC branch. Only RLC branches are allowed to use the ground node block. Although
the ground node block has a node greater than zero (displayed on the block), it is internally
treated as a node with number zero. Beside other information, the ground node block tells
the SLF that one neighbor voltage is zero. The current through the branch can then be
calculated, by simply using i = y u . For practical programming, it is convenient when
all MiniNAMs have the same sizes. Therefore the MiniNAM of the RLC shunt impedance is
defined to (5.2.14). The SLF export to Excel feature writes data for both sides of a branch.
For this functionality, the currents for the both sides of the branch are calculated by using
(5.2.15). Both values in the result vector are equal and describe the current flowing through
the branch.

MiniNam:


y Shunt
Mi ni Nam =
y Shunt


0
0

(5.2.14)

Current, flowing through the shunt impedance:


 
i
u
= Mi ni Nam
i
0

53

(5.2.15)

5. Branch blocks

5.2.7. Simulink mask

Figure 5.7.: Simulink mask of the RLC impedance branch

5.3. Overhead line


The equivalent circuit of an overhead line is a series RL impedance. In principle, the series RLC impedance branch could be used for this purpose. Normally, the overhead line
impedance is given in /km. For the overhead line branch the user specifies the /km and
length value. In this way, the user does not need to do the multiplication with the length by
hand.

5.3.1. Nominal ratings


Z

Impedance per length in /km

54

5. Branch blocks

5.3.2. Equivalent circuit

X
j

Figure 5.8.: Overhead line equivalent circuit.

5.3.3. Equivalent circuit quantities


R

Resistance per unit of length

Inductance per unit of length

Series admittance:

Ser ies

1
length
(R + jX )

(5.3.1)
(5.3.2)

5.3.4. Per unit values

y Ser ies =

Ser ies

YRef

Ser ies
2
URef
SRef

(5.3.3)
(5.3.4)

5.3.5. NAM and Y0V


The overhead branch has a connecting admittance and therefore template (5.1.3) is used.

55

5. Branch blocks
Template elements:

y jk = y kj = y Ser ies

(5.3.5)

y j0 = y k0 = 0

(5.3.6)

NAM modification:

...
...

(1)
+ y Ser ies
. . . y jj
nam =

. . .
y Ser ies
...
...

...
y Ser ies
(1)

y kk

+ y Ser ies
...

...

. . .

. . .
...

(5.3.7)

Y0V modification:
(No modification)

...

(1)
y j0

y0 =
(1)
y k0
...

(5.3.8)

5.3.6. Mini NAM

Mi ni Nam =

y Ser ies
y Ser ies

56

y Ser ies
y Ser ies

(5.3.9)

5. Branch blocks

5.3.7. Simulink mask

Figure 5.9.: Simulink mask of the overhead line branch

5.4. Cable
The implementation of the cable branch is based on the standard -equivalent circuit with
an inductive, resistive and capacitive element.

5.4.1. Nominal ratings


R

Resistance per unit of length in /km

Inductance per unit of length in /km

Capacitance per unit of length in F/km

Note: For simplification the SLF stores these nominal ratings in a library function which is
called cableDataLibrary.m .

57

5. Branch blocks

5.4.2. Equivalent circuit

Y
j

Ser i es

Shunt

Shunt

Figure 5.10.: Cable branch equivalent circuit.

5.4.3. Equivalent circuit quantities

Lengthwise admittance:

Ser ies

(R

1
length
+ jX )

(5.4.1)

Shunt admittance:

Z Shunt =
j

C
2

(5.4.2)

length

Shunt impedance:

Shunt

= j

C
length
2

(5.4.3)

Note: In contrast to the previous part of this document, the admittance value for one leg of
the -equivalent circuit is chosen to (5.4.3). In the foregoing part, the whole cable capacitive
admittance was defined to Y = jC length and 2 Y for the admittance of one leg of the
cable equivalent circuit. The definition (5.4.3) is here used, because it results in an single
expression without a factor.

58

5. Branch blocks

5.4.4. Per unit values


Per unit values are straightforward. The nominal voltage of the grid at the cable position is
used as reference voltage URef for the per unit values.

y Ser ies =
y Shunt =

Ser ies

YRef

Ser ies
2
URef
SRef

(5.4.4)

Y S
YRef

(5.4.5)

5.4.5. NAM and Y0V


The cable branch has a connecting admittance and therefore template (5.1.3) is used.
Template elements:

y jk = y kj = y Ser ies

(5.4.6)

y j0 = y k0 = y Shunt

(5.4.7)

NAM modification:

...
...

(1)
+ y Ser ies + y Shunt
. . . y jj
nam =

. . .
y Ser ies
...
...

...
y Ser ies
(1)

y kk

+ y Ser ies + y Shunt


...

...

. . .

. . .
...

(5.4.8)

Y0V modification:

...

(1)
+ y Shunt
y j0

y0 =

(1)
y k0
+ y Shunt
...

(5.4.9)

59

5. Branch blocks

5.4.6. Simulink mask

Figure 5.11.: Simulink mask of the cable branch

For each cable type and size, nominal ratings R , X and C are stored in an additional
Matlab file, called cableLibrary.m . This file is also a function and is called by a function
callback of the mask. Each time the user modifies type, size or length of the cable, function
cableLibrary.m is called. The function returns R, X and C and displays them in the
grayed out fields of the mask. These fields are accessed by the load flow initialization
program. For further explanation of the function itself, please refer to section 6.2.1 on page
75.

5.4.7. Mini NAM

Mi ni Nam =

y Shunt + y Ser ies


y Ser ies

60

y Ser ies
y Shunt + y Ser ies

(5.4.10)

5. Branch blocks

5.5. Transformer
In a single phase diagram, a three phase transformer is represented by a two winding transformer. Tap changing for the real part of the voltage at the primary winding can be simulated.
Depending on the transformers switching group, three phase transformers can produce a
constant phase shift of an integer multiple of 30 on the volt age phase angle . Since this
phase shift is constant, it is not categorically necessary to respect this voltage phase shift
in load flow calculations. Alternatively the phase shift can also be added, after all complex
voltages are known. However, in this application, the voltage shift of the vector group is used
in the complex transformer ratio and therewith also respected in the load flow calculations.
By doing so, the user does not need to add any constant shifts to the final voltage results.
The derivations in this section follow mainly those defined in [1], except the Y0V modification.

5.5.1. Nominal ratings


U 1N

Nominal voltage on primary side in kV

U 2N

Nominal voltage on secondary side in kV

U1

Open circuit voltage on primary side in kV


If the tap changer is not in its nominal position, this voltage is different from U 1N .

U2

Open circuit voltage on secondary side in kV.


Due to lower switching currents the tap changer is usually located on the high
voltage side. Therefore, U 2 is equal to U 2N and cannot be adjusted.

Transformer vector group number.


(Example: Dy11 Trafo, k=11)

SN

Transformer nominal power in MVA.

ur

Resistance part of the relative short circuit voltage in %.

ux

Inductive part of the relative short circuit voltage in %.

61

5. Branch blocks

5.5.2. Equivalent circuit

ZT

I1

I2

:1

I2

U2

U1

U2

Figure 5.12.: Transformer equivalent circuit with tap changer on high voltage side.

5.5.3. Equivalent circuit quantities


The following definitions for a transformer are made according to [1].

Complex ratio:

U1
U1 jk30

=
e
= e jk30
U2
U2

(5.5.1)

U 1N
U1N jk30

=
e
= N e jk30
U 2N
U2N

(5.5.2)

Complex nominal ratio:

N =

Transformer relative impedance and relative short circuit voltage:


The inverse hat is marking a per unit value of the transformer per unit system.

z T = xr + j xx

(5.5.3)

u k = ur + j ux

(5.5.4)

z T = u k

(5.5.5)

Transformer impedance:

Z T = z T

2
U1N
SN

(5.5.6)

62

5. Branch blocks
Later in this document, the transformer impedance Z T will be expressed in the load flow
per unit system. Here z T is expressed in the transformer per unit system. In the load flow
per unit system it will be written z T .
In power system transformers, the value of ur compared to ux is usually very low. Therefore
the influence of ur is often neglected in u k . The user can implement this by choosing ur
to be zero in the transformer Simulink mask. By doing so, the short circuit voltage gets
u k = j ux .

5.5.4. Derivation of the NAM


The directions of the current arrows in figure 5.12 represent the normal operating mode of a
transformer. According to the made convention for currents, I 1 , flowing out of node j , has a
negative sign and I 2 , flowing into node 0, has a positive sign. Applying the this convention
in figure 5.12 yields to:

I 1 = (U 2 U 1 ) Y

I 2 = (U 2 U 1 ) Y

(5.5.7)
(5.5.8)

Rearranged:

I1 =Y

I =Y

T
T

(U 1 U 2 )
(U 1 + U

2)

(5.5.9)
(5.5.10)

In matrix notation:

  
I1
Y T
=

I2
Y T

Y T
YT

  
U1

U 2

(5.5.11)

The complex transformer ratio is:

U 2
U2

(5.5.12)

or:

I 2
1
=

I2
Insert (5.5.13) and (5.5.12) in (5.5.11) gives:

63

(5.5.13)

5. Branch blocks

 


I1
U1
I 2 = Y T Y T
Y T Y T
U2

  
  
I1
Y T
Y T
U1

2
I2
U2
Y T + Y T

(5.5.14)

with

= | |2 = 2

5.5.5. Per unit values


The quantities are now transferred to the per unit system that is used in the load flow calculations. It is suitable to use the transformer nominal voltages U1N and U2N as reference
voltages (in the load flow per unit system) for the high and low voltage sides of the transformer. The transformer impedance Z T , which models the transformer losses, is located
on the high voltage (left) side. Normally, it is given in the per unit system of the transformer.
Therefore the value needs to be transferred from the per unit system of the transformer to
the per unit system of the load flow.

z T = z T

U1N
U1N

2

SRef
SRef
= z T
SN
SN

(5.5.15)

The variable z T is defined here as the transformer impedance in the transformer per unit
system and z T as the corresponding value in the load flow per unit system.
The admittance value of z T is:

yT =

1
zT

(5.5.16)

The transformer nominal voltages, U1N and U2N , are the nominal voltages of the grid sections connected by the transformer. They are used as reference voltages to define a per unit
transformer ratio t :

U1
U 2N
U
t = 1N =
U2
U 1N
U 2N

64

(5.5.17)

5. Branch blocks
This definition for t and the per unit transformation equations from section 8.1 (page 107)
allows us to transform (5.5.14) in the per unit system.

i
i

1
2

t y

t y T
t2 y T

  
u1

u2

(5.5.18)

with

t t = |t |2 = t 2
The transformation of figure 5.12 in the per unit system is displayed in figure 5.13. Equation
(5.5.18) contains the NAM for the transformer branch.

t :1
I1

I2

zT

U2

U1

Figure 5.13.: Transformer equivalent circuit in per unit

One can assume a transformer without voltage phase shift (switching group group 0). Per
unit shifting ratio t is then equal to one and the per unit equivalent circuit is reduced to the
line impedance. Since the load flow calculates in the per unit system, such a transformer
can be treated like a simple line impedance for building the NAM. This shows one of the
advantages of the per unit system. However, if the tap changer is not in nominal position or
a phase shift of the transformer is respected t gets unequal one and the NAM gets more
complex.

65

5. Branch blocks

5.5.6. Template elements identification


Now template (5.1.3) should also be used for describing the NAM of the transformer branch.
For this it is necessary to identify the template elements in the transformer NAM. The template elements for the transformer branch can be identified by comparing the general template (equation (5.1.3)) to the transformer branch NAM (equation (5.5.18)). Comparison is
made for just one transformer branch, therefore the special notation and dots in the template
are not required.


y j0 + y jk
y kj

 
y jk
yT
!
=
t y T
y k0 + y kj

t y T
t2 y T

(5.5.19)

Comparing the the first line of (5.5.19) gives:

y j 0 + y jk = y T
y jk = t y T

(5.5.20)
(5.5.21)

Inserting (5.5.21) in (5.5.20):

y j0 +t y T = y T

(5.5.22)

y jk = t y T

(5.5.23)

y j 0 = y T (1 t )

(5.5.24)

Rearranged:

y jk = t y T

(5.5.25)

Comparing the the second line of (5.5.19) gives:

y kj = t y T

(5.5.26)

y k0 + y kj = t 2 y T

(5.5.27)

y kj = t y T

(5.5.28)

Inserting (5.5.26) in (5.5.27):

y k0 + t y T = t y T

66

(5.5.29)

5. Branch blocks
Rearranged:

y kj = t y T

(5.5.30)

y k0 = y T t (t 1)

(5.5.31)

y jk = t y T

(5.5.32)

Results of comparing
first and second line:

y kj = t y T

y j 0 = y T (1 t )

y k0 = y T t (t 1)

(5.5.33)
(5.5.34)
(5.5.35)

It can be seen that in the case of a complex t , the connecting admittance value y kj becomes
unequal y jk . A representation in the form of an equivalent circuit, such as figure 5.3 is then
not possible.

5.5.7. NAM and Y0


The template for branches with a connecting admittance (Equation (5.1.3)) is used. Using the template of the NAM with the expressions found by comparison is possible but not
mandatory since the transformer NAM is already derived in (5.5.18). However, in order to
avoid errors on the signs, it is suggested by the author of this thesis that the found elements
are inserted into the template.

Template elements:

y jk = t y T

(5.5.36)

y kj = t y T

(5.5.37)

y j 0 = y T (1 t )

(5.5.38)

y k0 = y T t (t 1)

(5.5.39)

67

5. Branch blocks
NAM modification:
Insert (5.5.36)-(5.5.39) in template (5.1.3)

...
...
...
...

(1)
+ y T (1 t ) + t y T
t y T
. . .
. . . y jj

nam =

(1)

. . .
t y T
y kk
+ y T t (t 1) + t y T . . .
...
...
...
...

...
...
...
...

(1)
+yT
t y T
. . .
. . . y jj

(5.5.40)
=

(1)
. . .
t y T
y kk
+ t 2 y T . . .
...
...
...
...

Y0V modification:
Insert (5.5.38)-(5.5.39) in template (5.1.3)

...
y T (1) (1 t )

y0 =

y T (1) t (t 1)
...

(5.5.41)

For t = 1, the modifications on the NAM and Y0V are similar to those of the RLC branch in
series connection. If t is a real number, the modifications on the NAM and Y0V are similar
to those of the cable. When t is complex, the connecting admittance values y kj and y jk
are not equal. A representation in the form of an equivalent circuit, such as figure 5.3 is then
not possible.

5.5.8. Mini NAM

Mi ni Nam =

yT
t y T

68

t y T
t2 y T

(5.5.42)

5. Branch blocks

5.5.9. Simulink mask

Figure 5.14.: Simulink mask of the transformer branch with typical data for a WTG
transformer.

69

6. Implementation
Viewed from the top level, SLF consists of Simulink blocks and Matlab functions which are
interacting in various ways. As an example, some Matlab functions are called by Simulink
blocks, and some Simulink blocks output the result of Matlab functions. The scope of this
chapter is to give a brief overview of what the respective SLC parts do and how they interact.
For a detailed understanding of the implementation, the descriptions given here can be
compared to the source code. The comments made in the source code are using the same
key words, as applied in this chapter.

6.1. Simulink blocks


There are two groups of SLF Simulink blocks: branches and nodes. These blocks are used
to build the circuit for the load flow analysis. The SLF identifies nodes and branches by their
background colors. The colors which are searched for are, by default, yellow, green, dark
green and blue. Any other block which is present but not identified by one of the these colors
is ignored by the SLF. There are several types of nodes and branches which are described
in the following sections.

6.1.1. Init block


This block (default color red) controls some general settings of the load flow analysis. Depending on the chosen load flow mode some fields of the init mask will change dynamically.
Figure 6.1 shows the mask for the single load flow mode and figure 6.2 shows it for the
successive load flow mode. For further explanation, especially on the deviation parameters,
please refer to section 6.2.3 Node monitoring at page 78.
Note: The name of the init block must be init, because it is accessed with this name by
init.m .

70

6. Implementation

Figure 6.1.: Simulink mask of the init block in single load flow mode.

71

6. Implementation

Figure 6.2.: Simulink mask of the init block in successive load flow mode.

6.1.2. Branch blocks


Branch blocks are used to build the circuit for which a load flow analysis should be performed. The set of branch blocks is orientated on the required elements for modelling a
WPP power network.
Node

Short
term

Default
color

Note

RLC impedance
Overhead line
Cable
Transformer

RLC
Ohl
Cable
Trafo

Blue
Blue
Blue
Blue

Can be used in series or shunt connection


Specific cable data provided by a library function
Optional tap change

Table 6.1.: Brief overview of SLF branch blocks

72

6. Implementation
Branch properties, especially the NAM and Y0V modifications, are separately described in
chapter 5 Branch blocks at page 42.

6.1.3. Node blocks


Node blocks follow the general node description given in section 4.3.2 on page 38. Some
limitations and specializations are made for the general node types. Overview table 6.2
gives a list of available SLF node blocks and some of their properties. Further node block
characteristics are described below.
Branch
PQ node(s)
Passive PQ node(s)
Slack node
Ground node(s)

Short
term

Default
color

Input

PQ
pPQ
Slack
Gnd

Green
Green
Yellow
Dark green

P, Q
P =Q=0
U,

Output

u, U ,

P , Q, cos

Calls

nomon.m 1

Table 6.2.: Brief overview of SLF node blocks

Symbol

U
u

cos
P
Q

Unit

Name

kV
pu
Degree

Voltage, phase to phase


Per unit voltage
Voltage shift
Power factor
Active power
Reactive power

MW
Mvar

Table 6.3.: Units for node blocks

All nodes are numbered with a consecutive number from one on. First PQ and passive PQ
nodes are numbered. There is no separation between PQ and passive PQ nodes, regarding
the numbering order. The Slack node is then labeled with the next highest number. By doing
so, the Slack node number also determines the size of the NAM. If the Slack node has the
node number n the NAM is a n n Matrix. Finally the ground nodes are also numbered with
the consecutive number. In the load flow theory, ground nodes are usually all numbered with
1

Matlab function nomon.m is called by using the Simulink S-Function block. The code of function nomon.m
is attached to the S-Function block. If the node calls the function, this block is located in the subsystem of
the node block.

73

6. Implementation
the number zero. For programming issues it is more convenient to number also the ground
nodes.

Ground node(s)
Although ground nodes are also numbered with the consecutive number, they are interpreted by the SLF as a node with number zero. The ground node block is only allowed to
be used in connection with the RLC impedance branch. This branch can serve as a series
or as a shunt impedance. As a series impedance, it is connected between two nodes of
type PQ or pPQ. For building a shunt impedance, one side of the RLC impedance branch
is connected to a node of type PQ or pPQ, and the other side of the branch is connected
to a ground node block. The ground node block is introduced only for building a shunt RLC
impedance. Either no, one or several ground node blocks are allowed in the circuit.

PQ node(s)
At this block the values of P and Q can be specified. For a WPP related load flow analysis,
a PQ node imposes a wind turbine. Either one or several PQ nodes are allowed.

Passive PQ node(s)
The passive PQ node is intended as a connection element between branch blocks when no
additional power is injected into the circuit. Its definition is the same as for PQ nodes but
with the input parameters P and Q hard coded (assumed) to zero. Output parameters u
and of the passive PQ node are calculated but, to provide a better overview, not displayed.
Either no, one or several passive PQ nodes are allowed in the circuit.

Slack node
The Slack node is the designated point of common coupling (PCC) in a circuit. Following
the interpretation of the Slack node from section 4.3.3 (page 39), at least one Slack node
must be in a circuit. Within the SLF environment, exactly one Slack node is required and
allowed.

74

6. Implementation

6.2. Matlab functions


Matlab function

Simulink block

Called by

cableLibrary.m

Cable branch

Called by a function callback of the cable


mask and returns R, X, C for a specific cable type. Executed whenever cable type,
size or length is modified in the mask.

Init

Called before the simulation starts as an initialization callback of the init block.

Nodes

Called by PQ nodes and the Slack node.


See also table 6.2 on page 73 .

init.m
nomon.m
solver.m

Called by function nomon.m

export2Excel.m

Called by function nomon.m , if load flow


calculation is finished and export data to
Excel option is enabled in the mask of the
Init block.

Table 6.4.: Overview of the SLF Matlab functions and corresponding Simulink blocks.

6.2.1. Data library (cableLibrary.m )


This function stores nominal per km ratings (R , X , C ), for the cable types that can be
chosen in the cable branches Simulink mask. It is called by a function callback when the
user modifies the type, size or length parameter of the cable mask. The function call is
performed by a function callback of the cable branch mask for each of these parameters.
Return values are R, X, C , which are inserted into the Simulink mask, and later read out by
init.m . A screenshot of the cable branch mask can be seen at figure 5.11 on page 60.
The purpose of this function is to easily change or add nominal data constants, without
modifying the actual source code. Another advantage is that data can be changed simultaneously for all cable branch blocks. In principle, this library function can be used by several
branch block types. However, of all SLF branches, only the cable branch uses library data.
Therefore only this branch type calls the library function.

75

6. Implementation

6.2.2. Initialization (init.m )


Setting up the NAM and Y0V for a larger network is unwieldily and error-prone. Therefore
it is preferable to have this performed by a program. In this way, the user only arranges
the branch and node blocks in the Simulink environment and connects them. When the
simulation is started, init.m builds the NAM and Y0V.
Beside building the NAM and the Y0V, function init.m collects additional information from
the circuit built in Simulink. For example, the number of nodes and their type is detected.
The SLF functions need to access this and other data at different points in the simulation.
For interchanging data between the SLF functions, four global variables are used. Each
global variable contains a structure which are the SLFs main data storages.
Since it is good programming style to modularize large functions, the initialization process
passes in three phases. Each of the these phases is implemented in a sub function of the init
function. The sub functions were created with the intention that it should not be necessary
to run the whole init function again when, for example, only a mask value is changed. The
possibility to conduct partial runs of function init is not utilized here because it can only be
used in special cases, such as this. In the following description the sub functions are briefly
explained.

76

6. Implementation
Start

init main

initphase1

initphase2

initphase3

init main

Stop
Figure 6.3.: Flow chart of the init function

init main
First, general declarations such as defining the node and branch identification color and
global variables are done. Then the three subfunctions named initphase are called
consecutively.

initphase1
The Simulink diagram is scanned for nodes and branches. Nodes are numbered and basic
setup of the NODE and BRANCH structures are done.

77

6. Implementation

initphase2
This allows each branch to discover its left and right neighbor node. In this way, the connection between nodes and branches is revealed.

initphase3
Load flow setting from the init block in the simulation is accessed. Node blocks are examined
for their type. Branch blocks are scanned for their type and for the electrical data, which was
entered by the user. Admittance per unit values are calculated. The NAM and a vector,
containing all admittances connected to ground, are set up.

init main
Back in the main function, final actions are performed. The abbreviated NAM is built by
taking the row and column corresponding to the Slack node number out of the NAM. The Y0
vector is build, from the vector containing all admittances leading to ground, by taking out
the position that corresponds to the Slack node number.

6.2.3. Node monitoring (nomon.m )


In successive load flow mode the SLF can calculate successive load flow analyses for
changing input parameters. Input parameters are U and for the Slack node and P and
Q for the PQ nodes. Starting the iteration process each time an input values change (compared to computational accuracy) would slow down the simulation to an unacceptable execution speed. Therefore, the user can set a maximum deviation between the actual input
and the value when the last load flow calculation was performed. When running the simulation, a program receives input data and compares it to the values when the last load flow
calculation was performed. If the deviation is higher than specified, the iteration process is
started (call to solver.m ). In this way, the number of load flow calculations is reduced,
resulting in an acceptable execution time. The SLF function that provides the described
functionality is called nomon.m .
In single load flow mode function nomon.m receives the constant input values from all PQ
nodes plus the Slack node and calls the solver. When function nomon.m is then called
again the input parameters are the same as the ones when the last last load flow was
performed. Therefore the deviations to the input values (U , , P and Q) are all zero and the

78

6. Implementation
solver is not called again. In this state, the simulation runs simply to the specified ending
time by calling nomon.m and stating that no further load flow calculations are required.

Properties
Function nomon.m is implemented as a Simulink Level-2 M-file S-function block, or abbreviated S-function block. A block of this type allows use of the Matlab programming language
for creating custom made Simulink blocks. The Matlab code defines the properties of the
inputs and the output method of the S-Function block. The function nomon is assigned to
such a S-function block, which is called nomon block. The nomon block is located in the
subsystem of all node blocks, except passive PQ node blocks and ground node blocks.
There are two inputs of type 1 1 vector and one output of type 3 1 scalar at the nomon
block. For each nomon block, two known values are input and two output values are iterated
and output. A third output value is additionally calculated. The third output value is U for
PQ nodes and cos for the Slack node. These values relies on the two iterated ones. For
a general overview of known and unknown values at different nodes, please refer to table
4.3.2 at 38. For a specific overview of input and output values at SLF nodes, please refer to
table 6.2 at page 73.
The function uses two flag arrays (two flag for each node) to indicate the current state of
the simulation. To understand this design aspect, a short description of how Simulink works
is included here: After the simulation has started, Simulink calculates all block outputs sequentially. The order of evaluating the blocks depends mainly on the order the user has
placed them, and can not be influenced by a parameter2 . Next, the time step is done and
all blocks are evaluated again. Following this, the nomon blocks are evaluated in a hard to
predict order. This is the reason for the flag operations in the following nomon description.
For a better understanding, function nomon.m can be split up in execution steps. In the
following, a flow chart and further explanation to the execution steps is given.

Strictly speaking there is the possibility of assigning high or low evaluating priority to Simulink blocks. However,
it is not possible to choose freely the complete block evaluation order.

79

6. Implementation

Start

Step 1
Detecting node type

Step 2
Output current data

Step 3
Nomon called flag

Step 4
Load flow request flag

Step 5
Solver call

Solver.m

Step 6
Flags clearing

Stop

Figure 6.4.: Flow chart of the nomon function

80

6. Implementation
Step 1: Detecting the node type
The node type (Slack node or PQ node) is passed by the calling argument to function nomon.
The calling argument for a S-function block is named DialogPrm in the Matlab programming language.

Step 2: Output actual data


Computed values for the unknown parameters are looked up in fields of the NODE structure
and written to the output.

Step 3: Receive and store new data


Input data is read and saved in the fields of the NODE structure.

Step 4: nomon called flag


The nomon called flag is set. This flag is individual for each node. For a passive PQ node it
is always set (1).

Step 5: Load flow request flag


If a nomon block would call the solver at any time, it is not ensured that the solver works
with the most recent data available. As an example, the deviation of the input values at two
nomon blocks could be above the specified maximum. It could than happen that one nomon
block calls the solver and, after a result has been calculated, the second node is evaluated
and is calling for the solver again. To avoid this situation, each node can only set a load flow
request flag when its deviation on the input values is above the specified maximum. This
flag is individual for each node. For passive PQ at ground nodes it is always zero.

Step 6: Optional solver call


If all nomon called flags are set and any load flow request flag is set the solver is called.
After an optional solver call, all load flow request flags are cleared.

81

6. Implementation
Step 7: Flag clearing
Eventually, set load flow request flags are cleared. If all nomon called flags are set, the
nomon called flags are cleared for all nodes except for passive PQ nodes.

6.2.4. Solver (solver.m )


This function solves the non linear equation system by applying two numerical solving methods. The first method is the current iteration and the second is the Newton-Raphson algorithm. The current iteration is a pseudo Gauss Seidel iteration method. In contrast to the
Gauss Seidel method, the current iteration does not use new results within the same iteration
step. This makes the current iteration converge more slowly, but reduces the programming
complexity in Matlab.
The purpose of the current iteration algorithm is to improve the starting guesses of the
voltages for the Newton-Raphson algorithm. According to [2] the Newton Raphson algorithm
shows a fast convergence but is sensitive to starting guesses, which are far away from the
final results. The current, or Gauss-Seidel, method is more robust regarding bad starting
guesses, but shows a slow convergence. By using first the current iteration and then, after
it has reached a certain tolerance, switching over to Newton Raphson, the advantages of
both methods can be combined. Following [2], this approach is a common way for load flow
analysis programs. It could be mentioned at this point, that in the testing phase, load flow
examples with unrealistically long cable lengths ( 1000 km) were run at PowerFactory and
SLF. Within these unrealistic test cases PowerFactory showed no convergence in its iterative
method, but SLF did.
Both algorithms are implemented as a variant to handle one Slack node and all other nodes
of type PQ node. This assumption fits well to a typical WPP layout with the point of common
coupling (Slack node) and turbines interpreted as PQ sources (PQ nodes).
In the single load flow mode, the solver assumes all unknown voltages to be one per unit
and starts the iteration process with this starting guess. Such a starting guess is also called
flat start. In successive load flow mode, a flat start is only performed for the first solver call.
Any other successive solver calls in this mode use the previous voltage results as a starting
guess. By uncommenting a marked line in the code of function solver.m , the SLF can
be set to perform a flat start each time it is called in the successive load flow mode. This
option should be chosen when the change on the SLF input parameters in successive load
flow mode is not continuous.
The implementation of the two solving methods used in function solver.m is designed to
execute quickly. For this purpose the code was almost completely vectorized. Vectorized

82

6. Implementation
code means operations are done on full matrices. Rather than using for-loops for operations
on each matrix element, the operation is done for the full matrix system by using the special
Matlab matrix commands. According to the Matlab documentation, this approach yields a
faster and cleaner algorithm.
In the following pages, the two algorithms are shown in the form of two flow charts for each
algorithm. One flow chart contains the literal explanation for each step, whilst the other
shows the corresponding formulae. In order to express the formulae usefully, it is suitable to
use the Matlab command symbols listed below.
The flow charts presented here for the current and Newton Raphson iteration are a slightly
adapted copy from [1]. For further information on the theory, especially the Newton-Raphson
algorithm, please refer to this script.

Used Matlab notation in the flow charts

./

Element wise vector division.

Element wise vector multiplication.

abs(X)

Gives the magnitude vector of the complex input vector X.

i k ,u k , s k A superscripted k indicates an iterator variable. Such a variable will change during


two consecutive passes (k and k + 1) of the loop .
n1

An indexed n 1 at a vector or matrix indicates data for n nodes, except the Slack
node (1). There are always n nodes in the circuit, with n 1 PQ node numbers
and n as the Slack node number.

i nv

Matrix inversion.

di ag

Diagonal matrix of a vector.

re

Real part.

im

Imaginary part.

83

6. Implementation

START

Calculate current with


voltage from previous
iteration step

Use rearranged equation (4.3.15)


to calculate a new
voltage vector.

Calculate a new power


vector with the
new values

Tolerance reached
for all vector rows?

false

true

STOP
Figure 6.5.: Literal flow chart of the current iteration algorithm
84

6. Implementation

START

k1
in1
= sn1
./ (un1
)

k
1
k
un1
= [nam n1
(kn1
+ u Slack y )] + uSlack

k
k
k
sn1
= un1
. in1

false
k
abs(sn1

sn1 ) <

true

STOP
Figure 6.6.: Formulae flow chart of the current iteration algorithm
85

6. Implementation

START

Calculation of voltage matrices

Calculation of all power values for all nodes

Help matrices Z

Jacobi matrix elements ABCD

Jacobi matrix

New voltage and voltage angle differences


Calculation of new values

Tolerance reached
for all vector rows?

false

true
STOP
Figure 6.7.: Literal flow chart of the Newton Raphson algorithm
86

6. Implementation

START

k
k
udiag,n1
= di ag(un1
)
k
k
) = di ag(un1
)
(udiag,n1


k
k
k
(ediag,n1
) = di ag (un1
) ./abs(un1
)

snk = di ag(un ) nam un

pnk = r e(snk )

qnk = i m(snk )

k
k
Z1k = udiag,n1
nam n1 (udiag,n1
)


k
Ak = +i m(Z1k ) di ag qn1
 k 
pn1
B k = +r e(Z2k ) + di ag
k
un1

k
k
Z2k = udiag,n1
nam n1 (ediag,n1
)

Jacobi k =

Ak
Ck

Bk
Dk


k
C k = r e(Z1k ) + di ag pn1
 k 
qn1
Dk = +i m(Z2k ) + di ag
k
un1

  k   k 

p
pn1
n1
n1
i nv (Jacobi )
=
k
k
qn1
qn1
un1
 k+1   k   k 
n1
n1
n1
=
+
k+1
k
k
un1
un1
un1
k

false
k
abs(sn1
sn1 ) <

true

STOP

Figure 6.8.: Formulae flow chart of the Newton Raphson algorithm


87

7. Applications
In this chapter, some possible applications of the SLF are presented. The capability of
exporting data to Excel and performing successive load analyses are demonstrated. Within
some examples, results are benchmarked and checked.
A first check of results is done by comparing with a small load flow example from university.
For further verification, the layout and electrical data for a standard 50 WTGs wind farm is
used. In the power plant department this example wind farm is named as the 100 MW base
case. The general layout and WTGs numbers for the base case can be found at the image
section of the appendix, starting at page 110.
The base case is used for various purposes and was therefore already available in the power
engineering tool PowerFactory. This program, produced by DIgSILENT GmbH, is a common
engineering tool for load flow analysis and also used in the Power Plant department. It is
therefore used as a benchmark for the SLF results.
It should be mentioned that the SLF transformer model does not include magnetization
losses, but the PowerFactory transformer model does. The SLF transformer model is orientated on [1]. According to this script, transformer magnetization is often neglected in power
engineering. Therefore magnetization losses of the PowerFactory transformer branch must
be set to zero, for comparing SLF and PowerFactory results.
Another limitation of SLF is the grid impedance. The SLF Slack node imposes a direct
infinite voltage source without an upstream grid impedance. When comparing to SLF, the
short circuit power of the grid in PowerFactory should be set to a high value, here 10 000 MW
was used. By doing so, the grid impedance becomes very small and can be neglected in
calculations.

7.1. University script benchmark


In [1], page 264, a small example for a load flow analysis is given. This example includes four
nodes and four over head line (Ohl) branches. The branches are all located on a common
110 kV voltage level, which is at the same time the reference voltage for the whole circuit.

88

7. Applications
Compared to the university script, iteration steps (not presented) and results are matching.
The only difference is, that in [1] a consumer orientated sign convention is used and the SLF
uses a production orientated sign convention. Therefore the signs on P and Q in figure 7.1
are, compared to [1], all inversed.

Figure 7.1.: Load flow example from University in SLF.

7.2. Three turbines benchmark


For further checking of results, a three WTGs part of the 100 MW base case is used. This
circuit includes cable and transformer branches, which are connecting three voltage levels.
The transformers close to the PQ nodes are the WTGs transformer with the nominal voltages of 0.69 kV and 22 kV. The transformer close to the point of common coupling is the
substation transformer with 22 kV and 132 kV nominal voltages.

89

7. Applications

Figure 7.2.: Circuit view of the three turbines benchmark in SLF.

Figure 7.3.: Input/result view of the three turbines benchmark in SLF.

Compared to figure 7.1, the circuit and input/result view are now separated from each other.
Figure 7.2 is the SLFs circuit view and figure 7.3 shows the view for the input/result values.
These two Simulink diagrams are stored in two subsystems and connected by goto blocks,
represented by the arrow blocks in the figures. By doing so, the overview is still given, when
the circuits become larger.
Figure 7.4 shows the same situation, as displayed in figure 7.2 and 7.3, in PowerFactory.
Compared to the SLF view, the orientation of the diagram is rotated 90. The content of the
input/result boxes in PowerFactory can be chosen, and are here set according to the SLF
result boxes.

90

7. Applications

Figure 7.4.: Three turbines benchmark in PowerFactory.


91

7. Applications

7.2.1. Comparison
Node name
SLF

PF

B1

Symbol

Value

Unit

SLF

PF

P
Q
cos

4, 97
0, 33
1, 00

4, 97
0, 33
1, 00

[MW]
[Mvar]

U
u

0, 71
1, 02
32, 95

0, 71
1, 02
32, 95

[kV]
[pu]
[ ]

U
u

0, 69
1, 00
35, 21

0, 69
1, 00
35, 21

[kV]
[pu]
[ ]

U
u

0, 69
1, 00
35, 22

0, 692
1, 00
35, 22

[kV]
[pu]
[ ]

1.1 LV

1.2 LV

1.3 LV

Table 7.1.: Comparison of SLF and Powerfactory (PF) results.

In table 7.1 the SLF result values are rounded on the second decimal position. For the shown
nodes the results are matching. For the other PowerFactory nodes in figure 7.4, which are
not shown in table 7.1, the SLF also calculates the result values internally. However, for a
clear screen view in Simulink, these values, among others, are only visible in the data set,
which can be exported to Excel. The export to Excel functionality will be used in the following
section for a more detailed comparison of load flow results from SLF and PowerFactory.

7.3. Half base case benchmark


For a complete check of all the results calculated by the SLF, the half base case is used.
This is done because the original documents of the full base case for PowerFactory and
SLF are too large for a readable print out on A4 paper. The original documents for the half
base case can be found at the appendix section, starting from page 110 onwards. The

92

7. Applications
circuit includes cable and transformer branches and 25 WTGs (PQ nodes). Together with
the connecting, passive PQ nodes, there are 52 nodes in the circuit, resulting in a 52 52
NAM. In this example, all turbines of the half base case are running at full load with a unique
power factor of cos = 1. This means they are injecting P = 2 MW and Q = 0 Mvar at
each PQ node.

7.3.1. Error considerations


In the following tables, the load flow results for the feeder 5 of the half base case are surveyed. All data that can be calculated by the SLF for the branches of this feeder is compared to the results of PowerFactory. Since cable and transformer branches are connected
to common nodes, it is sufficient to compare the values for u , U and voltage angle only
for transformer branches. Values for I , P ,Q and cos are compared for all branches of the
feeder 5.
Branch

Grid Side: Pu voltage

WTG side: Pu voltage

SLF

PF

SLF

PF

Error

SLF

PF

Error

Name

Name

[Pu]

[Pu]

[%]

[Pu]

[Pu]

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31

1, 0000
0, 9901
0, 9939
0, 9969
0, 9982
0, 9922
0, 9928

1, 0000
0, 9901
0, 9939
0, 9969
0, 9982
0, 9922
0, 9928

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

0, 9893
0, 9871
0, 9909
0, 9940
0, 9952
0, 9892
0, 9898

0, 9893
0, 9871
0, 9909
0, 9940
0, 9952
0, 9893
0, 9898

0, 00
0, 00
0, 00
0, 00
0, 00
0, 01
0, 00

Table 7.2.: Comparing per unit voltage results of SLF and PowerFactory.

93

7. Applications
Branch

Grid Side: Voltage

WTG side: Voltage

SLF

PF

SLF

PF

Error

SLF

PF

Error

Name

Name

[kV]

[kV]

[%]

[kV]

[kV]

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31

132, 0000
21, 7827
21, 8661
21, 9329
21, 9594
21, 8293
21, 8406

132, 0000
21, 7827
21, 8661
21, 9329
21, 9594
21, 8294
21, 8407

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

21, 7654
0, 6811
0, 6837
0, 6859
0, 6867
0, 6826
0, 6829

21, 7654
0, 6811
0, 6837
0, 6859
0, 6867
0, 6826
0, 6829

0, 00
0, 00
0, 01
0, 01
0, 00
0, 00
0, 01

Table 7.3.: Comparing voltage results of SLF and PowerFactory.

Branch

Grid Side: Angle

WTG side: Angle

SLF

PF

Error

Error

[ ]

[%]

SLF
[ ]

PF

Name

SLF
[ ]

PF

Name

[ ]

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31

0, 0000
5, 3028
5, 4325
5, 5361
5, 5776
5, 3766
5, 3946

0, 0000
5, 3028
5, 4325
5, 5361
5, 5776
5, 3776
5, 3946

0, 00
0, 00
0, 00
0, 00
0, 00
0, 02
0, 00

5, 2439
39, 7739
39, 8693
39, 9456
39, 9764
39, 8284
39, 8418

5, 2439
39, 7739
39, 8693
39, 9456
39, 9764
39, 8284
39, 8418

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

Table 7.4.: Comparing voltage angle results of SLF and PowerFactory.

94

7. Applications
Branch

Grid Side: Current

WTG side: Current

SLF

PF

SLF

PF

Error

SLF

PF

Error

Name

Name

[kA]

[kA]

[%]

[kA]

[kA]

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39
Cable 51-50
Cable 50-48
Cable 50-42
Cable 48-46
Cable 46-44
Cable 42-40

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31
Feeder 5
Line 26-27
Line 26-30
Line 27-28
Line 28-29
Line 30-31

0, 2195
0, 0532
0, 0530
0, 0528
0, 0527
0, 0531
0, 0530
0, 3175
0, 1583
0, 1060
0, 1054
0, 0527
0, 0530

0, 2195
0, 0532
0, 0530
0, 0528
0, 0527
0, 0531
0, 0530
0, 3175
0, 1583
0, 1060
0, 1054
0, 0527
0, 0530

0, 02
0, 05
0, 06
0, 01
0, 07
0, 08
0, 05
0, 02
0, 00
0, 00
0, 00
0, 04
0, 00

1, 3173
1, 6953
1, 6888
1, 6836
1, 6815
1, 6917
1, 6908
0, 3175
0, 1584
0, 1061
0, 1055
0, 0527
0, 0530

1, 3173
1, 6953
1, 6888
1, 6836
1, 6815
1, 6917
1, 6908
0, 3175
0, 1584
0, 1061
0, 1055
0, 0527
0, 0530

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 01
0, 02
0, 04
0, 02
0, 07
0, 05

Table 7.5.: Comparing current results of SLF and PowerFactory.

Branch
SLF

PF

Name

Name

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39
Cable 51-50
Cable 50-48
Cable 50-42
Cable 48-46
Cable 46-44
Cable 42-40

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31
Feeder 5
Line 26-27
Line 26-30
Line 27-28
Line 28-29
Line 30-31

Grid Side: Active power

WTG side: Active power

SLF

PF

Error

SLF

PF

Error

[MW]

[MW]

[%]

[MW]

[MW]

[%]

-49, 5347
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-11, 9409
-5, 9612
-3, 9900
-3, 9849
-1, 9975
-1, 9989

-49, 5348
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-2, 0000
-11, 9411
-5, 9613
-3, 9900
-3, 9849
-1, 9975
-1, 9989

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

49, 5347
2, 0000
2, 0000
2, 0000
2, 0000
2, 0000
2, 0000
11, 9512
5, 9849
3, 9989
3, 9975
2, 0000
2, 0000

49, 5360
2, 0000
2, 0000
2, 0000
2, 0000
2, 0000
2, 0000
11, 9513
5, 9849
3, 9989
3, 9975
2, 0000
2, 0000

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

Table 7.6.: Comparing active power results of SLF and PowerFactory.

95

7. Applications
Branch

Grid Side: Reactive power

WTG side: Reactive power

SLF

PF

SLF

PF

Error

SLF

PF

Error

Name

Name

[Mvar]

[Mvar]

[%]

[Mvar]

[Mvar]

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39
Cable 51-50
Cable 50-48
Cable 50-42
Cable 48-46
Cable 46-44
Cable 42-40

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31
Feeder 5
Line 26-27
Line 26-30
Line 27-28
Line 28-29
Line 30-31

8, 1096
0, 1564
0, 1552
0, 1542
0, 1538
0, 1557
0, 1555
0, 7981
0, 3705
0, 2723
0, 2386
0, 1208
0, 1417

8, 1093
0, 1564
0, 1552
0, 1542
0, 1538
0, 1557
0, 1555
0, 7980
0, 3704
0, 2723
0, 2386
0, 1208
0, 1417

0, 00
0, 01
0, 01
0, 02
0, 03
0, 01
0, 03
0, 01
0, 01
0, 01
0, 00
0, 00
0, 02

-3, 5106

-3, 5103

0, 0000
0, 0000
0, 0000
0, 0000
0, 0000
0, 0000
-0, 7991
-0, 3938
-0, 2974
-0, 2750
-0, 1538
-0, 1555

0, 0000
0, 0000
0, 0000
0, 0000
0, 0000
0, 0000
-0, 7991
-0, 3938
-0, 2974
-0, 2750
-0, 1538
-0, 1555

0, 01
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 01
0, 01
0, 03
0, 03

Table 7.7.: Comparing reactive power results of SLF and PowerFactory.

Branch

Grid Side: Power factor

WTG side: Power factor

SLF

PF

SLF

PF

Error

SLF

PF

Error

Name

Name

cos

cos

[%]

cos

cos

[%]

Trafo 52-51
Trafo 50-49
Trafo 48-47
Trafo 46-45
Trafo 44-43
Trafo 42-41
Trafo 40-39
Cable 51-50
Cable 50-48
Cable 50-42
Cable 48-46
Cable 46-44
Cable 42-40

T2
T5.26
T5.27
T 5.28
T 5.29
T 5.30
T 5.31
Feeder 5
Line 26-27
Line 26-30
Line 27-28
Line 28-29
Line 30-31

-0, 9869
-0, 9970
-0, 9970
-0, 9970
-0, 9971
-0, 9970
-0, 9970
-0, 9978
-0, 9981
-0, 9977
-0, 9982
-0, 9982
-0, 9975

-0, 9869
-0, 9970
-0, 9970
-0, 9970
-0, 9971
-0, 9970
-0, 9970
-0, 9978
-0, 9981
-0, 9981
-0, 9982
-0, 9982
-0, 9975

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 04
0, 00
0, 00
0, 00

0, 9975
1, 0000
1, 0000
1, 0000
1, 0000
1, 0000
1, 0000
0, 9978
0, 9978
0, 9972
0, 9976
0, 9971
0, 9970

0, 9975
1, 0000
1, 0000
1, 0000
1, 0000
1, 0000
1, 0000
0, 9978
0, 9978
0, 9972
0, 9976
0, 9971
0, 9970

0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00
0, 00

Table 7.8.: Comparing power factor results of SLF and PowerFactory.

96

7. Applications
Summary of error considerations
The maximal error of all tables is 0,08 %. The results produced by SLF and PowerFactory
match in a good degree of precision. However, it should be kept in mind to run the PowerFactory simulation with the simplifications mentioned (no transformer magnetization losses
and very high grid short circuit power).

7.3.2. Using exported data


Inside Excel the exported data can be used for creating charts. Figure 7.5 and 7.6 demonstrate a possible use of the exported data to study two properties for the cables of feeder 5
within the half base.

Figure 7.5.: Results for the grid side currents of the cables of Feeder 5.

97

7. Applications

Figure 7.6.: Power losses for the cables of Feeder 5.

7.4. PQ chart translation


Wind turbines using a doubly fed induction generator can produce or consume reactive
power. However, possible Q production or consumption is dependent on the operational
point of the WTG. Figure 7.7 shows the PQ capability for a Vestas V-80. The blue framed
area limits possible operation points of the turbine. The sign convention on producing/consuming reactive power is the same as for producing active power. Therefore the upper part
of the figure corresponds to Q production (capacitive behavior), and the lower part of the
figure corresponds to Q consumption (inductive behavior).

98

7. Applications

1
0.8
0.6
0.4

Q [Mvar]

0.2
0
0.2
0.4
0.6
0.8
1
0

0.2

0.4

0.6

0.8

1
P [MW]

1.2

1.4

1.6

1.8

Figure 7.7.: PQ chart of the Vestas V-80 (2 MW, 50 Hz, VCS).

An important characteristic of a wind farm is the PQ capability at the point of common


coupling (PCC). The PCC is always represented by the Slack node in the SLF environment.
In this example, the SLF possibility of performing successive load flow analysis for changing
input variables is used to calculate the PQ capability of the complete 100 MW base case.
The complete 100 MW consists of 50 V-80 WTGs with a nominal power of 2 MW. The ideal
PQ capability for the 100 MW would simply be the curve from figure 7.7, multiplied by the
number of turbines. However, due to cable and transformer losses within the wind farm, the
real PQ characteristic is different from the ideal one.
To obtain the capability PQ of the 100 MW base case, the values of the blue curve from
figure 7.7 were input simultaneously to all 50 WTGs (PQ nodes). This means the 50 WTGs
will receive simultaneously identical PQ references. The P and Q load flow results at the
PCC (Slack node) were exported to the Matlab workspace and plotted in a XY graph. Figure
7.8 shows the calculated PQ capability (red curve) together with the ideal one (blue curve).
For plotting the two curves in the same quadrant, the calculated P and Q results are both
multiplied by minus one.

99

7. Applications

60

40

Q [Mvar]

20

20

40

60

80

10

20

30

40

50
P [MW]

60

70

80

90

100

Figure 7.8.: Ideal and real PQ capability of the 100 MW base case.

The PQ chart translation from figure 7.8 is now also used to investigate the SLF execution
speed. A critical part of the execution time is the time for reaching the precision in the two
numeric algorithms applied by the solver function named solver.m . This function uses
first the current iteration algorithm to produce improved starting guesses and then uses
these results in the Newton-Raphson algorithm. The Newton-Raphson method is applied
until the final precision is reached. Following [2], this approach is common for load flow
analysis programs. For further explanation of the two solving algorithms please refer to
section 6.2.4 on page 82.
For the first load flow analysis (solver call) the SLF does a flat start. This means the per
unit voltage of all PQ nodes are assumed to be one and used as a starting guess. For
following solver calls, the SLF uses the previous voltage results as a starting guess. This
approach assumes that two successive sets of input variables are not totally different from
each other. For the continuously changing input from figure 7.7 this assumption is valid.
However, setting the SLF to perform a flat start each time the solver is called is possible by
uncommenting a line in the program code of function solver.m .
Execution time measurement was done in Matlab by using the tictoc command. The
PC used is on an Intel Core 2 Duo CPU (T7700) at 2.4 GHz and 1.98 MB RAM. The Simulink
simulation settings were set to a fixed time step of 0.005 s. The maximal deviation on P and
Q for the SLF were chosen as 0.001 MW and Mvar respectively. The maximal deviation
value, entered in the mask of the init block, specifies the maximal deviation on the input
values before a new load flow analysis is performed. With these settings, the SLF performs

100

7. Applications
3202 load flow calculations in total. The results for P and Q values at the Slack node are
presented in the red curve of figure 7.8.
The full base case results in a 103 103 NAM for the SLF. The switch-over tolerance for
the current iteration algorithm was set to 10%. The final precision for the Newton-Raphson
algorithm was set to 0, 01%.
Table 7.9 shows some time points of SLF for these settings. There is no significant difference
between the time, the solver needs when it is first called and the time needed for the second
call. When the solver is called the first time it performs a flat start. For any successive calls
the previous results are used as a starting guess.
As an experiment, the SLF was set to perform a flat start each time the solver was called.
The total simulation time increased slightly to 229 s. By using the previous result as a starting
guess the total execution time was 225 s. A difference could be noticed in the total number of
iterations in the Current and Newton Raphson method when running the 3202 solver calls.
By performing a flat start each time the solver is called, the total number of iterations after
finishing the simulation was 16093. In SLF default mode, using the previous results in the
solver, this was reduced to 6405 iterations.
All time values in seconds are rounded to the second decimal position.
Event

Time1

Finished init phase


(Main task is NAM building).

0.14 s

First solver call


(Flat start)

0.91 s

Reached final tolerance for first solver call

0.95 s

Second solver call

1.0 s

Reached final tolerance for second solver call

1.03 s

Finished simulation after 3202 solver calls:

225 s = 3.8 min

Table 7.9.: SLF significant execution time points.

101

7. Applications

7.5. Wind park compensation


Wind park operators have to pay the grid operating companies for consuming reactive power.
It is therefore normally demanded to run the wind farm with a power factor cos = 1 in
normal operation mode. Various solutions are adopted to fulfill this condition. One approach
is using capacitor banks to produce reactive power and compensate therewith the effect of
the transformer and cable inductances. A basic simulation of this approach can be done in
the SLF environment.
Figure 7.9 shows an uncompensated wind farm with three turbines, running each at 2 MW
and Q=2Mvar. It can be seen that the park consumes 1.119 Mvar reactive power.

Figure 7.9.: Uncompensated wind park.

The wind park should now be compensated with a shunt capacitor. Normally, such a capacitance is located on the low voltage side of the substation transformer, since this is cheaper.
However, because the voltage at this side is unknown before the load flow is done, the capacitance is here placed at the Slack node. This allows to determine the value of the needed
capacitance to compensate the park.
The reactive power production of a shunt capacitor is:

|U |2
Z C

(7.5.1)

1
j C

(7.5.2)

Q = j |U |2 C

(7.5.3)

Q =
with

ZC =
Inserting 7.5.2 in 7.5.1:

102

7. Applications
or:

C=

Q
j |U |2

(7.5.4)

For a phase to ground capacitor it makes no difference if the the line to ground voltage and
Q
3 or, alternatively, the line to line voltage and Q are used in 7.5.4. The capacitance should
produce 1.119 Mvar and is located at a phase to phase voltage of 132 kV. With these values,
the required capacitance is:

C=

1.119 Mvar
= 0.204 42 F
(132 kV)2

(7.5.5)

Figure 7.10 shows this situation in SLF. The power factor is now cos = 1 and the park
is compensated. The sign of power flowing out of the Slack node, which is the power delivered to the grid, was defined as negative and therefore the power factor also becomes
negative.

Figure 7.10.: Compensated wind park.

103

7. Applications

7.6. Conclusions
The requirements for a Matlab/Simulink load flow tool, fixed on page 27, could all be fullfilled.
Compared to PowerFactory the maximal observed error was 0,08 %.
In all cases, run for testing SLF, no convergence problems were noticed.
For a complete and comprehensive validation more benchmarking, eventually with other
load flow programs, need to be done.

7.7. Future research suggestions


Results should be benchmarked against more load flow programs, such as, for example,
PSS/E. One obstacle with comparing results to PowerFactory was often the rather closed
design of PowerFactory. The parameters of the used branches were sometimes undocumented and hard to identify. For detailed error and result tracking it would be advantageous
to compare against a load flow program where more internal calculations and proceedings
can be accessed.
Extending the SLF branch models is another suggestion. Wind parks are not operated at a
constant power. Due to this, transformer losses, caused by the magnetization impedances,
are also not constant. Therefore the SLF transformer branch should include magnetization
losses. At this point the SLF transformer branch only includes a series impedance. Magnetization losses can be simulated by adding a RLC impedance branch in shunt connection to
the transformer. However, it would be more convenient to have all this combined in a single
transformer branch. In the course of this, the RLC impedance branch in series connection
could be modified in order to comfortably simulate a power grid impedance.
Further on the SLF branches should be individually tested under all kind of conditions, such
as extraordinary high or low parameters. Special attention should be given to the reactive
power values. In the testing phase, an abnormal error on reactive power values could be
observed. It seems that this was due to the grid impedance in PowerFactory, which was not
set to a very high value. However, future testing should give consideration to reactive power
values.
Currently the SLF can handle a circuit built of one Slack node and an unlimited number of
PQ nodes. This approach fits well for building a WPP with turbines (PQ nodes) and the point
of common coupling (Slack node). The literature about load flow theory usually mentions

104

7. Applications
more node types in form of PV nodes and more than one Slack node. Although the SLF
solver is already optimized for a fast execution time, it could still be possible to speed it up by
using the Matlab sparse matrix functionalities. For time reasons these functionalities could
not be used in this implementation. Extending the SLF capabilities in this direction is an
option.
Another possible option is to transfer the Matlab code to Visual Basic. Since no Matlab
toolboxes are used in the original code, this should be possible. In this way, the SLF could be
of interest for the Vestas Sales and Business departments, who are involved in the planning
of WPPs. In the planning stage of wind farms the electrical parameters, such as used cable
types and lengths, are often stored in Excel spreadsheets. There are existing Visual Basic
implementations which use this Excel data to check, for example, the grid code compliance
of a planned wind farm. A load flow capability could be an interesting add-on to such a
tool.
In the authors opinion the most interesting suggestion is wind turbine operation point optimization. For a given wind speed, and therefore a given active power production, it is
possible to set the WTGs of a wind farm to individual reactive power set points. The capability of an individual WTG reactive power set point (within the corresponding PQ chart)
could be used to minimize active power losses for the wind park. The SLF can calculate
active power losses within a wind park for different PQ set points of the turbines. Therefore,
Matlab could be used to develop and test an optimization algorithm, which finds the optimal
operating state for a wind park at a given wind speed.

105

8. Appendix
8.1. Per unit system
Typically in power transmission networks, calculations are required with large values of voltage or power in kV and MW respectively. Additionally, branches on different voltage levels
occur. To avoid unwieldy numbers and to simplify voltage level treatment, the per unit system is introduced. A further advantage of the per unit system is that all voltage per unit
values usually differ around 1 pu. Therefore, the per unit system allows a quick identification
of abnormal high or low values in a transmission system.

Per unit reference values

SRef

Reference apparent power.


Chosen to whole system or a component nominal power.
In wind farm arrangements, typically chosen to 1 or 2 MW (component
nominal power) or whole wind park nominal power.

URef

Reference voltage, line to line.


Chosen to the nominal voltage of each voltage level.

IRef =
ZRef =
YRef =

SRef
3 URef

2
URef
SRef

1
ZRef

Reference current.

Reference impedance.

Reference admittance.

106

8. Appendix

Per unit values


u =

Ug
U
Ref
3

Per unit voltage from real star voltage (RMS).

u =

U
URef

Per unit voltage from real line to line voltage (RMS).

i =

Per unit current from real current.

IRef

s =

S
SRef

Per unit apparent power from real apparent power.

z =

Z
ZRef

Per unit impedance from real impedance.

y =

Per unit admittance from real admittance.

YRef

z = z Ref

URef
URef

!2

SRef
SRef

Per unit impedance from an impedance given in another per unit


system. Reference values of this per unit system are marked
by a tilde .

8.2. Notation
The following notations are used in this document.

Symbols
The symbols for electrical variables follow common practice. However, in load flow
analysis the voltage phase shift angle is not automatically the same as the angle used
in the power factor. Therefore the voltage phase shift is named and the power factor
is described with cos .

107

8. Appendix

Symbol accents
Complex values are indicated by an underscore: U , I , Z .
Per unit values are named with small letters: u, i, z.
Matrices and vectors in equations are printed in bold font: nam, Y0V.

Math and normal text


For improved readability, not all attributes of variables are used in text mode. Especially bold font and occasionally indexes, are not used in text mode. As an example
NAM or Y0 in math writing means the same as NAM and Y0V in text writing.

Cross referencing
Equations are generally indicated by parentheses: (4.2.13).
The introducing keyword Equation is optionally used: Equation (4.2.13).
Figures are introduced by the keyword Figure before the reference number: Figure 1.1.
Tables are introduced by the keyword Table before the reference number: Table 1.1.

8.3. Abbreviations
LL

Line to Line

PCC

Point of Common Coupling

PF

PowerFactory

PhPh

Phase to Phase

PSS/E

Power System Simulator for Engineering

108

8. Appendix
SLF

Simulink Load Flow

VSLFL

Vestas Simulink Load Flow Library

WPP

Wind Power Plant

WTG

Wind Turbine Generator

8.4. Synonymous used terms


Wind farm, wind park, wind power plant (WPP)
Y0 , Y0V, Y0V
Phase to Phase (Ph-Ph), Line to Line (LL)
Reference (voltage or power), base (voltage or power)

8.5. Matlab files


All Matlab functions programmed by the author of this thesis can be found on a CD at the
end of this document.

8.6. Literature

109

[1] L EIBFRIED, T HOMAS: Elektrische Anlagen- und Systemtechnik. Lecture script, Universitt Karlsruhe (TH), 2007.
[2] K UNDUR , P RABHA: Power System Stability and Control. McGraw-Hill, Inc, 1996.
[3] OMKHA: Vestas Simulink Load Flow Library - VSLFL Documentation. Technical Report
Item no. 963201.R0, Vestas, Technology R&D, 18.09.2006.
[4] J OHNSON , R ICHARD: MATLAB Programming Style Guidelines.
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2529&
objectType=File, October 2002.

8.7. Images
In this section images for the 100 MW base case are shown, which are too large for the
normal page layout. Therefore the following images are on pages without page numbers.
Images in printing order are:
Figure 8.1: Base case general layout
Figure 8.2: Circuit view for the half base case in SLF
Figure 8.3: Input/result view for the half base case in SLF
Figure 8.4: Exported SLF Excel data for the half base case
Figure 8.5: Result boxes for U , , I , cos for the half base case in PowerFactory
Figure 8.6: Result boxes for U , , P , Q for the half base case in PowerFactory

110

Figure 8.1.: Base case general layout

Figure 8.2.: Circuit view for the half base case in SLF

Figure 8.3.: Input/result view for the half base case in SLF

Figure 8.4.: Exported SLF Excel data for the half base case.
Only the lines corresponding to feeder 5 are shown.

Figure 8.5.: Result boxes for U , , I , cos for the half base case in PowerFactory

Figure 8.6.: Result boxes for U , , P , Q for the half base case in PowerFactory