Anda di halaman 1dari 25

DIgSILENT PowerFactory

Technical Documentation

RMS Simulation
Performance Benchmark
PowerFactory 15.2
DIgSILENT GmbH

Heinrich-Hertz-Str. 9
72810 - Gomaringen
Germany

T: +49 7072 9168 0


F: +49 7072 9168 88

http://www.digsilent.de
info@digsilent.de
r1596

Copyright 2014, DIgSILENT GmbH. Copyright of this document belongs to DIgSILENT GmbH.
No part of this document may be reproduced, copied, or transmitted in any form, by any means
electronic or mechanical, without the prior written permission of DIgSILENT GmbH.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 1


Contents

Contents

1 Introduction 4

2 Simulation Improvements 4

2.1 Improved Linear System Solver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2 One-shot DSL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.3 C Interface for Dynamic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.4 Compiled Improved Standard Libraries . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 Automatic DSL-to-C Interface Converter . . . . . . . . . . . . . . . . . . . . . . . 6

2.6 Algorithmic Enhancements and Additional Options . . . . . . . . . . . . . . . . . 6

2.7 Enhanced DSL Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.8 Enhanced Simulation Debug Information . . . . . . . . . . . . . . . . . . . . . . . 8

3 Benchmark Tests 10

3.1 Results on System 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1.1 Simulation with PowerFactory 15.1 . . . . . . . . . . . . . . . . . . . . . . 10

3.1.2 Simulation with PowerFactory 15.2 . . . . . . . . . . . . . . . . . . . . . . 10

3.2 Results on System 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.2.1 Simulation with PowerFactory 15.1 . . . . . . . . . . . . . . . . . . . . . . 12

3.2.2 Simulation with PowerFactory 15.2 . . . . . . . . . . . . . . . . . . . . . . 12

3.3 Results on System 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.3.1 Simulation with PowerFactory 15.1 . . . . . . . . . . . . . . . . . . . . . . 14

3.3.2 Simulation with PowerFactory 15.2 . . . . . . . . . . . . . . . . . . . . . . 14

3.4 Results on System 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3.4.1 Simulation with PowerFactory 15.1 . . . . . . . . . . . . . . . . . . . . . . 16

3.4.2 Simulation with PowerFactory 15.2 . . . . . . . . . . . . . . . . . . . . . . 16

4 Data Modelling 17

4.1 Development of Meaningful Models for Simulation . . . . . . . . . . . . . . . . . 17

4.1.1 Level of Detail in Modelling . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4.1.2 Verification of Initial Steady State . . . . . . . . . . . . . . . . . . . . . . . 18

4.1.3 Verification of Warning Messages . . . . . . . . . . . . . . . . . . . . . . 18

RMS Simulation Performance Benchmark (PowerFactory 15.2) 2


Contents

4.1.4 Verification of Expected Response . . . . . . . . . . . . . . . . . . . . . . 18

4.1.5 Choice of Integration Step Size . . . . . . . . . . . . . . . . . . . . . . . . 19

4.1.6 Choosing the Appropriate Simulation Algorithm . . . . . . . . . . . . . . . 19

4.1.7 Monitoring the Simulation Process . . . . . . . . . . . . . . . . . . . . . . 20

4.1.8 Choice of Step Size Strategy . . . . . . . . . . . . . . . . . . . . . . . . . 20

4.1.9 Compilation of DSL Models . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4.2 Improvements of System 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4.2.1 Simulation on Initial Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4.2.2 Optimisation of Model and Step Size Strategy . . . . . . . . . . . . . . . . 21

5 Conclusion 24

RMS Simulation Performance Benchmark (PowerFactory 15.2) 3


2 Simulation Improvements

1 Introduction

PowerFactory 15.2 completes the successful series of PowerFactory version 15 releases. The
latest release comes with a broad range of new functions, new electrical models and extensions
to the existing modelling suite. Special attention has been paid to improved calculation and
simulation performance.

This document is written in the form of a tutorial to show results of several RMS simulation
benchmark tests run on different projects which will not be made available to the user community
due to confidentiality reasons. This document is intended as a hands-on cookbook that shows
by examples what are the likely causes of slow simulations and what are the remedies which
are offered to the user in PowerFactory 15.2, together with an assessment of the performance
improvement with respect to PowerFactory 15.1.

2 Simulation Improvements

2.1 Improved Linear System Solver

A large number of linear equation systems must be solved during a simulation. PowerFactory
15.2 implements an enhanced high performance algorithm for this task, resulting in a significant
speed-up for the overall calculation.

2.2 One-shot DSL Functions

DSL has been enhanced via the introduction of the following one-shot functions: selfix, limfix
and outfix. These functions are analogous to the existing functions select, limits and output,
with the notable difference that they are evaluated only at initialisation, which provides significant
speed-up depending on their frequency of use. The introduction of the new functions exploits the
fact that a great proportion of the above-mentioned, existing functions were called on constant
parameters in dynamic models, e.g. to select a switch or to warn about a parameter lying outside
its allowable range, and thus need not be evaluated at each step. Also, any operation included
in an inc statement should use selfix rather than select regardless of the type of arguments
used, because inc statements are evaluated only at initialisation.

Figures 2.1 and 2.2 show an example of first order function coded with legacy DSL functions
and with new, one-shot DSL functions: in this case, the time constant T is a fixed parameter
which can thus be safely evaluated only at initialisation.

Figure 2.1: Usage of legacy DSL functions

RMS Simulation Performance Benchmark (PowerFactory 15.2) 4


2 Simulation Improvements

Figure 2.2: Usage of new, one-shot DSL functions

2.3 C Interface for Dynamic Models

The newly-developed C Interface lets the user program virtually any model using the C lan-
guage.The advantage with respect to the existing DSL models or MATLAB interface models is
that the model is then compiled and may run as fast as a standard PowerFactory element. A
detailed description of the C Interface is available in the User Manual.

2.4 Compiled Improved Standard Libraries

The standard models provided by PowerFactory have been enhanced with the use of new, one-
shot DSL functions and are delivered in a compiled form to achieve greater speed-up.

Figure 2.3: Compiled standard model avr SEXS

RMS Simulation Performance Benchmark (PowerFactory 15.2) 5


2 Simulation Improvements

2.5 Automatic DSL-to-C Interface Converter

The speed-up provided by the C Interface extends beyond models coded directly in the C lan-
guage, and models within the standard library. In addition, the user can create or modify an ex-
isting DSL model, run the automatic DSL-to-C Interface Converter and simulate the customised
model as fast as a standard PowerFactory element.

Figure 2.4: Compilation options for modified model avr SEXS

A detailed description of the procedure to compile user-defined models is available in the User
Manual.

2.6 Algorithmic Enhancements and Additional Options

Further performance improvements are made possible via the use of the following algorithm
options:

Fast convergence check


If this option is enabled, PowerFactory 15.2 will run faster because it determines conver-
gence via advanced heuristics instead of checking each equation.

Fast computation of outputs


PowerFactory 15.2 will run faster because it will use the last available output from the
solution process instead of recomputing each single quantity.
Fast independent solution of network and dynamic models
This option determines convergence sequentially and independently on network and dy-
namic models rather than simultaneously. PowerFactory 15.2 may run significantly faster
with this option enabled in case of systems exhibiting convergence difficulties.
Apply DSL events directly
This option enables internal DSL events stemming from the select(), lim() and limstate()
functions to be applied directly within one step which, depending on the number of tran-
sitions occurring, may be significantly faster than scheduling and applying each transition
singularly.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 6


2 Simulation Improvements

Figure 2.5: New solver options in calculation of initial conditions command

2.7 Enhanced DSL Debugging

PowerFactory 15.2 offers detailed monitoring of the transitions being scheduled and applied
within DSL models and informs the user about potential inconsistencies occurring during the
simulation.

Figure 2.6: Enhanced DSL debug messages

Warning messages can be of two kinds:

systematic error messages are due to inconsistent operations. These errors should be
solved as soon as they appear not only because they may indicate a modelling mistake,
but also because they may harm simulation performance. For instance, x. = 1/0 would
result in a very large derivative leading to large errors, small steps (in case of variable step
size strategy) and numerical problems.
occasional error messages may be due to continuous/discrete modelling inconsistencies.
This happens because any numerical solution cannot in the general case exactly identify

RMS Simulation Performance Benchmark (PowerFactory 15.2) 7


2 Simulation Improvements

and apply transitions at precise instants, but rather at approximate times. It is thus possi-
ble, for instance, that sqrt(limstate(x, 0, M ax)) issues a warning for a negative argument
because the limstate can be transitorily returning an unfeasible value outside its bounds.
While these errors may be ignored, it is recommended to use safer formulations such as
sqrt(max(limstate(x, 0., M ax), 0.)).

2.8 Enhanced Simulation Debug Information

PowerFactory 15.2 enhances the users possibilities to monitor the simulation process through
the introduction of several additional variables which are accessible within the result file of the
simulation. Variables are members of the result file object.

Figure 2.7: Enhanced simulation debug variables

These quantities are intended per simulation step. Several errors, counters and step sizes are
available. The following terms are used:

Inner loop Continuous-time equations


Outer loop Discrete-time equations

Dynamic model equations Dynamic equations of non-A-stable models


Bus equations Current equations of each node
Network model equations Equations of current injected by element
Network equations Bus equations, network model equations and dynamic equations
of A-stable models
Whole system Network equations and dynamic model equations

Error Mismatch between actual and numerical solution


Integration error Infinite norm (i.e. largest value) of normalised difference between
predicted and corrected value of state variables of dynamic
equations (for both A-stable and non-A-stable models)

RMS Simulation Performance Benchmark (PowerFactory 15.2) 8


2 Simulation Improvements

Equation errors:
b : errbs Error for bus equations
Error at the last iteration
b : errf i Error for network model equations
Error at the last iteration
b : erremt Error for dynamic model equations (EMT)
Error at the last iteration
b : errgrd Error for dynamic model equations (GRD)
Error at the last iteration

Network and system iteration counters:


b : itrgr Number of inner-loop iterations for network model equations
A high number may indicate difficult convergence of the network
b : ipjac Number of Jacobian matrix updates for network model equations
A high number may indicate difficult convergence of the network models
b : icjac Number of network Jacobian matrix factorisations
A high number may indicate difficult convergence within the network
b : ibvec Number of evaluations for network model equation mismatches
A number much higher than b : itrgr may indicate difficult convergence in the dynamic models
b : ibchk Number of convergence checks for network model equations
A number much higher than b : itrgr may indicate difficult convergence in the dynamic models
b : itreq Number of whole system iterations
A high number may indicate difficult convergence between network and dynamic models
b : itevt Number of event loops
A high number may indicate toggling
b : itout Number of outer-loop iterations for network model equations
A high number may indicate toggling within A-stable DSL models

Dynamic iteration counters:


b : itrstemt Number of inner-loop iterations for dynamic model equations (EMT)
An increase in this number indicates more dynamics or difficult convergence
b : itrstgrd Number of inner-loop iterations for dynamic model equations (GRD)
An increase in this number indicates more dynamics or difficult convergence
b : ijemt Number of Jacobian matrix factorisations for dynamic model equation (EMT)
An increase in this number indicates more difficult convergence
b : ijgrd Number of Jacobian matrix factorisations for dynamic model equations (GRD)
An increase in this number indicates more difficult convergence
b : itoutgrd Number of outer-loop iterations for dynamic model equations (GRD)
A high number may indicate toggling within non-A-stable DSL models

Integration errors:
b : ierremt Integration error for dynamic model equations (EMT)
A high value indicates that the step size may be too high
b : ierrgrd Integration error for dynamic model equations (GRD)
A high value indicates that the step size may be too high

Step sizes:
b : dtemt Integration step size for dynamic model equations (EMT)
Integration step size for instantaneous values simulation
b : dtgrd Integration step size for dynamic model equations (GRD)
Integration step size for RMS values simulation
b : dtint Interruption step
A value equal to zero indicates that the step size has not been interrupted

RMS Simulation Performance Benchmark (PowerFactory 15.2) 9


3 Benchmark Tests

3 Benchmark Tests

In this Section, several models of real-world systems are used to assess the performance
speed-up of the improvements detailed in Section 2.

For confidentiality reasons, the identity of the models is not revealed. The approximate figures
concerning system size and component characteristics are given only to provide a general idea
of the speed-up obtainable on similar systems.

These simulations are run on an off-the-shelf desktop PC, using one core, having the following
characteristics:
Processor: Intel Xeon CPU E3-1240 V2 @ 3.4 GHz
RAM: 12 GB
Operative System: 64-bit Windows 7

3.1 Results on System 1

System 1 is a very large model based on a real system with more than:

1200 synchronous generators


2600 simple standard models
24000 terminals between 400 V and 700 kV
30000 differential equations

The simulated disturbance is a the tripping of a synchronous machine at t = 0 s simulated


between t = 0 s and t = 20 s with a stable outcome. The step size is fixed and equal to 0.01 s.
The reported CPU times tCP U refer to this simulation horizon.

3.1.1 Simulation with PowerFactory 15.1

Importing and running the simulation in PowerFactory 15.1 is the first step of this investigation.
The simulation runs without warnings or errors with tCP U = 192 s, which is considered the
reference time for the following sections.

3.1.2 Simulation with PowerFactory 15.2

The simulation in PowerFactory 15.2 runs with tCP U = 38 s. Improved linear system solver (see
Section 2.1), default algorithmic options Fast convergence check and Fast computation of
outputs (see Section 2.6) and models from the Compiled improved standard library (see
Section 2.4) are to be credited for this more than five-fold speed-up.

Running the simulation without Fast convergence check and Fast computation of outputs
(see Section 2.6) and models from the Compiled improved standard library (see Section 2.4)
takes a simulation time of tCP U = 128 s, with a 1.5 speed-up to be attributed to the improved
linear system solver (see Section 2.1).

The default option Fast convergence check (see Section 2.6) gives a performance improve-
ment leading to a simulation lasting tCP U = 123 s with a speed-up of 1.55.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 10


3 Benchmark Tests

Another default option, Fast computation of outputs (see Section 2.6) allows to run the simu-
lation in tCP U = 79 s with a 2.45 speed-up.

An algorithmic option which may improve the simulation speed in the general case is Fast inde-
pendent solution of network and dynamic models (see Section 2.6). In this case however,
a speed-up cannot be expected because the whole system (i.e. the network and the dynamic
models) is completely solved once per time step in almost every step.

Finally, models from the Compiled improved standard library (see Section 2.4) bring down
the simulation time to tCP U = 38 s with more than five times speed-up.

The above speed-ups are summarised in table 3.1.

PowerFactory Improved Fast Fast Fast Standard tCP U Speed-up


version solver check output solution models (s) (wrt Base)
15.1.7 192 Base
15.2.1 ! 128 1.5
15.2.1 ! ! 123 1.55
15.2.1 ! ! ! 79 2.45
15.2.1 ! ! ! ! 79 2.45
15.2.1 (default) ! ! ! ! 38 5.05
Table 3.1: Speed-ups obtained with improved linear system solver, enhanced algorithmic op-
tions and models from the compiled improved standard library

Running the simulation with step size equal to 0.025 s gives the results summarised in table 3.2.
The overall simulation time in this case passes from tCP U = 96 s in PowerFactory 15.1 to
tCP U = 22 s in PowerFactory 15.2, with an overall speed-up of 4.35.

PowerFactory Improved Fast Fast Standard tCP U Speed-up


version solver check output models (s) (wrt Base)
15.1.7 96 Base
15.2.1 ! 66 1.45
15.2.1 ! ! 60 1.6
15.2.1 ! ! ! 60 1.6
15.2.1 ! ! ! 22 4.35
Table 3.2: Speed-ups obtained with improved linear system solver, enhanced algorithmic op-
tions and models from the compiled improved standard library (integration step size: 0.025 s)

3.2 Results on System 2

System 2 is a large model of a real system with more than:

200 synchronous generators


500 detailed customised controller models (in DSL)
1700 terminals between 1 and 500 kV
4800 differential equations

The simulated disturbance is a triphase short circuit on a 275 kV line at t = 1 s cleared by line
tripping at t = 1.1 s, resulting in a stable simulation between t = 0 s and t = 10 s. The variable

RMS Simulation Performance Benchmark (PowerFactory 15.2) 11


3 Benchmark Tests

step size is shown in Fig. 3.1: details on the optimisation process that led to this step size are
given in Section 4.2. The reported CPU times tCP U refer to this simulation horizon.

3.2.1 Simulation with PowerFactory 15.1

The data model and the solver parameters had some issues whose investigation is reported
in Section 4.2. Before these issues were solved, the simulation time was tCP U = 63 s. With
the improvements detailed in Section 4.2, PowerFactory 15.1 runs in tCP U = 22 s, which is
considered the reference time for the following measurements.

3.2.2 Simulation with PowerFactory 15.2

The simulation in PowerFactory 15.2 runs with tCP U = 18 s. The improved linear system solver
(see Section 2.1) is to be credited for this 1.2 speed-up.

The default options Fast convergence check and Fast computation of outputs (see Sec-
tion 2.6) give a straight performance improvement when applied in fixed step size simulation.
However, since they systematically worsen the error estimation, an adaptation of the prediction
error bounds is required in order to provide a speed-up in variable step size simulation (other-
wise they may result in a performance degradation due the increased estimation of the error and
the consequent decrease of the average step size). In this respect, the prediction error bounds
are increased by 50%.

This leads to a simulation lasting tCP U = 17 s with a speed-up of 1.3.

Another algorithmic option which may improve the simulation speed is Fast independent solu-
tion of network and dynamic models (see Section 2.6). To see whether a speed-up can be
expected, the result file variable itreq is plotted in Fig. 3.2: this quantity represents the number
of times the whole system (i.e. the network and the dynamic models) have to be completely
solved in order to achieve convergence in a given step.

By default, Fast independent solution of network and dynamic models is switched off to
guarantee the same accuracy as older PowerFactory versions whichever the step size used.
Indeed, if large steps are used, with respect to the dynamics involved, the response obtained
with the independent solution may differ from the default solution or even lead to divergence.
However, in this case, the Fast independent solution of network and dynamic models may
be safely used without loss of accuracy and gives a two-fold speed-up which corresponds to a
simulation time tCP U = 11 s.

Since this system is a real industrial case with customised models, no model from the Com-
piled improved standard library is used (see Section 2.4). However, the user may still improve
his(her) simulation, first by rewriting his(her) DSL models with the use of One-shot DSL func-
tions (see Section 2.2) and then by converting them with the Automatic DSL-to-C Interface
converter (see Section 2.5) and running them with the C Interface for dynamic models (see
Section 2.3).

One-shot DSL functions bring the simulation time down to tCP U = 10 s while the fastest
simulation is obtained with the C Interface for dynamic models and it lasts tCP U = 9 s with a
2.45 speed-up.

The above speed-ups are summarised in table 3.3.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 12


3 Benchmark Tests

Figure 3.1: Optimised step size in PowerFactory 15.2 simulation

Figure 3.2: Number of whole system iterations in PowerFactory 15.2 simulation

RMS Simulation Performance Benchmark (PowerFactory 15.2) 13


3 Benchmark Tests

PowerFactory Improved Fast check Fast One-shot Comp. tCP U Speed-up


version solver and output sol. DSL models (s) (wrt Base)
15.1.7 22 Base
15.2.1 ! 18 1.2
15.2.1 (default) ! ! 17 1.3
15.2.1 ! ! ! 11 2
15.2.1 ! ! ! ! 10 2.2
15.2.1 ! ! ! ! ! 9 2.45
Table 3.3: Speed-ups obtained with improved linear system solver, enhanced algorithmic op-
tions, one-shot DSL functions and C Interface on the consistent model with improved step size
strategy

3.3 Results on System 3

System 3 is a medium-sized model of a real system with more than:

160 synchronous generators


380 detailed customised controller models (in DSL)
570 terminals between 400 V and 220 kV

1600 differential equations

The simulated disturbance is a triphase short-circuit at a 220 kV busbar at t = 1 s cleared at


t = 1.12 s, resulting in a stable simulation between t = 0 s and t = 15 s. The step size is fixed
and equal to 0.01 s. The reported CPU times tCP U refer to this simulation horizon.

3.3.1 Simulation with PowerFactory 15.1

Importing and running the simulation in PowerFactory 15.1 is the first step of this investigation.
The simulation runs without warnings or errors with tCP U = 14 s, which is considered the
reference time for the following sections.

3.3.2 Simulation with PowerFactory 15.2

The simulation in PowerFactory 15.2 runs with tCP U = 13 s. The improved linear system solver
(see Section 2.1) is to be credited for this 1.1 speed-up.

The default option Fast computation of outputs (see Section 2.6) gives a performance im-
provement leading to a simulation lasting tCP U = 12 s with a speed-up of 1.15.

Another default option, Fast convergence check (see Section 2.6) allows to run the simulation
in tCP U = 9 s with a default speed-up of 1.55.

Another algorithmic option which may improve the simulation speed is Fast independent solu-
tion of network and dynamic models (see Section 2.6). To see whether a speed-up can be
expected, the result file variable itreq is plotted in Fig. 3.3: this quantity represents the number
of times the whole system (i.e. the network and the dynamic models) have to be completely
solved in order to achieve convergence in a given step.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 14


3 Benchmark Tests

Figure 3.3: Number of whole system iterations in PowerFactory 15.2 simulation

In this case, the Fast independent solution of network and dynamic models may be safely
used without loss of accuracy and gives a 3.5 speed-up which corresponds to a simulation time
tCP U = 4 s.

Since this system is a real industrial case with customised models, no model from the Com-
piled improved standard library is used (see Section 2.4). However, the user may still improve
his(her) simulation, first by rewriting his(her) DSL models with the use of One-shot DSL func-
tions (see Section 2.2) and then by converting them with the Automatic DSL-to-C Interface
converter (see Section 2.5) and running them with the C Interface for dynamic models (see
Section 2.3).

One-shot DSL functions and the usage of automatically converted models with the C Interface
for dynamic models bring the simulation time down to tCP U = 3 s with a 4.65 speed-up.

The above speed-ups are summarised in table 3.4.

PowerFactory Improved Fast Fast Fast One-shot DSL, tCP U Speed-up


version solver output check sol. comp. models (s) (wrt Base)
15.1.7 14 Base
15.2.1 ! 13 1.1
15.2.1 ! ! 12 1.15
15.2.1 (default) ! ! ! 9 1.55
15.2.1 ! ! ! ! 4 3.5
15.2.1 ! ! ! ! ! 3 4.65
Table 3.4: Speed-ups obtained with improved linear system solver, enhanced algorithmic op-
tions, one-shot DSL functions and C Interface

RMS Simulation Performance Benchmark (PowerFactory 15.2) 15


3 Benchmark Tests

3.4 Results on System 4

System 4 is a large model of a real system with more than:

270 synchronous generators


430 detailed customised controller models (in DSL)
1700 terminals between 400 V and 500 kV

4500 differential equations

The simulated disturbance is a load tripping at a 110 kV busbar at t = 0 s, resulting in a stable


simulation between t = 0 s and t = 10 s. The step size is fixed and equal to 0.001 s. The
reported CPU times tCP U refer to this simulation horizon.

3.4.1 Simulation with PowerFactory 15.1

Importing and running the simulation in PowerFactory 15.1 is the first step of this investigation.
The simulation runs without warnings or errors with tCP U = 137 s, which is considered the
reference time for the following sections.

3.4.2 Simulation with PowerFactory 15.2

The simulation in PowerFactory 15.2 runs with tCP U = 76 s. Improved linear system solver (see
Section 2.1) and default algorithmic options Fast convergence check and Fast computation
of outputs (see Section 2.6) are to be credited for this 1.8 speed-up.

Running the simulation without Fast convergence check and Fast computation of outputs
(see Section 2.6) takes a simulation time of tCP U = 103 s, with a 1.35 speed-up to be attributed
to the improved linear system solver (see Section 2.1).

The default option Fast convergence check (see Section 2.6) gives a performance improve-
ment leading to a simulation lasting tCP U = 98 s with a speed-up of 1.4.

The other default option, Fast computation of outputs (see Section 2.6) allows to run the
simulation in the default time of tCP U = 76 s, which corresponds to a 1.8 speed-up.

An algorithmic option which may improve the simulation speed in the general case is Fast inde-
pendent solution of network and dynamic models (see Section 2.6). In this case however,
a speed-up cannot be expected because the whole system (i.e. the network and the dynamic
models) is completely solved once per time step in almost every step.

Since this system is a real industrial case with customised models, no model from the Com-
piled improved standard library is used (see Section 2.4). However, the user may still improve
his(her) simulation, first by rewriting his(her) DSL models with the use of One-shot DSL func-
tions (see Section 2.2) and then by converting them with the Automatic DSL-to-C Interface
converter (see Section 2.5) and running them with the C Interface for dynamic models (see
Section 2.3).

One-shot DSL functions bring the simulation time down to tCP U = 73 s while the fastest
simulation is obtained with the C Interface for dynamic models and it lasts tCP U = 52 s with a
2.65 speed-up.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 16


4 Data Modelling

The above speed-ups are summarised in table 3.5.

PowerFactory Improved Fast check Fast One-shot Comp. tCP U Speed-up


version solver and output sol. DSL models (s) (wrt Base)
15.1.7 137 Base
15.2.1 ! 103 1.35
15.2.1 (default) ! ! 76 1.8
15.2.1 ! ! ! 76 1.8
15.2.1 ! ! ! 73 1.9
15.2.1 ! ! ! ! 52 2.65
Table 3.5: Speed-ups obtained with improved linear system solver, enhanced algorithmic op-
tions, one-shot DSL functions and C Interface

4 Data Modelling

Section 3 showed the speed-up of the improvements detailed in Section 2. Some of them are
available out-of-the-box in PowerFactory 15.2 while some others require some action from the
user. Some of these improvements may speed-up the simulation considerably.

Our experience shows, however, that equally significant speed-ups may come from the solution
of data model issues or from the proper tuning of simulation parameters. Such issues may go
unnoticed for long time because they possibly do not influence the simulated response but only
the simulation performance.

PowerFactory 15.2, as detailed in Section 2, also increases the user possibilities to analyse the
simulation, detect such issues and hopefully solve them.

This section explores several aspects of the development of simulation models and shows their
application on a practical example of improvement of simulation speed through solution of data
model and solver parameters issues.

4.1 Development of Meaningful Models for Simulation

The development of a model for simulation is a complex task. The following best practices aim
at developing more meaningful models. Our experience shows that consistent models are often
simulated faster than inconsistent ones.

4.1.1 Level of Detail in Modelling

A model is a means to an end: no matter how detailed it is, the model is always an imperfect
representation of the underlying system. The scope of the simulation should guide the mod-
eler in choosing the appropriate level of detail. For instance, if the time horizon of interest of
a transient simulation is the first few seconds after a disturbance, load tap changer and boiler
dynamics need not to be represented. Also, the implementation of the model should be as sim-
ple as possible, avoiding unnecessary functions, and potentially using one-shot DSL functions
whenever possible (see Section 2.2).

RMS Simulation Performance Benchmark (PowerFactory 15.2) 17


4 Data Modelling

4.1.2 Verification of Initial Steady State

Dynamic simulations in PowerFactory always suppose a steady-state initialisation, i.e. all the
derivatives of the state variables are supposed to be negligible. It is useful to verify that there
are indeed no dynamics by running a simulation without imposing any event and observing
that the response of the variables of interest is constant over a period of time. In case of DSL
models, it could also be useful to run the simulation with the option Display internal DSL events
in output window (see Fig. 4.1): ideally, no event should be scheduled or applied.

4.1.3 Verification of Warning Messages

At initialisation, and during the simulation (in case of DSL models with the appropriate DSL
warning option selected, as indicated in Fig. 4.1), some warnings may be printed.

Figure 4.1: Running a simulation with consistency checks (recommended setting)

Solving the problems that lead to the warnings is beneficial to the user for at least two reasons:
first, the user makes sure that all the operations inside his/her models are consistent (thus ruling
out that the inconsistency comes from inaccurate modelling or errors), and second the user will
exactly get from the simulation what he/she expects from it. As an example, a division by zero
may be interpreted differently by the DSL code (in DSL, for instance, a division by zero is a large
number), by the C code (infinity) and by the user him(her)self.

It is recommended to check any warning and potentially correct them with the objective of a
warning-free simulation.

4.1.4 Verification of Expected Response

After obtaining a warning-free steady-state simulation, the next step is to impose a simple event,
for which a qualitative expected response is known. At this stage, it is recommended to tem-
porarily switch to the most accurate simulation settings. With respect to the default settings,
these are the usage of A-stable algorithm for all models (solves all the equations together,
eliminating interface errors), the disabling of the fast algorithmic options (see Section 2.6) and
the setting of the Resolution factor to 0 (see Fig. 4.2 and Fig. 4.3).

RMS Simulation Performance Benchmark (PowerFactory 15.2) 18


4 Data Modelling

Figure 4.2: Running a simulation with the most accurate algorithmic options

Figure 4.3: Running a simulation with the most accurate event options

If the simulation runs with warnings or the simulated response is not as expected, possible
solutions are: to use a smaller integration step, or to examine again the model for modelling
inconsistencies.

4.1.5 Choice of Integration Step Size

The step size is the solution parameter which possibly has the largest impact on the simulation
performance. An appropriate tuning is thus needed to avoid unnecessarily slow simulations.

As a rule of thumb, in order to obtain accurate results in PowerFactory , the integration step
size should not be larger than the smallest equivalent time constant of the dynamics present
in the system. Starting with fixed step size simulations, the step size h should be increased
(or decreased) until the simulation responses show no substantial differences for h/2, h and
2h in a typical simulation. The largest h that satisfies this requirement is probably an optimal
integration step size.

4.1.6 Choosing the Appropriate Simulation Algorithm

Once the simulation responds as expected, the user may consider to disable the A-stable
algorithm for all models in order to solve network and dynamic models separately. For specific
models with strong interaction with the network, the option of solving some specific models only
together with the network is offered by enabling the A-stable flag of each single element.

In the general case, the simulation without A-stable models should be faster, but the simulated
response should not vary significantly.

The default options Fast convergence check and Fast computation of outputs (see Sec-
tion 2.6) may be enabled, provided that the simulated response is not changed significantly.
This may happen in case of too-large step sizes or numerical problems.

The default option Apply DSL events directly (see Section 2.6) may also be enabled, provided
that no outer-loop iteration problem occur as a consequence. In this case, the model should be
revised in order to separate events which cannot be resolved within the given step, or the step
size should be reduced.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 19


4 Data Modelling

4.1.7 Monitoring the Simulation Process

The simulation process can then be monitored for a typical simulation. The following iteration
counters are of particular interest: b : itreq, Number of whole system iterations and b : itevt,
Number of event loops. For more details please refer to Section 2.8.

It is important that these counters are, respectively, 1 and 0 from initialisation to the first event
imposed. This corresponds to a steady-state initialisation.

During the course of the simulation, higher values are acceptable. However, as the system
settles to a new steady-state (if any), these counters should tend to their initial values of 1 and
0.

If the value of b : itreq is significantly higher, this may indicate that some A-stable flags are not
set properly or that the step size is too large leading to high interface errors. The preferred option
in this case is to identify the responsible models and solve the interface problem. Alternatively,
the option Fast independent solution of network and dynamic models (see Section 2.6)
may be enabled, in order to enforce that the network is solved independently of and before the
dynamic models. The user should anyway check the simulated response and be advised that
this approach may lead to divergence or numerically unstable simulations, especially with large
step sizes.

Monitoring anomalies in other simulation process variables may be useful as well. For the
description and usage of the other variables, please refer to Section 2.8.

4.1.8 Choice of Step Size Strategy

PowerFactory offers the possibility of using an automatic step size adaptation algorithm. To
evaluate whether this may bring a performance boost, the following errors may be monitored: b :
ierremt, Integration error for dynamic model equations (EMT) and b : ierrgrd, Integration
error for dynamic model equations (GRD) (see Section 2.8).

The step size adaptation algorithm increases the step size as soon as these estimated errors
are below the specified minimum for a number of delay steps, and decreases the step size on
the step immediately following an estimated error higher than the maximum. These parameters
can be set as indicated in Fig. 4.4.

Figure 4.4: Automatic step size adaptation parameters

The automatic step size adaptation may be useful whenever a fixed step size simulation shows
generally declining error estimations tending to negligible values. The choice of the upper and
lower bounds should be made accordingly to the error estimations. The choice of delay, max-
imum increase and increase/decrease factors should be made taking into account that neither
too frequent nor too large step size variations are beneficial to the integration algorithm.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 20


4 Data Modelling

4.1.9 Compilation of DSL Models

Despite the newly developed C Interface for dynamic models (see Section 2.3), it is likely that
a vast majority of users will continue to use DSL for developing user-defined models, thanks to
its flexibility and ease of usage. Towards the end of the developing process, it is however rec-
ommended to use the Automatic DSL-to-C Interface converter (see Section 2.5) and compile
any developed user-defined DSL model to guarantee that the simulation runs as fast as pos-
sible. Negligible differences between the response computed with DSL and with C Interface
models are to be expected.

4.2 Improvements of System 2

One of the examples used for benchmark tests in Section 3, System 2, is revisited hereafter in
order to demonstrate the impact of appropriate data modelling to simulation performance.

4.2.1 Simulation on Initial Model

The description of System 2 is available in Section 3.2. Importing and running the simulation in
PowerFactory 15.1 is the first step of this investigation. The simulation runs without warnings or
errors with tCP U = 63 s, which is considered the reference time for the following section.

Since this is a variable step simulation, it is of interest to look at the step size used. The result file
variable dtgrd is shown in Fig. 4.6. The step size h, which should vary between h = 0.002 s and
h = 0.2 s, is in fact very close to the lower limit for the most of the simulation. To explain this
behaviour, the result file variable ierrgrd is plotted in Fig. 4.7.

The blue line in Fig. 4.7 is the upper limit for the prediction error estimation, which corresponds
to the default value 0.01. The error is very much above the maximum for the first few seconds
of the simulation, which explains why the step size is so small.

Finding the state variable(s) which is(are) responsible for such large error estimation is a cum-
bersome task in PowerFactory 15.1. The investigation proceeds in the next section with Power-
Factory 15.2, which gives the user more tools to investigate such simulation issues.

The simulation in PowerFactory 15.2 runs with tCP U = 46 s. The improved linear system solver
(see Section 2.1) is to be credited for this 1.35 speed-up. More specifically, the simulation is
run without Fast convergence check and Fast computation of outputs (see Section 2.6) to
better assess the speed-up of the improved linear system solver.

4.2.2 Optimisation of Model and Step Size Strategy

Since speeding up power system simulation is a complex subject, which can be hardly achieved
by one-fits-all approaches, the biggest gain may come from the attentive analysis of the ex-
perienced user. The first difference that the user may remark between the simulation run of
PowerFactory 15.2 with respect PowerFactory 15.1 is that several warnings of the type shown
in Fig. 4.5 are printed out at initialisation (see Section 2.7). In this example, a division by zero is
interpreted by DSL as a division by a large number.

Figure 4.5: Inconsistent DSL argument warning at initialisation

RMS Simulation Performance Benchmark (PowerFactory 15.2) 21


4 Data Modelling

Figure 4.6: Step size in the initial PowerFactory 15.1 simulation

Figure 4.7: Prediction error estimation in the initial PowerFactory 15.1 simulation

RMS Simulation Performance Benchmark (PowerFactory 15.2) 22


4 Data Modelling

Figure 4.8: Step size in the corrected model PowerFactory 15.2 simulation

Once the model definitions have been modified to avoid inconsistent operations at initialisa-
tion, the user has the option to run the simulation with DSL consistency checks, by setting the
appropriate DSL warning option as shown in Fig. 4.1.

The simulation without inconsistencies now runs in tCP U = 22 s with a speed-up of 2.85. The
explanation for such surprising speed-up is that some of the state variables derivatives were
the result of a division by zero (probably because of a modelling error that went unnoticed).
This is interpreted by DSL as a very large derivative, resulting in a very large estimation of the
prediction error which was preventing the step size from increasing. Indeed, the integration step
looks different now, as plotted in Fig. 4.8.

Observing the step size in Fig. 4.8 shows many variations which are in general not beneficial to
the simulation speed. The maximum prediction error is thus set to 0.02 leading to tCP U = 18 s
and a less variable and somewhat larger step size, as plotted in Fig. 3.1.

The simulation with improved step size strategy in PowerFactory 15.2 now runs with a speed-
up of 3.5 compared to the initial PowerFactory 15.1. The above speed-ups are summarised in
table 4.1. Exporting the corrected model to PowerFactory 15.1 leads to tCP U = 22 s, which was
considered the reference time in the previous Section 3.2.

To ease the comparison, the final timing of tCP U = 9 s reported in Section 3.2, correspond-
ing to the use of all PowerFactory 15.2 enhanced algorithmic options detailed in Section 2.6
(Fast computation of outputs, Fast convergence check and Fast independent solution of
network and dynamic models), Fast DSL functions (see Section 2.2) and C Interface for
dynamic models (see Section 2.3) is here shown again in table 4.1, this time with respect to
the initial simulation time of tCP U = 63 s.

The final seven-fold speed-up is thus obtained not only by use of the new PowerFactory 15.2
options and improved linear solver, but also by solving data model and step size strategy issues
thanks to the enhanced DSL and simulation debugging possibilities.

RMS Simulation Performance Benchmark (PowerFactory 15.2) 23


5 Conclusion

PowerFactory Improved Consistent Improved All options tCP U Speed-up


version solver model step strategy Section 3.2 (s) (wrt Base)
15.1.7 63 Base
15.2.1 ! 46 1.35
15.2.1 ! ! 22 2.85
15.1.7 ! ! 22 2.85
15.2.1 ! ! ! 18 3.5
15.2.1 ! ! ! ! 9 7
Table 4.1: Speed-ups obtained with improved linear system solver, consistent model and im-
proved variable step size strategy and PowerFactory 15.2 enhancements (enhanced algorithmic
options, fast DSL functions and C Interface)

5 Conclusion

PowerFactory 15.2 provides considerable performance improvement for RMS simulation. This
paper describes various enhancements which significantly increase the simulation speed, de-
pending on the specific dynamic model. In summary, these are:

Improved linear system solver (see Section 2.1);


New, one-shot DSL functions which can speed-up the simulation of DSL models consid-
erably (see Section 2.2);
The newly-developed C Interface, which offers the possibility to include any customised
dynamic model in a compiled file which will run as fast as a standard PowerFactory ele-
ment (see Section 2.3);
Compiled models in the standard library for major performance improvement (see Sec-
tion 2.4);

The possibility to compile user-defined models using the new automatic DSL-to-C con-
verter, which allows the user to run a customised DSL model as fast as a standard Pow-
erFactory element (see Section 2.5);
Advanced algorithmic options which offer additional speed-ups (see Section 2.6);
Enhanced DSL debugging possibilities that may warn the user about potential issues that
can severely affect the simulation speed (see Section 2.7);
Enhanced simulation debug information that may give insight on computational effort and
provide directions towards additional speed-ups (see Section 2.8).

This paper also shows the above improvements in action on several benchmark tests, leading to
up to seven-fold speed-ups of an optimised simulation in PowerFactory 15.2 with respect to an
initial simulation in PowerFactory 15.1 (System 2, see Section 4.2), and up to five-fold speed-
ups of an optimal default simulation in PowerFactory 15.2 with respect to an optimal default
simulation in PowerFactory 15.1 (System 1, see Section 3.1).

RMS Simulation Performance Benchmark (PowerFactory 15.2) 24

Anda mungkin juga menyukai