DynawoDocumentation PDF
DynawoDocumentation PDF
DynawoDocumentation PDF
List of Figures 5
1 Introduction 6
2 Install procedure 8
2.1 Building Dynaωo . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Launching Dynaωo . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Third parties . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Configure Dynaωo 13
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 Dynaωo inputs . . . . . . . . . . . . . . . . . . . . . . 14
3.1.2 Dynaωo outputs . . . . . . . . . . . . . . . . . . . . . . 15
3.2 Dynaωo input files . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 jobs file . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 iidm file . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.3 dyd file . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.4 par file . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.5 crv file . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Dynaωo input files modification . . . . . . . . . . . . . . . . . 21
3.3.1 jobs file . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.1.1 Simulate several scenarios . . . . . . . . . . . 21
3.3.1.2 Change the solver . . . . . . . . . . . . . . . 22
3.3.1.3 Specify stop conditions for the simulation . . 22
3.3.1.4 Specify what kind of models to use . . . . . . 23
3.3.1.5 Start a simulation from the end of another one 23
3.3.1.6 Run a simulation with no iidm file . . . . . . 23
3.3.1.7 Configure the jobs outputs . . . . . . . . . . . 24
3.3.2 dyd file . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.2.1 Use a black-box model . . . . . . . . . . . . . 26
3.3.2.2 Use a Modelica model from Dynaωo library . 26
1
3.3.2.3 Use a Modelica model not in Dynaωo Library 26
3.3.2.4 Assemble unit Modelica models in a macro
model . . . . . . . . . . . . . . . . . . . . . . 27
3.3.2.5 Use a template model . . . . . . . . . . . . . 27
3.3.2.6 Write connections . . . . . . . . . . . . . . . 28
3.3.2.7 Associate a dynamic model to a static com-
ponent . . . . . . . . . . . . . . . . . . . . . . 28
3.3.2.8 Define sets of connections . . . . . . . . . . . 29
3.3.2.9 Define sets of static references . . . . . . . . . 29
3.3.3 par file . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.3.1 Set a reference to a value stored in the iidm file 30
3.3.3.2 Enter a table of parameter . . . . . . . . . . . 30
3.3.4 crv file . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.3.4.1 Add a new curve to the curve file . . . . . . . 31
3.4 Basic errors in input files . . . . . . . . . . . . . . . . . . . . . 31
3.4.1 dyd file . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4.1.1 Missing connection . . . . . . . . . . . . . . . 31
3.4.1.2 Invalid connection due to connector’s type . . 32
3.4.1.3 Invalid connection due to inconsistency . . . . 32
3.4.2 par file . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.4.2.1 Parameter not found . . . . . . . . . . . . . . 33
3.4.2.2 Wrong type of parameter . . . . . . . . . . . 33
3.4.3 crv file . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.4.3.1 Wrong variable name in crv file . . . . . . . . 34
4 Functional documentation 35
4.1 Dynaωo Overview . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.2 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.2 C++ library . . . . . . . . . . . . . . . . . . . . . . . . 41
4.2.2.1 Network model . . . . . . . . . . . . . . . . . 41
4.2.2.2 OmegaRef model . . . . . . . . . . . . . . . . 45
4.2.2.3 Variation area model . . . . . . . . . . . . . . 45
4.2.3 Modelica library . . . . . . . . . . . . . . . . . . . . . 46
4.2.3.1 Library content . . . . . . . . . . . . . . . . . 46
4.2.3.2 Preassembled models . . . . . . . . . . . . . . 48
4.3 Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3.1.1 Differential Algebraic Equations . . . . . . . . 49
4.3.1.2 System resolution . . . . . . . . . . . . . . . . 50
4.3.1.3 Prediction-Correction scheme . . . . . . . . . 51
2
4.3.1.4 Discrete event handling . . . . . . . . . . . . 51
4.3.1.5 Solvers in Dynaωo . . . . . . . . . . . . . . . 52
4.3.2 Simplified solver . . . . . . . . . . . . . . . . . . . . . . 53
4.3.2.1 Introduction . . . . . . . . . . . . . . . . . . 53
4.3.2.2 Prediction step . . . . . . . . . . . . . . . . . 54
4.3.2.3 Correction step . . . . . . . . . . . . . . . . . 54
4.3.2.4 Discontinuities handling . . . . . . . . . . . . 57
4.3.2.5 Time step management . . . . . . . . . . . . 57
4.3.2.6 Algebraic equations restoration . . . . . . . . 59
4.3.3 Variable time-step solver . . . . . . . . . . . . . . . . . 60
4.3.3.1 Introduction . . . . . . . . . . . . . . . . . . 60
4.3.3.2 Prediction step . . . . . . . . . . . . . . . . . 61
4.3.3.3 Correction step . . . . . . . . . . . . . . . . . 61
4.3.3.4 Events detection . . . . . . . . . . . . . . . . 62
4.3.3.5 Time-step and order management . . . . . . . 62
4.3.3.6 Algebraic equations restoration . . . . . . . . 63
5 Advanced documentation 64
5.1 Code organization . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.2 Dynaωo executables . . . . . . . . . . . . . . . . . . . . . . . 66
5.2.1 Dynaωo commands . . . . . . . . . . . . . . . . . . . . 67
5.2.2 Compilation and simulation of a single Modelica model 67
5.2.3 Compilation and simulation of complex models . . . . 72
5.2.4 Generation of a xml summary of the parameters and
variables of a compiled model . . . . . . . . . . . . . . 78
5.3 Adding a model to the Dynaωo library . . . . . . . . . . . . . 79
5.3.1 Adding a Modelica model in the Dynaωo Modelica library 79
5.3.2 Adding a Modelica model in the Dynaωo precompiled
library . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.4 Adding a new solver . . . . . . . . . . . . . . . . . . . . . . . 85
Bibliography 87
3
Appendix F Adept License 124
4
List of Figures
5
1 Introduction
To achieve this goal, Dynaωo is based on two mains principles: the use
of a high-level modelling language Modelica and a strict separation between
the modelling and the solving parts.
6
long as the user provides the necessary models and solvers. Different initia-
tives are under discussion or submission to test the possibility to use Dynaωo
for EMT simulations or multi-system simulations.
Only validated models are included into the library that is still
under construction. We plan to release a new set of models in the near
future, e.g. HVDC, wind and solar power plants models or more different
standard regulation models.
Dynaωo is licensed under the terms of the Mozilla Public License, v2.0. The
source code is hosted into a GitHub repository.
7
2 Install procedure
Contents
2.1 Building Dynaωo . . . . . . . . . . . . . . . . . . . 8
2.2 Launching Dynaωo . . . . . . . . . . . . . . . . . . 10
2.3 Third parties . . . . . . . . . . . . . . . . . . . . . 10
8
java -1.8.0 - openjdk - devel blas - devel lapack - devel
lpsolve - devel expat - devel glibc - devel sqlite - devel
xerces -c - devel libarchive - devel zlib - devel doxygen
doxygen - latex qt - devel gettext patch wget python - devel
clang llvm - devel ncurses - devel readline - devel unzip
perl - Digest - MD5 vim gcovr python - pip python - psutil
boost - devel lcov gtest - devel gmock - devel xz rsync
python - lxml graphviz
To build Dynaωo you need to clone its repository and launch the following
commands in the source code directory:
$ > git clone https :// github . com / dynawo / dynawo . git dynawo
$ > cd dynawo
$ > echo '#!/ bin / bash
export DYNAWO_HOME = $ ( cd " $ ( dirname " $ { BASH_SOURCE [0]}") " &&
pwd )
export O P E N M O D E L I C A _ V E R S I O N =1 _9_4
export SRC_OPENMODELICA = $DYNAWO_HOME / OpenModelica / Source
export I N S T A L L _ O P E N M O D E L I C A = $DYNAWO_HOME / OpenModelica / Install
Warning: If you’re working behind a proxy make sure you have exported
the following proxy environement variables:
9
$ > export https_proxy =
$ > export no_proxy = localhost ,127.0.0.0/8 ,::1
$ > export HTTP_PROXY = $http_proxy ; export
HTTPS_PROXY = $https_proxy ; export NO_PROXY = $no_proxy ;
This command launches a simple simulation on the IEEE 14-bus network that
should succeed if your installation went well and your compilation finished
successfully.
The correctness of the simulation can be checked by looking into the outputs
directory and compare its content with the ones from the reference outputs
directory (especially the curves file).
All the simulation outputs are stored into the outputs directory, as specified
in the jobs file.
For example, for this line disconnection simulation, the plot for the voltage
module in p.u. on bus 10 should look like this:
10
Figure 3: Dynaωo results on IEEE14_DisconnectLine case
11
• Adept [13] [12], an automatic differentiation library that is developed
and maintained at the University of Reading by R.J. Hogan. The 1.1
version is currently employed into Dynaωo to evaluate the Jacobian
matrices for Modelica models during the simulation and distributed
under both Apache-2.0, GPL-2.0 and MIT licenses.
Finally, Dynaωo also uses a large number of other system libraries for its
compilation process, the unit testing process or to build its source documen-
tation. These libraries must be installed by the developer before compiling
Dynaωo and the complete list is given in 2.1.
12
3 Configure Dynaωo
Contents
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 Dynaωo inputs . . . . . . . . . . . . . . . . . . . . 14
3.1.2 Dynaωo outputs . . . . . . . . . . . . . . . . . . . 15
3.2 Dynaωo input files . . . . . . . . . . . . . . . . . . 16
3.2.1 jobs file . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 iidm file . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.3 dyd file . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.4 par file . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.5 crv file . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Dynaωo input files modification . . . . . . . . . . 21
3.3.1 jobs file . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3.2 dyd file . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.3 par file . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.4 crv file . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4 Basic errors in input files . . . . . . . . . . . . . . 31
3.4.1 dyd file . . . . . . . . . . . . . . . . . . . . . . . . 31
3.4.2 par file . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.4.3 crv file . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1 Overview
The following section will provide information on:
• How to create the input files in order to simulate a given test case;
13
• How to configure the input files in order to get the necessary output
files to analyse the obtained results;
The list of input files and the most important output files are summarized
in the figure below:
• A file providing the static description of the test grid to simulate: the
iidm file (.iidm extension);
• A file providing the list of the variables to plot at the end of the simu-
lation: the curves file (.crv extension);
The crv file is optional: with no crv file, no curves will be available at the end
of the simulation but the simulation can be run anyway. The iidm file can
also be optional for small test cases where the whole system is represented
in the dyd file (see paragraph 3.3.1.6). Other files are mandatory.
All jobs, iidm, dyd, par and crv files are XML files. Their extension can also
be .xml. For each file, there is an associated xsd file used to validate the xml
14
file and to check that it respects a certain format. The xsd file defines which
elements and attributes are permitted and in which order. In that sense, they
can help the user write or modify one or several input files. The different xsd
files are to be found in the install directory in dynawo/share/xsd.
The iidm.xsd is directly located in the install directory of the IIDM library
and can be found in share/iidm/xsd.
• A file providing the static state of the network at the end of the simula-
tion (output.iidm). This iidm file can be used to start another dynamic
simulation;
• A file providing the value of the desired variables at each time step in
order to visualize their evolution through time (curves.crv);
• Files providing the variables values after initialization for each model.
The values can be printed after local (or individual model) initialization
or global (or system) initialization.
The input jobs file should be configured properly in order to give access to
all these outputs (see paragraph 3.3.1.7).
15
3.2 Dynaωo input files
The following sections get into more details regarding the five input files and
give some examples based on the non regression test IEEE14 present in the
Dynaωo repository.
Warning: the following example files are extracted from IEEE14 case in
Dynaωo and might not be complete, hence not work as they are presented
here.
16
directory. Network parameters are stored in IEEE14.par file, set 18.
The solver used is the simplified solver, and its parameters are described in
solvers.par file, set 1.
At the end of the simulation, the user will have the possibility to plot the
different variables listed in IEEE14.crv, thanks to a csv file generated by
Dynaωo in outputs/curves directory.
The chronology of events that happened during the simulation will also be
available in a text file in outputs/timeline directory.
Absolute and relative paths can be used and mixed in a single jobs file.
Relative paths refer to the directory where the jobs file is located.
• the substations, which contain one or more voltage levels, which them-
selves contain buses, loads, generators, etc;
• the branches (lines and transformers) that connect buses defined in the
voltage levels;
17
8 < iidm : load id = " _LOAD__10_EC " name = " LOAD 10 "
loadType = " UNDEFINED " p0 = " 9.0 " q0 = " 5.8 "
bus = " _BUS___10_TN "
connectableBus = " _BUS___10_TN " p = " 9.0 "
q = " 5.8 " / >
9 </ iidm : voltageLevel >
10 </ iidm : substation >
11 < iidm : substation id = " _BUS___11_SS " name = " BUS 11 _SS "
country = " AF " geographicalTags = " _SGR_01 " >
12 < iidm : voltageLevel id = " _BUS___11_VL " name = " BUS
11 _VL " nominalV = " 13.8 " topologyKind = " BUS_BREAKER " >
13 < iidm : busBreakerTopology >
14 < iidm : bus id = " _BUS___11_TN " v = " 14.5959015 "
angle = " -14.809061 " / >
15 </ iidm : busBreakerTopology >
16 < iidm : load id = " _LOAD__11_EC " name = " LOAD 11 "
loadType = " UNDEFINED " p0 = " 3.5 " q0 = " 1.8 "
bus = " _BUS___11_TN "
connectableBus = " _BUS___11_TN " p = " 3.5 "
q = " 1.8 " / >
17 </ iidm : voltageLevel >
18 </ iidm : substation >
19 < iidm : line id = " _BUS___10 - BUS___11 -1 _AC " name = " BUS
10 - BUS 11 -1 " r = " 0.156256 " x = " 0.365778 " g1 = " 0.0 "
b1 = " 0.0 " g2 = " 0.0 " b2 = " 0.0 " bus1 = " _BUS___10_TN "
connectableBus1 = " _BUS___10_TN "
voltageLevelId1 = " _BUS___10_VL " bus2 = " _BUS___11_TN "
connectableBus2 = " _BUS___11_TN "
voltageLevelId2 = " _BUS___11_VL " p1 = " -3.628976 "
q1 = " -1.291152 " p2 = " 3.639966 " q2 = " 1.316878 " >
20 < iidm : currentLimits1 permanentLimit = " 4183.7 " / >
21 </ iidm : line >
22 </ iidm : network >
In this example, the network is composed of only two voltage levels connected
through one line.
iidm files are very dense and can be very large in case of large systems because
they provide a lot of information:
18
• the static parameters with their values. For example, for the line
the static parameters are: the resistance (R), the reactance (X), the
conductances on both sides (G1, G2) and the susceptances on both
sides (B1, B2). They are used by Dynaωo to build the network model.
• the network topology in the initial situation. We have seen in our ex-
ample that we have information about the connection between different
voltage levels through a line.
The connections between these models are written at the end of the file: the
load output terminal is connected to the pin of a bus given in the iidm file.
The connections between the dynamics models are provided with the key-
19
word “connect”.
Here the load models are precompiled black-box models but the dyd file can
use other kind of models such as macro Modelica models assembling different
unit Modelica models, or template models. See following sections for more
information about the different types of models supported by the dyd file.
In most cases, the iidm file provides information about the network topology
and the static parameters, and the dyd file provides information about the
dynamic behaviour of components given in the iidm file.
When a static component has no equivalent in the dyd file, Dynaωo uses a
default C++ model for the component. This is often the case for the lines
for example. It can also be the case for any other component, but the reader
should keep in mind that the default C++ models are basic and simple
models. In order to obtain accurate and detailed results from a dynamic
simulation, it is important to use accurate and detailed models.
20
For each parameter, the user should give the name, the type (DOUBLE,
INT, BOOL or STRING) and the value of the parameter.
Sometimes, the par file contains references to parameters present in the iidm
file (see paragraph 3.3.3.1).
In this example, the curves available are the voltage amplitudes of buses
_BUS___10_TN and _BUS___10_TN in per unit.
1 < jobs xmlns = " http :// www . rte - france . com / dynawo " >
2 < job name = " MyFirstJOB " >
3 ...
4 </ job >
5 < job name = " MySecondJOB " >
6 ...
21
7 </ job >
8 </ jobs >
For IDA solver, IDA order 1 and IDA order 2 can be used (fill the value for
the parameter “order” in the par file).
When criteria are not activated, simulation will stop at the stop time given
by the user. When criteria are activated, the simulation could stop before
the stop time if a criteria is not respected. The most commonly used criteria
is “U < 0.8 ∗ U N om”;
22
3.3.1.4 Specify what kind of models to use
Dynamic models used by Dynaωo are either precompiled models or Modelica
models. The user should specify which kind of models he wants to use (he
can use both). These items may have an additional “directory” attribute
with the path to case-specific models.
23
Static components and topology normally defined in the iidm file should
consequently be defined in the dyd file (buses, lines, etc).
• Initialization: the user can have access to the results of the initializa-
tion stages (local and/or global) by adding the item “dumpInitValues”
in the jobs file.
< dumpInitValues local = " true " global = " true " / >
• Constraints: the user can have access to the list of constraints that
happened during the simulation by adding the item “constraints” in
the jobs file, and by specifying the export mode.
• Timeline: the user can have access to the list of events that happened
during the simulation and the instant of their occurrence by adding the
item “timeline” in the jobs file, and by specifying the export mode.
Three export modes are available for the timeline: TXT, XML or CSV.
• Final state: the user can have access to the final state of the simulation
thanks to two files: the iidm file and the dump file. The user can specify
which of those he wants to obtain. The iidm output file contains the
static data of the network at the end of the simulation. The dump
file is a binary file that contains the value of all dynamic variables and
derivatives at the end of the simulation and that enables to restart
another simulation from this operating point.
< finalState exportIIDMFile = " true " exportDumpFile = " true " / >
24
• Curves: the user can plot curves at the end of the simulation. To
do so, he should specify the name of the file containing the list of the
variables to be plotted and the export mode.
< curves inputFile = " MyCurves . crv " exportMode = " CSV " / >
Two export modes are available for curves export: CSV or XML.
• Logs: the user can have access to different log files that give informa-
tion about the execution of the compilation and the simulation, and
that could help him in case of failure. The main log file corresponds to
the appender with no tag named “dynawo.log” in the example below.
For each “appender”, a format could be configured to set how the log
should be printed. By default, the format of the “appender” is the
following:
where “lvlFilter” is used to filter the trace exported by giving the min-
imum level exported. For example, if a level filter of “WARN” is set,
only logs declared as “WARN” or “ERROR” will be exported.
25
• Black-box models;
• Modelica models;
• Template models;
The following subsections explain how to use these models and how to write
the dyd file in the different cases.
The name of the model should include the whole path through the library,
for example for a transformer: Dynawo.Electrical.Branches.Transformer.
26
2 < unitDynamicModel id = " MyModel " name = " MyModel "
moFile = " myDirectory / MyModel . mo "
initFile = " myDirectory / MyModel_INIT . mo "
parFile = " MyPar . par " parId = " 1 " / >
3 </ modelicaModel >
We use this technique for example to assemble the physical model of a gen-
erator with the models of its regulations: the result is a macro model of a
generator with its controllers.
27
3.3.2.6 Write connections
The connections between the dynamics models are provided with the key-
word “connect”, and the connections between the initialization models are
provided with the keyword “initConnect”.
1 < connect id1 = " id1 " var1 = " var1 " id2 = " id2 " var2 = " var1 " / >
2 < initConnect id1 = " id1 " var1 = " var1 " id2 = " id2 " var2 = " var1 " / >
• For connections between precompiled models, id1 and id2 refer to the
models id and var1 and var2 are simply the variables name;
• For connections between macro Modelica models, id1 and id2 refer to
the macro models id and var1 and var2 should be built as:
unitModelId_VariableNameInModel;
1 < modelicaModel id = " MyModel " staticId = " MyModelIIDMId " >
2 ...
3 < staticRef var = " DynVarName " staticVar = " StaticVarName " / >
4 </ modelicaModel >
1 < modelicaModel id = " MyGenerator " staticId = " M yGene ratorI IDMId " >
2 ...
3 < staticRef var = " P_value " staticVar = " p " / >
4 < staticRef var = " Q_value " staticVar = " q " / >
5 < staticRef var = " state " staticVar = " state " / >
6 </ modelicaModel >
28
If no static references are done, the simulation will proceed but Dynaωo will
not be able to output an iidm file.
And then we can use this macro connection as many time as needed with the
keyword “macroConnect”:
29
And then we can use this macro static reference as many time as needed with
the keyword “macroStaticRef”:
1 < modelicaModel id = " MyGenerator " staticId = " M yGene ratorI IDMId " >
2 ...
3 < macroStaticRef id = " GEN " / >
4 </ modelicaModel >
1 <set >
2 < par type = " ParType " name = " ParName " value = " ParValue " / >
3 ...
4 < reference type = " RefType " name = " RefName " origData = " IIDM "
origName = " NameIIDM "
componentId = " M o d e l _ i d _ i n _ i i d m _ F i l e " / >
5 </ set >
1 <set >
2 < parTable type = " DOUBLE " name = " MyTable " >
3 < par row = " 1 " column = " 1 " value = " 0.1 " / >
4 < par row = " 1 " column = " 2 " value = " 0.5 " / >
5 < par row = " 2 " column = " 1 " value = " 1.0 " / >
6 < par row = " 2 " column = " 2 " value = " 0 " / >
7 </ parTable >
8 ...
9 </ set >
30
3.3.4 crv file
3.3.4.1 Add a new curve to the curve file
To add a new curve to the crv file, the following line should be added in the
crv file:
< curve model = " ModelId " variable = " var " / >
• For Modelica models, ModelId refers to the macro model id and var
should be built as:
unitModelId_VariableNameInModel;
These error messages can be found in the dynawo.log file in the outputs
directory specified in the jobs file, usually named “outputs”.
31
1 | DEBUG | subModel : GeneratorPQ Var
- Generator_omegaRefPu_value - is external and not connected
2 | ERROR | missing connection for one / several external
variable ( s ) ( DYNSimulation . cpp :591 )
32
: G e n e r a t o r _ o m e g a R e f P u impossible connection (
DYNModelMulti . cpp :605 )
For example, if you forget to give a value for the parameter “alpha” of the
load model, you will get the following message:
As the parameter “alpha” is not given a default value in the Modelica model
Dynawo.Electrical.Loads.LoadAlphaBeta, it needs to be present in the pa-
rameters set of the par file.
33
U P hase0 is defined as Real in the generator Modelica model and should be
declared as a DOUBLE in the par file.
34
4 Functional documentation
Contents
4.1 Dynaωo Overview . . . . . . . . . . . . . . . . . . 35
4.2 Models . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . 39
4.2.2 C++ library . . . . . . . . . . . . . . . . . . . . . 41
4.2.3 Modelica library . . . . . . . . . . . . . . . . . . . 46
4.3 Solvers . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . 49
4.3.2 Simplified solver . . . . . . . . . . . . . . . . . . . 53
4.3.3 Variable time-step solver . . . . . . . . . . . . . . . 60
35
way. This analysis has motivated us to launch a new effort on time-domain
simulation tools that finally ends up in the development of the Dynaωo’s
software.
36
and that covers the best the language norm. As such and in order not to de-
velop an in-house solution that will be difficult to maintain in the long-term,
as well as to benefit from developments and progresses made for other in-
dustrial sectors simulations, we have made the choice to build Dynaωo upon
OpenModelica. In addition to the transformation done by the OpenMod-
elica compiler, Python scripts are implemented into Dynaωo to transform
the outputs from the OpenModelica compiler in a generic frame that is also
common to the C++ models available in Dynaωo. All the thereby generated
C++ models are then combined to build a global model that will interact
with the solving part.
The global model only exposes a few methods to the solvers such as
the residual functions, the Jacobian function or the zero-crossing functions.
Having a separation between the modelling and the solving parts means
37
that the choice of the numerical resolution method doesn’t interfere with the
models implementation. This feature has several advantages: it enables to
easily test or use new solvers, it eases the addition of new model and it allows
modelling experts not to bother about numerical difficulties and vice versa.
Figure 7: Exchange between the modelling and the solving parts in Dynaωo
• The first solver is a fixed time-step solver developed for long-term sta-
bility studies that is based on works done during the European project
Pegase. It is an order-1 Backward-Euler solver that focuses more on
performances than on accuracy as there is no control error scheme and
events are detected and applied in a synchronous way at time instants
corresponding to the time step values;
• The second solver is the variable time-step variable order BDF solver
called IDA and developed by the Lawrence Livermore National Lab as
part of the SUNDIALS suite of solvers. Contrary to the first solver,
IDA aims at running very accurate simulations by using a control error
scheme and by detecting the exact instant corresponding to an event,
thanks to its root findings mechanism;
One important idea in Dynaωo is that the same models could be used for
different stability studies, in particular one set of RMS models should be
usable for both short-term and long-term stability analysis. It is the solvers
approximations that enable to run long-term stability studies with accept-
able computation time and not a priori simplifications done at the modelling
stage.
38
4.2 Models
4.2.1 Introduction
Dynaωo 's library is divided into two parts: a C++ part and a Modelica part.
In order to be able to model any kind of object and to bypass the aforemen-
tioned Modelica's limitations, it is possible to use C++ models in Dynaωo.
This is particularly useful to model large-scale regulations that need to be
connected to a large number of components or to deal with the network
topology.
All library models are available in the ddb repository generated by Dynaωo
compilation and can be directly used into test cases. In addition, the ddb di-
rectory also contains the .so library corresponding to the preassembled mod-
els and two xml files - one describing the connection needed by the model
*.xml and one describing the parameters required and the model variables
*.desc.xml.
39
Below is an example of a Pi line model in Modelica. As explained earlier,
the model is easy to read and understand:
40
38 protected
39 parameter T ype s. AC .I mp ed an ce ZPu ( re = RPu , im = XPu )
" Line impedance " ;
40 parameter T y p es . A C. A d mi t t an c e YPu ( re = GPu , im = BPu )
" Line half - admittance " ;
41
42 equation
43
44 ZPu * ( terminal2.i - YPu * terminal2.V ) = terminal2.V -
terminal1.V ;
45 ZPu * ( terminal1.i - YPu * terminal1.V ) = terminal1.V -
terminal2.V ;
46
47 end Line ;
• A network model that provides a default behaviour for any grid com-
ponent
41
Bus
The bus model contains two equations corresponding to the Kirchoff’s law
P
on the current i = 0. It is also possible to turn on or turn off a bus during
a simulation by using events.
In addition to this, the voltage module and angle are available as outputs
both in per unit, kV or degree for display as well as the bus connection state.
The model also enables to define an upper and a lower constraint limit for
the bus’ voltage. If they are violated, a constraint is printed out into the
output constraint file.
Line
Transformer
42
The transformer model could be connected to either a phase shifter automa-
ton to regulate the current on a line or to a tap changer to control the
bus module voltage. The tap changer automaton modifies the voltage ra-
tio applied between side 1 and side 2 to respect a certain set point on side
2, whereas the phase shifter can add a contribution to the voltage angle to
change the power flow going through a line. There are logs indicating a tap
change when the automata have to act.
As the line model it is possible to display the P, Q, current values going
through the transformer. In a similar way, maximum current limits could be
added to the transformer.
HVDC
The current implementation for the C++ HVDC model is a one that keeps
P and Q on the HVDC AC sides constant. There is no calculation of any
variables on the DC side.
The HVDC can be connected or disconnected during the simulation. The
user can have access to the active and reactive power injected by the link on
the network.
Generator
The generator model calculates the necessary current to follow set points for
P and Q. It doesn’t have any limits on P, Q or the current. The set points
can be modified during the simulation and the generator can be connected
or disconnected. In case the set point is modified, there is a log message
displayed into the timeline output that indicates the set point new value(s).
Load
The load model can represent different behaviours, depending on the param-
eters given by the user. The generic equations defining the load behaviour
are:
U α
P = zP ∗ P0 ∗ (1 + ∆PC ) ∗ ( )
U0
(4.1)
U
Q = zQ ∗ Q0 ∗ (1 + ∆QC ) ∗ ( )α
U0
43
The possible behaviours are:
• A load with a possible variation coming from another model (for ex-
ample the variation area model). In this case, there is a delta applied
on P and Q at each instant that is determined by the other model. For
example, if we choose to apply a variation of 10 MW over 10 s, the load
value will vary by 1 MW every 1 s. In this case, ∆PC and ∆QC are
varying over time but zP and zQ are kept constant equal to 1. This is
the controllable load model.
• A restorative load model in which the load works as a first order restora-
tive one. zP and zQ can vary during the simulation.
zpt−1 ( UU )α zpt
0 +
1+Tp s +
( UU0 )αL
Any load model can be connected or disconnected. It is also possible for the
user to have access to the output P , Q,PC and QC values.
Shunt
44
Static Var Compensator
The static var compensator model controls the susceptance to respect a pre-
define set point. This is done through a PI structure as shown in Figure 10
control scheme:
BM ax
UC B
+ + Kp ∗ Kg +
− + +
BM in
UN et λ ∗ QN et
1
Kp ∗Ti
This model is connected to all the generators of one synchronous area and
takes their speed as inputs to calculate the reference speed that is used into
the machine models.
45
4.2.3 Modelica library
The Dynaωo Modelica library contains several models to describe advanced
dynamic behaviours of the main grid components as well as simple models
equivalent to the C++ default models that are mainly used for testing in
full Modelica simulations. In addition to the individual models (.mo files),
Dynaωo 's code contains “preassembled” models that consists in a group of
Modelica models that are compiled together to create a single final model
library (.so) that could be directly used in the simulation (without being
compiled at run time). These preassembled models correspond to a coherent
dynamic behaviour (physical model + regulation models) and are built to
be associated to one static component. One example is the combination of
a synchronous machine model with its regulations (voltage regulators and
governors). This gives one preassembled model that can be directly used
during the simulation and associated to one particular generator (without
having to associate the three models to the generator).
• The “Connectors” part contains all the specific connectors defined into
Dynaωo that are used to connect together different models. This en-
ables to have clear interfaces between the different models or the differ-
ent parts of a model (regulation and physical model for example). For
each type of variable, there is a type of connector (BPin for boolean
values, ZPin for discrete values, ImPin for real values and ACPower for
connecting both complex voltages and complex currents)
• The “Electrical” part with the different models of the electrical com-
ponents and their controls.
46
reused several times. This folder also contains logs files that are used
to generate logs from the Modelica model during a simulation.
More details on the “Electrical” package are given in the next sections.
Bus
The bus package contains an InfiniteBus model. No other bus models are pro-
vided in the package as the default C++ model is generally used in Dynaωo
simulations and is simple enough to be understandable by everyone, even
written in C++.
Controls
The controls package gathers all the controls and regulations models for the
different components:
• The Machines package with the different regulations for the machines
such as voltage regulations, governors or under-voltage protection.
• The Transformers package that includes the phase-shifter and tap changer
automata models.
Events
Events models enable to change the connection status of the different grid
elements. They are all based on a similar basis with a time corresponding to
the event and a variable whose value will change at the event time.
47
Lines
Loads
Machines
Different models with different levels of details constitute the Machines pack-
age. The most detailed model is a four-windings synchronous machine model
(GeneratorSynchronous). Others are simplified ones:
• GeneratorPQ in which the P output is modulated according to fre-
quency and the Q output is only modulated when large variations oc-
cur.
• GeneratorPV that modulates the P output according to frequency and
the Q outputs to keep U + λ ∗ Q as close as possible to a set point.
• GeneratorFictitious that acts as a voltage-dependent generator. P and
Q vary around their initial values depending on the voltage value.
Transformers
The transformers package contains both a fixed ratio transformer model and
a variable tap transformer model that can serve for phase shifter or tap
changer modelling.
48
• CurrentLimitAutomaton corresponding to the current limit automaton
model
4.3 Solvers
4.3.1 Introduction
4.3.1.1 Differential Algebraic Equations
The mathematical problem to be solved in power system time-domain simu-
lations is an explicit Differential Algebraic Equations (DAE) system:
49
where fd represents the differential equations vector, fa the algebraic equa-
tions vector, yd the differential continuous variables vector and ya the alge-
braic continuous variables vector.
F (x) = 0 (4.7)
This non linear algebraic system can then be solved using different iterative
methods, the most frequent in power system being the Newton method.
At each iteration i of the Newton algorithm, the new values for x are calcu-
lated using a first-order Taylor development:
50
Using (4.7) and (4.8) leads to:
• A prediction step that consists in using past values (y(tn−1 , y(tn−2 ), ...),
of the variables to calculate initial values (y(tn0 ) <=> x0 ) for the next
time step. It is generally done by extrapolating a function that fits the
past values of the variables. This step gives a very good initial point
for the Newton used in the correction step and facilitates convergence,
especially when the system is evolving in a continuous way.
With such schemes, the convergence step iterations number is a good indi-
cator of the system evolution. Indeed, a slow convergence means that the
system has changed a lot since the last time step.
• a change of the DAE system functions fd (t) and fa (t) (called modes);
A mode change corresponds for example to the switch from one regula-
tion mode to another (machine switching from standard regulation mode to
maximum reactive absorption limit, static var compensator switching from
standy to standard regulation mode, etc).
51
It is important to be able to correctly determine the time instants corre-
sponding to a discrete variable value change or to a mode change. This is
done by using a root detection mechanism that detects the zero crossing of
a set of functions called root functions (denoted r(y(t), ẏ(t), z(t), t) = 0) as-
sociated to each discrete variable or each f function that can change over time.
For the simulation of a given test case, the results obtained with these solvers
will be different, as the numerical methods applied are different. These dif-
ferences are illustrated in the figure below for a test simulating a line discon-
nection.
52
406
USIM
UIDA1
404 UIDA2
402
400
398
396
40 50 60
time (s)
The next sections give more details about the two aforementioned solvers.
It uses an order-1 Backward Euler (BE) method, which means that y˙t =
yt −yt−1
h
. This method is an A-stable method thus if the system is stable, the
calculated solution will be stable. It is also an A-unstable method and as
53
such, a stable solution can be found by the solver even if it doesn’t exist for
the real system.
This solver goal is to have acceptable computation times for long-term dy-
namics simulations. It doesn’t aim at making accurate simulations to detect
oscillations or any other short-term dynamics. Its behaviour for long-term
dynamics has been compared against the variable time step solver to validate
the approximations done.
y0 (tn+1 ) = y(tn )
(4.11)
y˙0 (tn+1 ) = 0
It is important to mention that different prediction schemes have been tested
both during the Pegase project and internally in RTE after the project. These
alternatives have shown to be beneficial most of the time (especially when
the system evolution is “continuous") but have also led to very detrimental
behaviours in certain cases. The current choice is thus to stick to this “no-
prediction" approach. In the current version, this choice can’t be modified
by the user.
KINSOL parameters
54
• The tolerance is set to tolerance.
• The Jacobian matrix isn’t calculated at each iteration but only if the
solver hasn’t converged after n iterations or if the residual functions
hasn’t decreased enough after n2 iterations. Other conditions also exist
in KINSOL but can’t be modified by the software calling it.
By default, these parameters have the following values into Dynaωo: tolerance =
10−4 , n = 10, n2 = 5, nM ax = 30. They aren’t yet configurable by the user.
Jacobian evaluation
LU decomposition
55
• A symbolical factorization or pre-ordering in which the non zero struc-
ture (ie sparsity pattern) of the matrix gets permuted in order to im-
prove numerical properties as well as performance.
• A numerical factorization or factorization where the LU decomposition
is really done.
The symbolical factorization is the most costly part in the overall process.
That’s why, when the matrix structure doesn’t evolve (constant number and
position of the non zero entries), we only call the numerical part.
One can expect that symbolical decomposition is required only in the case of
important change in the system such as topological change, running status
of generators changes, etc. In practice, due to some numerical noises, the
number of non zeros elements in the matrix in large test cases often varies
from one decomposition to another. Complementary studies on this point
will be done in the next few months to try to detect the origin of these
numerical noises and decrease their impact on the computation time.
LU decomposition libraries
56
Residual function evaluation
At the moment, the different tests conducted with both strategies haven’t
permitted to exhibit a test case in which only one of the two strategies en-
ables to find the correct final state (= similar to IDA). As the “go-through”
strategy is more efficient because it requires less calculations, we advise to
use it by default. Nevertheless the user can choose to use one or the other
strategy by modifying the recalculatedStep parameter.
The algorithm for one time step for the Simplified solver (particularly for
discontinuity handling) is presented in Figure 12.
57
Start for tn+1
Calculate Reduce
y(tn+1 ) time step
Yes
No No
Succes? h 6= hM in ? Divergence
Yes
Calculate
g(tn+1 )
g(tn+1 ) 6= No
Go to tn+2
g(tn )?
Yes
Calculate
g(tn+1 ),
z(tn+1 )
and modes
Change?
Yes
No
Algebraic Restaure
Yes
mode algebraic Go to tn+2
change? equations
No
No No
Go to tn+2 Go to tn+2
All these parameters can be modified by the user and their default values
are: hM ax = 1s, hM in = 10−6 s, kReduceStep = 0.5, nEf f = 10, nDeadband = 2.
In most of the cases, these changes are smooth changes (for example reach-
ing a limit) and the simulation can just go on without any special process.
Nevertheless, some changes lead to a deep change in the equations form (for
example a change in the network topology) and require to reinitialize the
DAE system by calculating new initial conditions for ya in the Simplified
solver case. This is done by calling a NR on the algebraic equations.
59
4.3.3 Variable time-step solver
4.3.3.1 Introduction
The variable time-step solver corresponds to a packaging of Implicit Differential-
Algebraic solver (IDA) plus some additional in-house routines to deal with
discrete variable values changes propagation or algebraic mode restoration.
Otherwise, the continuous variable calculation as well as the zero crossing
times determination are done by classical approaches from IDA.
The IDA solver contains a root finding routine enabling the solver to detect
the exact moment of a zero crossing, ie the exact moment corresponding to
a discrete variable value or a mode change. When such a moment is de-
tected, the solver will stop at this time-step and calculates the solution for
this time. Compared to the Simplified solver, the IDA solver focuses on accu-
racy, especially when used with small minimal time-step and high order. We
recommend to use it in off-line simulations to run very accurate simulations.
It has to be noticed that IDA is used in the ONE STEP mode in Dynaωo:
it means that the solver resolves one step and then returns to the main
Dynaωo code. Between time steps, a series of additional routines are called
into Dynaωo main code:
• Changes in the discrete variable values and mode are propagating, es-
pecially through the connectors
• Curves are plotted and criteria to stop the simulation are checked
60
• ...
In the next following parts, the main principles for this approach will be
briefly explained but a complete and thorough description is available in the
IDA documentation. The content of the next paragraphs will rather focus on
the conceptual ideas present in IDA than in the exact mathematical formu-
lations or the implementation details that are widely and clearly explained
in IDA documentation or Sundials website.
This prediction step enables to have initial values for the correction step that
should be close to the final values calculated, ie to have a correction step that
is convergent with only a few iterations.
• when the time step variation is larger or smaller than a certain threshold
(5/3 or 3/5 by default)
61
As for the Simplified solver, the idea is to try to minimize the number of Jaco-
bian evaluations. However, the Jacobian evaluations are much more frequent
with IDA because of the time-step variations, especially for simulations with
a lots of events where the time-step decreases around the event and increases
during steady-state.
Regarding the LU decompositions that could be used with IDA in Dynaωo,
the user can choose to use KLU or NICSLU. Most of the simulations have
been done until now with KLU but NICSLU gives slightly better perfor-
mances (especially because the Jacobian is sometimes updated without any
change in its structure when using IDA).
The time-step and order are changed by IDA using the Local Truncation
Error, which is an image of the convergence difficulty of the correction step
and so of the prediction phase viability.
62
4.3.3.6 Algebraic equations restoration
In a similar way than for the Simplified solver, in case of a severe event that
leads to a strong discontinuity in the system (for example a line disconnec-
tion), a reinitialization of the problem is done into Dynaωo before the next
time step. In the IDA case, it consists in two Newton-Raphson resolutions;
one on the algebraic equations enabling to calculate ya and one on the differ-
ential equations only to calculate the derivative values of differential variables
y˙d . These values are necessary to be able to relaunch correctly IDA after the
discontinuity.
63
5 Advanced documentation
Contents
5.1 Code organization . . . . . . . . . . . . . . . . . . 65
5.2 Dynaωo executables . . . . . . . . . . . . . . . . . 66
5.2.1 Dynaωo commands . . . . . . . . . . . . . . . . . . 67
5.2.2 Compilation and simulation of a single Modelica
model . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.2.3 Compilation and simulation of complex models . . 72
5.2.4 Generation of a xml summary of the parameters
and variables of a compiled model . . . . . . . . . 78
5.3 Adding a model to the Dynaωo library . . . . . 79
5.3.1 Adding a Modelica model in the Dynaωo Modelica
library . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.3.2 Adding a Modelica model in the Dynaωo precom-
piled library . . . . . . . . . . . . . . . . . . . . . . 83
5.4 Adding a new solver . . . . . . . . . . . . . . . . . 85
64
5.1 Code organization
The Dynaωo source code repository is organized as follows:
cpplint
document
dynawo
3rd party
cmake
doxygen
sources
API
Common
Launcher
Modeler
ModelicaCompiler
Models
Simulation
Solvers
nrt
util
• the cpplint directory contains the Python scripts needed to use cpplint;
• the document directory contains the different latex documents used to
create this documentation as well as the Dynaωo website;
• the dynawo directory contains all the code related to Dynaωo itself and
the modifications on 3rd party. This is the most important directory;
• the nrt directory contains the testsuite used to check the correct behav-
ior of the simulation tool. They also serve as examples of the simulation
tool behavior and main principles;
• the util directory contains some utilities code e.g. to display the simula-
tion results in a browser or to compare the nrt results with a reference.
The main dynawo directory contains the following folders:
• the 3rd party folder contains the toolchains to download, potentially
modify and compile the necessary third-party libraries needed to run a
Dynaωo simulation;
• the cmake folder contains all the files related to the general configura-
tion of the compilation process;
65
• the doxygen folder contains the Dynaωo settings to build the source
code documentation;
• the sources folder contains the Dynaωo code.
Finally, the source code is divided into different subdirectories corresponding
to the different parts of the Dynaωo simulation tool. They are:
• the API directory contains the code related to all the Input/Output
files;
• the Common directory contains all the code dealing with common fea-
ture and methods as well as the dictionaries for logs;
• the Launcher folder contains the main file and the launcher;
• the Modeler folder corresponding to all the code related to the generic
API for the models, ie. the files that define the architecture and re-
quired methods expected from a model. It also contains the code re-
lated to the data transfer from the input data file to the models as well
as the generic methods for the Modelica models;
• the ModelicaCompiler directory contains the Python scripts that are
applied to the outputs produced by OpenModelica compiler. These
scripts allow to get a final C code in adequation with the Dynaωo API;
• the Models directory contains the Dynaωo models library (both C++
and Modelica models);
• the Simulation directory contains the files related to the handling of
the global simulation itself;
• the Solvers directory is the part of the code dealing with the resolution
of the DAE system.
66
5.2.1 Dynaωo commands
To see all available Dynaωo commands run:
In the following we will give examples on how to use some commands, and
particularly: compileModelicaOMC, generate-preassembled and dump-model.
To be able to execute Dynaωo from anywhere in the following examples you
can do:
Test.mo
1 model Test
2 parameter Real a = 1;
3 parameter Real b = 2;
4 Real u ( start = 1) ;
5 equation
6 a * der ( u ) = -b * u ;
7 end Test ;
To generate the .so library of this model, the command below can be used.
67
Warning, if you execute directly the command in the folder containing your
.mo file it will be deleted so be sure to make a copy of it and execute all the
following commands.
In the compilation folder you will find the output model library Test.so.
To only generate the C++ files used to compile the model .so library, the
user can call the same command without the --lib argument. This will only
generate the C++ model files used to generate the library:
The following input files are needed in the same folder as the library to launch
a Dynaωo simulation of this basic model:
Test.jobs
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : jobs xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : job name = " Test " >
4 < dyn : solver lib = " l ib d y na w o _S o l ve r S I M . so "
parFile = " solvers . par " parId = " 1 " / >
5 < dyn : modeler compileDir = " outputs / compilation " >
6 < dyn : dynModels dydFile = " Test . dyd " / >
7 < dyn : pr ecompi ledMod els u seStan dardMo dels = " true " >
8 < dyn : directory path = " . " recursive = " false " / >
9 </ dyn : precompiledModels >
10 < dyn : modelicaModels us eStan dardMo dels = " false " / >
11 </ dyn : modeler >
12 < dyn : simulation startTime = " 0 " stopTime = " 10 " / >
13 < dyn : outputs directory = " outputs " >
14 < dyn : curves inputFile = " Test . crv " exportMode = " CSV " / >
15 < dyn : logs >
16 < dyn : appender tag = " " file = " dynawo . log "
lvlFilter = " DEBUG " / >
17 </ dyn : logs >
18 </ dyn : outputs >
19 </ dyn : job >
20 </ dyn : jobs >
68
Test.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : blackBoxModel id = " Model " lib = " Test . so "
parFile = " Test . par " parId = " 1 " / >
4 </ dyn : dynamicModelsArchitecture >
Test.par
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < parametersSet xmlns = " http :// www . rte - france . com / dynawo " >
3 < set id = " 1 " >
4 < par type = " DOUBLE " name = " a " value = " 2. " / >
5 < par type = " DOUBLE " name = " b " value = " 10. " / >
6 </ set >
7 </ parametersSet >
Test.crv
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < curvesInput xmlns = " http :// www . rte - france . com / dynawo " >
3 < curve model = " Model " variable = " u " / >
4 </ curvesInput >
solvers.par
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < parametersSet xmlns = " http :// www . rte - france . com / dynawo " >
3 < set id = " 1 " >
4 < par type = " DOUBLE " name = " hMin " value = " 0.000001 " / >
5 < par type = " DOUBLE " name = " hMax " value = " 1 " / >
6 < par type = " DOUBLE " name = " kReduceStep " value = " 0.5 " / >
7 < par type = " INT " name = " nEff " value = " 10 " / >
8 < par type = " INT " name = " nDeadband " value = " 2 " / >
9 < par type = " INT " name = " maxRootRestart " value = " 3 " / >
10 < par type = " INT " name = " maxNewtonTry " value = " 10 " / >
11 < par type = " STRING " name = " linearSolverName " value = " KLU " / >
12 < par type = " BOOL " name = " recalculateStep " value = " false " / >
13 </ set >
14 </ parametersSet >
69
With different input files, it is also possible to let Dynaωo internally compiles
the model before launching the simulation. The following input files need to
be created in the same folder as the Test.mo file:
Test.job
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : jobs xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : job name = " Test " >
4 < dyn : solver lib = " l ib d y na w o _S o l ve r S I M . so "
parFile = " solvers . par " parId = " 1 " / >
5 < dyn : modeler compileDir = " outputs / compilation " >
6 < dyn : dynModels dydFile = " Test . dyd " / >
7 < dyn : pr ecompi ledMod els u seStan dardMo dels = " false " / >
8 < dyn : modelicaModels us eStan dardMo dels = " true " >
9 < dyn : directory path = " . " recursive = " false " / >
10 </ dyn : modelicaModels >
11 </ dyn : modeler >
12 < dyn : simulation startTime = " 0 " stopTime = " 10 " / >
13 < dyn : outputs directory = " outputs " >
14 < dyn : curves inputFile = " Test . crv " exportMode = " CSV " / >
15 < dyn : logs >
16 < dyn : appender tag = " " file = " dynawo . log "
lvlFilter = " DEBUG " / >
17 < dyn : appender tag = " COMPILE "
file = " dynawoCompiler . log " lvlFilter = " DEBUG " / >
18 </ dyn : logs >
19 </ dyn : outputs >
20 </ dyn : job >
21 </ dyn : jobs >
Test.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : modelicaModel id = " Model " >
4 < dyn : unitDynamicModel id = " TEST " name = " Test "
moFile = " Test . mo " / >
5 </ dyn : modelicaModel >
6 </ dyn : dynamicModelsArchitecture >
Test.crv
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < curvesInput xmlns = " http :// www . rte - france . com / dynawo " >
3 < curve model = " Model " variable = " TEST_u " / >
70
4 </ curvesInput >
resources/exampleExecutables/TestCompile/ExternalVariables/Test.mo
1 model Test
2 parameter Real a = 1;
3 parameter Real b = 2;
4 Real u ( start = 1) ;
5 Real v ;
6 equation
7 a * der ( u ) = -b * u ;
8 end Test ;
Test.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < e xter na l_ va ri ab le s xmlns = " http :// www . rte - france . com / dynawo "
xmlns : xi = " http :// www . w3 . org /2001/ XInclude " >
3 < variable type = " continuous " id = " v " / >
4 </ external_variables >
To generate the .so library of this model, the following commands are used:
71
$ > cp Test . xml compilation
$ > $MY_ENV_DYNAWO co mp ile Mo de li ca OM C -- model Test
-- output - dir compilation -- lib Test . so
Warning, at this point you cannot directly launch a simulation with only
this model as it needs to be connected to another model providing the missing
equation on v. The way to do this is described in section 5.2.3.
rModel1.mo
1 model Model1
2 parameter Real a = 1;
3 parameter Real b = 2;
4 Real u ( start = 1) ;
5 Real v ;
6 equation
7 a * der ( u ) = -b * u ;
8 end Model1 ;
And the second:
Model2.mo
1 model Model2
2 parameter Real a = 1;
3 parameter Real b = 2;
4 Real v ( start = 2) ;
5 equation
6 a * der ( v ) = b * v ;
7 end Model2 ;
In this example, the v variable from Model1 needs to be connected to the v
variable of Model2. The two models have their respective external variables
72
declared in xml files as shown in section 5.2.2.
The Test.xml file shown below describes to Dynaωo how to compile and
connect those two models:
resources/exampleExecutables/TestDydLibNoExternal/Test.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : modelicaModel id = " Test " >
4 < dyn : unitDynamicModel id = " MODEL1 " name = " Model1 " / >
5 < dyn : unitDynamicModel id = " MODEL2 " name = " Model2 " / >
6 < dyn : connect id1 = " MODEL1 " var1 = " v " id2 = " MODEL2 "
var2 = " v " / >
7 </ dyn : modelicaModel >
8 </ dyn : dynamicModelsArchitecture >
To launch a simulation with the compiled model the following input files
needs to be created in the same folder as the .so library:
Test.jobs
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : jobs xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : job name = " Test " >
4 < dyn : solver lib = " l ib d y na w o _S o l ve r S I M . so "
parFile = " solvers . par " parId = " 1 " / >
5 < dyn : modeler compileDir = " outputs / compilation " >
6 < dyn : dynModels dydFile = " Test . dyd " / >
7 < dyn : pr ecompi ledMod els u seStan dardMo dels = " true " >
8 < dyn : directory path = " . " recursive = " false " / >
9 </ dyn : precompiledModels >
10 < dyn : modelicaModels us eStan dardMo dels = " false " / >
11 </ dyn : modeler >
12 < dyn : simulation startTime = " 0 " stopTime = " 1 " / >
73
13 < dyn : outputs directory = " outputs " >
14 < dyn : curves inputFile = " Test . crv " exportMode = " CSV " / >
15 < dyn : logs >
16 < dyn : appender tag = " " file = " dynawo . log "
lvlFilter = " DEBUG " / >
17 </ dyn : logs >
18 </ dyn : outputs >
19 </ dyn : job >
20 </ dyn : jobs >
Test.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : blackBoxModel id = " Model " lib = " Test . so " / >
4 </ dyn : dynamicModelsArchitecture >
Test.crv
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < curvesInput xmlns = " http :// www . rte - france . com / dynawo " >
3 < curve model = " Model " variable = " MODEL1_u " / >
4 < curve model = " Model " variable = " MODEL1_v " / >
5 < curve model = " Model " variable = " MODEL2_v " / >
6 </ curvesInput >
In this example the parameters in Model1 and Model2 are fixed at the com-
pilation of the model and to change them the compilation needs to be run
again.
The Dynaωo par files can be used to avoid recompiling models just to change
parameters value. To do so, the following par file needs to be created in the
same folder as the .so library:
Test.par
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < parametersSet xmlns = " http :// www . rte - france . com / dynawo " >
74
3 < set id = " 1 " >
4 < par type = " DOUBLE " name = " MODEL1_a " value = " 1. " / >
5 < par type = " DOUBLE " name = " MODEL1_b " value = " 1. " / >
6 < par type = " DOUBLE " name = " MODEL2_a " value = " .1 " / >
7 < par type = " DOUBLE " name = " MODEL2_b " value = " .1 " / >
8 </ set >
9 </ parametersSet >
1 < dyn : blackBoxModel id = " Model " lib = " Test . so "
parFile = " Test . par " parId = " 1 " / >
To modify Model2 parameters it is now enough to modify the par file and
regenerating the .so library is not required.
With different input files, it is also possible to let Dynaωo internally compiles
the model before launching the simulation. To do so, the following files need
to be created in the same folder as the Model1.mo and Model2.mo files:
Test.jobs
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : jobs xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : job name = " Test " >
4 < dyn : solver lib = " l ib d y na w o _S o l ve r S I M . so "
parFile = " solvers . par " parId = " 1 " / >
5 < dyn : modeler compileDir = " outputs / compilation " >
6 < dyn : dynModels dydFile = " Test . dyd " / >
7 < dyn : pr ecompi ledMod els u seStan dardMo dels = " false " / >
8 < dyn : modelicaModels us eStan dardMo dels = " true " >
9 < dyn : directory path = " . " recursive = " false " / >
10 </ dyn : modelicaModels >
11 </ dyn : modeler >
12 < dyn : simulation startTime = " 0 " stopTime = " 1 " / >
13 < dyn : outputs directory = " outputs " >
14 < dyn : curves inputFile = " Test . crv " exportMode = " CSV " / >
15 < dyn : logs >
16 < dyn : appender tag = " " file = " dynawo . log "
lvlFilter = " DEBUG " / >
17 < dyn : appender tag = " COMPILE "
file = " dynawoCompiler . log " lvlFilter = " DEBUG " / >
18 </ dyn : logs >
19 </ dyn : outputs >
20 </ dyn : job >
21 </ dyn : jobs >
75
Test.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : modelicaModel id = " Test " >
4 < dyn : unitDynamicModel id = " MODEL1 " name = " Model1 "
moFile = " Model1 . mo " / >
5 < dyn : unitDynamicModel id = " MODEL2 " name = " Model2 "
moFile = " Model2 . mo " parFile = " Test . par " parId = " 1 " / >
6 < dyn : connect id1 = " MODEL1 " var1 = " v " id2 = " MODEL2 "
var2 = " v " / >
7 </ dyn : modelicaModel >
8 </ dyn : dynamicModelsArchitecture >
Test.par
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < parametersSet xmlns = " http :// www . rte - france . com / dynawo " >
3 < set id = " 1 " >
4 < par type = " DOUBLE " name = " a " value = " .1 " / >
5 < par type = " DOUBLE " name = " b " value = " .1 " / >
6 </ set >
7 </ parametersSet >
Test.crv
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < curvesInput xmlns = " http :// www . rte - france . com / dynawo " >
3 < curve model = " Test " variable = " MODEL1_u " / >
4 < curve model = " Test " variable = " MODEL1_v " / >
5 < curve model = " Test " variable = " MODEL2_v " / >
6 </ curvesInput >
And the same solvers.par file as previously.
76
Model2.mo
1 model Model2
2 parameter Real a = 1;
3 parameter Real b = 2;
4 Real v ( start = 2) ;
5 Real w ;
6 equation
7 a * der ( v ) = b * v ;
8 end Model2 ;
Model2.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < e xter na l_ va ri ab le s xmlns = " http :// www . rte - france . com / dynawo "
xmlns : xi = " http :// www . w3 . org /2001/ XInclude " >
3 < variable type = " continuous " id = " v " / >
4 < variable type = " continuous " id = " w " / >
5 </ external_variables >
The same xml file is used as in the first example to connect those models:
Test.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
3 < dyn : modelicaModel id = " Test " >
4 < dyn : unitDynamicModel id = " MODEL1 " name = " Model1 " / >
5 < dyn : unitDynamicModel id = " MODEL2 " name = " Model2 " / >
6 < dyn : connect id1 = " MODEL1 " var1 = " v " id2 = " MODEL2 "
var2 = " v " / >
7 </ dyn : modelicaModel >
8 </ dyn : dynamicModelsArchitecture >
The following commands generate the associated Test.so library and a Test.xml
file summarizing the external variables of the combined models:
77
Test.xml
1 <? xml version ="1.0" encoding =" ISO -8859 -1" standalone =" no " ? >
2 < e xter na l_ va ri ab le s xmlns = " http :// www . rte - france . com / dynawo " >
3 < variable id = " MODEL2 . w " type = " continuous " / >
4 </ external_variables >
The dump-model option takes as input a compiled Dynaωo model and generates
a xml file that contains a list of the parameters and variables of this model.
A summary of the possible arguments of the dump-model options can be ob-
tained with the following command:
Test.desc.xml
1 <? xml version ="1.0" encoding =" ISO -8859 -1" standalone =" no " ? >
2 < model xmlns = " http :// www . rte - france . com / dynawo " >
3 < name > Test </ name >
4 < elements >
5 < parameters >
6 < parameter name = " MODEL1_a " valueType = " DOUBLE "
cardinality = " 1 " readOnly = " false " defaultValue = " 1 " / >
7 < parameter name = " MODEL1_b " valueType = " DOUBLE "
cardinality = " 1 " readOnly = " false " defaultValue = " 2 " / >
8 < parameter name = " MODEL2_a " valueType = " DOUBLE "
cardinality = " 1 " readOnly = " false " defaultValue = " 1 " / >
78
9 < parameter name = " MODEL2_b " valueType = " DOUBLE "
cardinality = " 1 " readOnly = " false " defaultValue = " 2 " / >
10 </ parameters >
11 < variables >
12 < variable name = " MODEL1_u " valueType = " DOUBLE " / >
13 < variable name = " MODEL1_v " valueType = " DOUBLE " / >
14 < variable name = " MODEL2_v " valueType = " DOUBLE " / >
15 </ variables >
16 </ elements >
17 </ model >
To do this, the best way is to include your Modelica model into the Dynawo
library part of the code: dynawo/sources/Models/Modelica/Dynawo/. You
need to add your mo file into one existing directory or create a new direc-
tory containing your mo file. If your model is not squared (not the same
number of equations than variables), you must supplement it with a xml file
(called external variable file) to describe the pending equations that will be
connected to your model later on (see 5.2.2).
• add the mo file into the package.order file that deals with display orders
into OpenModelica;
• add the mo and xml files into the CMakeFiles.txt file that will ensure
that the model is integrated into the library
79
For example, to add a FrequencyDependantLoad to the Dynaωo library, you
first need to create the Modelica model and the associated xml file to describe
the connections between your model and other models:
FrequencyLoad.mo
1 within D y n a w o . E l e c t r i c a l . L o a d s ;
2
3 /*
4 * Copyright ( c ) 2015 -2019 , RTE ( http :// www.rte - france.com )
5 * See AUTHORS.txt
6 * All rights reserved.
7 * This Source Code Form is subject to the terms of the
Mozilla Public
8 * License , v. 2 .0. If a copy of the MPL was not distributed
with this
9 * file , you can obtain one at http :// mozilla.org / MPL /2 .0 / .
10 * SPDX - License - Identifier : MPL -2 .0
11 *
12 * This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain simulation tool for power systems.
13 */
14
15 model FrequencyLoad " Load with frequency dependant active
and reactive power "
16 extends B a s e C l a s s e s . B a s e L o a d ;
17
18 public
19 parameter Real Gamma " Active load sensitivity to
frequency " ;
20 parameter Real Delta " Reactive load sensitivity to
voltage " ;
21 parameter Real omegaRef0Pu = 1 " Reference frequency
value " ;
22
23 Connectors.ImPin omegaRefPu " Network angular reference
frequency in p.u ( base OmegaNom ) " ;
24
25 equation
26 if ( running.value ) then
27 PPu = PLoadPu.value * (( omegaRefPu / omegaRef0Pu ) ^
Gamma ) ;
28 QPu = QLoadPu.value * (( omegaRefPu / omegaRef0Pu ) ^
Delta ) ;
29 else
30 terminal.i = Complex (0) ;
31 end if ;
32
33 end FrequencyLoad ;
80
FrequencyLoad.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 <! - -
3 Copyright ( c ) 2015 -2019 , RTE ( http :// www . rte - france . com )
4 See AUTHORS . txt
5 All rights reserved .
6 This Source Code Form is subject to the terms of the
Mozilla Public
7 License , v . 2.0. If a copy of the MPL was not
distributed with this
8 file , you can obtain one at http :// mozilla . org / MPL /2.0/.
9 SPDX - License - Identifier : MPL -2.0
10
11 This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain
12 simulation tool for power systems .
13 -->
14 < e xt er na l_ va ri ab le s xmlns = " http :// www . rte - france . com / dynawo "
xmlns : xi = " http :// www . w3 . org /2001/ XInclude " >
15 < variable type = " continuous " id = " terminal . V . re " / >
16 < variable type = " continuous " id = " terminal . V . im " / >
17 < variable type = " continuous " id = " omegaRefPu . value " / >
18 </ external_variables >
You then need to add these two files into the dynawo/sources/Models/
Modelica/Dynawo/Electrical/Loads repository and to update the CMake-
Lists.txt and package.order to take into account these two new files.
CMakeLists.txt
1 # Copyright ( c ) 2015 -2019 , RTE ( http :// www . rte - france . com )
2 # See AUTHORS . txt
3 # All rights reserved .
4 # This Source Code Form is subject to the terms of the
Mozilla Public
5 # License , v . 2.0. If a copy of the MPL was not distributed
with this
6 # file , you can obtain one at http :// mozilla . org / MPL /2.0/.
7 # SPDX - License - Identifier : MPL -2.0
8 #
9 # This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain simulation tool for power systems .
10
11 SET ( MODEL_FILES
12 # Electrical Loads models
13 package . mo
14 BaseClasses . mo
15 BaseClasses_INIT . mo
16 FrequencyLoad . mo
81
17 FrequencyLoad . xml
18 LoadAlphaBeta . mo
19 LoadAlphaBeta . xml
20 LoadPQ . mo
21 LoadPQ . xml
22 Load_INIT . mo
23 LoadConnect_INIT . mo
24 L o a d A u x i l i a r i e s _ I N I T . mo
25 SwitchOffLoad . xml
26 )
27
28 #
29 # Modelica models install
30 #
31 FOREACH ( MODEL_FILE $ { MODEL_FILES } )
32 I NST AL L_ MO DE L_ FI LE ( $ { MODEL_FILE })
33 ENDFOREACH ( MODEL_FILE )
package.order
1 BaseClasses
2 BaseClasses_INIT
3 LoadPQ
4 FrequencyLoad
5 LoadAlphaBeta
6 Load_INIT
7 LoadConnect_INIT
8 LoadAuxiliaries_INIT
Once this is done, the frequency load model could be directly used into a
dyd file in the following way. Notice that there is a connection between the
frequency load model and a set point to provide a value for ω to the model.
resources/exampleLibrary/testFrequencyLoadWithMo.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 <! - -
3 Copyright ( c ) 2015 -2019 , RTE ( http :// www . rte - france . com )
4 See AUTHORS . txt
5 All rights reserved .
6 This Source Code Form is subject to the terms of the
Mozilla Public
7 License , v . 2.0. If a copy of the MPL was not
distributed with this
8 file , you can obtain one at http :// mozilla . org / MPL /2.0/.
9 SPDX - License - Identifier : MPL -2.0
10
11 This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain
82
12 simulation tool for power systems .
13 -->
14 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
15 < dyn : modelicaModel id = " Te st _L oad Fr eq ue nc y " >
16 < dyn : unitDynamicModel id = " Generator "
name = " Dynawo . Electrical . Machines . GeneratorPQ "
initName
= " Dynawo . Electrical . Machines . GeneratorPQ_INIT "
parFile = " Load . par " parId = " 1 " / >
17 < dyn : unitDynamicModel id = " Line "
name = " Dynawo . Electrical . Lines . Line "
parFile = " Load . par " parId = " 2 " / >
18 < dyn : unitDynamicModel id = " infBus "
name = " Dynawo . Electrical . Buses . InfiniteBus "
parFile = " Load . par " parId = " 3 " / >
19 < dyn : unitDynamicModel id = " Load "
name = " Dynawo . Electrical . Loads . FrequencyLoad "
parFile = " Load . par " parId = " 4 "
initName = " Dynawo . Electrical . Loads . Load_INIT " / >
20 < dyn : connect id1 = " Line " var1 = " terminal1 " id2 = " Generator "
var2 = " terminal " / >
21 < dyn : connect id1 = " Line " var1 = " terminal2 " id2 = " infBus "
var2 = " terminal " / >
22 < dyn : connect id1 = " Generator " var1 = " terminal " id2 = " Load "
var2 = " terminal " / >
23 </ dyn : modelicaModel >
24 < dyn : blackBoxModel id = " SP_Omega " lib = " SET_POINT . so "
parFile = " Load . par " parId = " 5 " / >
25 < dyn : connect id1 = " SP_Omega " var1 = " SP_setPoint "
id2 = " Te st _L oa dF re qu enc y " var2 = " G e n e r a t o r _ o m e g a R e f P u " / >
26 < dyn : blackBoxModel id = " SP_Omega2 " lib = " SET_POINT . so "
parFile = " Load . par " parId = " 5 " / >
27 < dyn : connect id1 = " SP_Omega2 " var1 = " SP_setPoint "
id2 = " Te st _L oa dF re qu enc y " var2 = " Load_omegaRefPu " / >
28 </ dyn : dynamicModelsArchitecture >
83
component e.g. having different precompiled models for the loads: voltage-
dependant load, frequency-dependant load. . .
FrequencyLoadPAM.xml
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 <! - -
3 Copyright ( c ) 2015 -2019 , RTE ( http :// www . rte - france . com )
4 See AUTHORS . txt
5 All rights reserved .
6 This Source Code Form is subject to the terms of the
Mozilla Public
7 License , v . 2.0. If a copy of the MPL was not
distributed with this
8 file , you can obtain one at http :// mozilla . org / MPL /2.0/.
9 SPDX - License - Identifier : MPL -2.0
10
11 This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain
12 simulation tool for power systems .
13 -->
14 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
15 <! - - Frequency Load Model -->
16 < dyn : modelicaModel id = " FrequencyLoad " >
17 < dyn : unitDynamicModel id = " LOAD "
name = " Dynawo . Electrical . Loads . FrequencyLoad "
initName = " Dynawo . Electrical . Loads . Load_INIT " / >
18 </ dyn : modelicaModel >
19 </ dyn : dynamicModelsArchitecture >
Once this is done, the model can be used as a black-box model into the
simulations.
testFrequencyLoadWithSo.dyd
1 <? xml version = '1.0 ' encoding = ' UTF -8 ' ? >
2 <! - -
3 Copyright ( c ) 2015 -2019 , RTE ( http :// www . rte - france . com )
4 See AUTHORS . txt
5 All rights reserved .
6 This Source Code Form is subject to the terms of the
84
Mozilla Public
7 License , v . 2.0. If a copy of the MPL was not
distributed with this
8 file , you can obtain one at http :// mozilla . org / MPL /2.0/.
9 SPDX - License - Identifier : MPL -2.0
10
11 This file is part of Dynawo , an hybrid C ++/ Modelica open
source time domain
12 simulation tool for power systems .
13 -->
14 < dyn : d y n a m i c M o d e l s A r c h i t e c t u r e
xmlns : dyn = " http :// www . rte - france . com / dynawo " >
15 < dyn : modelicaModel id = " Te st _L oad Fr eq ue nc y " >
16 < dyn : unitDynamicModel id = " Generator "
name = " Dynawo . Electrical . Machines . GeneratorPQ "
initName
= " Dynawo . Electrical . Machines . GeneratorPQ_INIT "
parFile = " Load . par " parId = " 1 " / >
17 < dyn : unitDynamicModel id = " Line "
name = " Dynawo . Electrical . Lines . Line "
parFile = " Load . par " parId = " 2 " / >
18 < dyn : unitDynamicModel id = " infBus "
name = " Dynawo . Electrical . Buses . InfiniteBus "
parFile = " Load . par " parId = " 3 " / >
19 < dyn : connect id1 = " Line " var1 = " terminal1 " id2 = " Generator "
var2 = " terminal " / >
20 < dyn : connect id1 = " Line " var1 = " terminal2 " id2 = " infBus "
var2 = " terminal " / >
21 </ dyn : modelicaModel >
22 < dyn : blackBoxModel id = " Load " lib = " FrequencyLoad . so "
parFile = " Load . par " parId = " 5 " / >
23 < dyn : connect id1 = " Load " var1 = " LOAD_terminal "
id2 = " Te st _L oa dF re qu enc y " var2 = " Ge ne ra to r_ te rm in al " / >
24 < dyn : blackBoxModel id = " SP_Omega " lib = " SET_POINT . so "
parFile = " Load . par " parId = " 5 " / >
25 < dyn : connect id1 = " SP_Omega " var1 = " SP_setPoint "
id2 = " Te st _L oa dF re qu enc y " var2 = " G e n e r a t o r _ o m e g a R e f P u " / >
26 < dyn : blackBoxModel id = " SP_Omega2 " lib = " SET_POINT . so "
parFile = " Load . par " parId = " 5 " / >
27 < dyn : connect id1 = " SP_Omega2 " var1 = " SP_setPoint " id2 = " Load "
var2 = " LOAD_omegaRefPu " / >
28 </ dyn : dynamicModelsArchitecture >
85
Solvers/Common/DYNSolver.h) that gives all the methods that a solver
needs to implement to be integrated into the Dynaωo frame. The most
important ones are:
• the solve method resolving the DAE problem for each time step;
If you want to add your own solver implementation, the simplest way is to
create a new directory SolverX and then to implement your solver there. You
can have a look to the SolverIDA and SolverSIM directories ; the first one
shows how to get connected to an existing solver library whereas the second
one is an example of a solver implementation specific to Dynaωo. Once it is
done and the solver compiled, you can use it directly into the jobs file in a
similar way than existing Dynaωo solvers.
86
Bibliography
[3] CRSA, RTE, TE, and TU/e. D4.1: Algorithmic requirements for simu-
lation of large network extreme scenarios. Technical report, tech. rep.,
PEGASE Consortium, 2011.
87
[9] P.-M. Gibert, D. Tromeur-Dervout, P. Panciatici, F. Beaude, P. Wang,
and J. Erhel. A generic customized predictor corrector approach for
accelerating EMTP-like simulations. In 2017 IEEE Manchester Pow-
erTech. IEEE, jun 2017.
88
A Dynaωo License
89
Mozilla Public License Version 2.0
1 Definitions
1.1 “Contributor”
means each individual or legal entity that creates, contributes to the creation
of, or owns Covered Software.
1.3 “Contribution”
means Covered Software of a particular Contributor.
(a) that the initial Contributor has attached the notice described in Exhibit
B to the Covered Software; or
(b) that the Covered Software was made available under the terms of ver-
sion 1.1 or earlier of the License, but not also under the terms of a
Secondary License.
90
1.6 “Executable Form”
means any form of the work other than Source Code Form.
1.8 “License”
means this document.
1.9 “Licensable”
means having the right to grant, to the maximum extent possible, whether
at the time of the initial grant or subsequently, any and all of the rights
conveyed by this License.
1.10 “Modifications”
means any of the following:
(a) any file in Source Code Form that results from an addition to, deletion
from, or modification of the contents of Covered Software; or
(b) any new file in Source Code Form that contains any Covered Software.
91
1.13 “Source Code Form”
means the form of the work preferred for making modifications.
(a) under intellectual property rights (other than patent or trademark) Li-
censable by such Contributor to use, reproduce, make available, modify,
display, perform, distribute, and otherwise exploit its Contributions, ei-
ther on an unmodified basis, with Modifications, or as part of a Larger
Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer for
sale, have made, import, and otherwise transfer either its Contributions
or its Contributor Version.
92
or licensing of Covered Software under this License. Notwithstanding Section
2.1(b) above, no patent license is granted by a Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party’s mod-
ifications of Covered Software, or (ii) the combination of its Contribu-
tions with other software (except as part of its Contributor Version);
or
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with the
notice requirements in Section 3.4).
2.5 Representation
Each Contributor represents that the Contributor believes its Contributions
are its original creation(s) or it has sufficient rights to grant the rights to its
Contributions conveyed by this License.
2.7 Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section
2.1.
93
3 Responsibilities
3.1 Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source Code
Form of the Covered Software is governed by the terms of this License, and
how they can obtain a copy of this License. You may not attempt to alter
or restrict the recipients’ rights in the Source Code Form.
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this Li-
cense, or sublicense it under different terms, provided that the license
for the Executable Form does not attempt to limit or alter the recipi-
ents’ rights in the Source Code Form under this License.
3.4 Notices
You may not remove or alter the substance of any license notices (including
copyright notices, patent notices, disclaimers of warranty, or limitations of
94
liability) contained within the Source Code Form of the Covered Software,
except that You may alter any license notices to the extent required to remedy
known factual inaccuracies.
5 Termination
5.1
The rights granted under this License will terminate automatically if You
fail to comply with any of its terms. However, if You become compliant,
then the rights granted under this License from a particular Contributor
are reinstated (a) provisionally, unless and until such Contributor explicitly
and finally terminates Your grants, and (b) on an ongoing basis, if such
Contributor fails to notify You of the non-compliance by some reasonable
95
means prior to 60 days after You have come back into compliance. Moreover,
Your grants from a particular Contributor are reinstated on an ongoing basis
if such Contributor notifies You of the non-compliance by some reasonable
means, this is the first time You have received notice of non-compliance with
this License from such Contributor, and You become compliant prior to 30
days after Your receipt of the notice.
5.2
If You initiate litigation against any entity by asserting a patent infringement
claim (excluding declaratory judgment actions, counter-claims, and cross-
claims) alleging that a Contributor Version directly or indirectly infringes
any patent, then the rights granted to You by any and all Contributors for
the Covered Software under Section 2.1 of this License shall terminate.
5.3
In the event of termination under Sections 5.1 or 5.2 above, all end user license
agreements (excluding distributors and resellers) which have been validly
granted by You or Your distributors under this License prior to termination
shall survive termination.
6 Disclaimer of Warranty
Covered Software is provided under this License on an “as is” basis, with-
out warranty of any kind, either expressed, implied, or statutory, including,
without limitation, warranties that the Covered Software is free of defects,
merchantable, fit for a particular purpose or non-infringing. The entire risk as
to the quality and performance of the Covered Software is with You. Should
any Covered Software prove defective in any respect, You (not any Contrib-
utor) assume the cost of any necessary servicing, repair, or correction. This
disclaimer of warranty constitutes an essential part of this License. No use
of any Covered Software is authorized under this License except under this
disclaimer.
7 Limitation of Liability
Under no circumstances and under no legal theory, whether tort (including
negligence), contract, or otherwise, shall any Contributor, or anyone who
distributes Covered Software as permitted above, be liable to You for any
96
direct, indirect, special, incidental, or consequential damages of any charac-
ter including, without limitation, damages for lost profits, loss of goodwill,
work stoppage, computer failure or malfunction, or any and all other com-
mercial damages or losses, even if such party shall have been informed of the
possibility of such damages. This limitation of liability shall not apply to
liability for death or personal injury resulting from such party’s negligence
to the extent applicable law prohibits such limitation. Some jurisdictions do
not allow the exclusion or limitation of incidental or consequential damages,
so this exclusion and limitation may not apply to You.
8 Litigation
Any litigation relating to this License may be brought only in the courts of a
jurisdiction where the defendant maintains its principal place of business and
such litigation shall be governed by laws of that jurisdiction, without refer-
ence to its conflict-of-law provisions. Nothing in this Section shall prevent a
party’s ability to bring cross-claims or counter-claims.
9 Miscellaneous
This License represents the complete agreement concerning the subject mat-
ter hereof. If any provision of this License is held to be unenforceable, such
provision shall be reformed only to the extent necessary to make it enforce-
able. Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not be used to construe this Li-
cense against a Contributor.
97
10.2 Effect of New Versions
You may distribute the Covered Software under the terms of the version of
the License under which You originally received the Covered Software, or
under the terms of any subsequent version published by the license steward.
98
B Dynaωo Documentation License
99
Creative Commons Attribution-ShareAlike 4.0
Creative Commons public licenses provide a standard set of terms and condi-
tions that creators and other rights holders may use to share original works of
authorship and other material subject to copyright and certain other rights
specified in the public license below. The following considerations are for
informational purposes only, are not exhaustive, and do not form part of our
licenses.
Considerations for licensors: Our public licenses are intended for use by those
authorized to give the public permission to use material in ways otherwise
restricted by copyright and certain other rights. Our licenses are irrevocable.
Licensors should read and understand the terms and conditions of the license
they choose before applying it. Licensors should also secure all rights nec-
essary before applying our licenses so that the public can reuse the material
as expected. Licensors should clearly mark any material not subject to the
license. This includes other CC-licensed material, or material used under
an exception or limitation to copyright. More considerations for licensors :
wiki.creativecommons.org/Considerations for licensors
Considerations for the public: By using one of our public licenses, a licensor
grants the public permission to use the licensed material under specified terms
100
and conditions. If the licensor’s permission is not necessary for any reasonfor
example, because of any applicable exception or limitation to copyrightthen
that use is not regulated by the license. Our licenses grant only permissions
under copyright and certain other rights that a licensor has authority to
grant. Use of the licensed material may still be restricted for other reasons,
including because others have copyright or other rights in the material. A
licensor may make special requests, such as asking that all changes be marked
or described.
Although not required by our licenses, you are encouraged to respect those
requests where reasonable. More considerations for the public :
wiki.creativecommons.org/Considerations for licensees
By exercising the Licensed Rights (defined below), You accept and agree to
be bound by the terms and conditions of this Creative Commons Attribution-
ShareAlike 4.0 International Public License (“Public License”). To the ex-
tent this Public License may be interpreted as a contract, You are granted
the Licensed Rights in consideration of Your acceptance of these terms and
conditions, and the Licensor grants You such rights in consideration of bene-
fits the Licensor receives from making the Licensed Material available under
these terms and conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material and
in which the Licensed Material is translated, altered, arranged, trans-
formed, or otherwise modified in a manner requiring permission under
the Copyright and Similar Rights held by the Licensor. For purposes
of this Public License, where the Licensed Material is a musical work,
performance, or sound recording, Adapted Material is always produced
where the Licensed Material is synched in timed relation with a moving
image.
101
mons.org/compatiblelicenses, approved by Creative Commons as es-
sentially the equivalent of this Public License.
i. Licensed Rights means the rights granted to You subject to the terms
and conditions of this Public License, which are limited to all Copyright
and Similar Rights that apply to Your use of the Licensed Material and
that the Licensor has authority to license.
102
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially equivalent
rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights un-
der this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor
hereby grants You a worldwide, royalty-free, non-sublicensable, non-
exclusive, irrevocable license to exercise the Licensed Rights in the
Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part;
and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Excep-
tions and Limitations apply to Your use, this Public License does not
apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor au-
thorizes You to exercise the Licensed Rights in all media and formats
whether now known or hereafter created, and to make technical mod-
ifications necessary to do so. The Licensor waives and/or agrees not
to assert any right or authority to forbid You from making techni-
cal modifications necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective Technological
Measures. For purposes of this Public License, simply making modi-
fications authorized by this Section 2(a)(4) never produces Adapted
Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the
Licensed Material automatically receives an offer from the Licen-
sor to exercise the Licensed Rights under the terms and conditions
of this Public License.
103
B. Additional offer from the Licensor Adapted Material. Every re-
cipient of Adapted Material from You automatically receives an
offer from the Licensor to exercise the Licensed Rights in the
Adapted Material under the conditions of the Adapter’s License
You apply.
C. No downstream restrictions. You may not offer or impose any
additional or different terms or conditions on, or apply any Ef-
fective Technological Measures to, the Licensed Material if doing
so restricts exercise of the Licensed Rights by any recipient of the
Licensed Material.
D. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You are,
or that Your use of the Licensed Material is, connected with, or
sponsored, endorsed, or granted official status by, the Licensor
or others designated to receive attribution as provided in Section
3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this
Public License, nor are publicity, privacy, and/or other similar person-
ality rights; however, to the extent possible, the Licensor waives and/or
agrees not to assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed Rights, but not
otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royal-
ties from You for the exercise of the Licensed Rights, whether directly
or through a collecting society under any voluntary or waivable statu-
tory or compulsory licensing scheme. In all other cases the Licensor
expressly reserves any right to collect such royalties.
104
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You
must:
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share Adapted Material
You produce, the following conditions also apply.
105
2. You must include the text of, or the URI or hyperlink to, the Adapter’s
License You apply. You may satisfy this condition in any reasonable
manner based on the medium, means, and context in which You Share
Adapted Material.
3. You may not offer or impose any additional or different terms or con-
ditions on, or apply any Effective Technological Measures to, Adapted
Material that restrict exercise of the rights granted under the Adapter’s
License You apply.
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to
extract, reuse, reproduce, and Share all or a substantial portion of the
contents of the database;
b. if You include all or a substantial portion of the database contents
in a database in which You have Sui Generis Database Rights, then
the database in which You have Sui Generis Database Rights (but not
its individual contents) is Adapted Material, including for purposes of
Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share all
or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace
Your obligations under this Public License where the Licensed Rights include
other Copyright and Similar Rights.
106
a particular purpose, non-infringement, absence of latent or
other defects, accuracy, or the presence or absence of errors,
whether or not known or discoverable. Where disclaimers of
warranties are not allowed in full or in part, this disclaimer
may not apply to You.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
c. For the avoidance of doubt, this Section 6(b) does not affect any right
the Licensor may have to seek remedies for Your violations of this
Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed
Material under separate terms or conditions or stop distributing the
Licensed Material at any time; however, doing so will not terminate
this Public License.
107
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall
not be interpreted to, reduce, limit, restrict, or impose conditions on
any use of the Licensed Material that could lawfully be made without
permission under this Public License.
108
at creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark “Creative Commons” or any other trademark or logo of
Creative Commons without its prior written consent including, without limi-
tation, in connection with any unauthorized modifications to any of its public
licenses or any other arrangements, understandings, or agreements concern-
ing use of licensed material. For the avoidance of doubt, this paragraph does
not form part of the public licenses.
109
C OpenModelica License
110
Open Source Modelica Consortium (OSMC)
Public License (OSMC-PL)
111
∗ GNU v e r s i o n 3 i s o b t a i n e d from :
h t t p : / /www. gnu . org / c o p y l e f t / g p l . html .
∗
∗ This program i s d i s t r i b u t e d WITHOUT ANY WARRANTY;
without
∗ even t h e i m p l i e d warranty o f MERCHANTABILITY or
FITNESS
∗ FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET
FORTH
∗ IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
CONDITIONS OF OSMC−PL .
∗
∗ See t h e f u l l OSMC P u b l i c L i c e n s e c o n d i t i o n s f o r
more d e t a i l s .
∗
∗/
— End of OSMC Public License Header —
112
• OSMC-External-EPL = These OSMC Public license conditions to-
gether with Externally restricted EPL, i.e., EPL version 1.0 with the
Additional Condition that use and redistribution by an OSMC member,
or by a Licensed Third Party Distributor having a redistribution agree-
ment with that member, to parties external to the OSMC members own
organization (i.e., its own legal entity) is only allowed in binary/object-
code form, except the case of redistribution to other OSMC members
to which source is also allowed to be distributed.
[This has the consequence that an external party who wishes to use Open-
Modelica in source form together with its own proprietary software in all
cases must be a member of OSMC].
Definitions:
“Subsidiary license conditions” means:
113
The additional license conditions depending on the by the recipient chosen
mode of OSMC-PL, defined by GPL version 3.0 for GPL, and by EPL for
OSMC-Internal-EPL and OSMC-External-EPL.
“OSMC-PL” means:
Open Source Modelica Consortium Public License version 1.2, i.e., the li-
cense defined here (the text between “— Start of Definition of OSMC Public
License —” and “— End of Definition of OSMC Public License —”, or later
versions thereof.
“Contribution” means:
a) in the case of the initial Contributor, the initial code and documenta-
tion distributed under OSMC-PL, and
114
allowed under the Additional Condition of internal distribution according to
OSMC-Internal-EPL and/or Additional Condition for external distribution
according to OSMC-External-EPL.
“Contributor” means any person or entity that distributes (part of) Open-
Modelica.
115
further redistribution to other resellers if the Level 2 member is granting
such a right to it in the redistribution/resale agreement between the Level 2
member and the Licensed Third Party Distributor.
“Affiliate” shall mean any legal entity, directly or indirectly, through one or
more intermediaries, controlling or controlled by or under common control
with any other legal entity, as the case may be. For purposes of this definition,
the term “control” (including the terms “controlling,” “controlled by” and
“under common control with”) means the possession, direct or indirect, of
the power to direct or cause the direction of the management and policies of a
legal entity, whether through the ownership of voting securities, by contract
or otherwise.
NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THE BY RECIPIENT SE-
LECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL, OPEN-
MODELICA IS PROVIDED ON AN “AS IS” BASIS, WITHOUT WAR-
RANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IM-
PLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABIL-
ITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
solely responsible for determining the appropriateness of using and distribut-
ing OPENMODELICA and assumes all risks associated with its exercise of
rights under OSMC-PL , including but not limited to the risks and costs of
program errors, compliance with applicable laws, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THE BY RECIPIENT SE-
LECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL, NEITHER
RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABIL-
ITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEM-
PLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT
LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABIL-
ITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARIS-
ING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF OPEN-
116
MODELICA OR THE EXERCISE OF ANY RIGHTS GRANTED HERE-
UNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM-
AGES.
Contributors may not remove or alter any copyright notices contained within
OPENMODELICA.
117
If there is a conflict between OSMC-PL and the subsidiary license conditions,
OSMC-PL has priority.
The EPL 1.0 license definition has been obtained from: http://www.eclipse.org/legal/epl-
v10.html. It is also reproduced in Appendix B of the OSMC Bylaws, and in
the OpenModelica distribution.
The GPL Version 3 license definition has been obtained from http://www.gnu.org/copyleft/gpl.htm
It is also reproduced in Appendix C of the OSMC Bylaws, and in the Open-
Modelica distribution.
118
D SUNDIALS License
119
SUNDIALS License
3. Neither the name of the LLNS/LLNL nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
120
OF ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUEN-
TIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCURE-
MENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH-
ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFT-
WARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
121
E SuiteSparse License
122
BSD-3-Clause License
3. Neither the name of the copyright holder nor the names of its contrib-
utors may be used to endorse or promote products derived from this
software without specific prior written permission.
123
F Adept License
124
Apache License
Version 2
January 2004
1 Definitions.
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the copyright owner or entity authorized by the copy-
right owner that is granting the License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, ”control” means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
“You” (or “Your”) shall mean an individual or Legal Entity exercising per-
missions granted by this License.
“Source” form shall mean the preferred form for making modifications, in-
cluding but not limited to software source code, documentation source, and
configuration files.
“Object” form shall mean any form resulting from mechanical transformation
or translation of a Source form, including but not limited to compiled object
code, generated documentation, and conversions to other media types.
“Work” shall mean the work of authorship, whether in Source or Object
125
form, made available under the License, as indicated by a copyright notice
that is included in or attached to the work (an example is provided in the
Appendix below).
“Derivative Works” shall mean any work, whether in Source or Object form,
that is based on (or derived from) the Work and for which the editorial
revisions, annotations, elaborations, or other modifications represent, as a
whole, an original work of authorship. For the purposes of this License,
Derivative Works shall not include works that remain separable from, or
merely link (or bind by name) to the interfaces of, the Work and Derivative
Works thereof.
“Contribution” shall mean any work of authorship, including the original
version of the Work and any modifications or additions to that Work or
Derivative Works thereof, that is intentionally submitted to Licensor for in-
clusion in the Work by the copyright owner or by an individual or Legal Entity
authorized to submit on behalf of the copyright owner. For the purposes of
this definition, “submitted” means any form of electronic, verbal, or written
communication sent to the Licensor or its representatives, including but not
limited to communication on electronic mailing lists, source code control sys-
tems, and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but exclud-
ing communication that is conspicuously marked or otherwise designated in
writing by the copyright owner as ”Not a Contribution.”
“Contributor” shall mean Licensor and any individual or Legal Entity on be-
half of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
126
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combina-
tion of their Contribution(s) with the Work to which such Contribution(s)
was submitted. If You institute patent litigation against any entity (includ-
ing a cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contribu-
tory patent infringement, then any patent licenses granted to You under this
License for that Work shall terminate as of the date such litigation is filed.
4 Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works
thereof in any medium, with or without modifications, and in Source or
Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a
copy of this License; and
(b) You must cause any modified files to carry prominent notices stating
that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You
distribute, all copyright, patent, trademark, and attribution notices
from the Source form of the Work, excluding those notices that do not
pertain to any part of the Derivative Works; and
(d) If the Work includes a ”NOTICE” text file as part of its distribution,
then any Derivative Works that You distribute must include a readable
copy of the attribution notices contained within such NOTICE file,
excluding those notices that do not pertain to any part of the Derivative
Works, in at least one of the following places: within a NOTICE text
file distributed as part of the Derivative Works; within the Source form
or documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and wherever
such third-party notices normally appear. The contents of the NOTICE
file are for informational purposes only and do not modify the License.
You may add Your own attribution notices within Derivative Works
that You distribute, alongside or as an addendum to the NOTICE
text from the Work, provided that such additional attribution notices
cannot be construed as modifying the License.
127
You may add Your own copyright statement to Your modifications and may
provide additional or different license terms and conditions for use, reproduc-
tion, or distribution of Your modifications, or for any such Derivative Works
as a whole, provided Your use, reproduction, and distribution of the Work
otherwise complies with the conditions stated in this License.
5 Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally sub-
mitted for inclusion in the Work by You to the Licensor shall be under the
terms and conditions of this License, without any additional terms or condi-
tions. Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed with
Licensor regarding such Contributions.
6 Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for rea-
sonable and customary use in describing the origin of the Work and repro-
ducing the content of the NOTICE file.
7 Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides
the Work (and each Contributor provides its Contributions) on an ”AS IS”
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied, including, without limitation, any warranties or
conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible
for determining the appropriateness of using or redistributing the Work and
assume any risks associated with Your exercise of permissions under this
License.
8 Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
128
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License
or out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction,
or any and all other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
129
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an “AS IS” BASIS, WITHOUT WAR-
RANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limita-
tions under the License.
130
G NICSLU License
131
GNU LESSER GENERAL PUBLIC
LICENSE
Version 3
29 June 2007
0 Additional Definitions.
As used herein, “this License” refers to version 3 of the GNU Lesser General
Public License, and the “GNU GPL” refers to version 3 of the GNU General
Public License.
“The Library” refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An “Application” is any work that makes use of an interface provided by
the Library, but which is not otherwise based on the Library. Defining a
subclass of a class defined by the Library is deemed a mode of using an
interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an Appli-
cation with the Library. The particular version of the Library with which
the Combined Work was made is also called the “Linked Version”.
The “Minimal Corresponding Source” for a Combined Work means the Cor-
responding Source for the Combined Work, excluding any source code for
132
portions of the Combined Work that, considered in isolation, are based on
the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the
object code and/or source code for the Application, including any data and
utility programs needed for reproducing the Combined Work from the Ap-
plication, but excluding the System Libraries of the Combined Work.
133
b) Accompany the object code with a copy of the GNU GPL and this
license document.
4 Combined Works.
You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of the Library
contained in the Combined Work and reverse engineering for debugging such
modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the
Library is used in it and that the Library and its use are covered by
this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
134
Linked Version. (If you use option 4d0, the Installation Information
must accompany the Minimal Corresponding Source and Correspond-
ing Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the
GNU GPL for conveying Corresponding Source.)
5 Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are not
Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities, conveyed
under the terms of this License.
135
proxy’s public statement of acceptance of any version is permanent autho-
rization for you to choose that version for the Library.
136
H jQuery MIT License
137
MIT License
138
I jQuery GPL License
139
GNU GENERAL PUBLIC LICENSE
Version 2
June 1991
Preamble
The licenses for most software are designed to take away your freedom to
share and change it. By contrast, the GNU General Public License is in-
tended to guarantee your freedom to share and change free software–to make
sure the software is free for all its users. This General Public License applies
to most of the Free Software Foundation’s software and to any other program
whose authors commit to using it. (Some other Free Software Foundation
software is covered by the GNU Lesser General Public License instead.) You
can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you
can do these things.
To protect your rights, we need to make restrictions that forbid anyone to
deny you these rights or to ask you to surrender the rights. These restrictions
translate to certain responsibilities for you if you distribute copies of the
software, or if you modify it.
140
For example, if you distribute copies of such a program, whether gratis or
for a fee, you must give the recipients all the rights that you have. You must
make sure that they, too, receive or can get the source code. And you must
show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2)
offer you this license which gives you legal permission to copy, distribute
and/or modify the software.
Also, for each author’s protection and ours, we want to make certain that
everyone understands that there is no warranty for this free software. If the
software is modified by someone else and passed on, we want its recipients to
know that what they have is not the original, so that any problems introduced
by others will not reflect on the original authors’ reputations.
Finally, any free program is threatened constantly by software patents. We
wish to avoid the danger that redistributors of a free program will individually
obtain patent licenses, in effect making the program proprietary. To prevent
this, we have made it clear that any patent must be licensed for everyone’s
free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification
follow.
141
contents constitute a work based on the Program (independent of having
been made by running the Program). Whether that is true depends on what
the Program does.
1.
You may copy and distribute verbatim copies of the Program’s source code
as you receive it, in any medium, provided that you conspicuously and appro-
priately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to the
absence of any warranty; and give any other recipients of the Program a copy
of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may
at your option offer warranty protection in exchange for a fee.
2.
You may modify your copy or copies of the Program or any portion of it,
thus forming a work based on the Program, and copy and distribute such
modifications or work under the terms of Section 1 above, provided that you
also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating
that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole
or in part contains or is derived from the Program or any part thereof,
to be licensed as a whole at no charge to all third parties under the
terms of this License.
142
These requirements apply to the modified work as a whole. If identifiable sec-
tions of that work are not derived from the Program, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Program, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend to
the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise the
right to control the distribution of derivative or collective works based on the
Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under the
scope of this License.
3.
You may copy and distribute the Program (or a work based on it, under
Section 2) in object code or executable form under the terms of Sections 1
and 2 above provided that you also do one of the following:
143
The source code for a work means the preferred form of the work for making
modifications to it. For an executable work, complete source code means
all the source code for all modules it contains, plus any associated interface
definition files, plus the scripts used to control compilation and installation of
the executable. However, as a special exception, the source code distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even
though third parties are not compelled to copy the source along with the
object code.
4.
You may not copy, modify, sublicense, or distribute the Program except
as expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense or distribute the Program is void, and will automatically
terminate your rights under this License. However, parties who have received
copies, or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
5.
You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the
Program or its derivative works. These actions are prohibited by law if you do
not accept this License. Therefore, by modifying or distributing the Program
(or any work based on the Program), you indicate your acceptance of this
License to do so, and all its terms and conditions for copying, distributing or
modifying the Program or works based on it.
6.
Each time you redistribute the Program (or any work based on the Program),
the recipient automatically receives a license from the original licensor to
copy, distribute or modify the Program subject to these terms and conditions.
You may not impose any further restrictions on the recipients’ exercise of the
144
rights granted herein. You are not responsible for enforcing compliance by
third parties to this License.
7.
If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Program at all. For example, if a
patent license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then the only
way you could satisfy both it and this License would be to refrain entirely
from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any par-
ticular circumstance, the balance of the section is intended to apply and the
section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system, which is implemented by public license practices. Many
people have made generous contributions to the wide range of software dis-
tributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to dis-
tribute software through any other system and a licensee cannot impose that
choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
8.
If the distribution and/or use of the Program is restricted in certain countries
either by patents or by copyrighted interfaces, the original copyright holder
who places the Program under this License may add an explicit geographi-
cal distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
145
9.
The Free Software Foundation may publish revised and/or new versions of
the General Public License from time to time. Such new versions will be
similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Program spec-
ifies a version number of this License which applies to it and “any later
version”, you have the option of following the terms and conditions either of
that version or of any later version published by the Free Software Founda-
tion. If the Program does not specify a version number of this License, you
may choose any version ever published by the Free Software Foundation.
10.
If you wish to incorporate parts of the Program into other free programs
whose distribution conditions are different, write to the author to ask for
permission. For software which is copyrighted by the Free Software Founda-
tion, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing and
reuse of software generally.
NO WARRANTY
11.
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMIT-
TED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED
IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU AS-
SUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR COR-
RECTION.
146
12.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER
PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM
AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, IN-
CLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUEN-
TIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED
BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. END OF TERMS AND CONDITIONS
147
J ccplint License
148
CC-BY-3.0 License
cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google
Inc.
Redistribution and use in source and binary forms, with or without modifi-
cation, are permitted provided that the following conditions are met:
• Neither the name of Google Inc. nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
149
150