Handling User-Written Models in PSS®E-31
Abstract
This article
discusses changes in the way PSS®E handles user-written models
starting with version 31.
General
PSS®E has
a vast library of time-tested dynamic models. PSS®E also provides
the capability of creating "user-written" models, an extremely
powerful technique employed by numerous PSS®E users over the years
to create highly sophisticated models. PSS®E user-written dynamic
models, like PSS®E standard models, are analytically initialized
based on the power flow results. The initialization is accurate,
and the dynamics simulation can be started without any movement
from initial time (t=0). In addition, users can create any type
of model of any desired complexity. In fact, many of the PSS®E-standard
models in the PSS®E library were initially implemented as user-written
models, and then later transformed to PSS®E standard library models.
In view
of the widespread use of user-written models, Siemens PTI has
a long-standing commitment to making the use of user-written models
as easy and intuitive as possible. In order to achieve this goal,
PSS®E-31 introduces a major shift in the way user-written models
are handled.
Connection
Routines
The connection
between PSS®E and the user-written models is established via
calls to the user-written models which, in the pre-31 releases
of PSS®E, was required to be in one of the connection routines.
In the PSS®E-30
release, there were eight different connection routines: USRXXX,
USRLOD, USRREL, USRAUX, USRDCL, USRFCT (collectively called USRzzz
routines), CONEC and CONET. Subroutines USRzzz and CONEC are normally
in the file conec.flx (called conec file), while subroutine CONET
is in the file conet.flx (called conet file).
Depending
on the model type, user-written model calls were generated in
one of the USRzzz routines, the subroutine CONEC, or in the subroutine
CONET. For example, user-written plant-related models were called
in subroutine USRXXX, user-written load-related models in USRLOD,
user-written line-relay models in USRREL, user-written auxiliary
signal models in USRAUX, user-written dc line models in USRDCL,
and user-written FACTS device models in USRFCT. All other model
types were called in subroutine CONEC and/or subroutine CONET.
In order
to include user-written models in a PSS®E dynamic simulation,
users were required to create the dynamics user library (called
"dsusr.dll"). Typically this entails compiling their
connection routines and user-written models and then linking the
dynamics user library. Previously compiled objects of model programs
can be managed at the link step.
Since there
were no changes to the structure of the conet file between releases
of PSS®E-30 and PSS®E-31, models called in subroutine
CONET will not be discussed further in this article.
At PSS®E-30,
the default (or skeleton) conec file with no user-written model
calls consisted of the following code:

If the dynamic
simulation case has the following user-written models: CONEC-called
model MYMDLA, plant-related model AVR1, load-related model LOD1,
line-relay model REL1, auxiliary signal model AUX1, dc line model
DCL1, and FACTS device model FCT1, then the PSS®E-30
conec file consisted of the following code:

The conec
file, for PSS®E-31, with the same set of user-written models
in the dynamics case consists of the following code:

Some of the key differences
between PSS®E-31 and earlier releases are:
- PSS®E-31 conec
file has neither the USRzzz subroutines nor the user-written
model calls that were required in the previous version. Since
PSS®E can identify the user-written model names and the
arguments to them, these model calls can be generated by PSS®E
like any other PSS®E standard model.
- With no user-written
model calls in any of the USRzzz routines, there is no need
to “cut & paste” following addition of dynamics
data (DYRE,ADD) containing user-written models.
- The structure of
conec and conet files generated by PSS®E is consistent for
use either as FLECS or FORTRAN files.
- As of PSS®E-31,
the model calls in subroutines CONEC and CONET still remain.
Our goal is to remove these as well. We are fully committed
to doing this, to be implemented in a future PSS®E release.
- As of PSS®E-31,
conec and conet files are not mandatory. If there are user-written
models whose model calls are not generated in subroutine CONEC
and/or CONET, then there is no need to generate the conec and
conet files.
- If there are no
model calls in conec and conet files, there is no need for conec
and conet files at all, and hence there would be no need to
compile them.
Although
we plan to remove the need for conec and conet files, we intend
to retain the CONEC and CONET subroutines as a feature. Reasons
include allowing for backward compatibility and allowing for users'
adjustment to the new procedures at a time of their own choosing.
In addition, the CONEC and CONET subroutines are a quick and an
easy place to implement in-line codes.
There is
still a need to compile user-written models, and there is still
a need to communicate to PSS®E where to find them. This will
be addressed in the sections below.
Compilation
and Creating the Dynamics User Library
In the pre-31
releases of PSS®E the following methods were provided to compile
the conec and conet files and any user-written models: (1) use
the PSS®E generated batch file "compile.bat" (to
compile FLECS files only), (2) use the PSS®E supplied batch
file "cmdlusr.bat" (which could be used to compile FORTRAN
as well as FLECS files), (3) employ a user-modified version of
one of the batch files. After compilation the only method provided
to create the dynamics user library was to run the PSS®E batch
file "cload4.bat".
"cload4.bat"
always created a file named "dsusr.dll". Although it
is possible to modify "cload4.bat" to create a dll with
a different name, the changes required in "cload4.bat"
to do this were not very obvious and, more importantly, there
was no API routine prior to PSS®E-31 to load a dll by name.
"dsusr.dll" is loaded automatically, and always was.
At PSS®E-31,
a GUI method for compiling and creating the dynamics user library
is provided. This method, called “create usrdll”,
is supplied with PSS®E and combines the functions of "compile.bat",
"cmdlsur.bat", and "cload4.bat" procedures
of PSS®E dynamic simulation.
Users can
use either "cload4.bat" or the "create usrdll"
facility to create the dynamics user library. "cload4.bat",
as before, will always create the file named "dsusr.dll".
With the "create usrdll" facility users can create a
dll of any name. By default the name "dsusr.dll" will
be presented in the "create usrdll" GUI. However the
user has the liberty to change the name "dsusr.dll"
to any name (for example "abc.dll"). When PSS®E
is started up, by default it will attempt to load "dsusr.dll".
If it finds "dsusr.dll", it will load it. However, if
PSS®E does not find it, there will be no error. In previous
versions of PSS®E "dsusr.dll" was required; this
is no longer the case. In contrast, "abc.dll" will not
get loaded automatically because PSS®E does not know this
name. The user can load "abc.dll" using the ADDMODELLIBRARY
API routine.
The natural
approach for an experienced PSS®E dynamics user to take when
using the new "create usrdll" process is to specify
the sources to be used to build the library – i.e., conec
and conet, if used, and user-written models, if used – and
create "dsusr.dll". When used in this way the change
from the preceding methodology is minimal. The GUI process is
simpler and more intuitive.
Of greater
benefit to the user is the ability to create a customized dll.
For example, users can maintain all their models in one dll, and
that dll does not need to have the CONEC and CONET subroutines.
In fact, it would be better if "abc.dll" does not have
any references to CONEC and CONET. As explained earlier, CONEC
and CONET have hard coded numbers in model calls and are, therefore,
user-specific, and perhaps even case-specific. Each user or study
can have unique CONEC and CONET routines in "dsusr.dll",
if needed. If the models themselves are all in "abc.dll",
then only that dll needs to be recreated if the source to one
of the models changes.
The same
"abc.dll" can be used for more than one study. It would
not need to be rebuilt by every user. It can be maintained by
one person (the contact person) and distributed to all users who
need it or referenced from a common network drive. If the user
model types do not generate any model calls in conec.flx and conet.flx,
then the user does not have to compile and generate "dsusr.dll".
In such situations, although there are user models in the case,
if users employ "abc.dll", they do not have to compile
or link (i.e., there is no need for a compiler). All they have
to do is get "abc.dll" from the contact person, start
PSS®E, load "abc.dll", and they are ready to run
PSS®E.
With the
current PSS®E release (version 31.0.1), the user will need
to enter the ADDMODELLIBRARY call for every execution of PSS®E
that needs access to a dynamics user library named other than
"dsusr.dll". Enhancements to retain additional library
names from one execution to the next, and then provide GUI access
to this list, are in development.
Conclusions
Siemens
PTI is committed to making the handling of user-written models
as easy and intuitive as possible. The overall goal is to remove
the need for user dependence on conec and conet files, and to
limit the need for compilers to only those users who write or
modify user-written models. Our first step was to simplify the
connection routines and allow the creation of user named model
libraries. In the immediate future we’ll be enhancing the
tools to manage these user named model libraries. In a future
PSS®E release there will be no need for the conec and conet
files at all. At that time only the user-written models themselves
will need to be maintained by the user community, and only developers
of those models will need to compile programs or link libraries
in order to use those models in PSS®E dynamics studies.
Download
document as .pdf
| Siemens Power Transmission
& Distribution, Inc., Power Technologies International
400 State Street | P.O. Box 1058 | Schenectady,
NY 12301-1058
Privacy
& Legal |
|