OpenDSS Dynamics Mode
OpenDSS Dynamics Mode
{Predictor}
IterationFlag := 0;
IntegratePCStates;
SolveSnap;
{Corrector}
IterationFlag := 1;
IntegratePCStates;
SolveSnap;
The algorithm is currently a simple predictor-corrector method with one step of
correction. The IterationFlag variable indicates to the integration routines whether the
solution is in the predictor step or the corrector step.
The dynamics algorithm was first implemented with no corrector step, but after some
experimentation it was found that the machine electromechanical transients behaved
much better with one step of correction.
The IntegratePCStates function cycles through each Power Conversion (PC) element in
the circuit and executes its IntegrateStates function. IntegrateStates is a virtual function
that is overridden in models that actually have something to integrate. For example,
Generator elements have state variables to integrate. However, others do not and this
function is simply empty.
Only PC elements have states that are integrated. Power Delivery (PD) elements are
constant impedance elements simply defined by a primitive Y matrix.
1
In addition to Dynamics mode, the OpenDSS program goes into dynamics solution mode
for FaultStudy and MonteFault (MF) solution modes so that contributions from
Generator objects and other active objects are more accurately captured.
The steps the program executes when going into Dynamics mode from one of the power
flow solution modes is as follows:
Initialize state variables in all PC Elements
o For example, in a Generator object currently:
Compute voltage, E1, behind Xd' to match power flow
(approximately)
Initialize the phase angle, , (power angle) of equivalent voltage
source
Set derivatives of the state variables to zero
o For the Generator,
Speed (relative to synch frequency)
Angle
Set controlmode=time
o When running in time steps of a few seconds or less, controls that depend
on the control queue for instructions on delayed actions will be
automatically sequenced when the solution time reaches the designated
time for an action to occur.
Set a flag to preserve Node voltages in case Y matrix changes.
o Y matrix changes could occur if a switch were to open during the
simulation, which might re-order the bus lists. This flag prevents loss of
data by reassigning the Node voltage after the re-ordering.
2
previous solution. The following three steps are performed for both the predictor and
corrector steps:
1. Compute derivatives for this time step
2. Integrate state variables
3. Solve the circuit with this guess
For the present implementation of the Generator object, the state variables are the speed
(relative to synchronous speed) and the shaft angle, . The derivatives of these are
computed and then integrated in a trapezoidal formula as follows:
Derivative Calculation:
dv Pshaft Pterm D v
dt M
d
v
dt
Where,
v = shaft speed (velocity) relative to synchronous speed
= shaft, or power, angle (relative to synchronous reference frame)
Pshaft = shaft power
Pterm = terminal power out
D = damping constant
M = mass
Integration
Trapezoidal integration formula for , for example:
t d d
n 1 n
2 dt n dt n 1
3
Circuit Solution in Dynamics Mode
The circuit solution proceeds more or less like it would for a normal power flow solution.
The Load elements are presently treated the same since load dynamics have not been
implemented. They are sinks or sources of power, depending on sign. However, the
Generator, and any other elements with dynamics models, will behave differently. The
present implementation of the Generator model computes its terminal currents using the
voltage source, adjusted for the new phase angle computed by the integration steps, rather
than a specified power and power factor as it is modeled in a power flow solution. Thus,
the power from the Generator will depend on system conditions with might be the result
of a disturbance (thats usually why you would be simulating dynamics).
As a point of reference, in Harmonics mode, the Loadmodel option is set to Admittance
and a direct solution is performed. This is a non-iterative solution mode. However, in
Dynamics mode, the load flow is normally solved iteratively for each guess at the
Generator voltages.
Phases Xd
A Positive
Phase Sequence EE1 1
to
B Symmetrical
Component
Transformation
C
Negative
Xd
Sequence
4
initializing power flow solution is reasonably well balanced (i.e., no fault conditions do
that after entering dynamics mode). The generator excitation is assumed to be only
positive sequence.
The negative-sequence network consists of the value specified for the Xdpp property of
the Generator. This is usually closer to the actual negative sequence reactance of a
machine. The actual negative sequence reactance of the generator many be entered for
Xdpp if known.
The terminal currents are computed as follows:
The phase domain (ABC) voltages are transformed to symmetrical component
(012) voltages.
The symmetrical component currents are computed based on the present value of
E1 and .
o is determined in the integration step. In the default model this is based
on a simple single-mass model and the difference between the shaft power
and the electrical power.
o In the default model, no exciter or governor action is modeled. Therefore,
E1 and the shaft power remain constant for the duration of the simulation.
User-written modules could change these values.
Finally, the symmetrical component currents are transformed back into the phase
domain. The terminal currents are used to compute the compensation currents that
are used in the circuit solution algorithm (see below).
Compensation Currents
Once the terminal currents have been computed, the compensation currents from all PC
elements that appear in the system nodal admittance equations in the Normal solution
mode are computed (see Figure 2).
5
ALL Elements
PC Elements
Comp. Currents
I1
I2
Iinj =
Y V Node
Voltages
Im
Iteration Loop
Compensation
Yprim Current