0% found this document useful (0 votes)
54 views

Tutorial DSL TestTroubleshooting

The document discusses testing and troubleshooting models in PowerFactory software. It provides three key steps: 1) Check model equations for syntax errors using the "Check" function; 2) Verify initial conditions are defined properly using the "Verify initial conditions" option; 3) Check signal and variable values by printing them to the output window, using the flexible data window, or overlaying on block diagrams. The document also provides advice for troubleshooting models, such as initializing all state variables, avoiding division by zero, and reformulating equations to remove algebraic loops.

Uploaded by

Kike Becerra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Tutorial DSL TestTroubleshooting

The document discusses testing and troubleshooting models in PowerFactory software. It provides three key steps: 1) Check model equations for syntax errors using the "Check" function; 2) Verify initial conditions are defined properly using the "Verify initial conditions" option; 3) Check signal and variable values by printing them to the output window, using the flexible data window, or overlaying on block diagrams. The document also provides advice for troubleshooting models, such as initializing all state variables, avoiding division by zero, and reformulating equations to remove algebraic loops.

Uploaded by

Kike Becerra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Testing and Troubleshooting

PowerFactory includes different options and methods to test a model for errors. If you are following the
complete tutorial and have completed the previous part Building a User Defined Model, then you can continue
working with the same project; otherwise you can import the project with the already prepared model. If you
select the first option then go to Section 1, otherwise:

• Click on the icon from the exercise “Testing and Troubleshooting” of the PowerFactory Tutorial window,
to import and activate the project for this exercise.

1 Verifying Model Equations

After creating a complete model definition including the initialisation, the next step should be checking for
syntax and typing errors. To this end, PowerFactory provides the “Check” function in the DSL model type (see
Figure 1.1).

Figure 1.1: “Check” function in the DSL model type dialog


TESTING AND TROUBLESHOOTING

The “Check” function looks for syntax and typographical errors; for instance, built-in function names that are
misspelled (e.g. “sqrut(4)” instead of “sqrt(4)”), mathematical syntax errors (e.g. “2 ++ 3” instead of “2 + 3”),
variable or signal names that don’t exist or are misspelled, etc. Actual numerical checks are not performed,
however it checks whether all state variables in the model have an initial condition statement (whether the
definitions of the initial values lead to a steady-state operating point is not verified at this point).

Verifying the AVR Model Equations:


– Locate the "Simplified AVR" block diagram in the Data Manager, then edit it and use the “Check”
function.
– Look at the output window for any message, solve any problem if reported with the help of the error
message description. A message “Block is ok” will be issued when no errors have been found.

Figure 1.2: Model Equations Check

2 Verification of the Initial Conditions

The “Check” function, as said before, only looks for syntax errors, but does not check whether a model is
correctly connected to other elements or if the initialisation is adequately defined. Checks of this kind can only
be performed at the DSL model level (i.e, when the model has been included in the grid calculations).

A most important tool for this is the “Verify initial conditions” option of the “Calculate Initial Conditions” command
( ): when enabled, this option will print to the output window a summary of errors and warnings concerning
the model initial status, as, for example:
• Model cannot be initialised
• Derivative of state variable not zero

• Output signal not correctly initialised


Initialisation errors can also appear not only for structural reasons (errors in the DSL model type or in the
composite model frame), but also for parametrical and scenario-related reasons, for example parameters set to
zero used as divisors, wrongly defined limits, or a system operating point outside the intended range allowed by
the model: It is therefore advised to always have this option enabled when initialising a time domain simulation.

When testing models and troubleshooting initialisation issues, it is useful to be able to examine the input /output
signals connecting the DSL models, as well as any internal and state variables from inside the DSL models.
In the following sections three possible ways to inspect model signals and variables in PowerFactory will be
demonstrated.

2.1 Printing Values to the Output Window

• Run the “Calculate Initial Conditions” command ( )

• Define a variable selection for the DSL common model object (“Voltage Controller”). From the variable
selection dialog, select the following signals and variables: s:Vref; s:Vs; s:Vt; s:Efd; c:Vc; c:yi; c:Va; c:Vr.

Rev.2 2
TESTING AND TROUBLESHOOTING

Note: Signals and state variables are located in the “Signals” menu, and internal variables are located
in the “Calculation Parameter” menu.

• Press the “Print Values” button to show the calculated initial values of the selected signals and variables
(see Figures 2.1 and 2.2).

Figure 2.1: Printing initial values from the variable set dialog

Figure 2.2: Result of “Print Values” button in output window

Rev.2 3
TESTING AND TROUBLESHOOTING

2.2 Flexible Data

The flexible data window of the network model manager ( ) can also be used to view model signals and
variables.
• Run the “Calculate Initial Conditions” command ( )

• Open the network model manager and look for the DSL model (“Voltage Controller”), select “Detail Mode”
using the icon and then select the “Flexible Data” tab at the bottom of the window.

• Clicking on the “Variable Selection” icon ( ) brings up a variable set dialog, where the signals and
variables of interests can be selected. Select the same variables defined in previous section 2.1; these
signals and variables will then be displayed in the network model manager as shown in Figure 2.3.

Figure 2.3: Using the flexible data window to view model signals and variables

2.3 Overlay of Signals in Block Diagrams

The graphical representation of the DSL model object can be also used to view signals and variables values at
initialisation.
• Open the data manager and locate the “Voltage Controller” DSL model, do right-click Diagrams → Show
Diagram. A new page with the controller block diagram will be displayed, however it is in freeze mode
and doesn’t allow you to modify the model. You will see the external frame as a thin grey line, this is the
only visible difference with the block diagram.

• Execute the “Calculate Initial Conditions” command ( ) and check the results on the diagram as shown
in Figure 2.4.

Rev.2 4
TESTING AND TROUBLESHOOTING

Figure 2.4: Using the block diagram to see signals and variables

3 Advice for Troubleshooting Models

The following guidelines are provided to help find and resolve any issues encountered when creating dynamic
models in PowerFactory :

• Add the initialisation equations to the composite block definitions, rather than to the primitive blocks.
• Make sure that DSL model types are set up so that each model can be completely initialised individually.

• Don’t forget to initialise all state variables and unknown signals.


• Signal and variable names are sensitive to context and white spaces. For example, the signals “pt”, “Pt”
and “pt ” (space at the end) are not the same. In particular, watch out for spaces at the beginning or end
of signal (or variable) names, as problems may arise that can be difficult to find.
• Make sure that the signal names in the composite model frame are the same as the signal names in the
DSL model type.
• If one composite model is causing problems, put all the other models out of service and try to solve the
problem in isolation. The other models can be re-instated and tested again once the problem has been
solved.

• The previous point also applies to a single composite model with many block definitions (DSL models).
If there is a problem with one DSL model, try to put the DSL models that are not directly connected or
related to the problematic model out of service. Some dummy initialisation values (i.e. with the inc0
statement) may need to be added.

Rev.2 5
TESTING AND TROUBLESHOOTING

• Use the “Verify Initial Conditions” option in the “Calculation of Initial Conditions” command object (Com-
Inc).

• Use the “Display internal DSL-events in output window” option in the “Run Simulation” command object
(ComSim).
• Avoid potentially inconsistent operations such as division by zero. The concrete case of a division by zero
can be handled by adding some extra code to avoid the inconsistency. One option is to skip the division,
e.g. instead of writing “(yi-x)/T” where “T” can take potentially the value of zero, use “select(T>0,(yi-x)/T,
yi)”.
• Expressions resulting (directly or indirectly) in the definition of a variable as a function of itself (e.g, yo=
x+yi+K*yo) are not allowed and are reported as “algebraic loop” errors by PowerFactory. Some algebraic
loops may be solved by reformulating the model equations, but this is not always possible. Typically
algebraic loops occur in feedback branches and in some if/else (“select”) implementations. To solve
algebraic loops resulting from feedback branches it is necessary to decouple the input/output equations,
for example by introducing a single order lag filter “1/(1+sT)” with a time constant close to the simulation
step size. Algebraic loops are detected by PowerFactory evaluating all possible paths, e.g., all “select”
alternatives, this can be solved avoiding the path in the “select” function causing the loop.

4 Summary

This concludes the exercise. Now it should be clear how to carry out the following tasks:

□ Check model equations.


□ Verify initial conditions.

□ Check signal and variable values.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy