Professional Documents
Culture Documents
Diplomarbeit
Start: 01.05.2008
End: 31.10.2008
Eidesstattliche Erklrung
Malte Hof
Contents
1 Introduction
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6
6
8
II
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
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.
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.
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
11
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.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
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
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)
S 2 = S 1 |U |2 Y
(2.2.4)
I1
I2
U1
U2
I 1 Z Ser i es = R + jL
U1
I2
U2
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.
U1 =Z I +U2
14
U1 =Z
S1
U1
+U2
(2.2.5)
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
15
U2
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.
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)
I 1 = I S1 + I Z
= 2 Y U 1 + I 2 + I S2
=2Y U1+I2+2Y U2
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)
U1
I2
(2 Z Y + 1)
Z
U2
I2
4ZY +4 2ZY +1
A B
U2
C D
I2
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.
U1
I2
U1
I2
BC
A D
=
C
D
B
D
U2
1
I1
D
!
U2
I1
M N
K
I2
M N
17
U 2
S1
U1
(2.2.12)
(2.2.13)
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.
18
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
20
21
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 [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
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.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
24
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.
26
27
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
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].
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
31
4. Theory
y 12
y 23
y 10
y 20
y 30
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.
32
4. Theory
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
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.
positive sign.
positive sign.
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)
i1
i2
y 12
u1
y 10
y 23
y 20
u2
i3
y 30
u3
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)
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)
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)
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
Y 0a = Y
(4.2.15)
a0
Element in Y0V:
35
4. Theory
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.
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
0
s1
u1 0
i1
s 2 = 0 u 2 0 i 2
0
0 u3
s3
i3
(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)
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,
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.
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)
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
(4.3.15)
un1
40
4. Theory
uSlack
in1
u Slack
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
(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
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
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)
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
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.
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 .
... ...
...
. . . 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)
...
...
() (1)
y0 = y j0
+ y j0
= y j0
...
...
(5.1.4)
47
5. Branch blocks
y Ser i es
i1
u1
y Shunt
y Shunt
i2
u2
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.
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.
Resistance in /km
Inductance in mH/km
Capacitance in F/km
C
k
49
5. Branch blocks
Shunt RLC impedance
j
L
C
0
Resistance R
Inductance L
Capacitance C
Ser ies
1
R+j L+
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)
y Ser ies =
YL
YL
= U2
YRef
Ref
(5.2.3)
SRef
(5.2.4)
y Shunt =
YL
Y L
= U2
YRef
Ref
(5.2.5)
SRef
(5.2.6)
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)
NAM modification:
...
...
...
. . .
...
(5.2.11)
Y0V modification:
...
(1) + y Shunt
y0 = y j0
...
52
(5.2.12)
5. Branch blocks
Mi ni Nam =
y Ser ies
y Ser ies
y Ser ies
y Ser ies
(5.2.13)
MiniNam:
y Shunt
Mi ni Nam =
y Shunt
0
0
(5.2.14)
i
u
= Mi ni Nam
i
0
53
(5.2.15)
5. Branch blocks
54
5. Branch blocks
X
j
Series admittance:
Ser ies
1
length
(R + jX )
(5.3.1)
(5.3.2)
y Ser ies =
Ser ies
YRef
Ser ies
2
URef
SRef
(5.3.3)
(5.3.4)
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)
Mi ni Nam =
y Ser ies
y Ser ies
56
y Ser ies
y Ser ies
(5.3.9)
5. Branch blocks
5.4. Cable
The implementation of the cable branch is based on the standard -equivalent circuit with
an inductive, resistive and capacitive element.
Note: For simplification the SLF stores these nominal ratings in a library function which is
called cableDataLibrary.m .
57
5. Branch blocks
Y
j
Ser i es
Shunt
Shunt
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
y Ser ies =
y Shunt =
Ser ies
YRef
Ser ies
2
URef
SRef
(5.4.4)
Y S
YRef
(5.4.5)
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
...
. . .
. . .
...
(5.4.8)
Y0V modification:
...
(1)
+ y Shunt
y j0
y0 =
(1)
y k0
+ y Shunt
...
(5.4.9)
59
5. Branch blocks
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.
Mi ni Nam =
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.
U 2N
U1
U2
SN
ur
ux
61
5. Branch blocks
ZT
I1
I2
:1
I2
U2
U1
U2
Figure 5.12.: Transformer equivalent circuit with tap changer on high voltage side.
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)
N =
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 .
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)
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
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
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
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)
y j 0 + y jk = y T
y jk = t y T
(5.5.20)
(5.5.21)
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)
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)
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.
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.
Mi ni Nam =
yT
t y T
68
t y T
t2 y T
(5.5.42)
5. Branch blocks
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.
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.
Short
term
Default
color
Note
RLC impedance
Overhead line
Cable
Transformer
RLC
Ohl
Cable
Trafo
Blue
Blue
Blue
Blue
72
6. Implementation
Branch properties, especially the NAM and Y0V modifications, are separately described in
chapter 5 Branch blocks at page 42.
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
Symbol
U
u
cos
P
Q
Unit
Name
kV
pu
Degree
MW
Mvar
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
Simulink block
Called by
cableLibrary.m
Cable branch
Init
Called before the simulation starts as an initialization callback of the init block.
Nodes
init.m
nomon.m
solver.m
export2Excel.m
Table 6.4.: Overview of the SLF Matlab functions and corresponding Simulink blocks.
75
6. Implementation
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.
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
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.
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.
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.
./
abs(X)
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
re
Real part.
im
Imaginary part.
83
6. Implementation
START
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
Help matrices Z
Jacobi matrix
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
)
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
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.
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.
89
7. Applications
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
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
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.
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.
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
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
Branch
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
94
7. Applications
Branch
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
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
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
95
7. Applications
Branch
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
Branch
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
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).
Figure 7.5.: Results for the grid side currents of the cables of Feeder 5.
97
7. Applications
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
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
0.14 s
0.91 s
0.95 s
1.0 s
1.03 s
101
7. Applications
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.
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.
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.
SRef
URef
IRef =
ZRef =
YRef =
SRef
3 URef
2
URef
SRef
1
ZRef
Reference current.
Reference impedance.
Reference admittance.
106
8. Appendix
Ug
U
Ref
3
u =
U
URef
i =
IRef
s =
S
SRef
z =
Z
ZRef
y =
YRef
z = z Ref
URef
URef
!2
SRef
SRef
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.
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
PF
PowerFactory
PhPh
Phase to Phase
PSS/E
108
8. Appendix
SLF
VSLFL
WPP
WTG
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.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