Chapter 26

Stability and EMT Simulations
The transient simulation functions available in DIgSILENT PowerFactory are able to analyze the dynamic
behaviour of small systems and large power systems in the time domain. These functions therefore
make it possible to model complex systems such as industrial networks and large transmission grids in
detail, taking into account electrical and mechanical parameters.
Transients, stability problems and control problems are important considerations during the planning,
design and operation of modern power systems. Studies involving electro-magnetic transients and
different aspects of stability may be conducted using time-domain simulations for varying time periods,
or dynamic or small-signal stability analysis tools using (for example) eigenvalue analysis.
A large range of AC and DC systems can be analyzed (i.e. transmission systems with detailed models
of power plants, complex HVDC systems, motor start-up), as well as a combination of both. Applications
such as wind power integration or power electronics constitute new challenges in the analysis of power
systems, and as a result new models and techniques are provided in PowerFactory to meet these
requirements.
For modelling a variety of machines and controller units, as well as the electrical and mechanical components of power plants, etc., PowerFactory ’s global library provides a large number of predefined models.
This library includes models of generators, motors, controllers, motor driven machines, dynamic loads
and passive network elements. As an example, this library contains the IEEE standard models of power
plant controllers. Furthermore, the user can model specific controllers and develop block diagrams of
power plants with a large degree of freedom.
A Stability simulation in PowerFactory is started by:
• Selecting the Stability toolbar by clicking on the Change Toolbox icon (

);

• Calculating the initial conditions for the simulation by either pressing the Initial Conditions
on
the main toolbar, or by selecting Calculation → Stability → Initial Conditions... from the main menu;
• When the initial values have been calculated successfully, the icon
activated and can be pressed to start the simulation.

26.1

on the main toolbar will be

Introduction

The study of power system stability involves the analysis of the behaviour of power systems under
conditions before and after sudden changes in load or generation, during faults and outages. The
robustness of a system is defined by the ability of the system to maintain stable operation under normal
and perturbed conditions. It is therefore necessary to design and operate a power system so that
transient events (i.e. probable contingencies), can be withstood without the loss of load or loss of
DIgSILENT PowerFactory 15, User Manual

541

CHAPTER 26. STABILITY AND EMT SIMULATIONS
synchronism in the power system. Transients in electrical power systems can be classified according to
three possible timeframes:
• short-term, or electromagnetic transients;
• mid-term, or electromechanical transients;
• long-term transients.
The multilevel modelling of power system elements and the use of advanced algorithms means that the
functions in PowerFactory can analyze the complete range of transient phenomena in electrical power
systems. Consequently, there are three different simulation functions available:
1. A basic function which uses a symmetrical steady-state (RMS) network model for mid-term and
long-term transients under balanced network conditions;
2. A three-phase function which uses a steady-state (RMS) network model for mid-term and longterm transients under balanced and unbalanced network conditions, i.e. for analyzing dynamic
behaviour after unsymmetrical faults;
3. An electromagnetic transient (EMT) simulation function using a dynamic network model for electromagnetic and electromechanical transients under balanced and unbalanced network conditions. This function is particularly suited to the analysis of short-term transients.
In addition to the time-domain calculations, two other analysis functions are available:
• Parameter Identification
• Modal Analysis or Eigenvalue Analysis
Time-domain simulations in PowerFactory are initialized by a valid load flow, and PowerFactory functions
determine the initial conditions for all power system elements including all controller units and mechanical components. These initial conditions represent the steady-state operating point at the beginning of
the simulation, fulfilling the requirements that the derivatives of all state variables of loads, machines,
controllers, etc., are zero.
Before the start of the simulation process, it is also determined what type of network representation
must be used for further analysis, what step sizes to use, which events to handle and where to store the
results.
The simulation uses an iterative procedure to solve AC and DC load flows, and the dynamic model state
variable integrals simultaneously. Highly accurate non-linear system models result in exact solutions,
including during high-amplitude transients. Various numerical integration routines are used for the
electromechanical systems (including voltage regulators and power system stabilizer) and also for the
hydro-mechanical or thermo-mechanical models.
The process of performing a transient simulation typically involves the following steps:
1. Calculation of initial values, including a load flow calculation;
2. Definition of result variables and/or simulation events;
3. Optional definition of result graphs and/or other virtual instruments;
4. Execution of simulation;
5. Creating additional result graphs or virtual instruments, or editing existing ones;
6. Changing settings, repeating calculations;
7. Printing results.
542

DIgSILENT PowerFactory 15, User Manual

26.2. CALCULATION METHODS

26.2

Calculation Methods

26.2.1

Balanced RMS Simulation

The balanced RMS simulation function considers dynamics in electromechanical, control and thermal
devices. It uses a symmetrical, steady-state representation of the passive electrical network. Using this
representation, only the fundamental components of voltages and currents are taken into account.
Depending on the models of generators, motors, controllers, power plants and motor driven machines
used, the following studies may be carried out:
• transient stability (e.g. determination of critical fault clearing times);
• mid-term stability (e.g. optimization of spinning reserve and load shedding);
• oscillatory stability (e.g. optimization of control device to improve system damping);
• motor start-up (e.g. determination of start-up times and voltage drops);
Various events can be included in the simulation, including the following examples:
• start-up and/or loss of generators or motors;
• stepwise variation of loads;
• load-shedding;
• line and transformer switching/tripping;
• symmetrical short-circuit events;
• insertion of network elements;
• power plant shut down;
• variations of controller setpoint;
• change of any system parameter.
Because of the symmetrical network representation, the basic simulation function allows the insertion
of symmetrical faults only.

26.2.2

Three-Phase RMS Simulation

If asymmetrical faults or unbalanced networks have to be analyzed, the three phase RMS simulation
function must be used. This simulation function uses a steady-state, three-phase representation of
the passive electrical network and can therefore compute unbalanced network conditions, either due to
unbalanced network elements or due to asymmetrical faults. Dynamics in electromechanical, control
and thermal devices are represented in the same way as in the basic RMS simulation function.
Asymmetrical electromechanical devices can be modelled, and single-phase and two-phase networks
can also be analyzed using this analysis function.
In addition to the balanced RMS simulation events, unbalanced fault events can be simulated, such as:
• single-phase and two-phase (to ground) short-circuits;
• phase to phase short-circuits;
DIgSILENT PowerFactory 15, User Manual

543

26. the integration step size has to be significantly smaller than in the case of a steady-state representation and as a result. • Exact behaviour of HVDC transmission systems. 26. balanced. balanced or unbalanced) and simulation step size settings.. However. • Non-linear behaviour of passive network elements such as transformer saturation. the result object and the event list are defined. 544 DIgSILENT PowerFactory 15. EMT. the synchronous generator excitation voltages and load angles are calculated. unbalanced). so that the dynamic behaviour of passive network elements is also taken into account. and any other device which is active and will affect the time-domain simulation. This is necessary for the following applications: • DC and harmonic components of currents and voltages.3 Setting Up a Simulation Based on the results of a load flow calculation. • Exact behaviour of inverter-driven machines. User Manual . STABILITY AND EMT SIMULATIONS • inter-circuit faults between different lines. The EMT function can also be used for the simulation of longer-term transients. • single.e. controllers and other transient models have to be determined. In the Initial Conditions command (ComInc) dialogue (see Figure 26. • Selecting Calculation → Stability → Initial Conditions.. • Lightning strikes and travelling waves. hence any combination of symmetrical and asymmetrical faults can be modelled. Additionally. The calculation of initial conditions is started by either: • Selecting the stability toolbar. The high level of detail used to represent the modelled network means that all phases and all defined events (symmetrical and asymmetrical) can be simulated. • Overvoltage phenomena in switching devices.CHAPTER 26.1) all simulation settings can be defined.and double-phase line interruptions. As a result of this calculation. all internal variables and the internal operating status of connected machines.3. due to the passive network elements being represented dynamically.3 Three-Phase EMT Simulation Voltages and currents are represented in the EMT simulation by their instantaneous values. RMS or EMT. from the main menu. the calculation time increases. such as the simulation type (i. and then pressing the Initial Conditions icon. are also calculated. all state variables of controllers and power plant models. • Analysis of the exact behaviour of protection devices during faults.2. These settings include: Basic Options The simulation type is selected here (RMS. All of these events can be modelled to occur simultaneously or separately. and the load flow command.

1. Step Size Adaptation Enables the variable step size algorithm.3.1 Basic Options The basic options are used to select the simulation type and the network representation. then the condition dx/dt=0 is checked for all state variables. the power system will be in a steady-state condition.3. iteration limits.3.3. etc. User Manual 545 .1 Verify Initial Conditions If the initial conditions can be fulfilled. References to the result object.. the event list and the load flow command are available for inspecting or editing these objects.1: The Initial Conditions Command (ComInc)Dialogue 26. SETTING UP A SIMULATION Step Sizes Maximum and minimum step size are specified for use by the step size algorithms. Noise Generation Defines parameters of the noise generation for stochastic applications. Advanced Options Includes various error margins. by clicking on the respective icon. damping factors.26. 26. When the Verify Initial Conditions options is enabled. Figure 26. DIgSILENT PowerFactory 15.

PowerFactory calculates an optimal step size that keeps the numerical errors within the specified limits. the behaviour of the system during a transient event is represented with the best accuracy.2. In the case of events (external or internal). the simulation process will speed up without influencing the calculation process. respectively. Please check the following models: ’Simple Grid AVR Common Model. All warnings or error messages issued in the output window should be checked carefully. the step size is always set back to the Minimum Step Size. so that not every point in time throughout the simulation time will be drawn on the virtual instruments plot. even without the application of an external event. In this case the user should analyze the relevant controller or model and its defined initial conditions carefully. This way. It should be noted. PowerFactory automatically increases the step size and speeds up the simulation process considerably.3. User Manual . It is often unnecessary to plot every single calculated time step. If this option is activated. however. A step size controller adjusts the integration step size. that fast changes may not be seen in the reported results. and can be used to speed-up the simulation considerably. STABILITY AND EMT SIMULATIONS If one or more of the state variable derivatives does not equal zero. two integration step sizes are available on the Step Size tab of the dialogue: Electromagnetic Transients/Electromechanical Transients Minimum step size for EMT and RMS simulations.0001 sec 546 DIgSILENT PowerFactory 15. the integration step size for EMT or RMS has to be set. PowerFactory adjusts the step size to the actual course of each state variable at any moment in time. and this reduction in plotted data can also result in a reduced simulation time. As a result. Further parameters to adapt this algorithm can be found on the Step Size Adaptation tab.3.3. the step size for the output graphs can be set.CHAPTER 26.2 Step Sizes 26.1. Based on the local discretisation error. By selecting a larger Output step size.1 Integration Step Sizes When using a fixed step size for the simulation (deactivate Automatic Step Size Adaptation on the Basic Options tab).2 - Some models could not be initialized. Maximum Step Size Maximum step size for the simulation. Typical problems are devices which are overloaded or operate above or below signal limitation from the beginning of the simulation. For this purpose. 26. The error message displayed in the output window might look as follows: DIgSI/err DIgSI/err DIgSI/err DIgSI/err 26. the power system may start ’moving’ from the very beginning of the simulation. when fast transients have decayed.ElmDsl’: Initial conditions not valid ! Automatic Step Size Adaptation This option enables the step size adaptation algorithm. The parameters which are available for the step size are: • dtemt Electromagnetic Transients (typical value: 0.

It is strongly recommended to critically observe the simulation time and the results for different simulation parameters. when analyzing travelling waves. In case of such an interrupt.01) errinc Minimum Prediction Error (typical value: 0.3. In controllers one must consider both the open-loop and the closed-loop time constants. The dynamic model equations of the voltage-controllers (vco) and the power system stabilizers (pss) are solved simultaneously with the electrical generator and passive network equations (stepsize dtgrd).26.5) fdec Speed Factor for decreasing the time step (default value: 2) ddtemt_max Maximum increase of step size (typical values: 0. further step size options are available on the Step Size Adaptation tab. the EMT simulation function allows interrupts for the simulation of “strong" non-linearities (i. and dtgrd for RMS simulation) 26. These interrupts can also occur between time steps. 26. In addition to the Newton-Raphson based algorithm for the solution of “weak" non-linearities (i.3. saturation effects in synchronous and asynchronous machines). For example when you increase the maximum time step the duration of calculating transients may not always increase. User Manual 547 .05 for RMS. it is very important to use the correct time steps for simulations in order to observe the right phenomena in the results.001 sec for EMT) Note: The simulation time can be very sensitive to some of the parameters. asm. For electromagnetic transients. This prevents numerical oscillations and allows much a lower integration step size to cater for power electronics devices.e.01) ninc Delay for Step Size Increase (typical value: 10 time steps) finc Speed Factor for increasing the time step (default value: 1. all time dependent variables are interpolated to the instant of interrupt and the simulation restarts at that point. This is typically negative. e. vco. two-slope transformer saturation or thyristors). 0. These options are: errmax Maximum Prediction Error (typical value: 0.3 Step Size Adaptation If option Automatic Step Size Adaptation is enabled on the Basic Options tab.2 Start Time The start time of the simulation. Note: When setting up time-domain simulations.e. SETTING UP A SIMULATION • dtgrd Electromechanical Transients (sym.2.g.01 sec) • dtout Output (typical equal to dtemt for EMT. Less experienced users are recommended to use the default values. switches. the smallest travelling time would be the upper limit for the minimum time step.3. 26. For the RMS simulation the minimum time step should always be smaller then the time constants in the system.4 Advanced Options The advanced options may be used to tune the performance of the simulation algorithm. DIgSILENT PowerFactory 15.3. If this time step is increased over an “optimal" time step the simulation time may increase as well. pss) (typical 0. allowing the first event to be analyzed to take place at t=0 s.

If an event occurs. All system variables are then interpolated up to the point in time when the event takes place. errsm should be set to: errsm = 10*errlf.e. itrjx Iteration Limit to Recompute Jacobian Matrix (typical value: 5) 548 DIgSILENT PowerFactory 15.3. A higher resolution factor decreases the minimum time interval between events.3. 26. where errlf is the Max. hence two values at the same time. STABILITY AND EMT SIMULATIONS 26. The second method is applied if the option Re-initialize After Event is enabled. one before the occurrence of the event.001 is usually sufficient. If voltage steps are observed. the typical number of iterations required is between 1 and 5.1 itrpx Maximum Number of Successive State Iterations (typical value: 10) alpha_rms Damping Factor (RMS) (typical value: 1) alpha_emt Damping Factor (EMT) (typical value: 0. number of iterations at each integration step which are allowed to reach the max. Under certain conditions . As this would slow down the simulation considerably.4. there are two different options available: Interpolation at user defined events • Calculation of v(t) and v(t+h) as usual.3 Iteration Control errsm Maximum Iteration Error of Nodal Equations (typical value: 10*errlf) The iteration error errsm depends on the nominal power of the machines and the voltage levels. Allowable Load-Flow Error for each Bus. The default value of 0.4. after switching operations up to 25 iterations may be observed.i. Checking is best done by plotting some voltages at generator busbars. User Manual .99) 26.1 Event Control Resolution Factor The value entered here (parameter name: kres) determines the time interval used to synchronize events.CHAPTER 26. Further parameters can be changed to control the simulation algorithm. erreq Maximum Error of Model Equations (typical value: 1 itrlx Maximum Number of Iterations (typical value: 25) itrlx specifies the max. PowerFactory uses special numerical methods to allow this without numerical oscillations.3. tolerable bus-error errsm. Every time an internal or external event occurs (usually between two integration time steps). During the transient simulation process. As an adequate starting value.4. PowerFactory interpolates all state variables up to the moment in time at which the event has occurred and restarts the simulation from there. In the case of large disturbances it is possible that a very large number of events occur almost simultaneously. and one after. PowerFactory executes all events that occur within a time interval of duration kres*dtmin at the same time. Re-Initialize After Event • Calculation of v(t) and v(t+h).2 Integration Control errseq Maximum Error of State Equations (typical value: 0. the value of errsm should be reduced. and the simulation is started from there.

characteristic time constants can be extremely short (i. When using a conventional. This variable can be used as an indicator for the synchronous operation of a large transmission system. This algorithm is (slightly) slower in case of small step sizes but converges much better in case of large step sizes. But if excessively large step sizes are used. the numerical solution becomes unstable. explicit numerical integration algorithm. A typical application of this type of algorithm is the simulation of long-term phenomena . if power electronics are involved. the reference machine is displayed in the output window. in which the simulation step size is increased considerably after fast transients have decayed. In this case dynamic model equations and network equations are solved simultaneously. and the algorithm will automatically smooth fast variations. 26. When fast transients have decayed. With the PowerFactory A-stable algorithm. The first case should be used if the islands are re-synchronised again later in the simulation. It is usually the “Slack"-machine of the load-flow calculation. Even if power electronics devices are usually equipped with very fast controls. such as Runge-Kutta (not an Astable algorithm). In case of several isolated islands. Best choice for classical transient stability applications. If some very fast modes are not of interest. PowerFactory uses an A-stable numerical integration algorithms for all models to solve the simulation.4.3.4.where it is necessary to increase the simulation step size to the range of minutes. 1ms).3. SETTING UP A SIMULATION 26. the A-stable algorithm still allows reasonable step sizes.4. using a classical integration algorithm would require the use of step sizes significantly smaller than the smallest time constant of the system. However. This variable is then called dfrotx and can be chosen and displayed from the variables of all synchronous generators in the system.3.4. PowerFactory offers the option of using one reference machine for the whole system (Global Reference System).5 Reference System Local/Global Reference System The PowerFactory stability analysis uses the angle of a reference machine and refers all other angles to this reference angle. User Manual 549 .26. After running initial conditions. In all other cases the option (Local Reference System) should be used because it leads to a higher numerical stability and to faster simulation times. or to use an individual reference machine for each island.7 A-stable integration algorithm for all models If you enable this option.6 Calculate Maximum Rotor Angle Deviation PowerFactory can also calculate the maximum deviation between the rotor angles between the synchronous machines in the system. Such a method (Relaxation Method) means a mutual solution of dynamic model equations and network equations until convergence is reached: This algorithm is fast for small step sizes but fails to converge when the step size is increased. DIgSILENT PowerFactory 15. etc. even if fast modes have fully decayed and are no longer apparent in the system.3. even if a stability model with steady-state equations for the electrical network is used. This is a numerically very efficient approach. Typical applications are longer term simulations.e. the step size can be adjusted to the speed of slower transients. the step size can be adjusted to the actual course of all state variables without considering numerical stability. otherwise it would be numerically instable. Hence. even if fast modes are present in the system. a large step size can be selected from the beginning. the integration step size must be adjusted to the eigenvalues of a system. at which the relaxation method would fail.4 Signal Buffer 26. 26. Another typical application are systems with power electronics.3.

that it is also possible to choose the usage of an A-stable algorithm for some element models only (not for all models). The random number generator can be selected to be automatic (by selecting option auto). With the A-stable algorithm. in which case the random seed of the noise generator can be selected manually from "A" to "K".3. It should be mentioned. which is the default value and the most commonly used.3. 26. 550 DIgSILENT PowerFactory 15.5 Noise Generation The Noise Generator element (ElmNoise) can be used in a transient simulation to produce a noise signal based on random numbers. so that it is possible to run just a part of the models with the A-stable algorithm (for example the power electronic converters or fast controllers).3. the A-stable algorithm cannot be described as using simplified models but as a different type of numerical integration algorithm.Load Flow There are further options which can influence the simulation process and its results. the influence of protection devices or various controller models can be neglected. User Manual . Thus the noise signal will look the same in every simulation. This option is available in the dialogues of the elements. the random number generation method can be selected.6 Advanced Simulation Options . Hence the chosen models or protection devices will be ignored during the simulation as well as in load flow and other calculations. 26.2.CHAPTER 26. STABILITY AND EMT SIMULATIONS Note: A requirement for using the A-stable integration algorithm is that just “true" input and output signal variables are used for exchanging information between different models. the results of a former simulation can be reproduced exactly. In the load flow command dialogue (ComLdf. This is illustrated in Figure 26. see also Chapter 21: Load Flow) on the Advanced Simulation Options tab. the option renew may be selected. Alternatively. On the Noise Generation page of the ComInc dialogue.e. Hence. these systems can be analyzed with reasonable step sizes. i.

User Manual 551 .4 Result Objects During an EMT or RMS simulation. there is the possibility to ignore all controllers and mechanical elements with the option Ignore Composite Elements. If there are only some specific model types one would like to neglect in the simulation. a large number of signal variables are changing over time. According to the controller models. 26.2: Advanced Simulation Options in the ComLdf Command Dialogue The options available for the consideration of protection devices are: • none No protection devices are considered in the calculations • all All protection devices are considered • main Only the protection devices are in operation.3. To reduce the available data and to narrow down the number of variables to those necessary for the analysis of each particular case. RESULT OBJECTS Figure 26.4. Ignored Models. a selection of these signals for later use has to be defined. DIgSILENT PowerFactory 15. they can be moved from the left window Considered Models to the right window. which are defined as ’main’ devices • backup Only the ’backup’ protection devices are considered.26.

STABILITY AND EMT SIMULATIONS Therefore.4. right-click on the desired element in the single-line graphic and select Define → Variable Set(Sim).1 for the Initial Conditions (ComInc) dialogue. have result object references.CHAPTER 26. Figure 26. The right-arrow button ( ) is used to edit the result object itself.2 552 DIgSILENT PowerFactory 15. When editing the output variables press this Edit button and then Contents to get access to the list of variables stored inside the result object.1. as depicted in Figure 26. An easier way to edit or inspect the result object is to press the icon on the main toolbar. or to edit the contents of the referenced result object.3. or to select the Data → Stability → Result Variables option from the main menu.. User Manual . Result objects (ElmRes) are treated in detail in Chapter 17 (Reporting and Visualizing Results).1: Result Object Reference Such a result object reference refers to the currently used result object. The simulation function needs the reference to a result object to store the results.. that produce signals.4. The downward arrow button ( ) is used to select or reset the reference. See also Figure 26.4. This will pop up the corresponding ElmRes edit dialogue. This will enable the user to edit the contents of the currently selected Result object in the Initial Conditions command dialogue. To add variables of different elements to the result object for RMS and EMT simulations. The command dialogues for calculation functions. as shown in Figure 26. one or more result objects containing the result variables can be configured.

there is the possibility to save the result object of a previous simulation simply by copying the result objectAll calculations and renaming it to something else. User Manual 553 . If the results of two different simulations are to be displayed. Note: Most of the variables for RMS and EMT simulations are identical. in one virtual instrument.4(Result Objects).1 Saving Results from Previous Simulations The variables to be monitored are stored (by default) in the result object All calculations.4.4.4. The results of the variables in the current simulation are stored in this file also. 26. If desired. See also Section 26.2: Defining a Variable Set for a Line Element This element will then be monitored during the simulation.g.26. A browser window is automatically opened. e. This can be done easily in the data manager. the variables of interest to be recorded can then be selected. RESULT OBJECTS Figure 26. and by double-clicking on the variable set icon ( ) of the relevant row. In the following simulation. The result object can be found in the currently active study case. the object can be renamed to something more appropriate. the default result object All calculations will be overwritten with the new DIgSILENT PowerFactory 15. Nevertheless there may exist variables that are valid for EMT but not for RMS calculations. a second result object will be created with the name All calculations(1). Copy the result object and paste it into the same study case. It is advisable to only use variables for the calculation which is currently being performed. Following this.

To perform a simulation scan: 1. Minutes. Enter a Name and Description for the Simulation Scan (IntScn) object. 26. and other variables.5. Edit ( ). Action Select whether to Display Message or Stop Simulation if a limit is violated. For the variables scan module. or Show the simulation scan Modules. User Manual .5. Click Modules and then select New Object scan objects are described in the following subsections.2 (Plots). Set the Time Step to define the intervals at which the scan should be performed. 554 DIgSILENT PowerFactory 15. If an out of step condition is detected. to define a Simulation Scan object. stops the simulation. Stop Simulation.5. select ( ).1 Frequency Scan Module The frequency scan module (ScnFreq) monitors frequency at all nodes and triggers a display message or stops the simulation if a limit is violated. and Minimum Limit. On the Calculation of Initial Conditions (ComInc) dialogue select Perform Simulation Scan.5 Simulation Scan Simulation Scan modules can be used to monitor frequency. and the Variable to be monitored must be entered. or trips the generator/s that have lost synchronism.2 Loss of Synchronism Scan Module The loss of synchronism scan module (ScnSync) monitors the internal generator model signal “Out of Step" of all calculation relevant machine (ElmSym). an Element (*Elm) must be selected. and trigger events accordingly. Minutes. Maximum Limit.3 Variables Scan Module The variables scan module (ScnVar ) monitors an Element variables and triggers a display message or stops the simulation if a defined limit is violated. Set the Time Step to define the intervals at which the scan should be performed. voltage. and Seconds. Activation Time Define the time at which monitoring should start (till end) in Hours. but the copied results will not be modified and can be displayed together with the new simulation results in one plot. Simulation 4. 2. For further information see Chapter 17: Reporting and Visualizing Results. 26. and Seconds. Settings are as follows: Frequency Setting Define the frequency settings Nominal Frequency. 26. synchronism. Action Select whether to Display Message.5. STABILITY AND EMT SIMULATIONS results. 26.CHAPTER 26. 3. it triggers a display message. or Trip Generator if an out of step condition is detected. Subsection 17. Activation Time Define the time at which monitoring should start (till end) in Hours.

the selected Action will be performed for all violations.5. where a Voltage Scan module has been defined. 26.) for more than the Minimum Voltage Violation Time. The user can continue the simulation following a Stop Simulation Action by pressing Start Simulation (ComSim).u. 0.1 p. the selected Action will only be performed for the first of each violation.5. define the Recovery Voltage and Voltage Recovery Time. the simulation will continue without performing the selected Action. Optionally select to conduct a Continue Scan (see section 26.26. User Manual 555 . When the voltage recovers to above the Recovery Voltage. Minutes. Set the Time Step to define the intervals at which the scan should be performed.72 p. The module starts scanning at the Activation Time of 2.5.1. Action Select whether to Display Message or Stop Simulation if a limit is violated. Optionally select to conduct a Continue Scan (see section 26. and the Minimum limit and Minimum Voltage Violation Time.) for greater than the Maximum Voltage Violation Time.5. If the voltage is below the Minimum Limit (in this example.0 seconds. and Seconds. If the voltage decreases below the Recovery Voltage the “start time" is recorded. Activation Time Define the time at which monitoring should start (till end) in Hours. DIgSILENT PowerFactory 15. Depending on whether Continue Scan is selected: • If Continue Scan is not selected.4 Voltage Scan Module The voltage scan module (ScnVolt) monitors voltage at all nodes and triggers a display message or stops the simulation if a defined limit is violated. Activation Time Define the time at which monitoring should start (till end) in Hours.5. the selected Action will be performed.) for greater than the Voltage Recovery Time a message will be displayed in the Output Window. • If Continue Scan is selected. Set the Time Step to define the intervals at which the scan should be performed. Voltage Limits If Voltage Limits is checked.5.u. For subsequent violations. Minutes. Action Select whether to Display Message or Stop Simulation if a limit is violated. or above the Maximum voltage (1.u. define the Maximum limit and Maximum Voltage Violation Time. and Seconds.5 for details). SIMULATION SCAN Setting Define the variables Maximum Limit and Minimum Limit.5 for details). If the voltage is below the Recovery Voltage (0.5 Simulation scan example Consider the example simulation response shown in 26.72 p. the module checks that the voltage has recovered within the time span limit. 26. Voltage Recovery If Voltage Recovery is checked.

• From the main toolbar by pressing the Edit Simulation Events icon. There are several ways to access Events objects: • From the Data Manager. STABILITY AND EMT SIMULATIONS Figure 26. See Chapter 11: Study Cases. as they apply to time-domain simulations.6. Note that a duration for the “3p SC Fault" is not specified. A list of the currently defined events will be displayed including the set simulation time. when the event will occur. User Manual . ). 556 DIgSILENT PowerFactory 15.9 (Events) for a detailed description of the event types.6 Events (IntEvt) This section provides a general description of Events.1: Example voltage simulation scan 26.1 shows an example set of events. • From the Calculation of Initial Conditions ( ComInc) dialogue. it is possible to select ( or Show the Selection of Simulation Events. in the Simulation Events/Faults object stored within the Study Case.CHAPTER 26. and the related object. rather. Section 11. “Clear SC Fault". Edit ( ). another event is created to clear the fault. Figure 26.5.

as can be seen in the Simulation Events object dialogue in Figure 26. as shown in Figure 26.6.26. EVENTS (INTEVT) Figure 26.2 The events can also be modified during a simulation by stopping the calculation. editing the events and continuing the simulation. use the icon in the toolbar.6.6. User Manual 557 .1 The event type can be chosen from the list in the element selection dialogue which pops up.6. DIgSILENT PowerFactory 15.1: The Event Object Including a Set of Events When creating a new event.

which are now grey in colour. User Manual .. the icon on the DIgSILENT PowerFactory 15. because the simulation could be restarted from this point on... When the simulation is finished or is stopped manually.. are displayed in a grey font style and can no longer be edited or changed.→ Load Event or Define. During a simulation all previous events (i. → Switch Event Define.6.e.7 Running a Simulation Upon successful calculation of the initial conditions (i. double-click on the desired cubicles to create switch events. the user can right-click on an element and then select an element-related event such as Define. events which have already occurred).e. 558 ). Additionally. or when the simulation is already running. the events which are still to come in the simulation can be altered and new events can be created. Note: At the end of a simulation the event list shows all events. → Short-Circuit Event. They can no longer be modified for this simulation. so the simulation time is reset to the beginning.CHAPTER 26. STABILITY AND EMT SIMULATIONS Figure 26. 26.. To change the events for a new simulation one must first initialize the calculation again ( ). execution of ComInc main toolbar will be activated and can be pressed to start the simulation..2: Defining a New Simulation Event An alternative means of defining events is as follows: upon calculation of the initial conditions ( ).

and therefore have a clear need for accurate methods and tools for creating accurate transient models for stability analysis. User Manual 559 . For systems and configurations for which no IEEE models exist. The simulation is then continued by pressing the icon again.26. (ComSim) dialogue. it may be continued by pressing the and entering a new stop time. the stop time may also be entered relative to the current simulation time. This facilitates highly accurate system modelling.1 provides an overview of the PowerFactory modelling approach. Additional events can be created and results may be viewed while the simulation is paused. This demand led to the development of highly flexible and accurate DIgSILENT PowerFactory time-domain modelling features. After a simulation has finished. Note: Click on figure labels to link to the relevant section. icon or the icon on the main A running simulation may be interrupted by pressing either the toolbar. but instead building a new block diagram of the individual controller/mechanical system to represent the device. exact models can be created in PowerFactory . such as wind generators. In the majority of cases the standard IEEE definitions for controllers. and the system should show a response similar to a real system. DIgSILENT PowerFactory 15..8. Pausing and continuing the simulation may be done as often as required. The predefined sets of parameters will allow a favourable and reasonable behaviour of the analyzed system. This approach is often also applied to operation analysis. For this purpose. Utilities and consultants often conduct system operation performance and optimization studies. this approach might be acceptable. HVDCsystems. 26. In cases when manufacturers are able to supply exact controller models including real parameters. powerful tools for user defined modelling are required. as discussed in this chapter.8. In this case. This includes complex operation analysis and special component planning problems. MODELS FOR STABILITY ANALYSIS The simulation is performed for the time interval between the start time defined in the initial conditions command ComInc. highly specialised. the system model can be improved by not using the IEEE standard models.8 Models for Stability Analysis Stability analysis calculations are typically based on predefined system models. Figure 26. which can be specified in the simulation icon again. prime movers and other associated devices and functions are used. and the stop time (parameter name: tstop). etc. For planning purposes.

i. static VAr compensators. The common models are based on the DSL block definitions and are the front-end of the user-defined transient models. This is one aspect of the complexity of a transient stability study. single transient model from which the basic set of system differential equations can be obtained. User Manual .CHAPTER 26. for generators. Depending on the accuracy of the implemented model.1: Overview of Modelling Approach 26. STABILITY AND EMT SIMULATIONS Figure 26. which combines both graphical and scriptbased modelling methods. each of which may be a combination of other models. motors. Given this complexity of a transient analysis problem. The built-in models or elements are the transient PowerFactory models for standard power system equipment.8. etc. large-signal validity. All these time-domain models are ultimately wired together into one large.9 System Modelling Approach System modelling for stability analysis purposes is one of the most critical issues in the field of power system analysis.e. the PowerFactory modelling philosophy is targeted towards a strictly hierarchical system modelling approach. • The built-in models and common models. The other aspect results from the often large set of time-domain models that are required. The composite frames enable the 560 DIgSILENT PowerFactory 15. • The composite models are based on composite frames and are used to combine and interconnect several elements (built-in models) and/or common models. based on the "DIgSILENT Simulation Language" (DSL). form the basic building blocks to represent transfer functions and differential equations for the more complex transient models. nearly any result could be produced and arguments could be found for its justification. The basis for the modelling approach is formed by the basic hierarchical levels of time-domain modelling: • The DSL block definitions. available system parameters and applied faults or tests.

It may seem unnecessary to include steps 2 and 3: it would be possible to create customized transient models for each generator directly.9.1 shows a typical configuration of a synchronous generator with power system stabilizer. Depending on the network and the required detail in the calculated results.1: Example of a Composite or Power Plant Model Figure 26. voltage controller. Transient models for each required controller type or unit type have to be defined (Model/Block Definition). SYSTEM MODELLING APPROACH reuse of the basic structure of the composite model. and to link these models to a generator without having to define a diagram first. For each generator. 2. would mean that one would have to create a new voltage controller. this time between the generic power plant diagram (Composite Frame) and the individual power plant (Composite Model). prime movers and primary controllers. the transient models of the individual controller must be customized by setting the parameters to the correct values (Common Model). 3. for each generator in the system. Figure 26. e.g. primary controller. The relation between these models and the way that they are used is best described by the following example. however. Often the design of many of these voltage controllers will be similar. such analysis may ask for a detailed modelling of the voltage controllers. the following actions are required: 1. For each generator. DIgSILENT PowerFactory uses two key objects in creating composite models. or any other important equipment for all large generators in the system. To omit the need of creating copies of these controllers for each generator and to avoid redundant copies of controllers or also of whole generator models. To create this kind of model. The primary controller and prime mover can be summarized as the primary controller unit model.9. 4. Here the same relationship as that between individual controller (Common Model) and controller definition (Model Definition) is used.26. User Manual 561 . with ’burned-in’ parameter settings. the diagram and the customized transient models are to be grouped together to define an unique ’composite’ generator model (Composite Model). A diagram has to be made defining the connections between the inputs and outputs of the various models (Composite Frame). which can be compared to the element definition of the different elements: DIgSILENT PowerFactory 15. and prime mover model. Suppose the frequency deviation due to the sudden loss of a fully-loaded 600 MW unit in a particular network is to be analyzed.9. This.

9.CHAPTER 26. however. These slots are then interconnected according to the diagram. e.9.3 shows a Composite Frame (BlkDef ) which has one slot for a synchronous machine. the input of this slot is unused and the output is assumed to be constant over the entire simulation.2.11. Figure 26.3: Defining DSL Models). converters. In such cases. The usage of composite models with a composite frame. which uses this composite frame.6). • The voltage controller. The input and output variables have to fit with the slot definition of the slot that the model is defined for. This composite frame is basically a schematic diagram containing various empty slots.4 This means that such elements are pre-configured elements which do not need a specific model definition. • The schematic diagram in Figure 26. User Manual . are user-defined Common Models.11 (User Defined (DSL) Models). Now the specific synchronous generator. can be inserted into the slots. and one for a voltage controller (vco slot).9. The following diagrams explain the relation between the Composite Model (which is using a Frame as type) and the Common Model (based on a block diagram as type) in detail. in which controller or elements can be assigned. The design and creation of user defined common models using the "DIgSILENT Simulation Language" (DSL) can be found in Section 26. STABILITY AND EMT SIMULATIONS • The Common Model(ElmDsl) combines general time-domain models or model equations (a block definition) with a set of parameter values and creates an integrated time-domain model.9. busbars. see Section Composite Block Definitions (part of Section 26. which combines a model definition with specific parameter settings. one for a primary controller unit (pcu slot). There are predefined definitions as well. see Figure 26. Here different blocks are defined and connected together according to the diagram. Not all slots of the composite model must necessarily be used. • The Composite Model(ElmComp) connects a set of time-domain models inside a diagram (a composite frame) and creates a ’composite model’. so that the user can create her/his own model definitions. There can also be empty slots. shows a list of the available slots and the name of the slot.5 The ’front-end’ of all user-defined transient models is always a common model (ElmDsl). see Figure 26. etc. references the definition of a composite frame. and primary controller unit. Any kind of element which is able to provide input or output variables. The slots in the composite frame are pre-configured for specific transient models. voltage controller or primary controller unit model can be inserted into these slots. The composite model. which looks similar to the composite frame (shown in Figure 26. • The synchronous machine that is used in the Composite Model is called a Built-In Model. and the common model with its block definitions are described in the next sections.9. 562 DIgSILENT PowerFactory 15. • The Composite Model(ElmComp).g. • The common model has a reference to the Model Definition (BlkDef ).

9.9.2: Example of a Composite Model Using the Frame "Frame_Generator" Figure 26. SYSTEM MODELLING APPROACH Figure 26.26.3: Composite Frame "Frame_Generator" DIgSILENT PowerFactory 15.9. User Manual 563 .

User Manual . STABILITY AND EMT SIMULATIONS Figure 26.9.CHAPTER 26.5: Example of a Common Model Using the Definition "vco_simple" 564 DIgSILENT PowerFactory 15.9.4: Generator "G1" (Built-In Model) Figure 26.

DIgSILENT PowerFactory 15.7.1 The Composite Model A composite model element (ElmComp) can created using the New Object ( ) icon.6: Example of a Model Definition "vco_simple" 26. The next step is to select the composite frame. as depicted in Figure 26. The composite frame can be stored either in the global library or in the local library. and is conceptually similar to a type definition for an electrical element. Existing controllers or models can be assigned to a slot manually by right-clicking the slot and selecting Select Element/Type.7.9.26.9. located in the toolbar of the data manager and selecting Composite Model from the available options.9. A data manger window will pop up and the user can then browse the grid for the element to insert into the selected slot. The composite model then shows the list of slots in the composite frame as shown in Figure 26.9. User Manual 565 . SYSTEM MODELLING APPROACH Figure 26.9.

User Manual . similar to (for example) a transformer element.2 (The Composite Frame) and Figure 26. it is possible to edit the assigned element by simply right-clicking and selecting Edit Element/Type. When a standard composite model is available for the selected object.7: Editing the Composite Model (ElmComp) Dialogue When inserting controller models into a slot.9. • The static VAr system.6). a block definition has to be selected prior to setting the model parameters (see Section 26. If an element is assigned to a slot. A faster method for defining standard composite models is to right-click on an object in the single line diagram and select Define. which is automatically created when no composite model yet exists for the selected object.. the menu entry Reset Element/Type will not only clear the marked slot but also delete the built-in or common model. 566 DIgSILENT PowerFactory 15.2 (The Composite Frame). If no suitable model is found. These settings are explained in detail in Section 26. a list of the available controllers is shown.. PowerFactory will automatically jump to the project Library and show a list of available user defined models (ElmDsl). so that its parameters can be defined. Note: Depending on the settings of the individual slot. if it is stored inside the composite model in the data manager.9. To create a new controller element select New Element/Type from the slot’s contextsensitive menu. Selecting a model definition from the project library or the global library will open the element dialogue of the newly-created common model.CHAPTER 26. Selecting a controller will add it to the composite model. so that it is empty again.9. The right-mouse button menu entry Reset Element/Type will reset the slot.9. • The asynchronous motor and generator. STABILITY AND EMT SIMULATIONS Figure 26. Standard composite models are available for: • The synchronous motor and generator. it is often the case that the controller element has not yet been created. from the context menu of the element.

A slot assignment is invalid when a model has been assigned to a slot which is not suited to receive this kind of model. the template and the target directory.The options defined for each slot are important. and are described in the paragraph Classification in Section 26. the two step response tests. The dialogue can be seen in Figure 26. The contents of a composite model are shown in the data manager where the composite model is treated as a normal database folder.9. Figure 26. are normally not stored in the composite folder. The slot update will try to re-assign each model found in its contents to the corresponding slot. User Manual 567 .9. but in the grid itself.8: Step Response Command (ComStepres) Dialogue DIgSILENT PowerFactory 15. Figure 26.9.9. can be specified.8. Next to the references to the composite model. which will be created. When Execute is pressed. such as synchronous machines or static VAr compensators.9 shows this folder in the data manager. SYSTEM MODELLING APPROACH Slot Update The Slot Update button in the composite model (ElmComp) dialogue will re-read the slot definitions from the composite frame and will cancel all invalid slot assignments.9.2 (The Composite Frame). PowerFactory will create a new folder in the current project named Step Response Test.e. Basic power system equipment.26. Step Response The Step Response button in the composite model (ElmComp) dialogue will activate the Step Response command (ComStepres). i. All built-in models and common models which have been created for a specific composite model are stored in that composite model itself. a voltage controller cannot be assigned to a slot defined for a primary controller model. The study case to be activated can also be selected.

2 The Composite Frame A composite frame is a block diagram which defines two or more slots. only slots may be used. of the composite model can be tested. named according to the composite model which is to be tested. you can change any controller settings without changing your network.CHAPTER 26. their input and output signals. The user can switch between these two study cases and her/his previously-used study cases by activating and deactivating them. 26.9. After testing the controller. A composite frame is defined graphically by drawing it. Therefore. The main difference is that instead of common blocks. To create a new composite frame select the Insert New Graphic icon on the main toolbar (in the graphics window) and then select Block/Frame Diagram and press Execute as shown in Figure 26.9.10 This new block definition will then be automatically created in the local library.9. and the connections between them. a second folder is created. STABILITY AND EMT SIMULATIONS Figure 26. Drawing a composite model frame is similar to drawing a normal block diagram. Additionally there will be two new study cases in which a step response for the AVR and the PCU. Here the simple test grid can be found including only the generator. respectively. the folder Step Response Test can be deleted completely without loss of information in the original network.9: Step Response Folder in the Data Manager Inside the Step Response Test folder. User Manual . 568 DIgSILENT PowerFactory 15. Note: There is now no longer any connection between the original elements and the new elements of the composite model. the complete composite model and a load.

26. A slot is then created by selecting the icon in the graphics toolbox and positioning the slot on the drawing surface by clicking once at the desired location. An empty slot will be drawn on the page.9. This is similar to placing elements in the single-line diagram. To define the slot’s input and output signals and different parameters.9. The slot edit dialogue will pop up as shown in Figure 26. SYSTEM MODELLING APPROACH Figure 26.9.10: Creating a New Composite Frame An empty diagram of the frame will appear in the graphics window. User Manual 569 . DIgSILENT PowerFactory 15.11. edit the slot by double-clicking it.

11: Slot Dialogue (BlkSlot) 26.2 Assigning a Block Definition to a Slot A block definition (BlkDef ) can be assigned directly to a slot. ’vco slot’). 26. and it is therefore recommended to name this element according to which slot it will be assigned (e. STABILITY AND EMT SIMULATIONS Figure 26.1 Name and Sequence The name of the slot will appear later in the composite model dialogue.CHAPTER 26.g.2. 570 DIgSILENT PowerFactory 15. User Manual .2.9.9. The Sequence parameter defines the order of the slots appearing in the composite model dialogue.9. This option will simplify the handling of the slot and prevent errors due to miss-matched signal names of slot and assigned block.

When the slot refers to an outside block definition. the slot may be changed as well. if the newly-defined slot ought to represent a synchronous machine in the frame diagram. model will be created When this option is activated. If the reference to the definition is invalid or changed. A filter for a specific (part of an) element name can also be defined. for example. edit the slot by double-clicking it for the “Block Definition" in the dialogue.9.9. When the block definition is selected (in our example the “ElmSym. Therefore.26.3 Filter for Class/Name Filter There is also the possibility to specify a filter for the class name and/or for the model name to be inserted.e. Therefore. which should be assigned to this slot later. Model must be stored inside This option is activated by default.1: The Composite Model) will automatically create a DSL model and ask for a block definition from the library. In this case. beware that this reference is also inside your project.BlkDef"). the slot will then show the right inputs and outputs of the block definition. will be removed from the slot.2. The filter for the class name will automatically be entered. A controller should. More information about drawing composite frame diagrams can be found in Section 26. DIgSILENT PowerFactory 15. PowerFactory then will only allow the element class “synchronous machine" to be inserted into the slot. Some predefined block definitions can be found in the global library in the path Library/Models/Built-in. Local. the voltage or frequency of an AC voltage source ElmVac may be controlled by an external function. when only this type of controller is to be inserted into this slot.4 Classification The classification options only effect the external behaviour of the slot. This means that when a Slot Update is executed in the composite model. and no other model can be. Note: When a block definition is assigned directly to a slot. Not all input or output signals of built-in elements or common models have to be used and defined in the slot. As an example. which is the model inserted into the slot of the composite model. PowerFactory will only search for elements which are stored inside the ElmComp. the input and output as well as limiting signals will disappear from the slot dialogue. i. 26. a predefined block definition can be chosen to insert the input and output signals to this slot available for the element ElmSym. There is always the need to create a common model. This makes sense when (for example) only synchronous machines should be assigned to the slot. only the input/output signals are set automatically. e.9. Linear The slot representation in the frame diagram will be as a linear or non-linear model. A slot may only have an input or an output signal. the slot for the source will only have two input signals u0 and f0. Automatic. When clicking on the Ok button. User Manual 571 . the synchronous generator in a plant model. For example. the class name ElmSym* would be entered. Now the block definition can and choose the select button be selected.10. SYSTEM MODELLING APPROACH To assign the external form of a block definition to the selected slot. assign a block very carefully.1 (Drawing Composite Block Diagrams and Composite Frames). The internal equations/definitions of the block definition are not implemented in the slot and the slot itself remains empty. only be assigned to a slot. A reference to models which are stored outside.g.2. the function ’Slot Update’ (see Section 26. the type of controller or built-in element. 26.9.

12 uses the block definition "vco_Simple". Typically the model definition is implemented as a block definition.9.6 Variables Input and Output Signals The input and/or output signal(s) have to be defined for each slot.3 The Common Model is the front-end object for all user-defined block definitions. The difference is only in the graphical representation in the block diagram. It is therefore recommended to first position and edit all slots and to draw the signal connections thereafter. amplification factors. 26. but also the block diagrams that are ready-shipped with the PowerFactory program. Two kinds of parameters are supported: • Scalar parameters. A model definition contains block references which may in turn either point to a primitive block definition (see Figure 26. • Two and three dimensional array parameters. These signals are handled by PowerFactory exactly like normal input signals. The common model shown in Figure 26. STABILITY AND EMT SIMULATIONS 26.CHAPTER 26. 572 DIgSILENT PowerFactory 15. but directly as a primitive block definition (Figure 26. such as that shown in Figure 26. Each block definition generally has one or more parameters which can be changed to define the model’s behaviour. The structure of the block definition is thus recursive and the user should check that this recursive structure does not contain circular references to composite block definitions.5 Upper and Lower Limitation Limiting Signals There is also the possibility to enter ’limiting signals’. The common model element (ElmDsl.9.e. is it possible to connect the slot with signal lines to other slots.11 (User Defined (DSL) Models). It is also possible to implement the model definition not as a block definition.14). The given input and output signal names in this slot dialogue have to match the input/output signals of the given transient model exactly.9.2. which are used in the DSL lapprox()/lapprox2() and sapprox()/sapprox2() functions. Only after one or more input and output signals have been defined for a slot. A description of how to use and create DSL models can be found in Section 26. A primitive block definition contains one or more DSL expressions and forms a basic block for more complex transient models.14) or to a another composite block definition (see Figure 26.9. The available signal names for the Built-In transient models (Elements) can be found in the corresponding Appendix C: Technical References of Models. or the signals will not be connected properly and an error message will result. The common model combines a model or block definition with a specific set of parameter values. These signals will be shown as inputs on the top or bottom of the slot.9.2.9.9. setpoints. i. This means that user-defined transient models. 26.9.15). etc. offsets. coded using DSL.13. cannot be used other than through a common model. User Manual .

26. User Manual 573 . SYSTEM MODELLING APPROACH Figure 26.12: Common Model for the VCO DIgSILENT PowerFactory 15.9.9.

Using a Sub-Definition Figure 26. User Manual .13: Block Definition of the VCO.CHAPTER 26.9. STABILITY AND EMT SIMULATIONS Figure 26.14: Implementation of the Limiter Block.9. Using a DSL Routine 574 DIgSILENT PowerFactory 15.

9. The block/model definition has to be selected first. The common model then displays the list of available parameters and arrays from the block diagram. Defining a Sub-Block To create a common model. as shown in Figure 26. All parameters are listed on the first page of the common model.9. User Manual 575 . this definition is either stored in the global library or in the local library.15: Implementation of the Controller. Similar to the composite frame.9. and their values can be specified there. SYSTEM MODELLING APPROACH Figure 26.16.26. DIgSILENT PowerFactory 15. use the New Object ( ) icon in the toolbar of the data manager and select Common Model.

then these arrays are displayed on the second page (for simple characteristics) and third page (for two-dimensional characteristics) of the ElmDsl object.9.9.16: Common Model with Parameter List If the selected block definition uses one or more arrays in its definition. 576 DIgSILENT PowerFactory 15.17 an example is shown for a 13x4 array definition.CHAPTER 26. User Manual . In Figure 26. STABILITY AND EMT SIMULATIONS Figure 26.

) = function(u_0.. y_1. jump to the previous page and back again to update the characteristic..10 The Composite Block Definition A composite block diagram of the model definition is a graphical representation of a mathematical transfer function. 26. y_1. ..26. ...) where y_0. represent output signals 0. . jump to the previous page and back again to update the characteristic. . . which produces one or more output signals as a function of one or more input signals. If the number of rows is changed. If one of these numbers is changed. 1...9.... insert the number of rows in the first cell and the number of columns in the second cell.10. THE COMPOSITE BLOCK DEFINITION Figure 26. represent for input signals 0.. User Manual 577 . A block diagram may thus be described as: (y_0. A block diagram may also have limits (minimal and maximal values) as input signals. the number of columns is set automatically.. insert the number of rows in the first cell. u_1. . u_1..17: Common Model with Array List The characteristics are defined as follows: Characteristic In the row labelled ’Size’. Block diagrams consist basically of the following elements: DIgSILENT PowerFactory 15. 1. Two-Dimensional Characteristic In the row labelled ’Size’. These signals are all functions of time. and u_0.

It is allowed to refer to the block definition more than once in the same block diagram. Note: The composite frame and the model definition are very similar and their usage is almost identical. Valve Characteristics. STABILITY AND EMT SIMULATIONS • Summation Points which produce the single output y=(u_0+u_1+. An example of a simple block diagram. This way. Signal lines are directed branches. on the upper and lower side of the box. twice or more in the same model definition. respectively.CHAPTER 26.. and can be found in the PowerFactory tree under Database |Library|Models|Global_Macros.1: Example of a Simple Block Diagram 578 DIgSILENT PowerFactory 15. When creating one or the other PowerFactory recognizes the class when you place the first slot or block. Dead Bands.. These predefined DSL primitives may be copied and altered for specific needs.10. a summation point and a standard PI block. A block reference may either point to another composite block definition or to a primitive block definition.. Block references can be looked upon as macros that insert a low-level block definition inside a composite block diagram definition. If you place a block () first. This creates an empty square A block reference is created by using the which can then refer to any existing block definition in the library.1 (Drawing Composite Block Diagrams and Composite Frames). Figure 26. it will show the input. it is possible to use a particular PID-controller.. After the block reference has been edited..1. is shown in Figure 26. See also Section 26. however ensure that the order of the parameters is not changed. A single output line may be branched off and connected to more than one input terminal. Signal lines may then be connected to these points.10. etc.. connecting input and output signals.. User Manual .10. the icon for the slot will become inactive.= u • Block References which are used to include other block definitions. for instance. The PowerFactory program is shipped with a large set of primitive block diagrams for most common controller elements like PID-controllers.) • Switches which produce the single output y=u_0 or y=u_1 • Signal Lines which produce one or more outputs from one input: y_0 = y_1 =. The user may change the name of any parameter. PowerFactory inserts all available parameters of the referred block.. output and limiting signal connection points of the referenced block definition as one or more coloured dots on the left and right side.) • Divisors which produce the single output y=(u_0/u_1/.. icon in the graphics toolbox. The order is important so that the right parameter is assigned to the parameters inside the block definition.) • Multipliers which produce the single output y=(u_0*u_1*. If the block type is selected. comprising a multiplier. so the user cannot inadvertently mix up slots and blocks in one diagram.

and selecting • By right-clicking on. User Manual 579 . However.x1.10. • By using the New Object icon in the database manager and selecting Block Definition (BlkDef).x1.Diagram from the context-sensitive menu. but only for creating primitive block definitions by entering the DSL code. In the first two methods.1 Drawing Composite Block Diagrams and Composite Frames Although the composite block diagram and the composite frame diagram should be distinguished from one other. This method is therefore not suitable for creating a composite block or frame diagram. this results in the following output: model o1 = ’MyBlock’(i1. The new block/frame diagram graphic will show a single rectangular block. THE COMPOSITE BLOCK DEFINITION When rebuilding a diagram (by pressing the icon). → Block/Frame ..Kp. The basic distinction between a block diagram and a frame diagram is that the latter contains only slots and signals. the DSL representation of the block diagram is written to the output window.BlkDef’(xe. Inside this rectangle the following objects can be placed from the graphic toolbox for the block diagram: Node objects: • block references • summation points • multipliers • divisors DIgSILENT PowerFactory 15.yi) xe = i1*i2 o1 = s1+i2+i1 This simple example shows the whole meaning of the block diagram graphics: it is a convenient way to define specific controllers.Ti.1. The name of the new diagram will appear on top of the frame. • By clicking on the Insert New Graphic the option Block/Frame Diagram. For the example block diagram in Figure 26. or inside a (library) folder in the active project in the data manager and selecting New.yi) s1 = \System\Library\Models\DSL\PI. 26. they are drawn in the same way.. which depicts the block or frame. A new block or frame diagram can be created in various ways: • Selecting the main menu entry File → New or Strg-N and then selecting the option Block/Frame Diagram from the New command dialogue (ComNew). but no graphic. whilst the block diagram must not contain any slots.Kp. Note: The two later options only create a block definition object (BlkDef). A new graphics board will be created when no graphics board is open. icon on the toolbar of an open graphic.10. based on standard components.Ti. it would also be possible to define exactly the same block diagram by entering the above DSL script manually and thereby create a primitive block definition.26.10.i2. a graphic will be created and will appear in the open graphics board.

10.2: Block/Frame Diagram Objects Note: When creating a frame or a block definition. creating a slot will disable all other node objects in the drawing toolbox. Because of lack of information about the number of inputs and outputs of the new block reference before a (lower level) block definition is assigned to it. etc. rectangles. When the graphic is not frozen. it is not possible to connect signals to the empty block. STABILITY AND EMT SIMULATIONS • switches • different kinds of graphical objects Branch objects: • signals lines Inside a frame diagram only the following elements are allowed: Node objects: • slots • different kinds of graphical objects Branch objects: • signals lines These objects can be selected from the Drawing Toolbox. PowerFactory recognizes the type of definition when you place the first slot or block. Because a composite frame diagram may only contain slots and signal lines. The toolbox also has buttons for pure graphical add-on objects (lines.10. when the graphic is frozen for editing.CHAPTER 26. Figure 26. It should be noted that the availability of this toolbox is according to whether or not the graphic is ’frozen’ ( ).) as shown in Figure 26. the toolbox is available.1 Adding a Block Reference Drawing the block objects and connecting them with signals is done in a similar way as is done with elements in the single line graphic. If you place a block ( ) first. It 580 DIgSILENT PowerFactory 15.1.2. polygons. texts. so you can’t mix up slot and block elements in one diagram. A block reference is first displayed as an empty square which has to be edited in order to assign a (low level) block diagram to it. 26.10. and likewise. the icon for the slot will become inactive. User Manual . the toolbox is hidden.

10. A block reference is edited by right-clicking on it and selecting Edit from the context-sensitive menu.10.1. Multiplier Every grey dot of this block can be used as an input or output of the multiplier.3: Edit Dialogue of the Block Reference Use the Select button ( in Figure 26. Figure 26.10.2 Adding Calculation Blocks Summation Point Every dot can be used as an input to the summation point. where any connected input connection can be inverted. The dialogue as displayed in Figure 26.10. using the Drag & Drop functionality.3) to select a model definition. It should be noted that not all dots have to be used and only one dot can be defined as an output. It should be noted that not all dots have to be used and only one dot can be defined as an output. It is also possible to create a block in the graphical Block Definition by dragging Macros from the global library or project library into the drawing area of the Block Definition.10. 26. The block references then show all available input and output signal connections. The "edit" dialogue will pop up. Divisor DIgSILENT PowerFactory 15. An output of three input signals will thus be: out=(in_0*in_1*in_2).26. or simply by double-clicking on it.3 will pop up. Predefined standard block diagrams for your usage are located in the folder Database / Library / Models. The sign of signals at summation points can be changed by editing the summation point object. THE COMPOSITE BLOCK DEFINITION is therefore recommended to first draw all block references and to assign block definitions to them. User Manual 581 .

Figure 26.10.1. and finally clicking on a ’to’ node (input to a block/slot).7. In Figures 26. a signal line is drawn by first with signal lines.5 or less. the switch will stay in the displayed state. which will be connected to the output according to the position of the switch. Limitation • Gray: Every signal can be connected The signal lines can also be edited in the corresponding dialogue. The first input will be the numerator and thus will be divided by the second (and if existing. Switch Two input signals can be applied to this block. the multi-signal output and input of two block definitions are shown. An output of three input signals will then be: out=(in_0/in_1/in_2). If the control signal is 0.1.5 and 26.6.10. User Manual .5 will cause the switch to change to the upper signal and the other way round.10.CHAPTER 26.10.I_C". Mind that not all dots have to be used and only one dot can be defined as an output. they can be connected button from the graphical toolbox. as illustrated in Figure 26.I_B. e.10. Limitation • Pink: Max.10. After selecting the clicking on a ’from’ node (output of a block/slot). Both blocks will show a single input or output connection point. whereas a signal greater than 0. Especially in the case of three phase signals. The order of the signals will be clockwise beginning from the left. 582 DIgSILENT PowerFactory 15. Additionally a control signal has to be connected to the top. separated by semicolons. STABILITY AND EMT SIMULATIONS Every grey dot of this block can be used as an input or output for the divisor. A multi-signal is defined by writing two or more signal names together.4: Block Signal Connections • Green: Input • Red: Output • Blue: Min. which provides the possibility to change the name of the signal. slots or other node elements.4 Multi-Signal Connections Signals normally connect a single output parameter with a single input parameter. the third) input. In the edit dialogue the zero position of the switch may be altered. which will define the operation of the switch. The input and output terminals of common blocks and other node elements are depicted with coloured dots (see Figure 26. They can be connected to each other by a single signal line. optionally clicking on the drawing surface to make a nondirect connection. as is often the case for voltage or current signals. 26.4). multi-signal connections may be used.g "I_A. 26.10.3 Connecting Signals After drawing and defining the block references.

10. 26. and DIgSILENT PowerFactory 15.10. The cursor will change to a double diagonal arrow. top or bottom side of the frame enclosing block diagram. THE COMPOSITE BLOCK DEFINITION Figure 26. it can be resized by left clicking one of the squares. output and limiting signals of its own.5: Output Definition of Block1 Figure 26.8.10. New output signals are defined by ending a signal line by clicking on the right side of the enclosing rectangle frame.10.10. which are thus connected to the rectangular frame.1.7: Multi-Signal Connection Note: The number of variables and their order in the output signal must be equal to the number of signals in the input signal. Signals. Input signal points are defined by starting a new signal line on the left. 26.1.26. This will create a new input signal for the composite block definition.6 Resize If a marked symbol has small black squares at its corners.6: Input Definition Figure 26. as can be seen in Figure 26.10.10.5 Block Diagram Input and Output Definitions The composite block diagram normally has input. have the following meanings: • connected to the left side: Input • connected to the right side: Output • connected to the bottom side: Minimum Limitation • connected to the top side: Maximum Limitation Note: The names of the input and output signals must be the same as the names of the input and output signals defined in the slot or block to which it is intended to assign the definition. User Manual 583 .

as have been defined graphically. the block diagram itself can be edited. Assuming a total system droop of 7% and a K_f value of 0. Additionally. This can be done without having to close the graphical representation of the block diagram. average values with reasonable simple models may give acceptable results by tuning only some key parameters like the frequency dependency of loads or droop settings.7 Additional Equations After the internal structure of the block diagram has been defined graphically. Consequently. the block diagram edit dialogue will pop up. nearly any result could be produced and arguments could be found for its justification. Depending on the accuracy of the implemented models. 26. large signal validity. but the non-linear characteristics of hydro turbine efficiencies and steam valve non-linearities could be more relevant at a certain unit loading point. available system parameters and applied faults or tests.10.11 User Defined (DSL) Models System modelling for stability analysis purposes is one of the most critical issues in the field of power system analysis. A simple example illustrates this. 26. the steady-state frequency deviation is expected to be 596 mHz only.8: Resizing an Object It is also possible to make the object(s) have a new size by clicking on one side of the marking box.1. This dialogue will show all input.11: User Defined (DSL) Models). the name and the unit of the parameters to be defined in the common model can be specified (see also Section 26. On the Equations page. On the other hand. Figure 26. 584 DIgSILENT PowerFactory 15. the frequency dependency might be slightly higher or lower. User Manual .10. STABILITY AND EMT SIMULATIONS moving it (while holding down the left mouse button) resizes the object.ratio. Now with a more realistic coefficient of 𝐾𝑓 = 5%/𝐻𝑧. This is not possible for all objects. K_f. of loads. information and equations for the initialization of the block can/has to be entered. In a 10 GW power system the expected steady-state frequency deviation when losing a fully loaded 2000 MW unit depends highly on the frequency dependency. The marked object(s) will only resize in one direction in that case. Additional DSL equations can be defined on the second page of the block diagram edit dialogue. the steady-state frequency deviation will be approximately 700 mHz. as long as only one or two different loading scenarios are considered. some other objects cannot be resized at all. output and internal signals. By left or double-clicking the enclosing rectangular frame.CHAPTER 26. Some objects may only be resized with a fixed X/Y. Release the mouse when the new size is correct.

System fault Most relevant to system modelling considerations are the applied faults and related problems which are to be analyzed. The analysis of system damping and PSS tuning will not necessarily require the boiler dynamics to be considered. This can be easily demonstrated when weak systems with a longitudinal geographical extension or appropriate substructures are analyzed. • Optimization of control parameter settings. As soon as a detailed analysis and representation of system models is required. load shedding optimization and frequency restoration would not give appropriate results if mid. generator and HVDC controllers). System structure Independent of system and unit size. Typical applications are: • The analysis of controller problems and relevant malfunctions.26. a more detailed representation is necessary for system extensions. Special attention has to be paid to the analysis of operational problems and operation optimization. User Manual 585 . Unit size Steady-state and transient behaviour of large units is more decisive for the overall system response than smaller units which might have a very negligible effect on the total system. Referring to the above example. where a detailed model representation should form part of the performance specification. for systems which are in the planning stage. while in large systems such as UCTE or UPS/IPS. for a smaller power system the frequency dependency of loads is irrelevant. the system structure may be more relevant than any other factor. DIgSILENT PowerFactory 15. In addition. For these cases.and long-term characteristics of relevant system elements are neglected. all parameters such as time constants and gains which could be also derived from these basics. frequency dependency may cover the spinning reserve requirements totally. USER DEFINED (DSL) MODELS Thus system model structures and parameter settings are to be best evaluated against the following main criteria: System size Large and small systems have different “key parameters". the subsequent questions to be asked are: • How can the structures and parameters of the model be determined? • Are IEEE models and additional manufacturers’ block diagrams adequate and accurate? • How could the available information be used within the power system analysis software? The approach which is presented here and successfully applied in various projects can be called the “Advanced System Modelling Approach (ASMA)". power system stabilizer. • Modelling of unconventional system structures and control concepts often found in industrial systems.g. especially under disturbance conditions. are to be calculated with the same degree of accuracy. On the other hand. Study purpose In general. the following steps are critically important: Setup of system models Based on the fundamental equations of engineering and physics. typical models and parameters could be applied as long as there is no specific additional information available. • Study applications for the design and specification phase of components and systems (e.11. detailed modelling of the relevant components is critically important. However. For the ASMA approach. the basic algebraic and differential equations are to be set up according to the required degree of accuracy.

Comparison of measurements and simulations Besides the analysis of subsystems and components. • The simulation tool is based upon common control and logic diagrams. basic control elements like PID. most modern commercially available general purpose simulation tools may be used for flexible and specific system representation.1 Modelling and Simulation Tools As already indicated. • Provision of various intrinsic functions such as: “select". In the majority of cases. These measurements are preferably executed with a highly accurate digital transient performance measurement system.CHAPTER 26. In order to provide a very flexible modelling and simulation tool. where the system representation cannot be matched to a classical IEEE or any other standard model. gains and time constants. very strict application of the ASMA approach is not necessary for modelling relays and less complex or digital control functions. this approach does not adequately cover the special electrical system load flow characteristics.to the block-oriented approach which is based on the provision of predefined low-level block macros being connected at the case definition level. independently of the analyzed system. Methods for solving this task range from the classical and traditional way of using software which allows interfacing of user-defined models at the FORTRAN/C level . • DSL includes a complete mathematical description of (time-) continuous linear and non-linear systems. Of course. overall system performance is to be compared with the theoretical model for all relevant operating modes. which do not interfere with normal operation. which could be: algebraic equations. “lim". system performance tests are the best method. Typically. Special test procedures. STABILITY AND EMT SIMULATIONS Performance of system tests In order to define all other parameters and. • Provision of various formal procedures for error detection and testing purposes such as: algebraic loop detection. “lapprox". the mismatch between measured and identified data should be smaller than 2%. • Provision of flexible definition of macros. “picdrop" in order to provide a complete control of models. However. in particular. In other words.11.typically via connection lists . In addition. System Identification Non-linear. User Manual . a DSL model can be converted into a graphical representation. which forms part of a stability program. a control system based simulation language was developed. 26. PTn or even complete physical subsystems like valve groups or excitation systems. Unfortunately. there is a substantial need for an easy to use and flexible method for the realization of individual models. The following describes the main features of the DIgSILENT Simulation Language (DSL): • The simulation tool falls into the category of a Continuous System Simulation Languages (CSSL ). multi-input and multi-output system identification techniques are applied for system identification procedures. reporting of unused and undefined variables and missing initial conditions 586 DIgSILENT PowerFactory 15. “limits". the most critical and decisive factor for reliable simulation results is the accuracy and completeness of system model representation for identification and simulation purposes. non-linear characteristics. leading to a non-procedural language. as these are clearly defined by their appropriate general and acceptance test documentation. have to be applied to focus on the steady-state characteristics. frequency response tests will not permit the determination of any non-linear structure and its parameters. as the sequence of elements can be chosen arbitrarily.

11. leading to an integrated transient simulation of the combination of the power system and its controllers. These equations are then evaluated together. can be accessed in a read-and-write mode. Events: Conditions evaluated by DSL models may cause events to be sent to the program kernel where they will be scheduled within the event queue. USER DEFINED (DSL) MODELS 26. User Manual 587 . DIgSILENT PowerFactory 15.2 DSL Implementation: an Introduction The DIgSILENT Simulation Language is used to define new dynamic controllers which receive input signals from the simulated power system and which react by changing some other signals. the model equations of the DSL models are combined with those describing the dynamic behaviour of the power system components. Output and Monitoring: Conditions may trigger user-defined messages to be displayed in the output window. DSL itself can be looked upon as an add-on to the transient analysis functionality of PowerFactory .11. Main and sub-address features are implemented allowing the access of any signal existing in the system or to build up complex structures such as hardware-based modules taking equipment "rack" and "function card" structures into account. During the simulation.26. The DSL main interfacing functions are: Signal input and output channels: Any variable defined within the kernel (currently more than 2500) and in a DSL model.

The more complex controller is created graphically by drawing its block diagram.11. A set of basic DSL models is created. These models implement simple. but may also refer to other graphically defined complex models. The basic method for designing new DSL models is as follows: 1. User Manual . where the DSL primitives form the lowest level. 2. STABILITY AND EMT SIMULATIONS Figure 26. This embedded macro models a single integrator and is defined by programming it. This DSL model has been defined graphically. Controller references may be used to include DSL primitive models into the complex model.3 (Defining DSL Models) describes these procedures in detail. Section 26. ’primitive’ controllers like a ’first order time lag’ or a ’PID’ controller. This example considers a prime mover unit model of a simple hydro turbine. The PowerFactory program is shipped with a large number of these primitive controller models. 588 DIgSILENT PowerFactory 15.CHAPTER 26. This kind of block diagram normally uses references other DSL models which are thus combined into a more complex controller.1: Structure of the PowerFactory DSL System The structure of a DSL model is best explained by an example. using the DSL language. and contains one embedded DSL macro. by designing sub-models and sub-submodels.11. New primitives are created by programming their differential equations and signal settings. Highly complex controllers may thus be designed in a hierarchical way.

This primitive model is included in the hydro turbine (in line 2 of the definition of the hydro).x1. The DSL primitive implements a single integrator and is programmed as follows: 1.Ti.3 depicts the graphical representation of the embedded primitive DSL model. Figure 26.3: Graphical Representation of a DSL Model of an Integrator Figure 26. model Pt = ’pmu_hydro’(At. 6.Ti. 5.11. 3. 8.11. 6. 4. 3. USER DEFINED (DSL) MODELS Figure 26. 7.Ti.C.BlkDef’(xe.11.11.x1.x1. 2. 7.) i3 = i1/i2 i1 = At*At i2 = pt_x*pt_x i4 = xe*pt_x xe = i3-C Pt = pt_x-i4 The line numbers have been added for readability. model y = ’I’(xe. as shown in the output window when a graphical Rebuild ( ) is performed is: 1. C State Variables : x1 Parameter : Ti Internal Variables The example describes a simple hydro turbine model with the input signals A_t and C and the output signal P_t. 2.) pt_x = ’I.2: Diagram of a Simple Model of a Hydro Turbine Figure 26.26. = xe/Ti y = x1 DIgSILENT PowerFactory 15. The corresponding block definition shows: Output Signals : Pt Input Signals : At. 5. The resulting DSL code.) [Ti] = ’s’ limits(Ti) = (0. User Manual 589 . 4.11.) inc(x1) = y inc(xe) = 0 x1.2 depicts the model definition that was used to define the hydro turbine model.

Example (line 1 from the hydro turbine model): 1. based on the signals defined in the interface. Model description The model description describes the DSL model. User Manual .CHAPTER 26. 3. interrupt scheduling and input-output signal processing is handled automatically by the program kernel.2. In addition. • The algebraic relations which define the controller. [Ti] = ’s’ ! the unit of Ti is seconds limits(Ti) = (0. 7. if the output of a DSL model is an electric 590 DIgSILENT PowerFactory 15.7 were entered manually. names of input and output signals. The DSL model description Interface description The interface defines the model name. and the classification of the model as a linear model and/or as a DSL macro. Lines 2.x1.. The interface definitions 2. 4. The block definition dialogue was used to set the following: Output Signals : y Input Signals : xe State Variables : x1 Parameter : Ti Internal Variables 26.2.11. model Pt = ’pmu_hydro’(At. Example (the integrator): 2.C.2 Advanced Features The numerical integration of DSL models.Ti.) The block diagram dialogue further allows for the definition of limiting parameters and input signals. primitive or complex: 1.) ! Ti > 0 inc(x1) = y ! initially x1=y inc(xe) = 0 ! initially xe=0 x1. 6.1 Parts of a DSL Model Both example DSL models show the two basic parts of any DSL model. The DSL description includes: • Parameter descriptions: name and unit • Allowed parameter ranges • Initial conditions and functions which are used to calculate initial values. = xe/Ti ! equation 1: deltax1 / deltat = xe/Ti y = x1 ! equation 2: y=x1 26. STABILITY AND EMT SIMULATIONS Line 1 is generated by clicking on the Equations button in the block diagram dialogue.11. model parameters and state variables. 5. These are shown in the output window in the model heading.

2 Primitive Block Definitions To create a primitive DSL block definition: DIgSILENT PowerFactory 15. The block definition objects thus serve two purposes in the process of constructing a DSL model: • They hold the definitions and parts of a graphically constructed composite block definition.26.3 Defining DSL Models A new DSL model is created either by entering the DSL code in the equation part of a Block Definition (BlkDef ) object. multipliers. it allows for additional DSL equations to define those aspects of the controller that would be otherwise difficult to enter in a graphical way. small standard components (adders. Complex block definition objects are conceptually similar to “Grid Folders" in the PowerFactory database tree.which is the case if a load or generator model is created . 26. its organization via windows menus etc.3.11. double-click on the frame box surrounding the diagram. any model implemented at the DSL level will be automatically taken into consideration when calculating the system eigenvalues or when applying the modal network reduction approach (MRT).11. Please refer to Chapter 9 (Network Graphics (Single Line Diagrams)) for more information.all Jacobian elements necessary for the iterative simulation procedure will be calculated automatically. USER DEFINED (DSL) MODELS current being added to the appropriate total bus current . is not treated here. inputs and outputs of model parameters. Consequently. or by creating a new Graphical Block Diagram. is also derived automatically from the DSL model.11. Of course. These parts include signals. and the diagram graphic which was used to define the model.11. The graphical environment in which a complex block diagram is constructed. 26. In addition. any signal limiting functions will be disabled automatically for this calculation procedure.1 Composite Block Definitions To create a new composite block definition: • Use the main menu entry File → New or Strg-N and then select the option Block/Frame Diagram from the New command dialogue (ComNew). Both methods will result in a Block Definition Object which holds the definition of the DSL model. 26. icon on the toolbar (of the graphics window) and select the option To access the dialogue of the block definition (BlkDef ). • Use the Insert New Graphic Block/Frame Diagram. • They provide the surrounding in which a new “DSL primitive" or ’primitive block definition’ can be defined. Although a complex block definition object is created graphically.3. They are defined by graphically defining a controller block diagram of which they will store the graphical information and all logic parts. Another useful feature of DSL is the algorithm implemented for numerical setup of the system matrix for eigenvalue calculation purposes.) or DSL primitives. User Manual 591 . etc.

11. which may then be used to graphically construct more complex controllers which include this kind of filter. use the icon to create a new block definition inside the local library. parameters. 592 DIgSILENT PowerFactory 15.4: Dialogue of the Block Definition Name and Title will appear in the library folder. A DSL primitive. Unlike transformers or other power system components.11. • Double-click an new/empty block reference in an open block diagram and then use the button to select a block definition.CHAPTER 26. Figure 26. where input and output variables. state variables and limiting signals can be defined.3. additional equations. initial conditions of variables as well as names and units of parameters can be inserted. Figure 26. a dialogue will appear. which may be looked upon as ’power system primitives’. where the model is stored.11. Furthermore. for example. Following this. 26. DSL primitives are the building blocks from which the more complex controller diagrams are composed.4 shows an example dialogue of a PI controller including limiting parameters and a ’switch’ signal. → Block/Frame-Diagram from the context-sensitive menu. . might implement a low pass filter. a DSL primitive is only referred to by a complex block diagram and may thus be used in more than one complex DSL model at the same time.3 Block Definition Dialogue When creating a primitive DSL model or by double-clicking on the frame of a composite block definition. • Use the New Object icon in the database manager and select Block Definition ( BlkDef). STABILITY AND EMT SIMULATIONS • Right-click on or inside a (library) folder in the active project in the data manager and select New. . User Manual .

However.m) file can be defined with which the block definition can communicate during a simulation. but also differential. For new created models the highest level should always be used. Then for every first-order derivative one state variable must be specified.IntPrj DIgSILENT PowerFactory 15. regardless of whether they are defined graphically or on the "Additional Equations" page. USER DEFINED (DSL) MODELS Level of the model representation is only important when using or changing old models. The number and their name will then appear in the graphical diagram when the block is used. which are similar to input signals. This may additionally include. Internal variables are only used inside the block definition but can not be set from outside. for example.11.IntUser\Windparks. The difference is the graphical representation in the block diagram. There are several buttons on the right side of the dialogue: Contents This button will display the (possible) contents of the block definition. this option does not have any impact.Check ’\TestUser. State variables are needed when not only linear. Otherwise the following message will occur: DIgSI/info . Classification: • Linear : This option will only effect the graphical representation of the block in the diagram. further block references or the packed macros. Check "Check" will verify the model equations and output error messages if errors have occurred. For macros. where a MATLAB (*. as well as limiting signals. the block will be represented as a linear block.14 (MATLAB Interface). Only the order must be identical. The names of the parameters can be different in the block reference and in the block definition. Equations The "Equations" button will print the DSL equations to the output window. Input and output signals have to be defined for internal use inside the block definition. Parameters will appear in the common model dialogue and can then be specified. This can be the graphically inserted objects. Limiting Parameter. If this option is enabled. Automatic Calculation of Initial Conditions: PowerFactory can calculate the initial conditions automatically. • Macro: This option is used to identify the block definition as a macro inside the library. as well as variable definitions. A constant may be defined.26.e. The parameter defined in the block definition will automatically be inserted in the block reference. internally-defined events. i. for example. equations are used. For more information about the MATLAB interface see Section 26. User Manual 593 . if no sequence is found (because of. the controller definition. This button prints the current block definition DSL equations (including the equations in the used macros) to the output window. deadlock situations) there will be an error message. because the level of the highest block is important. otherwise as a non-linear block with two lines. • Matlab: Enabling the ’Matlab’ tag will show an input dialogue. which are defined in the common model dialogue. Macro Equat.

g.CHAPTER 26. Pack-> Macro This command will reduce the entire model including DSL blocks and additional equations and macros into one DSL model containing only equations. In this way there will now be references to other projects or libraries outside the model. User Manual .5 shows the additional equations of the DSL model of the PI controller. As for any other simulation or programming language.5: Dialogue of the block definition . Figure 26. It should be noted that this command is irreversible.BlkDef’: DIgSI/info . a special syntax is provided for the model formulation. Also further information e. Encrypt The "Encrypt" button is available when Pack → Macro is activated before. Figure 26.11. Beware: any further changes in the macro library have no influence. All graphical information will be lost. Check Inc. It should be noted that this command is irreversible and a decrypt function is not available. In the Equations page the (additional) equations of the DSL model can be defined. STABILITY AND EMT SIMULATIONS \Library\Block Definitions\DFIG\Voltage Control.12 The DIgSILENT Simulation Language (DSL) The DSL language is used to program models for the electrical controllers and other components used in electrical power systems.Page 2 The next section describes the handling and usage of the DSL language. 26. so that the equations can not be seen or output anymore. This command encrypts all equations inside the model. The initial conditions of the block definition will be printed and checked.11. This syntax is explained in the following order: 594 DIgSILENT PowerFactory 15. Pack Pack will copy all used DSL models (macros) of a composite model definition to the folder "Used Macros" inside the block definition. In this way a model containing sensitive or restricted device equations can be delivered without showing the internal equations. the macros are copied and no longer linked to the library.Block is ok. So if there is an error in a certain macro it has to be fixed separately in each packed block. the initial conditions of state variables and the name and unit of parameters can be specified.

12. <=. cosh(x). THE DIGSILENT SIMULATION LANGUAGE (DSL) 26.u.’ • arithmetic operators: +.45*T1/sin(3. User Manual 595 . min(x. & (1-sqr(x1)/sqr(at))/Tw. . 0) Line breaking cannot be used within names or strings..y).or.2 General DSL Syntax Line length: The maximal line length is 80 characters.or. tan(x). tanh(x).’ • Logical relations: <. >=.eor. variables. . < > (inequality). {bt>=10}.14*y) boolexpr • logical expression. round(x).and.12. • Unary operators: .12. names.and. cos(x).’Controller Gain’ 26.. abs(x). -. / • constants: all numbers are treated as real numbers • standard functions: sin(x). functions. These standard functions are described in detail in the last chapter.and. A ’&’ sign in the first column joins the current row and its preceding row. • Binary operators: .y).. ln(x). DIgSILENT PowerFactory 15. sqr(x) (power of 2).y). pow(x. *.nand. =.T1=0.y). ceil(x). are case sensitive. • Parenthesis: (arithmetic expression) All trigonometric functions are based on radians (RAD). . Case sensitivity: All keywords. atan(x). frac(x). . macros. models. not to be terminated with a ’. trunc(x). • Parentheses: logical expression Example: A = x1>0. log(x) (basis 10).not.7. not to be terminated with a ’.26.’. modulo(x. Example: vardef(Ka)=’p.1 Terms and Abbreviations The following terms and abbreviations are used to describe the DSL syntax: expr • arithmetic expression. asin(x).not. Longer lines have to be broken by using the ’&’ sign in the first column of the continuing line. etc. sinh(x). max(x. = select({at<>0} .0 string anything within ’. acos(x). Example: x1. Example: A = x1+2. floor(x).x2 <= 0. sqrt(x) (square root).nor. >.’ (single quotation marks). exp(x).

4 DSL Structure DSL models are constructed of three parts: • The interface part. the use of an assignment like y=x1 is recommended. currents and voltages. Input signals: Input variables may originate from other DSL models or from power system elements. The following rules may be helpful when interpreting warning and error messages: • A state variable may not be simultaneously used as a state variable and an output variable. • Definition code. title. 26. with 2*iiii elements is provided to define characteristics (see procedure “lapprox"). classification and variable set. Example: ! comments may start at the beginning of a line x1. Internal variables: Internal variables are defined and used in the DSL model to ease the construction of a set of DSL equations. • Only the derivatives of state variables can be assigned an expression. • Equation code.12. User Manual . which states the model name. ! comments may be used in broken lines & (1-sqr(x1)/sqr(at))/Tw. • All parameters are real numbers. In the latter case. = select(at<>0. State variables: State variables are time-dependent signals generated and used within the DSL model itself. 0) 26.12. Exception: blanks in strings are kept. 596 DIgSILENT PowerFactory 15.3 DSL Variables A DSL model may use five different types of variables: Output signals: Output signal variables are available as input signals to more complex DSL models. Comments: The ’!’ sign causes the remaining line to be interpreted as a comment. • A special parameter ’array_iiii’ (with up to 4 digits i). STABILITY AND EMT SIMULATIONS Blanks: All blanks are removed when the DSL code is processed. The definition and equation code form the actual controller network definition and are treated in the next sections. as well as any other signal available in the analyzed power system. become available to the DSL model. This part is set in the first page of the block diagram dialogue. if required. Comments are removed when the DSL code is processed. Parameters: Parameters are ’read only’ numbers which are set to alter the behaviour of the DSL model.CHAPTER 26.

12.max] limits(x)=(.3) and limits(x)=(2.12. The ’smallest interval’ method gives the calling model thus the freedom to redefine parameter limits without violating the internal macro limit definitions. 26. Examples: vardef(Ton) = ’s’. Violations of the interval limits during simulation will be reported: limits(yt)=(.5 Definition Code Definition code in the equation part of a DSL model is used to define parameter properties and initial conditions. DIgSILENT PowerFactory 15. ’Maximum exceeded: yt=yt>1’) The ’(’ and ’)’ braces exclude the minimum or maximum value from the interval.12. maximum 10 characters wide.max] limits(x)=(min. ! only defines unit [varnm] = unitstring Unit for variable varnm. Example: [Ton] = ’s’ ! 26.max] ! limits(x)=(min.5.12. Macro models often define limits for certain variables.) ! ! min <= x <= max ! min < x <= max x = max min < x If required and if possible. THE DIGSILENT SIMULATION LANGUAGE (DSL) 26.’Pick up time for restart’ !only defines name vardef(Ton) = ’s’. User Manual 597 . maximum value ]/) Defines the valid interval for variable varnm.26.2 defines unit Valid Value Ranges limits(varnm) = [/( minimum value. the ’[’ and ’]’ braces include them.’Pick up time for restart’ !defines unit and name vardef(Ton) = . Remark : A macro call causes error messages if the units of the substituted variables do not match the defined units. the program automatically determines the smallest interval under several intervals of the same variable.1] is equivalent to output(yt>1.5.4] results in 2<x<3.namestring Unit and name for variable varnm. Example: limits(x)=(1.1 Unit and Parameter Description vardef(varnm) = unitstring. Examples: limits(x)=[min. The model which uses the macro might also define limits for the variables which are used in the macro calls.

5. newtoninc.12. eps) Performs a simple linear search for a single value for which the parameter varnm is closest to its known initial value. These functions are used to find the initial value for one set of parameters if the initial values of another set of parameters. usetp ]. step. STABILITY AND EMT SIMULATIONS 26. Example: An AVR model has two inputs.6. with an increment of 0.2 Iterative Setting of Initial Conditions Three functions are available for determining initial values iteratively: looping. Both inputs cannot both be initialized automatically by the single output value. which are functions of the first set of parameters. it will be evaluated when the model is reset.01. ending at a=5. by incfix(upss)=0. The iterative functions are used to find the (approximated) values for the unknown parameters for which the known parameter take their initial value.6. the normal assignment expression will be evaluated (only possible if varnm is of the intern or input type). incfix(varnm) = expr This variant of the inc() statement is valid only in connection with automatic initialization and is used to determine the initial values in ambivalent situations. loopinc(varnm. The initial value of usetp is now automatically determined.6 Initial Conditions 26.CHAPTER 26. inc0(varnm) = expr Definition of the initial condition of variable varnm. are known. one or more variables can be directly initialized so that other variables can be initialized automatically. Therefore one of the inputs must be initialized as fixed. e. If inc(varnm) is defined. With the incfix. If inc(varnm) is not defined. beginning at a=-5. User Manual .12. max. -5. [uerrs ]. 26. min. 0.01.1 Direct Setting of Initial Conditions inc(varnm) = expr Definition of the initial condition of variable varnm. The inc0() statement is thus used to make open input or output terminals possible. intervalinc. This variant of the inc() statement is used only when the variable varnm could not be initialized through the initial condition of the connected input or output signal.g. whose initial value is known min = lower limit max = upper limit step = stepsize eps = maximum error Example: inc(a) = loopinc(b. using upss=0. 0. [upss . and one output. 598 DIgSILENT PowerFactory 15. varnm = target variable.12. for unconnected output or input variables.001) • The initial value of variable a is searched for by evaluating parameter b. which is determined by the connected machine.

maxiter. The iteration stops if the maximum number of iterations is reached. takes the smallest value. maxiter. eventually: ℎ𝑒𝑑𝑟 ≈ ℎ𝑤 − √︀ 𝑞𝑒𝑑𝑟 × (𝑅𝑑𝑠 + 𝑅𝑑𝑟) 𝑞𝑡1 ≈ 𝑃 𝑡1/(4 × 𝑑ℎ × 𝑒𝑡𝑎1) DIgSILENT PowerFactory 15. max. eps) inc(qt1) = newtoninc(Pt1/(4*dh*eta1). A warning is given if the smallest deviation is greater than eps. qt0. start. 0. maxiter.1) (26. -5.qt4) are sought simultaneously by setting up a system of coupled equations and solving that system by the Newton method so that. 5. within the interval [-5. • Restriction: Can only be used on the right side of an inc() statement intervalinc(varnm. min. eps) Performs a Newton iterative search for one or more parameters by minimizing the errors in a set of coupled equations.5 eps = 0. 40. THE DIGSILENT SIMULATION LANGUAGE (DSL) • Return value: the value of a for which the deviation of b from its known initial value. iter.. Restriction: May only be used on the right side of an inc() statement newtoninc (initexpr. inc(qt4) = newtoninc(Pt4/(4*dh*eta4). iter. qt0.qt1 . Example: qt0 = 0. varnm = target variable. maxiter. maxiter.5] by successively dividing the interval as long as the deviation of the variable b from its initial value is less than eps. qt0. User Manual (26..2) 599 . qt0.12.26. inc(qt2) = newtoninc(Pt2/(4*dh*eta2). max = upper limit iter = maximum number of iterations s = maximum error Example: inc(a) = intervalinc(b. initexpr = the expression which must equal the parameters whose initial value is sought start = the starting value for the parameter whose initial value is sought iter = the maximum allowed number of iterations eps = the maximum allowed absolute error between initexpr and the parameter whose initial value is sought. inc(qt3) = newtoninc(Pt3/(4*dh*eta3). eps) eps) eps) eps) This example shows a part of the initial value definitions for a model where the initial values of 5 parameters (hedr .000001 maxiter = 100 inc(hedr) = newtoninc(hw-sqr(qedr)*(Rds+Rdr). and a warning is given if the smallest deviation is greater than eps. hw.001) Explanation: The initial value of the variable a is searched for.. eps) Performs an ’interval-division search’ for a single value for which the parameter varnm is closest to its known initial value. whose initial value is known min = lower limit.

Syntax: varnm = expr Assigns expression ’expr’ to variable ’varnm’. but does not require correct initial conditions for each state/input variable. multi-output functions.12. It should be therefore enough to specify the initial conditions of the state variables and input variables.7 Equation Code Within the equation code. all equations necessary to build up the simulation models are included. The set of equations defines a set of coupled differential equations which describe the transfer functions between the input and output signals. The incfix-function can be used to determine the initial values in ambiguous situations. or to the first derivative of a state variable. The initial values are only used to initialize the iteration process. the outputs are normally known and the inputs (or setpoints) have to be determined. These transfer functions may range from simple linear. 26.CHAPTER 26. • The general initialisation ’direction’ is from right to left.or. non-continuous. • If initial conditions are not defined for a certain variable.8 Equation Statement The equation statements are used to assign expressions to parameters. thus relating all parameters in a set of differential equations. x1>2 . DSL is used to describe the direct relationships between signals and other variables.3) 𝑞𝑡3 ≈ 𝑃 𝑡3/(4 × 𝑑ℎ × 𝑒𝑡𝑎3) (26.12. a<=3 600 DIgSILENT PowerFactory 15. • Use the option Verify Initial Conditions to check if the initial conditions lead to the correct result.e. multi-input. as opposed to each primitive (like a first-order time lag). Expressions may be assigned to a variable. Higher order differential equations have to be thus split up into a set of single order equations by the introduction of additional state variables.4) 𝑞𝑡4 ≈ 𝑃 𝑡4/(4 × 𝑑ℎ × 𝑒𝑡𝑎4) (26. i. 26. Examples: y = sin(a)+3*x1 y = . singleinput single-output functions. the simulation equations are used instead. to highly complex non-linear.not. • The option Automatic Calculation of Initial Conditions requires configuring.5) The following guidelines should be considered: • Add the initial conditions to the complex block. User Manual . STABILITY AND EMT SIMULATIONS 𝑞𝑡2 ≈ 𝑃 𝑡2/(4 × 𝑑ℎ × 𝑒𝑡𝑎2) (26.

z will take the value x1 + 4. A DSL macro is included in a higher level DSL model either by creating a block reference in the block diagram graphics or by its explicit inclusion in a DSL equation. Derivatives may only appear on the left side of the equal sign... then line 1: 1. or just x1: y = .. In the case of the following example. In the following example. = 1 • Algebraic loops are not supported.s1.5): y1 = .0. = expr Assigns expression expr to the first order derivative of the variable varnm. a = b+5 2. varnm2 . The right side expression may not contain derivatives...or..not.not. in which case the value will be 0. The block diagram edit dialogue offers a ’Macro’ classification option which can be set to mark the model as a macro.i2.... i2.0*y + x1 • The assignment of a value to a variable takes place in an order which recognizes the connections between these variables. = (xe-x1)/T1 x2..not.5) There is no warning against mixing logical and non-discrete variables in expressions..0000. an error message will be displayed: a = b+5 b = 2*a • If there is no assignment to a variable varnm.12.. x1.P2 = ’\User\I.. . s2. i2.. Example: P1. Assigns the input signals of DSL macro to the variables i1. Consequently the following code will not cause a message to be emitted: depending on y.0000 or 1. The first example is correct.. complex or primitive. User Manual 601 .. and the internal variables i1..z is interpreted and equal to y1 = (z=<0.) ! Not accepted 26. Syntax: varnm1...i1. the second is false.. varnm will keep its initial value.) Assigns the output signals of the DSL macro macroname to the variables varnm1. p1.. x1>2 .BlkDef’(i1. = asin(a) ! Correct a = sin(x1. The sequence does not influence the evaluation of the assignments. • All variables are of type floating point. = x1 Remarks • DSL assignments may occur in any sequence.z). THE DIGSILENT SIMULATION LANGUAGE (DSL) varnm. b = x1 3..9 DSL Macros A DSL macro is a predefined DSL model.varnm2. x1. • When a variable z is used in a logical expression (i.. i2. which is meant to be included in higher level DSL models. the logical 1 of z is tested by evaluating (z>0. s1.. p2. The macro uses the state variables s1.T2) DIgSILENT PowerFactory 15. y=.T1.s2.= macroname(i1. Examples: x1. s2...12..e. the parameters p1. the second line will be evaluated first...26. even if assigned to a boolean expression.. p2. a<=3 z = 4. i2..

p1.1 DSL Internal Macro Handling A preparser substitutes each macro call with the equation code of the macro. The "fault" and "output" procedures are evaluated at each time step during the simulation of a model.BlkDef. However. Both procedures are explained in detail in the following paragraphs. the string will be processed and a message will be sent to the output window. The "fault" or "output" procedures will be disabled afterwards until the DSL model is reset. voltage controllers. there may be any other variable defined as an output signal. i1) + 4 which should be replaced by: y1 = my_macro(x1. s1. p1. loads or HVDC systems. The first time that boolexpr is found to be true.12. p1. in addition to the electrical device currents. STABILITY AND EMT SIMULATIONS This example assigns to P1 and P2 the output of DSL model User ∖ I. relays. calculation procedures. Macro calls are not supported within expressions. there are two basic types of DSL models possible: 1. output(boolexpr. 26. 26. 2. message_string) The message_string may contain variables and the special function num(boolexpr) or num(expr): 602 DIgSILENT PowerFactory 15. i1) ! Incorrect example: y = 3 * my_macro(x1.9. or an event will be added to the PowerFactory event queue. Models of electrical devices such as generators. User Manual . i1) y = 3 * y1 + 4 26.2 DSL Models In general. even if they only have one output variable.10 Events and Messages The DSL language provides procedures for the generation of an interrupt event and for sending messages to the output window: • The procedure fault(boolexpr. message_string) outputs a message and is evaluated at the end of each time step. Among these types of models are prime mover units. etc.CHAPTER 26. A summary of the available variables of each element can be seen in the corresponding Appendix C: Technical References of Models. s1.9.12. The local variable names of macros thus disappear after the preparation process. Models with output signals which are not directly injected to the electrical network (general devices). which is injected to the electrical grid at a certain busbar. These models are characterized by their principal output signal "complex device current". Correct example: y = my_macro(x1. event_string) generates an event and is evaluated at the beginning of each time step • The procedure output(boolexpr.12. s1. to prevent an avalanche of messages or events. The variables of the macro DSL model are then replaced by the variables used in the macro call.

a delayed event may be thrown by the DSL model by setting the execution time ahead of the current time.ptmw = 'pmu_1 '(at. The parameters of the event can be modified in the fault string by assigning a new value. e. and then pressing the button Events in the dialogue. for instance. event_string) Each DSL model can add events to the event list.2 > ymax=1. They must all be stored inside the common model (ElmDsl). These DSL events will thus form an integrated part of the DSL model. Consequently. Consequently. THE DIGSILENT SIMULATION LANGUAGE (DSL) • Variable names which appear directly after an ’=’ sign will be substituted by their actual values. the event named ’MySwitchEvent1’ will be thrown onto the event stack and its variable dtime (relative event time) will be set to 15 milliseconds.’name=MySwitchEvent1 dtime=0. which. The event will thus be delayed for that amount of time.12.’maximum exceeded: yt=yt > ymax=ymax’) • The num(expr) or num(boolexpr) will be substituted with the calculated value of the expression.x4. mimics the time needed to open a switch.cosn.x2. The events are not added to the project’s global event list unless the event is ’activated’ by the DSL model.x1.Tspi) [T1] = 's' limits(T1) = [0. Tip. 26. The event_string in the fault expression must refer to the name of one of these events.11 Example of a Complete DSL Model Thermal Double Reheat Turbine with Steam Storage Controller Model: model pt.1-alfhp] DIgSILENT PowerFactory 15. Note: The events are accessed or created by opening the edit dialogue of the common model (doubleclick on the DSL model in the Data Manager).) limits(alfhp) = [0. A list of events already defined inside this model is displayed.26.0: output(yymax.5000 value=num(a+b) may produce value=3.: value=num(a+b) may produce value=3.Thp.x3.ngnum.1] vardef(alfhp) = . ’Adding an event’ is done by executing an existing event object in the PowerFactory database.alflp. all events that may be used by the DSL model have to be created together with the DSL model. hence.1.Tlp. As soon as the simulation reaches the event.12. can open the power switch of a line by adding the correct switch event.'High pressure turbine ratio'.5000 fault (boolexpr. the event will be thrown onto the event stack if boolexpr is true. it will execute it. At evaluation.g.1. Example: fault(u>1. The mechanism is the same as described above in the output procedure. in this case.15’) If the variable u exceeds 1. limits(alflp) = [0. User Manual 603 . A DSL model of a distance relay. the line of code below may generate the message: maximum exceeded: yt=1.sgn. The actual switch that will open is defined in the event object ’MySwitchEvent1’.

vardef(Tspi) = ’s’.0 inc(at) = pt inc(steamflow0) = pt inc(ylp) = pt x1.0) y = K*select(T1>0.) 26.Tlp) ! low pressure part pt = yhp*alfhp + ylp*alflp+ yip*(1.x2.'First reheater time constant '.xe) ! if T1=0 => y=xe inc(x1) = y/K inc(xe) = y/K [T1] = 's' limits(T1) = [0.steamflow)/Tspi ! boiler yhp = PT1(steamflow.'Low pressure turbine ratio '. = (steamflow0 .Thp) ! high pressure part yip = PT1(yhp.'Boiler capacity time constant'. vardef(Tlp) = 's '.CHAPTER 26. limits(Tspi) = (0.13 DSL Reference 26.'High pressure turbine time constant '.Tip) ! medium pressure part ylp = PT1(yip. User Manual .x1.x1.(xe-x1)/T1.13.1 DSL Standard Functions 604 DIgSILENT PowerFactory 15.xe) ! if T1=0 => y=xe steamflow = at*x4 x4.(xe-x1)/T1.T1.x1.'Second reheater time constant ' inc(x1) = y/K inc(xe) = y/K inc(x4) = 1.) x1. vardef(Tip) = 's '.x3. = select(T1>0.0) y = K*select(T1>0.x1.0-alfhp-alflp) ptmw = pt*sgn*cosn*ngnum ! only for output purposes The used macro 'PT1’ is defined as: model y = 'PT1'(xe. STABILITY AND EMT SIMULATIONS vardef(alflp) = . = select(T1>0.K.) vardef(Thp) = 's '.

26.13. DSL REFERENCE
function
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
sinh(x)
cosh(x)
tanh(x)
exp(x)
ln(x)
log(x)
sqrt(x)
sqr(x)
pow (x,y)
abs(x)
min(x,y)
max(x,y)
modulo(x,y)
trunc(x)
frac(x)
round(x)
ceil(x)
floor(x)
time()
pi()
twopi()
e()

description
sine
cosine
tangent
arcsine
arccosine
arctangent
hyperbolic sine
hyperbolic cosine
hyperbolic tangent
exponential value
natural logarithm
log10
square root
power of 2
power of y
absolute value
smaller value
larger value
remainder of x/y
integral part
fractional part
closest integer
smallest larger integer
largest smaller integer
current simulation time
3.141592...
6.283185...
2,718281...

example
sin(1.2)=0.93203
cos(1.2)=0.36236
tan(1.2)=2.57215
asin(0.93203)=1.2
acos(0.36236)=1.2
atan(2.57215)=1.2
sinh(1.5708)=2.3013
cosh(1.5708)=2.5092
tanh(0.7616)=1.0000
exp(1.0)=2.718281
ln(2.718281)=1.0
log(100)=2
sqrt(9.5)=3.0822
sqr(3.0822)=9.5
pow(2.5, 3.4)=22.5422
abs(-2.34)=2.34
min(6.4, 1.5)=1.5
max(6.4, 1.5)=6.4
modulo(15.6,3.4)=2
trunc(-4.58823)=-4.0000
frac(-4.58823)=-0.58823
round(1.65)=2.000
ceil(1.15)=2.000
floor(1.78)=1.000
time()=0.1234
pi()=3.141592...
twopi()=6.283185...
e()=2,718281...

Table 26.13.1: DSL Standard Functions

26.13.2

DSL Special Functions

lim
lim (x, min, max)
Nonlinear limiter function:

Figure 26.13.1

limits
limits(param)=(min, max)
Limiter function used to print a warning message to the Output Window if a parameter is outside
the specified limits. Brackets [ and ] are used to indicate the inclusion of the end points in the
range, ( and ) are used to indicate the exclusion of the end points from the range.
Example:
limits(K)=(0,1]

DIgSILENT PowerFactory 15, User Manual

605

CHAPTER 26. STABILITY AND EMT SIMULATIONS
limstate
limstate (x1, min, max)
Nonlinear limiter function for creating limited integrators.
Example:

x1. = xe/Ti;
y = limstate(x1,min,max);
This was previously realized by using "select" and "lim" functions:
x1. = select( x1>=max.and.xe>0
& .or.x1<=min.and.xe<0, 0, xe/Ti);
y = lim(x1,min,max);
delay
delay (x, Tdelay)
Delay function. Stores the value x(Tnow) and returns the value x(Tnow-Tdelay). Tdelay in
seconds and larger than 0.0. The expression Tdelay must evaluate to a time independent
constant and may therefore only consist of constants and parameter variables. The expression
x(t) may contain other functions.
Example:
y = delay(xe + delay(x1, 1.0), 2.0)
Resetting a DSL model initializes its delay functions with x(Treset).
select
select (boolexpr, x, y)
Returns x if boolexpr is true, else y. Example:
x1.=select(T1>0, xe/T1, 0.0) !to avoid division by zero
time
time ()
Returns the current simulation time. Example:
t=time()
y = sin(t) or
y = sin(time())

file
file (ascii-parm, expr)
!OBSOLETE! Please use an ElmFile object in the composite model in stead.
picdro
picdro (boolexpr, Tpick, Tdrop)
Logical pick-up-drop-off function useful for relays. Returns the internal logical state: 0 or 1.
Return value:
The internal state:
• changes from 0 to 1, if boolexpr=1, for a duration of at least Tpick seconds
• changes from 1 to 0, if boolexpr=0, after Tdrop seconds
• remains unaltered in other situations.
606

DIgSILENT PowerFactory 15, User Manual

26.13. DSL REFERENCE
flipflop
flipflop (boolset, boolreset)
Logical flip-flop function. Returns the internal logical state: 0 or 1.
Return value:
The internal state:
• changes from 0 to 1, if boolset=1 and boolreset=0 (SET)
• changes from 1 to 0, if boolset=0 and boolreset=1 (RESET)
• remains unaltered in other situations. (HOLD)
Initial value: boolset. The initial condition boolset=boolreset=1 will cause an error message.
aflipflop
aflipflop (x, boolset, boolreset)
'Analog'flip-flop function. Returns the (old) value for x at SET-time if internal state=1, else returns
the current value of x.
lapprox
lapprox (x, array_iiii)
Returns the linear approximation y=f(x), where f is defined by the array_iiii. Please consider that
the array has to be sorted in ascending order.
Example:
y = lapprox(1.8, array_valve)
invlapprox
invlapprox (y, array_iiii)
Inverse lapprox with array.
lapprox2
lapprox2 (xl, xc, matrix_iiii)
Returns the linear approximation y=f(xl,xc) of a two-dimensional array, where f is defined by the
matrix_iiii. xl represents the line value and xc the column of the matrix. Please consider that the
array has to be sorted in ascending order.
Example:
y = lapprox2(2.5, 3.7, matrix_cp)
sapprox
sapprox (x, array_iiii)
Returns the spline approximation y=f(x), where f is defined by the array_iiii. Please consider that
the array has to be sorted in ascending order.
Example:
y = sapprox(1.8, array_valve)
sapprox2
sapprox2 (xl, xc, matrix_iiii)
Returns the spline approximation y=f(xl,xc) of a two-dimensional array, where f is defined by the
matrix_iiii. xl represents the line value and xc the column of the matrix.

DIgSILENT PowerFactory 15, User Manual

607

User Manual . string ThisSlot (mandatory. double var (optional) Parameter to which the value is set (only when ’name=this’ is set or when a parameter event is created). The event is executed. If ’name=this’ is set. depending on the trigger signal. ’create = ThisEvtType target = ThisSlot name = ThisEvent dtime = delay value = val variabl e =var’) This function can create or call any kind of event for the DSL model itself or elements inside the network. only option 3) Type of event to be created. Mind: the event command has changed from DSL level 3 to level 4! Arguments: int Condition (obligatory) Boolean expression to activate (=1) or deactivate (=0) the event handling.5. double trigger (obligatory) The trigger signal. trigger. the event can be executed. ’name = ThisEvent dtime = delay value = val variable=var’) Option 2: target specification. The event is then applied to the element assigned to that slot.CHAPTER 26. double val (optional) Value of the parameter event (only when ’name=this’ is set or when a parameter event is created). the DSL interpreter checks the composite model where the present DSL model (common model) is used and searches for a slot with the given name. and which of the three options above applies: string ThisEvtType (mandatory. Return value: void (no return value) 608 DIgSILENT PowerFactory 15. if Condition is set to 1. if the input signal trigger changes sign from .7.to + with a time delay of dtime. STABILITY AND EMT SIMULATIONS Example: y = sapprox2(2. double delay (obligatory) Delay time of the event after triggering. If any other name is given. ’target=ThisSlot name = ThisEvent dtime = delay value = val variable = var’) Option 3: create and target specification event(Condition. etc. no create parameter event(Condition.g. trigger. which will enable the execution of the event. The string format determines the details of the event call. a parameter event will be created and executed automatically with the DSL element itself as the target. To specify the type use e. string ThisEvent (obligatory) Name of the event created (option 3) or the external event to be started (option 1/2). matrix_cp) event Option 1: calling a predefined event in the DSL element event(Condition. 3. the event is applied to a signal of the present DSL model. trigger. The external event must be stored locally in the DSL model. only options 2 and 3) If ’target=this’ is defined. ’EvtParam’ for parameter event or ’EvtSwitch’ for switch event.

. PowerFactory calculates the derivatives of the state variables and outputs.’name=OpenBreaker dtime=0. The event in the event list will be called ’TripLoad’. There are two state variables.’name=this value=0 variable=xclock’) clockout=xclock The following event calls an external event called ’OpenBreaker’. PowerFactory calls MATLAB with every time step. MATLAB INTERFACE Remark: If the event()-definition according to options 2/3 is used. and y represents a matrix of output values. if the integrator output xclock is larger than 1.’name=this .01 ]︂ [︂ . MATLAB does not run a simulation in parallel with PowerFactory .7) 609 .02 2.g.to +.14 MATLAB Interface In addition to building controller models using the DIgSILENT Simulation Language (DSL). The numerical integration is conducted in PowerFactory .. PowerFactory calculates the derivates and the outputs at the beginning of the time step. when the signal ’u-umin’ becomes positive. inc(xclock)=0 inc(clockout)=0 xclock.’create=EvtSwitch name=TripLoad target=Load’) 26. Examples: The example shows a clock made with DSL using event( .𝑦 = 10 2 11 3 ]︂ (26. event(1.1 1.03 1. which correspond to the initial and the final times of that time step. In the following example the initial time is 0 s and the final time is 0.g.02 𝑑𝑥1 = 𝑑𝑡 0.𝑥 = 1. [︂ 𝑡= 0 0.yo. it simulates only one time step and returns two rows in t. . User Manual (26. The DSL model must have at least one output and at least one state variable. if yo changes sign from . The input signal is a clock signal with the time period Tclock. The matrix x has as many columns as there are state variables.1.2s..01 − 0 DIgSILENT PowerFactory 15. From these. The variable named xclock will be reset to value val=0 within dtime=0. and proceeds with the integration. x represents a matrix of state-variable values. where t represents a time-vector.’) which automatically creates and configures a parameter event. the create and target parameters must be the first parameters that are listed.=1/Tclock reset_clock=select(xclock>1. and two outputs.01 s. and obtains the outputs of the MATLAB model at the beginning of the time-step from the y-matrix.03 − 1. which is stored and defined inside the DSL element. event(1.26.14.6) PowerFactory calculates the deriviatives from the time step and the initial and final values of the state variables. A DSL model (object class BldDef ) is defined in PowerFactory and set up to have a link to a MATLAB .2’) The following event is a simple undervoltage load-shedding relay.m file.-1) event(enable. it is possible to connect to MATLAB models via a PowerFactory -MATLAB interface. The element in the slot ’Load’ will be disconnected with a switch event ’EvtSwitch’. and the matrix y has as many columns as there are outputs.reset_clock. x and y. The MATLAB .umin-u. (1.m file returns the vector t and the matrices x and y.9 ]︂ [︂ . e. The delay time is 0. e.

2. 610 DIgSILENT PowerFactory 15. where the reactive power is increased after 0. the voltage controller models are represented by the built-in models VCO type 16 (ElmVco__16).2 the edit dialogue of the ElmVco with the parameters of the AVR can be seen. The complete example contains three files: 1.g 𝑦1 = 10. Figure 26.14.1: MATLAB example grid The simulation event is defined for the load. and it is used as a middle layer in the communication between PowerFactory and Simulink.1.14. ˝ the When the time-domain simulation in PowerFactory is initialised. The following section provides an example of integrating a MATLAB model with PowerFactory . as shown in Figure 26.mdl is a Simulink model and contains Simulink implementation of VCO type 16. 26. e. 3.1 Example Implementation of Voltage Controller In this example the grid consists of two generators. The built-in VCO type 16 inside PowerFactory is one excitation control system with simplified exciter.14.1 Built-in Model In the base study case. User Manual . STABILITY AND EMT SIMULATIONS . This file is an interface to the Simulink model.m is a MATLAB M-file.14. Both composite models use the AVR inside the IEEE-frame from the global library. 26.14. vcotype16mod. To use the MATLAB interface. The generators have different VCO parameters set. This example can also be found in the SKnowledge ¸ Tˇ area of the DIgSILENT online customer portal. one load and one line. Matlab Example. it must be installed on the same computer as PowerFactory . In the example a voltage controller is implemented first using a PowerFactory model (ElmVco__16) and subsequently using an implementation in MATLAB Simulink.5 seconds.and obtains the outputs of the MATLAB model at the beginning of the time-step from the y-matrix. it will start an instance of MATLAB U same version that was used last.1. VCOtype16. In Figure 26.dz is a PowerFactory file.CHAPTER 26.

instead of using a built-in model.14.2 MATLAB Model In the second study case "Matlab" which is a modification of the base case.26.3. VCO type 16 is modelled inside the Simulink package.14. 26.3: Parameters dialogue of the voltage controller The plots resulting from the simulation (Figure 26.14 (MATLAB DIgSILENT PowerFactory 15.14.14. To implement a MATLAB model into a current project in PowerFactory it has to be included into a frame similar to a DSL model definition. Figure 26. MATLAB INTERFACE Figure 26. This procedure is described in detail in the Section 26.14. The MATLAB console is started automatically when running the simulation. The results are stored in result files located under the “Results" folder of the relevant study case.14.2: Parameters dialogue of the voltage controller The model representation of the ElmVco__16 is indicated in Figure 26.1. User Manual 611 .8) show busbar voltages and excitation voltage for both generators.

STABILITY AND EMT SIMULATIONS Interface). Instead of inserting the equations to describe the different function blocks. This is done exactly like for implementing built-in models or common models. This can be done in the dialogue of the block definition. a MATLAB file *. Figure 26. The edit dialogue of the block definition including the parameter definition and the selected file can be seen in Figure 26. parameters.CHAPTER 26. → Block/Frame . Instead of programming the transfer function using the DSL code. When creating a primitive DSL model in the library by • right-clicking a or inside a (library) folder in the active project in the data manager and selecting New.4: Composite model using a special frame 612 DIgSILENT PowerFactory 15.14. Now open the dialogue of the new BlkDef • by double-clicking on the frame of a composite block definition • by double-clicking the definition in side the library or on its icon Here input and output variables. • using the New Object icon ( ) in the database manager and selecting Block Definition (BlkDef ) • double-clicking an new/empty block reference in an open block diagram and then use the button to select a block definition. .14.Diagram from the context menu. when the option Matlab is activated. Then The icon can be used to create a new block definition inside the local library. there can now the definition of the MATLAB code be imported. where the controller model should be inserted. First a slot inside the frame has to be created.4 for the mentioned example.m can be selected. Then a block definition BlkDef has to be created inside the library. state variables and limiting signals have to be defined. User Manual . .

The common model then combines a model or block definition with specific set of parameter values. The edit dialogue of the DSL element now looks different to the built-in ElmVco.14. This means that all user-defined transient models including built-in elements or MATLAB models cannot be used other than through a common model. ) is the front-end object for all user-defined block definitions. a DSL model has to be created first.14. MATLAB INTERFACE The model representation of the ElmVco__16 in the MATLAB Simulink package is shown in Figure 26. From Figure 26. All time constants and other parameters are the same as for the built-in VCO models.5: Parameters dialogue of the voltage controller When the block definition is specified. that this dialogue is similar to the normal DSL models.14. DIgSILENT PowerFactory 15. As described in Section 26. User Manual 613 .5 Figure 26.14.26.3 (The Common Model).6 can be seen.9. the common model element (ElmDsl.

User Manual .CHAPTER 26.7 shows the composite model using the special frame with the generator ’G1’ and the Matlab-AVR inserted into the slots.14.6: Parameters dialogue of the MATLAB voltage controller Figure 26.14. STABILITY AND EMT SIMULATIONS Figure 26. 614 DIgSILENT PowerFactory 15.

7: Composite Model using a special frame These results from the simulation of the reactive power step using the built-in VCO model (dotted curves) and using the MATLAB representation (solid curves) can be seen in Figure 26. MATLAB INTERFACE Figure 26.14.8 Figure 26.14. User Manual 615 .14.14.8: Results of the transient simulation with the Built-In model DIgSILENT PowerFactory 15.26.

. [x1. x.m) file may not have the same name. e.01. The output of the string variable xstring contains the names of the dynamic blocks in the Simulink model in the desired order. To determine the order of the MATLAB state variable vector the user may use the command "[sizes. the parameters and the state variables are defined. the state derivatives equal to zero The Simulink solver parameters are set to integrate over one small time step. User Manual .g. Estop. x. for the purpose of PowerFactory ’s model checking mechanisms. . Ur1mn. The order of the state variables in the interface file’s statement "options = simset(’InitialState’. end time = 0. . To find appropriate equations for the initial conditions you need to understand the construction of the transfer function blocks in Simulink.mdl extension and without inverted commas). In each step of the PowerFactory simulation the Simulink model is completely evaluated. x1. Upss. . Efdmn.14. set the initial conditions. x2 Those variables are necessary to successfully run the Simulink model. x2. Usetp. stored in the file vcotype16mod. run it for a few seconds and monitor the outputs of all transfer functions to see whether the model initialized correctly.x0. ])" is important. as described below. The contents of this file is listed here: function [t. Upss). options = simset(’InitialState’. which allows only one instance of the model running at the same time. There are three input signals (U. y] = sim(’VCOtype16mod’..mdl. 616 DIgSILENT PowerFactory 15.01. ve1.. PowerFactory uses only one Simulink model for both generators. Ur1mx. start time = 0. STABILITY AND EMT SIMULATIONS 26. . The MATLAB Simulink model (. Vsex. ] must be the same as in the state variable vector constructed internally by MATLAB. The initial conditions are set within PowerFactory . Also. x. where ModelName is the name of the Simulink model (without the .CHAPTER 26. and step size = 0. [t. [x1..1. the order of the elements in the vector [x1. State variables (’InitialState’) are assigned to Simulink model in each step of the simulation. []. one output signal Uerrs and two state variables x1 and x2. There the input and output signals. To obtain this understanding you can replace the variables with actual numbers in the MATLAB Simulink model. In the case of the above example the first state variable is in the measurement block and the second state variable is in the integrator: xstring = . y] = VCOtype16 global U Tvm Usetp Upss Vska Tisp Ur1mx Ur1mn Vsex Efdmx Efdmn ve1 x1 x2 options = simget(’VCOtype16mod’). Efdmx. ..x2]). To avoid limitation of Simulink. PowerFactory must send all parameters in the each step of the simulation. Tvm. and the PowerFactory DSL model.xstring]= ModelName" in the MATLAB workspace. For PowerFactory it is a simple function call: [t.’VCOtype16_model/Integrator’ The names of the variables in the ’Initial conditions’ fields in the masks of the Simulink model dynamic blocks is irrelevant.3 The MATLAB File The MATLAB file VCOtype16. . Vska. The transfer function is specified.’VCOtype16_model/Measure/State Space’ . . x2.m is an interface configuration for the Simulink model. Tisp. PowerFactory inserts the following variables into the MATLAB workspace: U. y] = VCOtype16. options). .mdl) and the interface file (.

com DIgSILENT PowerFactory 15. User Manual 617 . if there are two outputs "uerrs" and "output". Additional information on the calling of MATLAB is available on http://www. then those are sorted alphabetically before assigning the outputs from MATLAB.2 Additional notes DIgSILENT PowerFactory calls MATLAB using the programme identification keys "Matlab.mathworks.Application. For example. then the value from the first column of the y-matrix is assigned to "output" and the value from the second column is assigned to "uerrs". MATLAB INTERFACE The y-matrix returned by MATLAB contains the output variables.14. PowerFactory will start that same MATLAB installation which was used last.Single".26. 26. If more than one output variable is defined in the DSL model.14.Application" and "Matlab.

CHAPTER 26. STABILITY AND EMT SIMULATIONS 618 DIgSILENT PowerFactory 15. User Manual .

When doing such a study. Electro–mechanical oscillations for each generator are then stable. This calculation can be completed at the beginning of a transient simulation and at every time step when the simulation is stopped. This means that they lie in the left complex half-plane. User Manual 619 . The various methods of analyzing the results are also presented. this chapter the calculation will generally be referred to as Modal Analysis. Finally. After determining these ’natural’ modes. gain. alternative methods for calculating the system eigenvalues and eigenvectors must be used when the system grows very large. Throughout. This chapter provides a brief background on the theory of Modal Analysis. or the simulation has been stopped at a point in time. These are the oscillation modes of the system when all controller and power plant models are deactivated so every synchronous machine will have constant turbine power and constant excitation voltage. the effects of controllers (structure. 27. time constants etc. for which the frequency dependencies are neglected.Chapter 27 Modal Analysis / Eigenvalue Calculation The Modal Analysis command calculates the eigenvalues and eigenvectors of a dynamic multi-machine system including all controllers and power plant models. it is highly recommended to first compute the “natural" system oscillation modes. For this reason. The computation time for the Modal Analysis is approximately proportional to the number of state space variables to the power of three.) and other models can be investigated. A multi-machine system exhibits oscillatory stability if all conjugate complex eigenvalues making up the rotor oscillations have negative real parts. iterative algorithms. Considering. After the initial conditions have been calculated successfully. Note that sometimes in the literature Modal Analysis is referred to as Eigenvalue Calculation or Small Signal Stability. a “troubleshooting" section explains what to do when you receive common errors. PowerFactory supports two types of analysis methods.1 Theory of Modal Analysis The calculation of eigenvalues and eigenvectors is the most powerful tool for oscillatory stability studies. which means that all time-derivatives of the state variables should be zero (the system is in steady state). DIgSILENT PowerFactory 15. except for the general load model. The representation of the electrodynamic network model is equivalent to the representation used for the balanced RMS simulation. the calculation time can rapidly increase as the size of the system being considered increases. followed by a detailed explanation of how to complete such an analysis in PowerFactory. the modal analysis calculates the complete system A-matrix using numerical. that most power system objects and models will contain several (perhaps up to a dozen or more for some complex controllers).