M ACDC 1.0 User's Manual: Jef Beerten
M ACDC 1.0 User's Manual: Jef Beerten
0
User’s Manual
Jef Beerten
University of Leuven (KU Leuven)
Dept. Electrical Engineering (ESAT), Division ELECTA
July 4, 2012
1
Contents
Contents 2
1 Introduction 3
1.1 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Citing M ATACDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Getting started 4
2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Running a simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Changing the input data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Using the results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Power flow options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 System Input Data Format 7
3.1 AC/DC System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 AC/DC System Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.3 Bus renumbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4 Modeling 14
4.1 Converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 DC System modelling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5 Sequential AC/DC Power Flow 23
5.1 AC System Power Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2 DC grid power flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.3 DC slack and droop buses iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6 Examples 29
6.1 Stagg 5-node test system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 RTS1996 test system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Bibliography 36
2
1 Introduction
M ATACDC is a free M ATLAB based open source program for AC/DC power flow analysis. The
program uses a sequential AC/DC power flow algorithm and can be used to simulate interconnected
AC systems and Multi-terminal Voltage Source Converter High Voltage Direct Current (VSC HVDC)
systems. With respect to the AC system power flow, the program completely relies on M ATPOWER,
a power flow and optimal power flow program in M ATLAB [1]. The AC/DC power flow problem is
solved sequentially, meaning that the program solves the AC/DC power flow by iterating between the
AC systems and the DC systems. Doing so, the DC system quantities remain unaltered during the AC
system power flow, and vice versa. The package has been fully integrated with the existing AC power
flow routines developed in M ATPOWER, while keeping the M ATPOWER original source code unaltered.
M ATACDC shares the same philosophy as M ATPOWER and M AT DYN [2, 3]: "It is intended as a
simulation tool for researchers and educators that is easy to use and modify." [4]. The source code
of M ATACDC is available [5]. The code is well documented, structured and easy to understand and
modify.
1.1 License
• M ATACDC may be modified for personal use provided this license remains in force.
• M ATACDC comes with no warranty whatsoever; not even the implied warranty of merchantabil-
ity or fitness for a particular purpose.
• Any publications derived from the use of M ATACDC must acknowledge M ATACDC.
• Modified versions of M ATACDC, or works derived from M ATACDC, may not be distributed
without prior written permission.
3
2 Getting started
This chapter briefly describes how to install MatACDC, how to run a simulation, change the input
data and access the results. This chapter is merely intended for a first understanding of how to start
working with the software. The different functions and components are explained in more detail in
the subsequent chapters and can be accessed in M ATLAB using the help command line.
2.1 Installation
In order to run the M ATACDC files, it is required to have the following programs installed on your
computer:
• The open source power program M ATPOWER must be installed and added to the M ATLAB path.
M ATPOWER is available at http://www.pserc.cornell.edu/matpower/. Please consult the
M ATPOWER manual for more info on how to install the latest stable version of the program.
M ATACDC has been tested with the latest stable version M ATPOWER 4.1.
• M ATACDC must be installed1 , and preferably added to the M ATLAB path. It is also advised to
add the sub-directories .../Cases/PowerflowAC and .../Cases/PowerflowDC to the path.
To check whether all program components are installed correctly, you can run the test_acdcpf.m
file.
>> runacdcpf(...);
The runacdcpf command needs two types of input data: The M ATPOWER AC power flow data and
the M ATACDC DC system data.
>> runacdcpf(’case5_stagg’,’case5_stagg_MTDCslack’);
4
>> [basemvaac, basemvadc, pol, busdc, convdc, branchdc] = loadcasedc(casefiledc);
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCslack’);
>> mpcdc.convdc(3,CONVTYPE_AC) = PVC;
>> runacdcpf(’case5_stagg’,mpcdc);
The data struct resultsac contains all AC power flow results, and uses the standard M ATPOWER
data struct format, limited to the fields baseMVA, bus, gen and branch. The data struct resultsdc
contains all DC power flow data.
Similarly to changing the input files in the example in the previous section, one can access the
individual data elements using the named column indices:
>> define_constantsdc;
>> [mpc, mpcdc] = runacdcpf(’case5_stagg’,’case5_stagg_MTDCslack’);
>> Vdc = mpcdc.busdc(:,VDC);
In this example, the voltages at the different DC buses are stored in the vector Vdc.
The command macdcoption is used to define the default program options. The indices of the
resulting option vector are defined in the file and can be easily accessed using the help command.
5
In this example, the converter limits are enforced during the power flow. As a result, the reactive
power limit in converter 1 is hit and the converter control is changed from AC voltage control to
constant Q injection.
6
3 System Input Data Format
This chapter introduces the hybrid AC/DC system from a conceptual point of view and discusses the
DC system input format. The AC system data input format is the standard M ATPOWER format. The
DC system data is divided into three matrices: busdc, convdc and branchdc. This chapter discusses
the DC system in terms of these three matrices and in terms of the AC/DC system interconnections.
For more details on the modeling of the system itself, the reader is referred to chapter 4.
1 ∼ 1 4 = 1
= ∼
AC 1 DC 1 AC 2
2 ∼ 2 5 = 2
= ∼
∼ = 1 AC 3
4 3 = 3 6 ∼
∼ 1 DC 2 2 = 1 AC 4
= ∼
has to be limited to these interconnected buses. In this example, AC systems 3 and 4 only share one
converter with respectively DC grids 1 and 2. These systems can represent relatively small systems
e.g. island systems or (offshore) wind farms connected to the offshore systems, but they can also
represent larger AC systems that only have 1 interconnection with the other AC systems in the grid.
• busdc matrix: Contains all DC bus data (e.g. bus numbers, active power withdrawals, voltages,
...)
• convdc matrix: Contains all converter station data (e.g. loss data, impedance values, status,
control modes, ...)
• branchdc matrix: Contains all DC branch data (e.g. line resistance, bus numbers, ...)
7
AC DC
∼
i = j
This flexible definition of the DC system allows a generalized implementation of DC systems with
multiple connections to different AC power systems as well as DC buses without connections to the
AC system.
Each DC bus can either have a corresponding AC bus or can not be connected to the AC system, as
shown in Fig. 3. This example shows a topology similar to the one from Fig. 2, but with an arbitrary
AC bus numbering and a consecutive DC bus numbering in the two DC systems. The system also
includes a DC bus without a connection to the AC grid (DC bus 7).
8
∼ 1 4 =
2 = ∼ 15
7
∼ 2 5 =
5 = ∼ 17
∼ 3 6 =
9 = ∼ 20
∼ 8 9 =
12 = ∼ 24
The representation of the AC bus numbers, DC bus numbers and the DC grid index in the busdc
matrix for this example is given by
%% busdc_i busac_i griddc . . .
busdc = [ 1 2 1 ...;
2 5 1 ...;
3 9 1 ...;
4 15 1 ...;
5 17 1 ...;
6 20 1 ...;
7 0 1 ...;
8 12 2 ...;
9 24 2 . . . ;] ;
The BUSAC_I = 0 indicates that their is no corresponding AC bus in any of the AC systems.
The AC buses can be interconnected by the same AC grid, or can alternatively be part of multiple non-
synchronized zones. This can be accomplished by selecting different ZONE values in the M ATPOWER
bus matrix.
9
Table 2: convdc data format (continued)
The CONV_BUS numbering corresponds to the BUSDC_I numbers defined in the busdc matrix.
The effect of a converter outage on the power flows in the AC/DC system can easily be adressed by
changing the CONVSTATUS flag from 1 to 0. Internally, M ATACDC handles DC buses without an AC
connection differently from buses with a connection. For more information, please consult section
3.3.
10
Additionally, a number of named indices are defined for CONVTYPE_DC and CONVTYPE_AC, depending
on the type of control. These are summarized in Tab. 3.
11
hampers a straight-forward implementation of the power flow algorithm. The M ATACDC functions
ext2intdc and ext2intac are used to redefine the bus numbers. Similarly, the functions int2extac
and int2extdc are used to convert the internal bus data to the external bus numbers.
Before renumbering the buses, converters facing an outage are treated similar to existing DC
buses without a connection to the AC system by using the function convout. The function sets
BUSAC_I = 0 in busdc for the converters that have CONVSTATUS = 0 flag, and also splits the con-
verter matrix into operational and non-operational converters. Similarly, the functions brchdcout
and brchout remove the non-operational DC and AC branches from the analysis.
AC DC
∼
1 = 1
.. 2
. ..
AC 1 . DC 1
∼ j
i =
∼ j +1
i +1 =
.. .. ..
. . .
m ∼ n
=
.. ..
AC i . .
p ∼ q
=
.. .. ..
. . . DC x
AC y v ∼ w
=
Fig. 4 shows the generalized case the interconnection of y AC grids with a total of v buses and x DC
grids with a total of w buses. Without lack of generality, we assume the last AC bus v to be connected
to the x-th DC grid. With v > w, there are v − w AC buses without a connection to a DC grid. The
DC buses have been numbered in a logical order for convenience, although the algorithm does not
impose any restrictions to the numbering of the DC buses as such. Each DC grid can have an arbitrary
number of converter-connected DC buses, as well as DC buses without an AC interconnection (e.g.
DC bus 2 in grid 1) and DC buses facing a converter outage (e.g. DC bus j in grid 1). Similarly, each AC
bus can either have a connection to the DC system, or can be an AC bus without an interconnection.
The M ATACDC bus numbering, allowing for different indices for AC and DC buses result in a maxi-
mum flexibility for the user to enter the different grid layouts in the power flow algorithm. After a per
unit conversion of the AC and DC grid quantities, and the removal of converters and branches facing
an outage, the overall sorting performed by the functions ext2intdc and ext2intac leads to the
result in Fig. 5.
The DC buses are generally not consecutively numbered, contrary to what was shown in 4 for
12
AC DC
∼
1 = 1
.. .. ..
. . .
∼
k = k DC 1
∼ j
i =
.. .. ..
. . .
n n
.. ..
. .
q ∼ q
=
.. .. .. DC x
. . .
w w
..
.
v
convenience. After renumbering the DC buses and sorting them per DC grid, the algorithm groups
converter-connected DC buses and renames their AC buses correspondingly, e.g. buses 1 to k for the
first DC grid in Fig. 5. This is done by the function ext2intdc.
Thereafter, arbitrary AC buses without DC connections are assigned to the DC buses without an AC
connection, e.g. buses k + 1 to n in Fig. 5. This is done by the function ext2intac. All converter
outages are considered equally to DC buses without a converter. The renumbering allows an easy
and straightforward access to both AC grid and DC grid variables during the power flow without
compromising the flexibility of the user interface.
As indicated in Fig. 5, M ATACDC does not take the AC zones into account when resorting the
AC/DC system, as M ATPOWER internally sorts the buses for each AC zone when an AC power flow is
performed.
13
4 Modeling
This chapter introduces the modeling of the AC/DC system, from the software user’s perspective.
while linking the models to the implementation in M ATACDC and to the DC system data matrices
defined in chapter 3. For more details on the modeling itself, the reader is referred to [6], [7].
4.1 Converters
A general representation of a VSC HVDC converter station, showing the different components is
depicted in Fig. 6. As seen from the AC point of common coupling (PCC), the different components
Pd c
Phase
Ss reactor S c
Filter
Converter
are [6]:
• the AC filters
• the converter
Ss Ss f Sc f Sc
Ztf Zc
Uf
Us
Qf
Bf Uc
Figure 7: Equivalent single phase power flow model of a converter station connected to the AC grid.
model consists of a controllable voltage source U c =Uc ∠δc behind the phase reactor, represented as
a complex impedance Z c = R c + X c . The low pass filter from Fig. 6 is represented as a susceptance
14
B f at system frequencies. A transformer connects the filter bus to the AC grid and is represented by
its complex impedance Z t f = R t f + X t f . The equations for active and reactive power at the grid side
in terms of the complex voltages are
with U s = U s ∠δs and U f = U f ∠δ f respectively the complex grid side and filter bus voltage. The
equations at the converter side are
Q f = −U f2 B f , (5)
while the expressions for the filter side complex power flowing through the transformer are written as
In this case, the user has to specify values for R t f , X t f , B f , R c and X c . In M ATACDC, both the
transformer impedance Z t f and the filter susceptance B f can be omitted, leading to the different
situations depicted in Fig. 8. Similarly, it is equally possible to only omit R t f and/or R c .
Depending on the parameters specified by the user, the M ATACDC implementation corresponds
to one of the situations depicted in Figs. 7 – 8. These implementations can be considered in the
following situations:
• No filter (B f = 0):
– Omitting filters
– Filterless design: Multilevel (modular) converter topologies. Contrary to earlier 2- or 3-
level converter topologies using Pulse Width Modulation (PWM), the latest converter
configurations synthesize the AC voltage waveform using a multilevel converter and do
not require low-pass AC filters.
• No transformer (Z t f = 0):
– Transformerless design
15
Ss Ss f Sc f Sc
Ztf Zc
Uf
Us
Uc
(a) no filter
Ss Sc Ss Sc
Zc Zc
Us Us
Bf Uc Uc
Figure 8: Single phase model of a converter station, (a) omitting the filter, (b) omitting the transformer
and (c) omitting both filter and transformer.
The different converter parameters R t f , X t f , B f , R c and X c are respectively defined as the named
indices RTF, XTF, BF, RCONV and XCONV in the convdc input matrix (see chapter 3). Depending on the
input data defined, M ATACDC automatically selects one of the corresponding representations from
Fig. 8.
The loss coefficients are defined as the named indices LOSSA, LOSSB, and LOSSCR and LOSSI in the
convdc matrix. A distinction can be made for the quadratic term in rectifier and inverter mode.
16
Fig. 9 shows the P −U steady-state characteristics for the three control options.
Ud c Ud c ud c
Ud∗c
∆Ud c,0
Ud c,0
kd c
P P P
P∗ P0
The active power operating mode can be changed using convdc index CONVTYPE_DC and the named
constants from Tab. 3. The corresponding steady state representations are defined in M ATACDC as
follows:
1. P constant: The converter has a constant active power injection P s into the AC grid.
2. Ud c constant: The converter controls the DC bus voltage Ud c at the converter terminal to a
constant value, irrespective of the active power signal.
convdc(..., CONVTYPE_DC) = DCSLACK; %% set to dc voltage control
busdc( ..., VDC) = ...; %% dc voltage set-point Ud∗c
3. P – Ud c droop: The active power injection into the DC grid P d c depends on the actual value of
the DC bus voltage Ud c . The droop control has set-points for voltage and power, respectively
Ud c,0 and P d c,0 , has a variable voltage droop k d c and can include a symmetric voltage deadband
∆Ud c,0 as depicted in Fig. 9c.
convdc(..., CONVTYPE_DC) = DCDROOP; %% set to dc voltage droop control
convdc(..., DROOP ) = ...; %% voltage droop kd c
convdc(..., PDCSET ) = ...; %% voltage droop power set-point P d c,0
convdc(..., VDCSET ) = ...; %% voltage droop voltage set-point Ud c,0
convdc(..., DVDCSET) = ...; %% voltage droop deadband ∆Ud c,0
The reactive power operating mode can be changed using convdc index CONVTYPE_AC and the named
constants from Tab. 3. The converter can be represented in M ATACDC as:
17
1. Q constant: The converter has a constant reactive power injection Q s into the AC grid.
convdc(...,CONVTYPE_AC) = PQC; %% set to reactive power control
convdc(..., QCONV) = ...; %% reactive power set point Q s∗
2. U constant: The converter adapts the reactive power injection to obtain a constant AC bus
voltage magnitude U s .
convdc(...,CONVTYPE_AC)=PVC; %% set to ac voltage control
convdc(..., VCONV) = ...; %% AC voltage set point U s∗
In existing point-to-point VSC HVDC systems, it is common practice to have only one converter at
the time controlling the DC voltage. The other converter is defined as constant power controller. In
the case5_stagg_HVDCptp file, a two-terminal DC system is defined with
In this case, the first converter is under active power control and will be represented in the power
flow algorithm as a constant P converter. The second converter, on the other hand, is the DC slack
converter (constant Ud c control) and changes the active power to keep its DC bus voltage constant.
Similarly, the reactive power for converter 2 is unknown prior to the power flow, as this converter is
set to constant AC voltage control.
Solving the power flow leads to the results for the active and reactive power:
>> define_constantsdc;
>> [mpc, mpcdc] = runacdcpf(’case5_stagg’,’case5_stagg_HVDCptp’);
>> mpcdc.convdc(:,[PCONV QCONV]) =
-60.0000 -40.0000
56.4959 0.0041
Please remark that the reactive power control can be set independently at each converter, whereas
the active power settings are not independent.
As discussed in chapter 6, the effect of the converter control on the power flows in the system can be
easily analyzed. This can be observed when using the casedc files case5_stagg_MTDCslack and
case5_stagg_MTDCdroop for a power flow calculation.
The results for the constant power and constant DC voltage control are obtained using:
>> runacdcpf(’case5_stagg’,’case5_stagg_MTDCslack’);
18
The results for the DC voltage droop control are obtained using:
>> runacdcpf(’case5_stagg’,’case5_stagg_MTDCdroop’);
Both files lead to similar results, since the droop set-points in case5_stagg_MTDCdroop have been
defined based on the power flow results from case5_stagg_MTDCslack. When, however, a converter
outage is simulated, it can be observed that the power injections at all converters are reduced as a
result of the droop control action.
The results for the constant power and constant DC voltage control are obtained using:
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCslack’);
>> mpcdc.convdc(3,CONVSTATUS) = 0; %% outage of converter 3
>> runacdcpf(’case5_stagg’, mpcdc);
The results for the DC voltage droop control are obtained using:
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCdroop’);
>> mpcdc.convdc(3,CONVSTATUS) = 0; %% outage of converter 3
>> runacdcpf(’case5_stagg’, mpcdc);
1
Reactive power, Qs (p.u.)
0.5
−0.5
−1
−1 −0.5 0 0.5 1
Active power, Ps (p.u.)
Figure 10: PQ-capability chart – Converter station current and voltage limits
filters, the dotted lines neglect the filters. The gray circle forms the converter current limit. The
black arcs depict the upper and lower converter voltage limits. When a converter set-point is located
outside of the converter limits, M ATACDC prioritizes active over reactive power when enforcing the
limits.
More details on the modelling of the converter limits can be found in [6].
19
4.1.4.1 Enabling/disabling converter limits
The converter upper and lower voltage limits and the converter current limit are defined in the
convdc matrix in respectively the VCMAX, VCMIN and ICMAX index and can be easily changed:
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCslack’);
>> mpcdc.convdc(3,ICMAX) = 1.1; %% change current limit in converter 3
By default, the converter limits are not enforced. The limits can be enabled by changing index LIMAC
of the default option vector defined in macdcoption:
When the limits are enabled by the user, the following situations may occur
• When an active power controlling converter has an active power set-point outside of the PQ
capability chart, the active power order is reduced to comply with the most stringent limit.
• When a DC voltage droop controlling converter hits a limit, the converter is set to a constant
active power injection equal to at the maximum converter active power limit.
• Similarly, when a reactive power controlling converter has a reactive power set-point outside
of the PQ capability chart, the reactive power order is reduced to comply with the most stringent
limit, provided that no active power limit is hit. If, on the other hand, this is the case, the active
power is prioritized when enforcing the limits.
• When an AC voltage controlling converter hits a reactive power limit, the converter is set to
a constant reactive power injection determined by the most stringent limit. Similarly to the
previous case, active power control is prioritized when the active power limit is violated.
DC slack converters (converters with a constant Ud c control) are excluded from the analysis, but
are checked at the end of the power flow calculation. It is up to the user to redefine the converter
set-points when it is observed that a limit is hit in those converters.
As an example, it is possible to change the active power set-point of converter 1, so that at the same
time, the reactive and active power limit are violated:
>> define_constantsdc;
>> opt = macdcoption;
>>opt(10) = 1; % enforce converter current and voltage limits
>> mpcdc = loadcasedc(’case5_stagg_MTDCslack’);
>> mpcdc.convdc(1,PCONV) = -130;
>> runacdcpf(’case5_stagg’,mpcdc,opt);
20
4.1.4.2 Visualization
It is also possible to visualize the converter limit violations, by enabling index CONVPLOTOPT. The
three possible options are
A graph similar to the one in Fig. 10 is plotted, showing the operational point with and without limit
inclusion.
Ud c1 Ud c4
I d c1 R d c17 I d c4
Ud c7
R d c47
R d c57
I d c2 R d c27 Ud c5
Ud c2 I d c5
R d c56
R d c36
I d c3 I d c6
Ud c3 Ud c6
R d c89
Ud c8 Ud c9
I d c8 I d c9
21
The current injected at a DC node i can be written as the current flowing to the other n − 1 nodes in
the network:
n
X
I d ci = Yd ci j · (Ud ci −Ud c j ), (11)
j =1
j 6=i
I d c =YdcUd c , (12)
I d c = [I d c1 , I d c2 . . . I d ck , 0 . . . 0 ]T , (13)
| {z } | {z }
working converters outage
with n − k zero elements due to converter outages and DC buses without a connection to the AC
system. The DC voltage vector is given by Ud c = [Ud c1 ,Ud c2 . . .Ud cn ]T and Ydc is the DC bus matrix.
with Yd ci j equal to 1/R d ci j and p = 1 for a monopolar system or p = 2 for a monopolar symmetrically
grounded or bipolar system. This parameter of the system is defined as the variable pol in the
casedc data files.
In case of a Ud c − P d c droop, the DC power injected by the voltage droop controlled buses, can be
written as
1
P d ci = P d c,0i − (Ud ci −Ud c,0i ). (15)
kd ci
22
5 Sequential AC/DC Power Flow
This chapter will briefly summarize the sequential AC/DC power flow method used by M ATACDC.
Fig. 12 summarizes converter AC and DC powers, voltages and losses and how they relate to the
busdc, convdc and branchdc data matrices. The AC representation of the converter stems with one
of the implementations depicted in Fig. 8.
P l oss, j
AC DC
S s, j S c, j P d c, j
U s,i
U c, j Ud c, j
The sequential AC/DC power flow algorithm sequentially solves the AC and DC system power flow,
thereby respectively keeping all converter powers and voltages constant. Fig. 13 shows the flow chart
of the AC/DC power flow algorithm. The remaining part of this chapter addresses how M ATACDC
internally implements the sequential power flow algorithm. More details on the mathematical
modelling can be found in [6, 7].
yes no
Output Converged?
Figure 13: Flow chart of the sequential VSC AC/DC power flow algorithm
23
In the mathematical description in this chapter, the converter AC powers are considered to be positive
when injected in the AC network. For convenience, DC powers are considered to be positive when
injected into the DC system. In the M ATACDC input and output format, however, the positive
direction of all active powers stems with a power transfer from the DC to the AC system. The
description in this chapter limits itself to one DC grid, but can be easily generalized.
1. Non-synchronized zones: In case multiple AC grids are defined (using the named index ZONE
in the bus matrix), M ATACDC extracts the AC system data for each zones and solves the power
flow for each AC grid one by one.
2. Infinite buses: In case the user is only interested in the DC system power flow or in case an
AC zone only has one node, the user can define infinite bus systems, by having inf for index
BUS_TYPE in the bus matrix. When M ATACDC runs the M ATPOWER runpf routine these buses
are taken out of the analysis.
5.1.1 Initialization
After having converted all converter data and the AC and DC grid data to the same per unit base,
the AC and DC buses are renumbered as explained in 3.3. In the AC power flow, all DC system and
converter data is kept constant. To start the iteration, the system needs a first approximation of the
converter active power injections. Thereby, the DC system and converters are assumed to be lossless.
As a first estimate to initiate the overall iteration, the AC active power injections of the droop con-
trolled converters are put equal to the negative of the DC power reference P d c,0 , thereby assuming
that the DC voltage does not deviate from the reference value Ud c,0 and neglecting the converter
losses P l oss . Without lack of generality, we assume 2 a n bus DC system with the first converter as the
DC slack bus and the subsequent m − 1 converters using a DC voltage droop control. The next k − m
buses are under constant active power control. The remaining n − k buses do not have a connection
to the AC grid or are facing a converter outage. The vector of AC power injections can thus be written
as
P s = [ P s1 , P s2 . . . P sm , P sm+1 . . . P sk , 0 . . . 0 ]T . (16)
|{z} | {z } | {z } | {z }
slack voltage droop P −control outage
The AC power injections of the k − m power controlled buses are defined in the input data. The
initialization can therefore be written as
P s(0)
i
=P si ∀i : m + 1 ≤ i ≤ n. (17)
The active power injection estimate of the m − 1 converters under voltage control is given by
P s(0)
i
=−P d c,0i ∀i : 2 ≤ i ≤ m. (18)
2 In M ATACDC, the converters are not sorted based on their control, as done here for convenience.
24
The active power delivered by the DC slack bus, if present, is initiated as
m n
P s(0) P s(0)
X X
1
=− i
− Ps j , (19)
i =2 j =m+1
with P s(0)
i
from (18) and P s j defined prior to the power flow as the active power injections of the
constant power buses.
In case one DC grids contains several voltage controlling converters, the total deficit power is dis-
tributed amongst the different DC converters. In the general case of l DC voltage controlling convert-
ers, the initialization from (19) becomes
à !
1 X m n
(0) (0)
X
P sh =− P + Ps j ∀h : 1 ≤ h ≤ l . (20)
l i =l +1 si j =m+1
Please note that having a multiple number of DC slack buses in one DC grid (hence multiple DC
voltage controlled nodes) can give rise to divergence in the DC power flow and has to be explicitly
defined by the user in the option vector.
For subsequent iterations, the solution from the previous iteration is used for P s(k)
1
.
p
P i (U , δ) =Ui
X £ ¤
U j G i j cos(δi −δ j )+B i j sin(δi −δ j ) , (21)
j =1
p
Q i (U , δ)=Ui
X £ ¤
U j G i j sin(δi −δ j )−B i j cos(δi −δ j ) . (22)
j =1
In the AC power flow routine, for which M ATACDC relies on the M ATPOWER file runpf, all converters
are represented as constant active power inputs to the AC system. Converters in V -control are
represented as dummy AC generators and their AC buses are changed from PQ-nodes to PV -nodes.
Several situations can occur for a converter under V -control :
• When no generator is present at the AC node under consideration, a dummy generator is added
to the bus.
• When a generator is present, but the node was a PQ node, the node is changed to a PV node
and only the additional reactive power delivered is considered to be the converter reactive
power.
• When a generator is present, and the AC node was a PV node, the converter is set to constant
reactive power control instead.
25
1 PQ PV 1
AC 1 DC 1 AC 2
2 PV PQ 2
4 3 PV PQ 1 AC 3
PV DC 2 PQ 1 AC 4
The converter power injections P s and Q s are included in the power mismatch vectors ∆P (k) and
∆Q (k) as negative loads. The power mismatch vectors can thus be rewritten as
(j) g en
∆P i =P i − (P id em − P si ) − P i (U ( j ) , δ( j ) ), (23)
(j) g en
∆Q i =Q i − (Q id em −Q si ) −Q i (U ( j ) , δ( j ) ). (24)
With respect to the active power, all converters are treated similar in the sense that also the DC slack
and droop buses are introduced in the AC power flow algorithm as either PQ or PV buses. However,
when a converter is under DC voltage control, either a slack bus or droop-based control, the active
power injection in the AC grid is not known beforehand, since it depends on the active power at the
DC side to control the DC voltage.
After calculating the AC power flow, all converter powers and losses are calculated to obtain the DC
grid’s injected powers P d c for the k DC buses to which converters are connected, disregarding the
ones facing outages.
P d ci = −P ci − P l ossi , ∀i < k, (25)
with P c the active part of the complex power injected at the converter side, shown in Fig. 6. The
converter powers are determined according to one of the implementations from Fig. 8. More details
can be found in [6].
Using this modified power vector, the DC bus voltages are calculated with a NR method:
!( j )
∂P d0 c
Ã
∆Ud c ( j ) (j)
Ud c · = ∆P d0 c . (27)
∂Ud c Ud c
26
The equations and terms corresponding to the slack bus are removed since its voltage is known prior
to the DC network power flow.
(j)
In this system of equations, the modified power mismatch vector ∆P d0 c is given by
(j)
P d c,0i − P d c,0i (Ud c )
∀i : 2 ≤ i ≤ m
0( j ) (k) (j)
∆P d c = P d c − P d ci (Ud c ) ∀i : m < i ≤ k , (28)
i i
−P d ci (Ud c ( j ) )
∀i : k < i ≤ n
(j) 1 (j)
P d c,0 = P d ci (Ud c ( j ) ) + (Ud c −Ud c,0i ), (29)
i ki i
and superscripts ( j ) and (k) respectively referring to the inner Newton-Raphson iteration and the
outer AC/DC power flow iteration.
More details on the DC grid power flow can be found in [6, 7].
P c(i ) = −P d(k)
c
− P l(ioss
)
, (30)
with the superscripts (i ) and (k) respectively referring to the DC slack bus iteration and the outer
AC/DC power flow iteration. The converter losses P l oss are calculated from (10). The previous AC
network power flow results are used to provide an initial estimate for the converter losses P l(0)
oss
.
A Newton iteration based on U c and U f as variables is internally used to update the converter state
in order to obtain a new value for P l(ioss
)
. For each DC slack or droop node, the iteration uses the values
of Q s , which is assumed to be constant during the iteration and the value of P c , which is updated
each iteration according to (30). Using (2) and (3), Q s and P c can be written as and in terms of U c
and U f . The power conservation at the filter bus leads to two additional equations in terms of U c
and U f , leading to four equations with four unknown variables
Q s (U f ,U c ) (31)
P c (U f ,U c ) (32)
F 1 (U s ,U c ,U f ) = P c f − P s f , (33)
F 2 (U s ,U c ,U f ) = Q c f −Q s f −Q f , (34)
which leads to a four equations with four unknown variables. P c f , P s f , Q c f , Q s f and Q f are defined
in terms of U c and U f in (3) and (2).
27
Inputs
P c(0) from (30) U (i ) (i )
c and U f
yes Check
Output no
convergence
P s from (1)
Pc
In the absence of a transformer, the active power P c and reactive power Q s are rewritten in terms of
U s and U c as
with B c + B f abbreviated as B c f . Thereby, the number of unknowns is reduced and the problem is
simplified to a system with two equations unknown variables and two unknown variables. More
details can be found in [6].
28
6 Examples
M ATACDC has a number of predefined data files that can be used to obtain AC/DC power flow
results.
All power flows use the runacdcpf command, and have the AC and DC power flow data as input
arguments, either as structs or as a string referring to the corresponding .m-file.
Optionally, the runacdcpf command also returns a convergence flag (converged) and a the elapsed
time (timecalc). It is also possible to define non-default options, both for the AC/DC power flow
algorithm (macdcopt), as well as for the standard M ATPOWER routines (mpopt):
Please consult help runacdcpf for more options and information on the input and output data and
format.
>> runpf(’case5_stagg’);
29
131.1 90.8 45+j15 40+j5
~ 1 3 4
41.8 40.3 19.4 19.3
86.9 72.9
54.7 53.4
6.6 5.2
5.6 4.8
~ 2 5
20+j10 60+j10
40 61.6
Figure 16: Stagg 5-node test system: AC power flow results (without DC system)
>> runacdcpf(’case5_stagg’,’case5_stagg_MTDCslack’);
For more information on the input and output data and the options, please use help runacdcpf.
All previous commands results in a printed output which summarizes the AC and DC power flow
results. The AC power flow results relies on the M ATPOWER printpf command.
30
Generators 2 On-line Capacity 550.0 -800.0 to 800.0
Committed Gens 2 Generation (actual) 173.6 51.5
Loads 4 Load 165.0 40.0
Fixed 4 Fixed 165.0 40.0
Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0
Shunts 0 Shunt (inj) -0.0 0.0
Branches 7 Losses (I^2 * Z) 4.39 13.18
Transformers 0 Branch Charging (inj) - 29.6
Inter-ties 0 Total Inter-tie Flow 0.0 0.0
Areas 1
Minimum Maximum
------------------------- --------------------------------
Voltage Magnitude 0.991 p.u. @ bus 5 1.060 p.u. @ bus 1
Voltage Angle -4.26 deg @ bus 4 0.00 deg @ bus 1
P Losses (I^2*R) - 2.72 MW @ line 1-2
Q Losses (I^2*X) - 8.15 MVAr @ line 1-2
================================================================================
| Bus Data |
================================================================================
Bus Voltage Generation Load
# Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr)
----- ------- -------- -------- -------- -------- --------
1 1.060 0.000* 133.64 84.32 - -
2 1.000 -2.383 40.00 -32.84 20.00 10.00
3 1.000 -3.895 - - 45.00 15.00
4 0.996 -4.262 - - 40.00 5.00
5 0.991 -4.149 - - 60.00 10.00
-------- -------- -------- --------
Total: 173.64 51.48 165.00 40.00
================================================================================
| Branch Data |
================================================================================
Brnch From To From Bus Injection To Bus Injection Loss (I^2 * Z)
# Bus Bus P (MW) Q (MVAr) P (MW) Q (MVAr) P (MW) Q (MVAr)
----- ----- ----- -------- -------- -------- -------- -------- --------
1 1 2 98.38 71.37 -95.66 -69.59 2.717 8.15
2 1 3 35.26 12.96 -34.20 -15.08 1.062 3.19
3 2 3 13.25 -6.22 -13.14 2.57 0.116 0.35
4 2 4 17.08 -5.18 -16.89 1.74 0.181 0.54
5 2 5 25.33 -1.85 -25.07 -0.35 0.257 0.77
6 3 4 23.09 4.64 -23.04 -6.47 0.057 0.17
7 4 5 -0.07 -0.27 0.07 -4.65 0.004 0.01
-------- --------
Total: 4.393 13.18
31
================================================================================
| DC bus data |
================================================================================
Bus Bus Voltage Power
DC # AC # Mag(pu) P (MW)
----- ---- --------- --------
1 2 1.008 -58.627
2 3 1.000 21.901
3 5 0.998 36.186
================================================================================
| VSC Converter Data |
================================================================================
Bus Bus injection Converter Voltage Total loss
DC# P (MW) Q (MVAr) Mag(pu) Ang(deg) P (MW)
----- ------- -------- ------- -------- -----------
1 -60.00 -40.00 0.890 -13.017 1.37
2 20.76 7.14 1.007 -0.655 1.14
3 35.00 5.00 0.995 1.442 1.19
------
Total: 3.70
Bus Converter power Filter Transfo loss Reactor loss Converter loss
DC# P (MW) Q (MVAr) Q (MVAr) P (MW) Q (MVAr) P (MW) Q (MVAr) P (MW)
----- ------- ------- -------- ------ -------- ------ -------- --------------
1 -59.92 -32.63 -8.12 0.08 5.83 0.01 9.66 1.29
2 20.76 -0.65 -9.02 0.01 0.54 0.00 0.70 1.14
3 35.02 -0.37 -8.83 0.02 1.43 0.00 2.03 1.17
------ -------- ------ -------- --------------
Total: 0.10 7.80 0.01 12.39 3.59
Bus Grid power Traf Filt.Power Filter Conv Filt. Pwr Converter Power
DC# P (MW) Q (MVAr) P (MW) Q (MVAr) Q (MVAr) Q (MVAr) P (MW) Q (MVAr)
----- ------ -------- ------ -------- -------- -------------- ------ --------
1 -60.00 -40.00 -59.92 -34.17 -8.12 -42.29 -59.92 -32.63
2 20.76 7.14 20.76 7.68 -9.02 -1.35 20.76 -0.65
3 35.00 5.00 35.02 6.43 -8.83 -2.40 35.02 -0.37
================================================================================
| DC branch data |
================================================================================
Brnch From To From Bus To Bus Loss
# Bus Bus P (MW) P (MW) P (MW)
----- ----- ----- -------- -------- --------
1 1 2 30.66 -30.42 0.24
2 2 3 8.52 -8.50 0.02
3 1 3 27.96 -27.68 0.28
32
--------
Total: 0.54
Similarly, the results after an outage of the third converter (DC bus 3 or AC bus 5) are obtained using:
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCslack’);
>> mpcdc.convdc(3,CONVSTATUS) = 0 %% outage of converter 3
>> runacdcpf(’case5_stagg’, mpcdc);
>> runacdcpf(’case5_stagg’,’case5_stagg_MTDCdroop’);
Similarly, the power flow results after an outage of converter 3 are obtained with the following
command:
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCdroop’);
>> mpcdc.convdc(3,CONVSTATUS) = 0; %% outage of converter 3
>> runacdcpf(’case5_stagg’, mpcdc);
Figs. 17–18 shows the results of the AC/DC power flow before and after the outage, both for a constant
power & voltage control, and a voltage droop control.
>> define_constantsdc;
>> mpcdc = loadcasedc(’case5_stagg_MTDCdroop’);
>> mpcdc.convdc(3,CONVSTATUS) = 0; %% outage of converter 3
>> mpcdc.convdc(:,DROOP) = mpcdc.convdc(:,DROOP)/5; %% changing all droop settings
>> runacdcpf(’case5_stagg’, mpcdc);
It can be observed that these lower droop settings result in much lower DC voltages after the outage
of converter 3.
%% bus data
% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin
33
133.6 84.3 45+j15 40+j5
~ 1 3 4
35.3 34.2 23.1 23.0
95.7 69.6
25.3 25.1
0.1 4.7
1.9 0.4
~ 2 5
20+j10 60+j10
40 32.8
14.6 17.5 3.1 4.5 14.8 0.7 13.3 15.6 5.9 7.5 11.9 1.6
104.2 69.7 99.1 71.2
Figure 17: Stagg 5-node test system: AC network power flow solution with a VSC MTDC system
between buses 2, 3 and 5: (a) Normal operation, (b) Converter outage on bus 5 & P -control, (c)
Converter outage on bus 5 & DC voltage droop on converters 2 and 3. Legend: → Active power (MW )
and 9 Reactive power (MVAr)
bus = [
2 inf 0 0 0 0 1 1.06 0 345 1 1.1 0.9;
3 inf 0 0 0 0 1 1 0 345 2 1.1 0.9;
5 inf 0 0 0 0 1 1 0 345 3 1.1 0.9;
];
The three nodes each belong to a different zone and have a voltage equal to the one defined in the VM
index.
>> runacdcpf(’case3_inf’,’case5_stagg_MTDCslack’);
The power flow with the infinite buses leads to similar results. Please note that in case of infinite
buses, the converters in V -control (in this example, bus 2) do not inject reactive power to support
the voltage.
34
20.8 7.1 3
21.9
28.0 27.7
58.6 36.2
58.0 37.3
58.6 37.5
Figure 18: DC network power flow solution with a VSC MTDC system between buses 2, 3 and 5
of Stagg 5-node test system: (a) Normal operation, (b) Converter outage on bus 5 & P -control, (c)
Converter outage on bus 5 & DC voltage droop on converters 2 and 3. Legend: → Active power (MW )
>> runacdcpf(’case24_ieee_rts1996_3zones’,’case24_ieee_rts1996_MTDC’);
Similarly to the previous example, the third AC zone can be replaced by an infinite bus, which has
been done in the data file case24_ieee_rts1996_3zones_inf.
>> runacdcpf(’case24_ieee_rts1996_3zones_inf’,’case24_ieee_rts1996_MTDC’);
35
Bibliography
[1] R. D. Zimmerman, C. E. Murillo-Sanchez, and R. J. Thomas, “MATPOWER: Steady-state opera-
tions, planning, and analysis tools for power systems research and education,” IEEE Trans. Power
Syst., vol. 26, no. 1, pp. 12–19, Feb. 2011.
[2] S. Cole and R. Belmans, “MatDyn, a new Matlab-based toolbox for power system dynamic
simulation,” IEEE Trans. Power Syst., vol. 26, no. 3, pp. 1129–1136, 2011.
[6] J. Beerten, S. Cole, and R. Belmans, “Generalized steady-state VSC MTDC model for sequential
AC/DC power flow algorithms,” IEEE Trans. Power Syst., vol. 27, no. 2, pp. 821 – 829, May 2012.
[7] J. Beerten, D. Van Hertem, and R. Belmans, “VSC MTDC systems with a distributed DC voltage
control – a power flow approach,” in Proc. IEEE PowerTech ’11, Trondheim, Norway, Jun. 19–23,
2011.
[8] G. Daelemans, “VSC HVDC in meshed networks,” Master’s thesis, Katholieke Universiteit Leuven,
Leuven, 2008.
[9] G. W. Stagg and A. H. El-Abaid, Computer Methods in Power System Analysis. Kogakusha, Japan:
McGraw-Hill, 1968.
36