Beruflich Dokumente
Kultur Dokumente
IN
POWER SYSTEM TRANSIENT SIMULATIONS
By
Antonio Emilio Angueth de Araujo
B. Sc. (Electrical Engineering) Universidade Federal de Minas Gerais, Brazil
M. Sc. (Electrical Engineering) Universidade Federal de Minas Gerais: Brazil
in
THE FACULTY OF GRADUATE STUDIES
ELECTRICAL ENGINEERING
Electrical Engineering
The University of British Columbia
2075 Wesbrook Place
Vancouver, Canada
V6T 1W5
Date: `3 9 3
Abstract
In power system simulations, control systems act upon the electric power system in
a variety of ways. There is, therefore, a necessity of simulating the control system
equations together with the power system equations. This is the case not only in
stability studies, but also in the simulation of electromagnetic transient phenomena.
Because of the different structure of the two sets of equations, computational
efficiency can be improved if both sets of equations are solved separately, with the
result from one set of equations showing up in the other set of equations one or more
time steps later. This procedure, however efficient, can lead to numerical instability.
In the simulation of the control system itself, the modelling of nonlinearities in
closed loops poses some problems as well. The most efficient way of handling a
nonlinear block is to open the closed loop and use, instead of the current value of
the variable, a predicted value of the feedback path. This can also lead to numerical
instabilities.
In this thesis a simultaneous solution of the control and power system equations
is proposed. For the cases of nonlinearities in closed loops, an iterative solution is
suggested. The implementation of the method is carried out in the Electromagnetic
Transients Program (EMTP).
Several comparisons between the proposed and other methods are performed. In
cases in which the analytical solution is not available, the comparison is made against
the results of the TAGS package ("Transient Analysis of Control Systems") which
ii
is integrated with the EMTP version of DCG/EPRI ("Development Coordination
Group/Electric Power Research Institute").
It is shown through simple, but typical, case studies that the proposed method is
not only accurate and efficient, but also numerically stable, thus representing a sig-
nificant improvement to the ability of the EMTP to reliably simulate electromagnetic
transients in power systems when control systems are involved.
iii
Table of Contents
Abstract^ ii
List of Figures^ ix
1 Introduction^ 1
2 Literature Review^ 4
2.1 Introduction ^4
2.2 EMTP-TACS Approach ^4
2.3 TACS Solution Method ^6
2.3.1 Transfer Functions - Linear Blocks ^6
2.3.2 Nonlinear Function Blocks ^8
2.3.3 Transfer Function with Limiters ^9
2.3.4 TACS-EMTP Interface ^ 11
2.4 Time Delays in the TACS-EMTP Approach ^ 12
2.5 Final Remarks ^ 14
iv
3 Time Delays and the Stability and Accuracy of the Simulation^15
3.1 Introduction ^15
3.2 Numerical Instability ^16
3.2.1 DC Circuit ^16
3.2.2 Arc modelling ^18
3.2.3 Sinusoidal Oscillator ^20
3.3 Stable Inaccurate Results ^21
3.3.1 Internal Time Delays ^21
3.3.2 Converter Simulation - External Time Delays ^ 22
6 Conclusions^ 81
Bibliography^ 83
vi
B.2 Control and Power System Case Studies - SS and EMTP Input Files 119
B.2.1 Arc Modelling (Section 5.3.1) ^ 119
B.2.2 Single-Phase Variable Load (Section 5.3.2) ^ 120
B.2.3 Step Load Variation (Section 5.3.3) ^ 122
B.2.4 Pulse Load Variation (Section 5.3.3) ^ 125
B.2.5 Load Variation with Thyristor Controlled Reactor (Section 5.3.3)128
B.2.6 HVDC System Simple Model (Section 5.3.4) ^ 135
B.2.7 Single-Phase Thyristor Rectifier Bridge (Section 5.4) ^ 138
B.2.8 Three-Phase Thyristor Inverter (Section 5.4) ^ 141
vii
List of Tables
viii
List of Figures
ix
4.3 Subroutine CONNEC and its interface with the EMTP ^ 30
4.4 Control actions upon the power system ^ 31
4.5 Matrix formation inside CONNEC ^ 32
4.6 Controlled integrator block ^36
5.1 Second-order linear system: (a) Diagram; (b) Solution for a unit step
input. ^43
5.2 Static limiter: (a) Diagram; (b) Simulation results. ^45
5.3 Dynamic limiter: (a) Diagram; (b) Simulation results ^46
5.4 Nonlinearity in a closed loop: (a) Diagram; (b) Simulation results [1] ^47
5.5 Special element blocks - Diagram and simulation results (source =
cos wt, w = 377 rad/s and time delay = 2 ms). ^ 47
5.6 Arc modelling - superposition of the analytical and the SS simulation
results ^48
5.7 R-L load representation; c = R/L ^ 49
5.8 Active power variation ^ 50
5.9 Block diagram - Single-phase variable load [1] ^51
5.10 Simulation Results: (a) TACS solution [1]; (b) SS results ^52
5.11 Sample power system [1]. ^ 54
5.12 Diagram of the Thevenin reduced system [1]. ^ 54
5.13 Load modelling - step variation [1] ^56
5.14 (a) Load variation - step variation, (b) TACS simulation result [1], (c)
SS simulation result. ^57
5.15 Load modelling - pulse variation [1]. ^58
5.16 (a) Load variation - pulse variation, (b) TACS simulation result [1],
(c) SS simulation result. ^59
5.17 Thyristor controlled reactor: (a) Circuit diagram; (b) Circuit model;
(c) TCR s-domain model ^ 61
5.18 Basic TCR voltage controller - ic/L modelling [1] ^62
5.19 TCR and its control system - a simple model ^62
5.20 SS block diagram. ^63
5.21 Load variation. ^64
5.22 Load variation without TCR: (a) TACS simulation [1]; (b) SS simulation. 65
5.23 Load variation with TCR: (a) TACS simulation [1]; (b) SS simulation. 66
5.24 Power system with a DC line [1]. ^ 67
5.25 Id and a modelling [1] ^68
5.26 EMTP-SS simulation diagram [1]. ^ 68
5.27 (a) Voltage tracking system; (b) DC system equations; (c) AC current
injection [1] ^69
5.28 IDC, ALPHA and IACF comparisons; (a) TACS simulation [1]; (b) SS
simulation. ^70
5.29 Voltage at bus 1 (BUS1) comparison; (a) TACS simulation [1]; (b) SS
simulation. ^71
5.30 Single-phase thyristor rectifier. ^73
5.31 Single-phase rectifier simulations - voltage vd: (a) TACS results; (b)
SS results ^74
5.32 Closing and opening of EMTP switches. ^ 75
5.33 Backtracking procedure. ^77
5.34 Inverter simulation: instability due to thyristor misfiring ^78
xi
Acknowledgements
To my wife Angela, for her having put aside her own career and interests to kindly
accompany me and, with love, make my undertaking possible. To my children Thiago
and Henrique, who made my life a little more complicated but full of love and fun.
To Dr. H.W. Dommel and Dr. J.R. Marti for their invaluable help, direction and
advice. To Dr. Nelson Santiago for his help during the period of my thesis writing.
To my colleagues for making my stay at UBC memorable.
Finally, to CNPq (Brazilian Research Council), to Universidade Federal de Minas
Gerais and to The University of British Columbia for their financial support.
xii
Chapter 1
Introduction
During the 1960's and 1970's the modelling and simulation of power systems transient
phenomena reached a high degree of sophistication. Numerical techniques, as well as
models of various power system components, were developed for digital transient
simulation software packages.
With the increased use of HVDC transmission systems, and the wide application
of other power electronic devices in power systems, it became necessary to simulate
the control systems acting upon the power system in addition to the power system
itself. This is very important in cases where the dynamic interactions between the
control and the power system are of major concern.
In general, the control system acts upon the power system in three different ways:
The decisions made by the control system are based on the information which it
receives from the power system, such as node or branch voltages, branch currents or
state of the switches. Figure 1.1 depicts the general situation.
1
Chapter 1. Introduction^ 2
switch status
voltage
Power current
System
'-7
Control
switch command System
voltage
current
The power system component models are relatively easy to incorporate into nodal
network equation representations. Control system components are not as easy to
model. They do not fit into the nodal network representation, and the associate
matrices are not symmetric.
The easiest and most efficient way of handling these differences, is to simulate
the power system equations separately from the simulation of the control system
equations. Both sets of equations are solved separately, and then interfaced with
each other through the exchange of information about the values of the parameters
which they share. This introduces time delays between both solutions and makes the
solution procedure non-simultaneous.
The simulation of the control system itself may require some special treatment as
well. Whenever a nonlinearity exists in a closed loop in the control system, there is
Non-simultaneity is the basis for the efficiency of the solution method outlined
above. However, this procedure can lead to two distinct and important problems -
inaccuracy and numerical instability.
These two problems are addressed in this thesis. A general simultaneous solution
method of the control and power system equations is proposed. Comparisons between
the proposed and other methods, showing its accuracy and stability, are performed.
The thesis is divided into six chapters as outlined below:
• Chapter Three - Effects of Time Delays on the Stability and Accuracy of the
Simulation ^ The main objective of this chapter is to identify the most
important effects of time delays (non-simultaneity) on the stability and accuracy
of the solution.
Literature Review
2.1 Introduction
Several current digital computer programs for power system transient analysis are
known as "Electromagnetic Transients Program". Most of them are variations of the
basic EMTP [3]. See reference [4] for a complete description of the various versions.
Control system simulation capabilities were originally added to the BPA EMTP
(Bonneville Power Administration EMTP). Although other programs not directly
related to the EMTP exist which are able to simulate control and power systems, this
chapter will cover only the EMTP-related literature, because of the wide-spread use
of the EMTP compared to other programs.
One of the first works on the simulation of control and power systems using general
purpose programs was done by L. Dube and H. Dommel [5]. Their technique was
incorporated into a digital computer program called TACS (Transient Analysis of
Control Systems), which became part of the EMTP. TACS is still used today in the
DCG/EPRI EMTP. The main objective at that time was the simulation of HVDC
converter controls.
4
Chapter 2. Literature Review^ 5
From internal
source To EMTP
G(s) Kl/s Vcos(180- P)
• its code is independent of the EMTP, and interfaces with the EMTP with one
time step delay;
• it solves the control system equations by implicit integration with the trape-
zoidal rule.
work, performs some actions and then gives information back to the network.
Although there have been many additions to the TACS set of blocks over the years
[6], the basic blocks used to simulate any control system are:
where u is the sum of all input variables. The coefficients c and d are calculated using
the recursive formula:
n^2 •
co = E() 2 D i
i . 0 At
where c = co . The formulas for d are found replacing D by N in the above formulas.
Chapter 2. Literature Review^ 7
Ul
+N s+.+Ns
0 1
U2 U X
K n
D + D s + + Dn s
O l
U3
The calculation of the history term hist(t — At) is not simple and the reader is
(A)(X) = (hist).
To clarify this point, assume the system of Figure 2.3 is to be simulated [7].
Applying Eq. 2.1 to the blocks of this figure, the related matrix equation will be
/ xi
Ca Ka da Ka d a 0 Kada 0 x2 (hist a
—Kbd b 0 0 Cb 0 Kbdb X3 histb
(2.2)
—K c d, c, 0 0 0 0 x4 hist
0 0 Cd — K add 0 0 U1 histd
\ U2
If u i and u 2 are known sources at each time step, the unknowns are x l , x 2 , x 3 and
x 4 . The previous equation can be written as follows:
-U2
Ul X1 X4
a b
where
( Ca Ka d a Ka d a 0
—Kbdb 0 0 Cb
A xe =--
—Kc d, c, 0 0
0 0 cd —Kddd
and
—Ka da 0
0^Kb db
ASU
0^0
(
0^0
The Equations 2.3 can now be solved for the unknowns at each time step. Trian-
gular factorization and ordering techniques with a sparsity storage scheme are used
in the solution. The factorization is performed once, and at each time step there is
one forward solution and one back substitution [5].
Nonlinear function blocks are not included in the previous simultaneous solution of
the whole system. Instead, they are solved sequentially as soon as their input signals
become available at some stage in the back substitution mentioned above.
Chapter 2. Literature Review^ 9
Delay 1--
Decoupling
Figure 2.4: Nonlinear function blocks
In an open loop configuration, the nonlinearity does not pose any problem since
its input does not depend on its output. Problems arise in a closed loop configuration,
where the sequential solution forces the introduction of a time-delay to decouple the
input from the output of the nonlinear block (see Figure 2.4).
The introduction of this time delay occurs whenever a nonlinear block exists inside
a closed loop configuration. Many of the Fortran Functions and Devices blocks are
nonlinear and are likely to cause the introduction of such time delays, which the
program user may not even be aware of.
The general transfer function block has an additional feature that enables the user to
use two types of limiters. The function of these limiters is to limit the output of the
block if a certain condition is reached.
The output of the static limiter shown in Figure 2.5 is
Chapter 2. Literature Review^ 10
x
G(s)
Xrain
Each of the three equations above is a linear algebraic equation of the form of
Eq. 2.1, with c = d = 1, hist = 0 inside the limits, and c = 1, d = 0, hist =
(X mas or x rnin ) at the limits.
Contrary to static limiters, the limiting action of dynamic limiters changes the
dynamic behaviour of the transfer function block. These limiters are applied only
for first-order transfer functions [7]. The equations for the dynamic limiter are (see
Figure 2.5)
I
x +T"t = Ku if X sa m < X < X mas ,
X = X m i a^if X < Xmin and (Ku — x) < 0,
x = X mas^if x> X mas and (Ku — x) > 0.
The dynamic limiter equations can also be put in the format of Eq. 2.1. Inside
the limits, the coefficients are:
d = K;
2T
c^(1+ —A7 );
2t
hist = Ku(t —^(1 )x(t At).
At
— — —
Chapter 2. Literature Review^ 11
t-2At^t-/.t
EMTP
TACS
t-20t t-:At
Outside the limits the coefficients are the same for both limiters.
Although both types of limiters fit into Eq. 2.1, when they occur in closed loops
their input will depend on their output. This situation is similar to the case of non-
linear blocks where the introduction of time delays is unavoidable. This is discussed
in Section 2.4.
As mentioned before, TACS solves the set of control system equations independently
from the EMTP and has to communicate with it to exchange information on how the
control action is supposed to influence the power system. Figure 1.1 in Chapter 1
outlines the interface process between both programs. It is clear from this figure
that for TACS to issue any control signal to the power system it must have received
information from the EMTP previously. Figure 2.6 shows how the process takes place
as a function of time.
TACS solves the control system equations from (t — 20t) to (t — At). Then it
gives the values of the variables to the EMTP. The EMTP solves the power system
equations for (t — At) to (t). At t, the EMTP gives to TACS the values of the variables
Chapter 2. Literature Review ^ 12
in order for TACS to advance the solution from (t - At) to (t). Therefore, the EMTP
always uses information from TACS delayed by one time step.
To summarize what has been discussed so far, there are two types of time delays in
the TACS-EMTP approach:
• Time delay between TACS and the EMTP - external time delays;
• Time delays generated by TACS itself due to nonlinear blocks or transfer func-
In 1983/84 Ma Ren-ming made some revisions to the original TACS code with
respect to the order in which the blocks of the control system are solved [7, 8]. One
of the objectives of this revision was to decrease the possibility of the introduction of
internal time delays in a variety of situations.
equation (Eq. 2.1) must be the last equation of equations 2.3 (the first one to be
solved during the backsubstitution - see Section 2.3.1). The limits constraints are
applied as soon as the output is available. With the output of F2 known, the output
of F3 can be calculated and its equation must be solved next in the backsubstitution
process. Then F4 and Fl are solved in this order. F5 and F6 are solved next and in
the last set of four blocks the order is: F10 -+F7 -*F8
Chapter 2. Literature Review^ 13
HI HI
Fl F2 F5 F6
HI
LOW LOW
F4 F3
LOW
The ordering used in this case avoids the introduction of time delays in the solution
procedure, but the ordering approach is far from general. Any ordering scheme fails
if there are two limiters in one single closed loop.
control and power systems, Lima [10] showed in 1985 that a numerical instability
can arise in the simulation of an arc of a circuit breaker, due to the time delay
between TACS and EMTP. A more recent work [11] describes numerical instability
in simulations of a lead acid battery (DC circuit) due to the same time delay.
In 1986/87 a study of several problems concerning TACS, after about ten years of
existence, was carried out at The University of Wisconsin [12]. This work classifies,
among others, the problem of time delays within TACS and between TACS and
EMTP as a major TACS problem. It also contains examples of numerically bounded
Chapter 2. Literature Review^ 14
The major work related to the elimination of time delays is reference [8]. This work
reduces many of the internal time delays, but not completely. The problem of the
time delay between TACS and EMTP has not been considered either by that work
or by any other work.
The importance of the present thesis lies in the fact that it addresses the problem
of eliminating both types of time delays. How important this is will become clear in
the next chapter, where the effects of the time delays in transient simulations will be
considered. Several cases of inaccuracy, instabilities and bounded oscillations will be
analyzed.
Chapter 3
"...if the feedback is delayed too long, oscillations will happen. A simple example that illustrates feedback instability
is the common home shower. Typically the shower begins with the water too cold, and the user turns up the hot water
to get the temperature he wants. If the adjustment is too strong (he turns the knob too far), he will soon find that
the shower is too hot, whereupon he rapidly turns back to cold and soon finds it is too cold. If the reactions are too
strong, or alternately the total system (pipes, valve, and human) is too slow, there will result a "hunting" that grows
more and more violent as time goes on."
R.W. Hamming°
° Numerical Methods for Scientists and Engineers — Dover Publications — New York — 1973.
3.1 Introduction
The objective of this chapter is to illustrate, with examples, the numerical instabil-
ity and stable inaccurate results that arise from the introduction of time delays in
transient simulations. The examples used are purposely simple to show the concepts
involved. However, some of them have practical importance in specific applications
as well.
15
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation^16
R= I
t= 0
b
TACS EMTP
where Va b(n) is the latest value TACS gives to the EMTP. As TACS lags one time
step behind the EMTP,
Figure 3.2 shows a plot of I versus t for the first 10 time steps, using the two
previous formulas for different values of the ratio K = R I /R2 (0.5, 1 and 1.5).
From the values of I(n) and Va t, given in the formulas above one can get the
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation ^17
40
K=1.5
e
z . 0.75
2°
2, 0.5 C' 0
112
0.25 -20
0 -40 ^
0 2^4^6 10 0^2^4^6^8^10
Time (s) Time (s)
1^R 1 T(^
I(n) = ^1 ).
)
— R2 °-1 '
1^R1
= — — Z-1/(2).
R2 R2
EMTP
TACSI V 1 / R2
(a) (b)
Consider the circuit of Figure 3.3a where the resistor R2 is simulated by a current
source inside TACS [10]. The simulation arrangement is shown in Figure 3.3b. This
circuit can be used to model an arc in a circuit breaker by allowing R2 to vary
according to the arc characteristic.
The EMTP-TACS program discretizes the differential equation of the system using
the trapezoidal rule of integration. If the system Laplace transform algebraic equation
is available, it is possible to directly obtain the z-transform difference equation by
replacing s in the Laplace domain by (2/At) (z=-1
z ) [14]. The circuit of Figure 3.3b is,
I(z) = v1 /Zi
1 j_ (ZR2)(Z1
1 +Z2)
Z1 Z2
1+
(zR 2 )(Z1 + Z2 )
Zi Z2
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation ^19
Ze--(2/At)[(z 1)/(z+1)]L
-
100
".7e 50
-50
-100 -
-150 ^
0 1^2^3^4^5^6^7
Time (Rs)
z = 1 and z = Ri/R2.
For R 1 > R2 the system is unstable even with At^0. Figure 3.5 shows one
unstable simulation for L 0.3H, R 1 = 10051, R2 = 10Q and At = 10ms.
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation ^20
20 40 60 80 100
Time (s)
Figure 3.6: Block diagram and exact solution of (t) x(t) = 0 [1]
The examples of instabilities that have been shown so far are caused by the time delay
between the power system solution and the control system solution. The example of
this section illustrates the effect of time delays inside the control system solution
procedure [1].
Consider the block diagram of Figure 3.6 that represents the differential equation
The exact solution of this equation is also shown in Figure 3.6. The introduction
of one time delay in the feedback path of the block diagram causes the system to
become unstable (see Figure 3.7).
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation ^21
20 40 60 80 100
Time (s)
any other type of control system block in closed loops will introduce time delays in
the solution procedure.
Figure 3.8 shows an example of the effect of the introduction of a Fortran func-
tion block in a closed loop control system [1]. The function used in the example
is the x 1 function which would not have had any influence on the system output
if the simulation had correctly been performed. The output of the system with the
TACS-introduced time delay jumps to 1.0 instantaneously l . In this case, not only the
1 The latest information from R.H. Lasseter of July 15, 1993 indicates that the wrong answer is
not only caused by the time delay, but by a coding error as well. The time delay by itself will still
produce incorrect answers, in the form of damped oscillations around the correct solution.
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation^22
OUT
0
— TACS solution
Correct solution
^
20^40^60^80 100
Time (ms)
Figure 3.8: Inaccuracy due to the internal time delay [1]
time delay, but also the ordering scheme [1], makes TACS work inaccurately. Note
that the system is stable throughout the simulation.
A recent paper [2] shows another case of the effect of time delays in the simulation of
The three-phase inverter described in the paper is the one simulated in [15] using
the EMTP-TACS approach and is also shown in Figure 3.9. To show how sensitive
Chapter 3. Time Delays and the Stability and Accuracy of the Simulation ^23
an inverter is to the variation of its firing angle, consider the following values:
VLL^480V at 60Hz;
L l = 0.2mH;
L2 = 1.0mH;
Ld = 16mH;
E = 600V;
Firing angle a = 150°.
The simulation is performed with a discretizing time step At = 50ps. A time delay
of one At means a time delay of 1.08° electric degrees at 60 Hz. The inverter current
1.35VLL cos a + E
Id^= ^
3wL3/71-
The difference between the two values above is approximately 14.4%. From Figure
Ld
80
"? 60
t
2 40
ii
0
20
^
90 100
Time (ms)
Figure 3.9: Three-phase thyristor inverter current - TACS inaccurate result [2]
Chapter 4
"There are no good, general methods for solving systems of more than one nonlinear equation."
W.H. Press, et al."
"...so Newton's method finds its chief use after we have got ourselves close to a root."
Forman S. Actonb
a Numerical Recipes — The Art of Scientific Computing, Second Edition — Cambridge University Press — 1992.
b Nurnerical Methods That Work — Mathematical Association of America — Washington, D.C. — 1990.
4.1 Introduction
The general concept of the simultaneous solution of the power system and the con-
trol system sets of equations is developed in this chapter. It involves two distinct
procedures, each one of them dealing with the elimination of one type of time delay.
The implementation of the concepts is carried out in one of the many versions of
the EMTP. The main concerns during the implementation were: to keep the EMTP
The code was written as a development code for testing ideas. At this stage, no
attempt towards optimizing parts of the code was done.
25
Chapter 4. Simultaneous Solution of Power and Control System Equations ^26
The basic idea of the simultaneous solution is to assemble both sets of equations (from
the power and from the control systems) in one single matrix equation. By doing this,
the time delay between the solution of both sets of equation is eliminated.
The assembling procedure would produce an augmented matrix which is not sym-
metric in general (see Chapter 2, Eq. 2.2). This fact must be accounted for in a full
implementation of this method in the EMTP code, which, currently, handles only
symmetric matrices.
The present EMTP code works with symmetric matrices only, while TACS must
work with non-symmetric ones. In the proposed scheme, the augmented matrix con-
sists of the elements of both matrices put together, plus the connection elements
between the power and control systems (these elements are hidden by the nonsimul-
taneous approach currently in use). The number of these elements depends on the
number of elements in the power system controlled by the control system. This does
not include switch opening or closing commands. A reasonable assumption is that
this number is small. Therefore, the nonsymmetric augmented matrix would require
more memory for storage (compared to the sum of memory required by the two sepa-
rate matrices, one symmetric and the other nonsymmetric), as well as a small amount
of extra computational time to handle the connection elements.
The existence of internal time delays is due to nonlinearities in closed loops inside
the control system. Therefore, to eliminate them, iterations must be allowed.
Chapter 4. Simultaneous Solution of Power and Control System Equations ^27
Y ^Y Linear Equations
11 12
Y ^Y Nonlinear Equations
21 22
Although the two opening statements of this chapter sound discouraging, the cho-
sen method for solving nonlinear equations was the Newton-Raphson procedure. This
method has fast convergence close to the root. The efficiency of the entire implemen-
tation will depend on this fast convergence characteristic. As for the closeness to
the root, except at moments of discontinuity of the solution (switching operations),
the previous value of a variable will constitute a very good guess for its present root
(value).
Figure 4.1 shows the partition of the augmented matrix, which is necessary to
isolate the nonlinear elements. Note that the nonlinear elements are not only those
from the control system, but also those from the power system. By the same token,
the linear part of the matrix contains linear elements from both systems.
The reduction of the matrix to the nonlinear element matrix is illustrated in what
Chapter 4. Simultaneous Solution of Power and Control System Equations ^28
where the vector [ei(t)] not only contains the node voltages in the power system, but
also includes the control system block outputs (see Chapter 2, Eq. 2.2).
The vector [ki] includes the history terms from both systems; and
x1
x2
= (
x n,
is the vector of nonlinear variables which [Y22(Y, 1)] depends on. The submatrix
[Y22(Y,t)} contains the information about the nonlinear elements and the submatrix
[Y21 ] contains the information on how those elements are interconnected to the other
elements. Therefore, Eq. 4.4 can be reduced to the subset 2:
({1'22(Y, t )} - [Y21][Yii]
-1
[ Y12])[e2(t) ] = [ k2] - [Y211[Y111 -1 [k1].
One of the methods used by the EMTP to handle nonlinearities is the compensation
method. This method excludes the nonlinear branch from the network and replaces
it by a current source (see Chapter 12 of [7]). The value of the current will depend
on the Thevenin equivalent network (seen from the nonlinear element nodes) and on
the nonlinear characteristic itself. Therefore, the equation of the network and of the
Chapter 4. Simultaneous Solution of Power and Control System Equations ^29
v
km Network Equation
/ Element Equation
Linear
Network
Solution
km i km
nonlinear element must be solved simultaneously. Fig 4.2 illustrates the situation.
The way of describing the nonlinear characteristic is, normally, point by point in the
EMTP input file.
The MicroTran version of the EMTP [18] makes this compensation method ap-
proach accessible through an interface which does not require any code changes in
the EMTP proper. The EMTP calculates at each time step the Thevenin equivalent
circuit of the network seen from whatever nodes are specified in the input file. It then
calls (at the same time step) a subroutine "CONNEC" to which it passes the values
of the Thevenin impedance and voltage (open circuit voltage) through the argument
list. This subroutine must return the value of the currents through the nonlinear
elements (Figure 4.3). Therefore, CONNEC enables the user to write a piece of code
to describe his/her own nonlinear elements and to interface these elements with the
EMTP, without having to touch the EMTP code itself. The important feature here is
that, although the nonlinear elements are not included directly in the EMTP matrix,
Chapter 4. Simultaneous Solution of Power and Control System Equations^30
Current
Figure 4.3: Subroutine CONNEC and its interface with the EMTP
• all the nonlinear elements to be modelled, regardless where they come from
• there are actually two matrices being built (one inside the EMTP and the other
one inside CONNEC).
Chapter 4. Simultaneous Solution of Power and Control System Equations ^31
Z They
.-..././..",-
Control Vcontrol Vopen
System
T ^
'input ^ •^
(a)
Vinput
Control 'control
System
^•
(b)
Figure 4.4: Control actions upon the power system
As mentioned before (Chapter 1), there are three ways through which the con-
trol system may act upon the network: switch commands (put aside for a while);
controlled voltage source; and controlled current source. The two controlled source
situations are depicted in Figure 4.4.
Figure 4.4a shows the case of a current controlled voltage source. In this situation,
the equation to be included in the control system equations is
while in the case of Figure 4.4b (voltage controlled current source), the equation is
This is done for each branch which is acted upon by the control system. A typical
matrix formation inside CONNEC is shown in Figure 4.5.
The switch commands are handled separately. CONNEC controls the firing time
of thyristors and requires the EMTP to actually fire them. The firing action appears
as changes in the Thevenin equivalent circuit of the network.
Chapter 4. Simultaneous Solution of Power and Control System Equations ^33
In what follows, the program capabilities are outlined. The elements which the pro-
gram can model are similar to those modelled by TACS. The input format for elements
similar to TACS elements use similar formats to facilitate the translation of TACS
input files. The present implementation can handle most (but not all) of the TACS
blocks and is sufficient to allow fairly complex cases to be simulated.
Linear Elements
Linear elements are transfer functions blocks, which model any n th -order transfer
function of the form
\ Output^No +^+ + Nm S m
G°) — Input K Do + D 1 s + + Dnsn
Figure 2.2 of Chapter 2 shows this type of block.
For transient solutions, the Laplace operator s can be replaced by the differential
operator Tic transforming the equation above into the following differential equation:
This equation can now be decomposed into a system of n first-order differential equa-
tions, as follows:
dx^dx1 dx,,--1
x1 = x2 =^• • • x n = ^
dt'^dt '^dt
du^dui^dum_i
u1 = U2 -=^Um = ^
dt^dt^dt
The trapezoidal rule of integration can now be used to numerically integrate the
first - order differential equations . The internal variables x; can then be expressed as
2
xt = t xi_ 1 — {x1(t — Ot) + Qt xi_1(t —fit)}
The history terms are recursively calculated using the following formulation:
The coefficients c and d are calculated once using the recursive formula:
n^2 •
co = E()'Di
i.0 At
where c = co . The formulas for d are found replacing D by N in the above formulas.
The current implementation accepts up to 5 (five) different signals as inputs of
this block. Therefore, the input in the equation above can be
The transfer function block also accepts the two types of limiters described in
Chapter 2 (Figure 2.5) - static and dynamic limiters.
FORTRAN Blocks
The FORTRAN blocks accept fairly general FORTRAN expressions as the relationship
between their output and input. One can have, for example,
a
= 3.6 • e -1-35.4 - 4.822 • e -217 • xP + 1.2217.
Xp
algebraic operators^: +, - , *, /, **
relational operators^: .EQ., .NE., .LT., .LE., .GE., .GT.
logical operators^: .0R., .AND., .NOT., .EQV., .NEQV.
Inputs (up to 5)
Special Elements
There are four blocks, called special element blocks, that play a special role described
bellow.
Sources
Several types of sources have been implemented in the program. They are listed
below (cf. [6]):
Chapter 4. Simultaneous Solution of Power and Control System Equations ^37
• Built-in sources
The Interpreter
the vector of symbols. Each FORTRAN block gives rise to a specific vector of symbols.
Chapter 4. Simultaneous Solution of Power and Control System Equations ^38
This is done outside the time loop. The second part of the process occurs inside the
time loop and is the evaluation of the expressions according to the values which their
variables take.
Initialization
initialization is simpler and yet does not limit too much the range of the program
applications.
The DC initialization process assumes that the input and output signals of the
control system blocks are DC quantities in steady state. In this case, the output-input
relationship of a linear (transfer function) block is
, No
Xpc = ----
„ UDC•
o
This equation fits into the same format of Eq. 2.1, Chapter 2 with c = 1, d = No /Do ,
and hist = 0 and a system of equations is formed and solved for the unknowns xpc.
Integrators pose a problem for this procedure because D o = 0 for this type of
linear block. Therefore, their steady-state output must be supplied by the user.
Since the initialization procedure implemented at this time is not iterative, it
cannot calculate the output of nonlinear blocks. The user must supply those values
to the program for the time being.
Chapter 4. Simultaneous Solution of Power and Control System Equations ^39
lows:
x2,..., x 7i ) = 0^i = 1,2,...,n.
If x denotes the variable vector and F denotes the function vector, at iteration h
where
aFi
ax e .
x(h+1)(h)^r
= X + OX.
The "dishonest" Newton method calculates the Jacobian matrix J only once (in-
stead of at each time step) and this is done outside the iterative loop. Therefore,
the steps, after calculating the Jacobian matrix, are:
J^= —F X( h )
and
x (h+1) = x(h) Sx.
The application of this method is controlled by the user, who can disable the
normal Newton method from the input file.
Chapter 4. Simultaneous Solution of Power and Control System Equations ^40
Comparison Between
Simultaneous and
Non-simultaneous Approach
5.1 Introduction
This chapter presents several cases simulated with the simultaneous solution pro-
gram (SS) described in the previous chapter. It also compares results with TACS
simulations, where available.
The case studies give an overall view of the behaviour of the implementation of
SS, exploring key issues such as accuracy, efficiency and stability.
To focus the attention on these key issues, the cases presented here were chosen to
be simple, without any additional unnecessary complexity. They can be considered,
however, prototype situations that can occur in more complex cases where the key
issues are difficult to identify.
The first group of cases consists of simulations where only the control system is
involved. Static and dynamic limiters, as well as nonlinear functions in closed loops,
are simulated.
The second group contains cases where the control system and the network work
together. The cases illustrate the strength of the simultaneous solution approach.
41
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 42
For the reader's reference, Appendix B shows the input files for SS and the EMTP
(when available) of all cases discussed in this chapter.
This set of cases shows the behaviour of SS in simulations involving control systems
alone. The EMTP part of it is disabled and only the program described in the
previous chapter is active.
Although the cases are simple, they are useful to show how the program performs
in general. Note that the case of Section 5.2.3 shows an important advantage of SS
over TACS.
Figure 5.1a shows the diagram of the following second-order transfer function:
\ Output w2
s 2 gw,i s + co n2
H(s) = Input —^
This system has an analytical solution for a step input [20]:
1
Output(t) = 1 — — • e - wn t • sin(wOt + 0)
Two simple cases are considered in this section. They are taken from Chapter 5 of
reference [1].
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 43
Output
^>
S
Input
(a)
1.6
1.2
0.4
o
o 2^4^6^8^10
Time (s)
(b)
Figure 5.1: Second-order linear system: (a) Diagram; (b) Solution for a unit step
input.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 44
Figure 5.2a shows the diagram of a static limiter system. Figure 5.2b shows its
solutions with and without the static limiter. Figure 5.3 illustrates a similar situation
for a dynamic limiter.
As mentioned earlier, a nonlinear function in a closed loop can lead TACS to produce
wrong results. Figure 3.8 of Chapter 3 is reproduced in Figure 5.4, with the SS
solution added.
To illustrate the application of special element blocks, Figure 5.5 shows a system uses
many of them. Some of these blocks will again be used in more realistic cases in
subsequent sections.
In this section, both the SS and the EMTP are active. The cases show the behaviour of
both programs working together, and demonstrate the advantages of the simultaneous
solution as the cases are presented.
For these cases, Appendix B shows not only the SS input files, but also the related
EMTP files.
the superposition of the analytical and the SS simulation results for the system of
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 45
2.0
^
u 1000 X
s
-2.0
Static Limiter
(a)
u(t), x(t)
6^
x(t) - without limiter x(t) - with limiter
4
2
0
-2
-4
-6
0 0.04^0.08 0.12
Time (s)
(b)
u> 1000
S
/
-0.5
Dynamic Limiter
(b)
3
+5
OUT
2
0
— TACS solution
1-
SS and Correct solutions
0^
0^20^40^60^80^100
Time (ms)
Figure 5.4: Nonlinearity in a closed loop: (a) Diagram; (b) Simulation results N.
varl
^
0.02 0.04
time (s)
Figure 5.5: Special element blocks - Diagram and simulation results (source = cos wt,
w = 377 rad/s and time delay = 2 ms).
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 48
0 ^
0^0.1 0.2
Time (s)
Analytical solution: i(t) 1 ^ri R, t,
Ril1R2^e - I'
Figure 5.6: Arc modelling - superposition of the analytical and the SS simulation
results.
Figure 3.4 with the same parameters used in Figure 3.5. Both results are practically
identical.
Figure 5.7a shows an R-L load, of which the active power P is variable (time-
dependent), and the ratio P/Q is kept constant [1}.
Such an R-L circuit has a Laplace domain representation as shown in Figure 5.7b
if zero initial conditions are assumed. The block diagram representation of the circuit
is shown in Figure 5.7c.
The assumed variation of the active power P is shown in Figure 5.8 and the system
parameters are as follows:
(a)
I(s)
1
>^ >
(b)
1
s -1- c
Source Fortran s-Block
Block
(c)
P (W) 15
1.5
E m = 3.1623 V
It can be shown [1] that the value of L is dependent on the value of P as follows:
1 2wP ,P Q
L =^kQ+ TD )
Signal from
EMTP to SS
K=1
SCR / IOUT
PINST
SCR*(CONS
+PULSE) ^> s + 1131
- -) *
Sinusoidal
Source CONS PULSE^IOUT
120
377 3393
\_.
Sources Delay
Controlled 0.00833
Current Source
PAVER
v
Network SS
-15 ^
0 40^80^120 160 200
Time (s)
20
(a)
15
10
5
0 -:.2"N,_."
-- — ..---
-5 -
-10 — iout
-15
0 40^80^120 160^200
Time (s)
(b)
Figure 5.10: Simulation Results: (a) TACS solution [1]; (b) SS results.
The simulation results obtained with TACS and SS are shown in Figure 5.10
for the current and the average power (PAVER). Note that both programs produce
practically identical results.
average power P(t) [1, Chapter 2] as follows:
1 f^1 f—T
P(t) = 7 ,- 0 p(t)dt — T 0^p(t)dt.
.,
Note that the second integral has the value of the first integral delayed by T seconds.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 53
The next three case studies are related to the 230 kV power system of Figure 5.11 [1].
The Thevenin equivalent circuit of the subsystem inside the dashed line is calculated
as seen from bus 7. The reduced system is shown in Figure 5.12 along with the
variable load connected to bus 13. The Thevenin equivalent values are (in sequence
values):
Zero Sequence:
Ro = 0.13 SI
L o = 27.71 mH
Positive Sequence:
= 0.06 C2
L i = 39.99 mH.
Zero Sequence:
Ro = 0.03167 SZ/km
L o = 3.222 mH/km
Co = 0.00787 pF/km
Positive Sequence:
R l = 0.0243 Il/km
= 0.9238 mH/km
Cl = 0.0126 pF/km.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 54
r
It T 50 MVA
13.8 kV 5 0.9 pf
4
500/v1i/A 10%
2
400 MVA1
. 200 MVA 200 MV 10
X"=12% X=10% mi -IN 0.9pf
42 200MVA 200
500 MVA
.
60 mi 230kV 1 00MVI
10%
^J
180 mi
200 MVA
50 MVA 50 M A 0.9 pf
X"=12% X =10%
Three Phase
They B Thevenin Bus7B Bus1B Busl2B
Equivalent ^
T ev C Sequence Bus7C Bus1C^Bus12C
Values 144.4 km three phase 24.14 km three phase
transmission lime^transmission lime
Transformer
Bus 13
IL13 A
Sources Variable
Load
The transformer between bus 12 and bus 13 is represented by its series inductance:
Active Power^P
= 3.042
Reative Power Q wL
The variable load, as in the previous case, is simulated inside either TACS or SS.
The load modelling diagram for this case is shown in Figure 5.13. The load variation
is shown in Figure 5.14a. There are four three-phase power levels with the following
corresponding values of 1/L:
IL13
Network as in Figure 5.12 CBA
Network
SS Bus13A Bus13B Bus13C
K=1 Sources K=1 Sources K=1
0.1795 2.3715 2.8650 1.2293
CONS1 OONS2 CC NS3 C 3NS4
PINSTA 120
Delay PA
8.3ms
1
= 2.551 for 114 MW;
1
= 5.416 for 190 MW;
1
= 6.645 for 206 MW.
The voltage of phase A on bus 1 is shown in Figures 5.14b and 5.14c for TACS and
SS simulations. The good agreement between the results is readily noticeable.
^
^
^
206
190
114
9.5
40 80^120 160^200
Time (ms)
(a)
300
>^200
100
a)
0)^0
cu
4-.^-100
-200
-300
0 40^80^120 160 200
Time (ms)
(b)
300
5 200
..^100
a)
co^0
al
.....^ -100
0
>^-200
-300 ^
0 40^80^120 160 200
Time (ms)
(c)
Figure 5.14: (a) Load variation — step variation, (b) TAGS simulation result [1], (c)
SS simulation result.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 58
IL13
Network as in Figure 5.12 CBA
Network
SS Bus 13A Bus 13B Busl3C
K=1 Source K=1 K=1
Sourc
5.2364 0.1795
CONS2 CONS1
INT—A INT_B
1 1 1
s+1146 s+1146 s+1146
PINSTA 120
8
x
Delay
PA
8.3ms
The load modelling diagram used to simulate this case is shown in Figure 5.15. Fig-
ure 5.16 shows the load variation and the voltage at phase A on bus 1 for both TACS
and SS simulations, respectively. Both results are practically identical.
A thyristor controlled reactor (TCR) is the basic building block of static Var com-
pensators (SVC). It is usually connected in parallel with a fixed capacitor. The TCR
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 59
186.2
9.8
^
0 40^80^120^160^200
Time (ms)
(a)
300 ^
200
100
a)
-100 —
O
>^-200 -
-300 ^
0 40^80^120^160 200
Time (ms)
(b)
300
5- 200
100
rn 0
ca -100 —
0
>^-200 -
-300 ^
0 40^80^120 160 200
Time (ms)
(c)
Figure 5.16: (a) Load variation — pulse variation, (b) TACS simulation result [1], (c)
SS simulation result.
^
Il^— sin ,
= ^ ),
wL^ 7r
where o is the conduction interval. This current has the same value as that of a
-
a — sin °-
normal inductor with L n „,,„ / = L/K where IC = ^ (cf. Figure 5.17b).
ir
If all current harmonics are neglected, the inductance of Figure 5.17b is the fun-
damental frequency model for the TCR of Figure 5.17a, which leads to the block
diagram of Figure 5.17c.
The TCR control system is represented, in this model, by the parameter IC. A
basic voltage controller for the TCR is shown in Figure 5.18 [1].
A voltage coming from the power system (VRMS pu ) is compared with the unity
source (UNITY). The difference is integrated with a gain and multiplied by 1/L.
If VRMS p .—UNITY> 0, a positive error signal is provided to the integrator. Epu,
which plays the role of IC in this model, and BLgam (K/L in Figure 5.17c) will increase.
The TCR and its control system is shown in Figure 5.19. This constitutes a simple
The block diagram for the SS simulation is shown in Figure 5.20. In the first sim-
ulation, the TCR is disconnected from the network. The variable load is assumed to
have the variation of Figure 5.21. The TACS and SS results are shown in Figure 5.22.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 61
ma
Current fundamental component: / 1 = lirma
VW
( a -sin a
7r I
) .
(a)
L/K
Mirn a — sin a
IC = ^
7r
I^i(t)>^I
I ^I
I <^ v(t) ^> I
(b)
V(s)
I(s)
S
x/L
(c)
Figure 5.17: Thyristor controlled reactor: (a) Circuit diagram; (b) Circuit model; (c)
TCR s-domain model
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 62
Network
SS Bus1A^Bus1B^Bus1C
K=1 K=1
EMTP1^EMTP2
^VRMS^ VRMSpu
I
EMTP3
1 300
RMS 132.7876
Epu
^PLUS1
Source
CD
CD
P (MW) 209
9.5
With the same load variation, the TCR is connected to the network and the
simulations result are shown in Figure 5.23. Note the excellent agreement between
TACS and SS simulations.
Assume that the following modifications are made in the power system of Figure 5.11:
• the double circuit lines between bus 2 and 9 are removed; and
270
Vrms
180
90
a) 0
cu
-90
O
-180 -
-270 ^
0 40^80^120 160 200
Time (ms)
(a)
f7 111
^270 ^
j^180^► A^kAA^A
90 ^
a)
0)^o
as
4-^-90 -
-180 -
-270
0 40^80^120^160^200
Time (ms)
(b)
Figure 5.22: Load variation without TCR: (a) TACS simulation [1]; (b) SS simulation.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 66
270 ^
Vrms
5' 180k-
/
90
G)
0
cc;
-90 —
0
-180 -
-270
0 40^80^120^160^200
Time (ms)
(a)
f ll I T T T
270
180
Vrms
>
.. 90
a) 0
0)
co
.... -90 —
>
O
-180 — i I A A A
-270 ^
0^ 40^80^120 160
Time (ms)
(b)
Figure 5.23: Load variation with TCR: (a) TACS simulation [l]; (b) SS simulation.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 67
1
SOOMVA
50 MVA^500MVA 120 mi
0.9 pf 500MVA 400 MW^DC line
3 1 50 00 MVA
200 10
MVA 200 MVA mi^ 0.9pf
500 MVA 6
11 100MVA
As 00 MVA
60 mi
90 mi
200M VA
9
15 mi
12
0.95 pf
11
100MVA
300 MVA
50 MVA 0.9 pf
50 MVA
To simulate these events in terms of the converter current (Id ) and firing angle
(a), the diagram of Figure 5.25 is used.
The AC system of Figure 5.24 is reduced to its single-phase equivalent, and the
HVDC system is simulated using the current injection method [1]. Figure 5.26 illus-
trates the simulation diagram.
In addition to the modelling for Id and a (Figure 5.25), there are three more
subsystems to be simulated. They are (Figure 5.27): the voltage tracking system,
the DC system itself, and the AC current injection system. The reader is referred to
reference [1] for a complete description of this system.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 68
Magnitude = 1.6
Turns on at t = 50 ms Source
IDC
Ramp up to 1.6
in 50 ms Source
TIMEX ^-286*XP
107.79* (X111
^)1 X1*(X.GE.0)
^>3.6*6 135"3:4.822*e 17."+1.2217
0.1
ALPHA
Source
Magnitude = 0.31416
V( t)
IACF IDC
SS
ALPHA
from Network
K=1
(a)
^
IDC cV^eV
1
Ilpk — +elan:DC
a=0.8933 coe(DT) cos(AF) ^
2*Xc*IDC IACF
0'43 *Vm term = cV*ces, + eV*sin,
(b)^ (c)
Figure 5.27: (a) Voltage tracking system; (b) DC system equations; (c) AC current
injection [1].
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 70
ALPHA
IACF
40^80^120 160 200
Time (ms)
(a)
ALPHA
160^200
Time (ms)
(b)
Figure 5.28: IDC, ALPHA and IACF comparisons; (a) TACS simulation [1]; (b) SS
simulation.
Four parameters from the TACS solution were compared against the SS solution:
currents IDC and IACF; firing angle ALPHA; and voltage at bus 1 (BUS1). Figures
5.28 and 5.29 show the results of both solutions.
Converter simulations were briefly discussed in Chapter 3, Section 3.3.2. This section
presents additional results concerning the thyristor rectifier and inverter simulations.
Comparisons between TACS and SS results are also provided.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 71
300
100
0)
co -100
0
-300
40^80^120^160 200
Time (ms)
(a)
300
100
a)
0)
co^-100
0
-300
0^40^80^120 160 200
Time (ms)
(b)
Figure 5.29: Voltage at bus 1 (BUS1) comparison; (a) TACS simulation [1]; (b) SS
simulation.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 72
A single-phase thyristor rectifier is shown in Figure 5-30a. The main functions of its
controller with its block diagram appears in Figure 5-30b. The TACS [16] and SS
simulation results for this rectifier are shown in Figure 5-31.
Although the curve of id is the same in both simulations, the curve of v d shows a
difference. The TACS solution presents pronounced peaks at the times of thyristor
firings (see Figure 5.31). It was possible to reproduce these peaks with the SS program
by introducing, artificially, one time delay between the program and the EMTP. This
shows that the origin of the peaks is the external time delay between TACS and
EMTP.
In the case of a three-phase thyristor inverter, the effect of the external time delay
between TACS and EMTP appears on the DC side current (id). Figure 3.9 shows the
inverter diagram and the TACS and SS simulation results. As stated before, there is
a difference of 14% between the two currents. If, again, one artificially introduces a
time delay between SS and the EMTP, it is possible to reproduce the TACS results.
Although not apparent from the discussion above, there is an extra non-simultaneous
phenomenon in effect in the thyristor converter simulations. This effect is a charac-
teristic of the EMTP and is present both in the SS and TACS results.
Thyristors are modelled by the EMTP as controlled switches. Their closing times
are controlled by the equations describing the firing angle control. The opening action
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 73
From (a)
EMTP
K=1 h
rsA
To EMTP
•
To EMTP
•
Source 120 RAMP
Comparator PLS1-2 Delay Block PLS34
Source VCONTL
0.25
VSA
RAMP
■11
Firing PLS1-2 PLS3-4
Signals
t
(b)
Figure 5.30: Single-phase thyristor rectifier.
^
•^
270 -
^d 200 -
a)
130 -
60-^
vd
^ho
Cd^-10 -
430 ^-
0
-150 ^
35^ 36 37
Time (s)
(a)
200 r-
>^
1 30 -
Pili^
60 -
CD
b.0^-10 -
Cd
17(
4dri.
" - - 80—
-150 ^
35 36 37
Time (s)
(b)
Figure 5.31: Single-phase rectifier simulations — voltage vd: (a) TACS results; (b) SS
results.
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 75
i ?witch opens
SWITCH
current forced to
zero in the next step
T FIRE
1
closed here
takes place as soon as the current goes through zero, from a positive to a negative
value.
Since the EMTP uses a fixed time step to integrate the differential equations of
the system, the closing and opening actions will generally not occur at the specified
instants of time [7]. Instead, there is a delay between the desired time and the real
one. Figure 5-32 illustrates the situation for a given firing angle. The closing action
takes place at the time step nearest to TFIRE (some EMTP versions may close at the
time step following TFIRE [7]). The opening action takes place after the current has
gone through zero, which is detected by the current sign change.
As presented in [21] this problem can be eliminated by the following procedure:
2. integration of the system equations after the discontinuity over two half time
steps (At/2) using the backward Euler method, to properly re-initialize the
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 76
tion over two half time steps are needed to provide the right re-initialization for the
variables of the system. This method is illustrated in Figure 5.33.
The effectiveness of the backtracking procedure can be seen in Figure 5.34, where
the inverter of Figure 3.9 is simulated with the normal EMTP (EMTP in the figure)
and with a modified version of the EMTP that includes the backtracking method
(bktrack in the figure). Because the normal EMTP misfires the thyristors, its solu-
tion shows a short-circuit of the inverter that does not exist, as demonstrated by the
modified EMTP solution. The time step used in the simulations was 200ps.
As mentioned in the introduction to this chapter, the case studies presented here were
intended to show the performance of a new, more accurate and stable approach of
the simultaneous solution, when compared to the current non-simultaneous option.
In general, when TACS performs well, so does the proposed method in terms
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 77
i( t) interpolation
iLt? ........
--->
t t o +A t
t - At 1
:
et^et
2^2
1
a ........, b
Vab
\..-----^---.-^ 1
1
1 t CLOSE^I
t + At
41, a^ ■ CLOSE
t - At^t
At^At
2^2
1000
EMTP
a)
c3)
500 bktrack
0
C
0 LiartA ^ vi
a)
L..
'5 -500
vd
-1000
0.16 0.185 0.21 0.235 0.26
Time (s)
of accuracy. In those cases where there is an instability in the TACS solution, the
proposed method outperforms TACS, showing no instability in its solution. In cases
where an analytical solution exists, it is possible to observe how accurate the SS
approach performs.
The efficiency of the SS method is related to the application of the Newton-
Raphson method, which is used whenever there is a nonlinearity in a closed loop.
Nonlinearities outside closed loops pose no problem since they do not require any
iterative solution method. As mentioned in Chapter 4, for slowly converging cases,
there is an option of the "dishonest" Newton method, which can speed up the solution
somewhat. Although most of the cases simulated by the author, and the great ma-
jority of the cases shown in this thesis, do not require more than three iterations, on
average, at each time step, some cases may require more than three iterations [2]. This
situation is caused by the fact that the convergence of the Newton-Raphson method
can be guaranteed only if one is close enough to a root. Since almost any kind of
equation can be simulated with SS, one cannot guarantee either fast convergence, nor
convergence per si, in the general case.
As mentioned before, at each time step, the guess for the value of the root is
normally its previous value. This may be sufficient in the majority of situations. In
cases of poor convergence, one may try to improve the method of prediction of the
present value of the root. The author has performed a theoretical analysis on the
stability and accuracy of various prediction method [22] and has implemented the
linear prediction method in the current version of the SS program. The application
of the linear prediction method is controlled by the user.
The case shown in Figure 5.24, for example, required 8 iterations to converge
when the normal guess method is used (previous value) and the "dishonest" Newton
Chapter 5. Comparison Between Simultaneous and Non-simultaneous Approach 80
method is applied. If the linear prediction and the full Newton method is applied the
number of iterations decreases to 4.
Timing is not shown in this thesis because the code developed is not a production
code. In a production code, simulation time would increase because of iterations, but
that is better than having unreliable answers.
Chapter 6
Conclusions
• it proposes and describes a method for solving the network equations and the
• it presents a set of case studies showing the main characteristics of the present
implementation and how well it performs when compared with other existing
implementations.
The proposed method of simultaneous solution of the control and power systems
equations has proved to be, not only accurate, but also stable. A number of example
circuits were simulated to illustrate the inaccuracy and instability problems that can
occur when artificial time delays are introduced in the simulation (as in TACS). The
situations typified in the case studies are likely to occur in more complex simulations
where the effect of these time delays can be much harder to isolate.
On the programming side, the main objective was to write enough code to demon-
strate the feasibility of the proposal. Code optimization was not considered during
81
Chapter 6. Conclusions^ 82
the development of the ideas. In this sense, more work has to be done if this code is
to become production-grade code.
It may be appropriate to indicate some of the improvements which the current
implementation might need to be transformed into a useful general-purpose code. The
first decision is related to the question whether the control system should be simulated
inside a subroutine (as it is in the current implementation). A better solution would
be to merge the control and network equations into one single system of equations.
This would require a major code modification in the EMTP. The new code would
have to be able, among other things, to handle non-symmetric matrices. Sparsity
techniques would still be applied.
One necessary modification in the current SS code, in the case of a major code
revision, is the implementation of a procedure similar to the CDA, to damp numerical
oscillations originating from within the control system. The current CDA procedure
is capable of damping only numerical oscillations caused by events occurring inside
the network.
Although the implementation has performed well in terms of accuracy and stabil-
ity, some cases may pose some problems in terms of efficiency, requiring an excessive
number of iterations. To better guess the value of the variables and improve the
convergence of the Newton method, prediction methods should be further studied.
[1] R.H. Lasseter. EMTP Workbook IV. Electric Power Research Institute, Palo
Alto - California, 1989.
[2] A.E.A. Araujo, H.W. Dommel, and J.R. Marti. Simultaneous Solution of Power
and Control Systems Equations. Paper 93 WM 241-0-PWRS, IEEE PES Winter
Power Meeting, Columbus, Ohio, 1993.
[3] H.W. Dommel. Digital Computer Solutions of Electromagnetic Transients in
Single- and Multiphase Networks. Trans. Power App. and Syst., PAS-88:388-
399, 1969.
[4] W.F. Long. Power Systems Analysis Using Electromagnetic Transients Pro-
grams. IEEE/PES Transmission and Distribution Conference, September 1991.
83
Bibliography^ 84
Applications and Design. John Wiley & Sons, New York - USA, 1989.
[17] H.W. Dommel. Nonlinear and Time Varying Elements in Digital Simulation of
-
[19] X.J. Cheng and C. Hatziadoniu. A Gradient-Based Algorithm for the State Ini-
tialization of Control Systems. IEEE Trans. on Power Syst., 6(4):1349-1355,
November 1991.
[20] Richard C. Dorf. Modern Control System. Addison-Wesley Publishing Company,
Inc, New York - USA, 1989.
[21] A.E.A. Araujo, H.W. Dommel, and J.R. Marti. Converter Simulations with the
EMTP: Simultaneous Solution and Backtracking Technique. Paper APT 286-
18 - Accepted for publication, Joint International Power Conference (IEEE -
NTUA) - Athens Power Tech, September 5-8, 1993, Athens, Greece.
[22] A.E.A. Araujo, H.W. Dommel, and J.R. Marti. Numerical Instabilities in Power
System Transients Simulations. In Proceedings of the IASTED Conference,
Power Systems and Engineering, pages 176-180, 1992.
Bibliography^ 85
[23] Jean-Paul Trembley and Paul G. Sorenson. The theory and Practice of Compiler
Writing. McGraw-Hill Book Company, New York — USA, 1985.
This appendix is based on references [23] and [24]. Its objective is to broadly de-
scribe the principles used to write the interpreter which reads, from the input file,
FORTRAN-like mathematical expressions and calculates their values, given the values
of their variables, at each time step.
The project of the interpreter begins with the definitions about the syntax, the
operators, the functions, types of variables and function arguments it will accept.
These definitions for the present interpreter are as follows:
algebraic operators^: +, - , *, / , **
relational operators^: .EQ . , . NE . , . LT . , . LE . , . GE . , . GT .
logical operators^: .0R., .AND., .NOT., .EQV., .NEQV.
FORTRAN functions^:SIN, COS, TAN, COTAN, SINH, COSH, TANH,
In addition, all the rules for constructing standard FORTRAN expressions apply.
86
A.1 Compilation of Arithmetic Expressions
The way an arithmetic expression is written in the input file is the normal way to
write them, for example: (a + b) (c d). This type of expression is called infix
or
(operator) (operand) (operand) ^(prefix)
The prefix and suffix forms of the notation are also called prefix Polish and reverse
Polish, respectively.
87
The evaluation of a Polish expression is much easier than the related infix expres-
sion. The infix expression
(x x ((y + z) — 5))
xyz + 5 — x.
A reverse Polish expression can be evaluated by applying the following rules re-
peatedly until all operators have been processed:
2. Select the two operands immediately preceding the operator found in step 1.
The previous reverse Polish expression is evaluated as follows (applying the four
rules above):
a
-------,
First evaluation x yz + 5 — x ---3 (y + z).
#
„....-.....,
Second evaluation x a5 — x —4 (y + z) — 5.
'Y
e....—"—.,
Final evaluation x/9 x -- 7 = x x ((y + z) — 5)).
Comparing this evaluation process with the evaluation of the infix expression
shown previously, one can see how much easier it is to calculate Polish expressions.
88
Table A.1: Simple Precedence Function
Symbol Precedence
f
— 1
x, / 2
Variables and
nonnegative integers 3
0
sion requires an operator precedence function and the use of a stack. As seen above,
in both forms of the Polish format (suffix and prefix) the variables and constants ap-
pear in the same order as in the infix format. The operators, however, are reordered
and this is the reason for the use of a stack. The output of the conversion is put in
an output string.
For the simple example discussed in this section, assume the existence of the
four arithmetic operators, variables and nonnegative integers. Table A.1 shows the
precedence function for this case. The special symbol # has the smallest precedence
value in the table and is used to initialize the stack and to ensure that the stack is
always nonempty.
The stack is initialized with the symbol #. The algorithm to be described is mainly
based on the comparison of the precedent function value of the current input and the
precedent function value of the top element of the stack. If the precedent value of
the input symbol is greater than that of the symbol on top of the stack, then the
89
Table A.2: Transformation of a— b x c+ d/5 into Reverse Polish
a^#a
a
b^#—b^a
x^#— x^ab
c^#— x c^ab
#+^abc x —
d^#+d^abc x —
/ #+/^abc x —d
5^#+/5^abc x —d
tt^ abc x —d5 +
current input symbol is pushed onto the stack and the next input symbol is scanned.
If, however, the precedence value of the current input symbol is less than or equal to
that of the stack top symbol, this top element is written in the output string. After
this, the same current input symbol is compared to the new element on the stack.
The process stops when all the input symbols have been analyzed. This algorithm is
illustrated in Table A.2, for the infix expression a — b x c+ d/5.
To handle more complex parenthesized expressions two precedent functions are
needed: the input precedence function f and the stack precedence function g. The
right and left parenthesis perform the same function as the special symbol # in the
simple algorithm previously described. Table A.3 shows the two functions for the
implementation of this thesis.
The complete algorithm to translate infix to reverse Polish is:
90
Table A.3: Input and Stack Precedence Functions
1. Initialize
TOP 4- 1
NEXT 4- STACK(TOP)
OUTBUFFER 4- "
91
LAST 4 NEXT
-
TOP 4 - TOP - 1
if f (NEXT) < g(TEMP) then
OUTBUFFER 4 OUTBUFFER//TEMP
-
end if
if TOP=0 then
write(Invalid expression')
end if
5. Push NEXT to STACK but not `)' or ' , '. The function of the delimiter 'Y is
to separate arguments of an intrinsic function. Therefore this delimiter must
not close the left parenthesis. Its action is similar to a right parenthesis and a
comma should not be inserted in the stack at any time.
6. Finished? or error
92
if TOP=0 then
exit the program
el se
write('1nvalid expression)
end if
The FORTRAN code for the precedence function f and g is shown right below. Next
it is shown the FORTRAN code for subroutine POLISH, which transforms a infix to a
reverse Polish expression. The subroutine EVAL (also shown below) takes the output of
POLISH (OUTPUT) and transforms it into a character vector that has, in each position,
93
PFUNC = 13
C^Exponential
ELSE IF(X .EQ.^'** ') THEN
PFUNC = 16
C^Intrinsic functions
ELSE IF(X .EQ. 'COS ' .OR. X .EQ. 'ACOS^' .OR.
1^X .EQ. 'SIN ' .OR. X .EQ. 'ASIN^' .OR.
2^X .EQ. 'TAN ' .OR. X .EQ. 'ATAN^' .0R.
3^X .EQ. 'ATAN2 ' .OR. X .EQ. 'TANH^' .OR.
4^X .EQ. 'COSH ' .OR. X .EQ. 'SINH^') THEN
PFUNC = 17
ELSE IF(X .EQ. 'DIM ' .OR. X .EQ. 'AMOD^' .OR.
1^X .EQ. 'SIGN ' .OR. X .EQ. 'ALOG^' .OR.
2^X .EQ. 'SQRT ' .OR. X .EQ. 'ALOG10' .OR.
3^X .EQ. 'EXP ' .OR. X .EQ. 'ABS^' ) THEN
PFUNC = 17
C^Parenthesis
ELSE IF(X .EQ. '(^') THEN
PFUNC = 21
ELSE IF(X .EQ. ')^') THEN
PFUNC = -1
C^Delimiter
ELSE IF(X .EQ.^') THEN
PFUNC = 0
C^Variables and Constants
ELSE
PFUNC = 19
ENDIF
RETURN
END
94
^
95
^
GFUNC = 20
ENDIF
RETURN
END
SUBROUTINE POLISH(INPUT,OUTPUT)
C^Transforms a expression from the infix to reverse Polish form. In
C^the transformation, it uses two functions: input precedence
C^function PFUNC; and stack precedence function GFUNC.
C^INPUT has its tokens separated by colons (delimiter). For example,
C^COS;(;VAR1;+;VAR2;) for the infix expression COS(VAR1+VAR2)
C^OUTPUT also has its tokens separated by colons. For example, for
C^the same infix expression, OUTPUT would be VAR1;VAR2;+;COS.
CHARACTER*6 COMMA
CHARACTER*400 INPUT, OUTPUT, OUTBUF
INTEGER^TOP, PFUNC, GFUNC, IBUF, POINTR
INTEGER^SIX, BUFSIZ, MAXSTK
LOGICAL^RPAREN
PARAMETER^(SIX = 6, BUFSIZ = 400)
PARAMETER^(MAXSTK = 100, COMMA =
CHARACTER*6 STKTOP, STACK(MAXSTK), NEXT, BLANK6
EXTERNAL^PFUNC, GFUNC
DATA^BLANK6/'
C^Initialize variables
DO 10 I = 1, BUFSIZ
OUTBUF(I:I) = BLANK6(1:1)
10^CONTINUE
DO 15 I = 1, MAXSTK
STACK(I)^= BLANK6
15^CONTINUE
IBUF = 1
TOP = 1
POINTR = 1
STACK(TOP) = '(
C^Get next token
100 CONTINUE
C^Get the next token from the input string and put in the
C^variable NEXT. If no more token is available ISTAT is set
C^to ZERO otherwise ISTAT is one.
96
NEXT = BLANK6
J = 0
ISTAT = 1
DO 50 I = POINTR, BUFSIZ
IF(INPUT(I:I) .EQ.^GOTO 60
IF(INPUT(I:I) .NE. BLANK6(1:1)) THEN
J = J + 1
IF(J .GT. SIX) THEN
WRITE(*,*) 'TOKEN IS GREATER THAN 6 CHARACTERS'
STOP 'INTERNAL ERROR'
ENDIF
NEXT(J:J) = INPUT(I:I)
ENDIF
50^CONTINUE
C^Check for J ?
IF(J .GT. 0) THEN
WRITE(*,*) 'LAST TOKEN DOES NOT HAVE A ENDING DELIMITER'
STOP 'ERROR'
ENDIF
ISTAT = 0
60^CONTINUE
C^Reset the pointer
POINTR = I + 1
IF(ISTAT .EQ. 0) THEN
NEXT = ')
ENDIF
C^Set right parenthesis flag
RPAREN = .FALSE.
C^Start
STKTOP = STACK(TOP)
70^IF(PFUNC(NEXT) .LE. GFUNC(STKTOP)) THEN
TOP = TOP - 1
IF(PFUNC(NEXT) .LT. GFUNC(STKTOP)) THEN
CALL TOBUFF(IBUF,OUTBUF,STKTOP)
ELSE
RPAREN = .TRUE.
GOTO 150
ENDIF
IF(TOP .EQ. 0) THEN
97
WRITE(*,*) 'INVALID EXPRESSION'
STOP 'ERROR'
ENDIF
STKTOP = STACK(TOP)
GOTO 70
ENDIF
150 CONTINUE
C^Push NEXT to STACK but not ")" or ","
C^The function of the delimiter "," is to separate arguments of an
C^intrinsic function. Therefore, this delimiter must not close the
C^left parenthesis. Its action is similar to a right parenthesis
C^and a comma should not be inserted in the stack at any time.
IF((.NOT. RPAREN) .AND. NEXT.NE . COMMA) THEN
TOP = TOP + 1
IF(TOP .GT. MAXSTK) THEN
WRITE(*,*) 'STACK OVERFLOW'
STOP 'ERROR'
ENDIF
STACK(TOP) = NEXT
ENDIF
C^Continue till ISTAT = 0
IF(ISTAT .NE. 0) THEN
GOTO 100
ENDIF
C^Finished?
IF(TOP .EQ. 0) THEN
OUTPUT = OUTBUF
RETURN
ELSE
WRITE(*,*) 'INVALID EXPRESSION'
STOP 'ERROR'
ENDIF
END
SUBROUTINE TOBUFF(IBUF,BUFF,TOKEN)
C^Routine TOBUFF writes the token to the output buffer OUTBUF.
C^It also trims each token and inserts a token delimiter ';'
C^after each token.
PARAMETER^(SIX = 6, BUFSIZ = 400)
98
CHARACTER*400 BUFF
CHARACTER*6^TOKEN, TRIMTK
C^Trims the incoming token
J = 0
DO 10 I = 1, SIX
IF(TOKEN(I:I) .NE. ") THEN
J = J + 1
TRIMTK(J:J) = TOKEN(I:I)
ENDIF
10^CONTINUE
IF(IBUF .LE. BUFSIZ) THEN
IF(J .GT. 0) THEN
BUFF(IBUF:80) = TRIMTK(1:J) // ';'
IBUF = IBUF + J + 1
ENDIF
ENDIF
RETURN
END
SUBROUTINE EVAL(OUTPUT,N,ISTACK)
C^Creates a stack ISTACK (a vector) that contains, in each position,
C^one token of OUTPUT. ISTACK has a proper form to be evaluated by
C^subroutine CALCU.
IMPLICIT^REAL*8 (A-H O-Z), INTEGER*4 (I-N)
2
PARAMETER^(NSTKSIZ=400,NVAR=30)
CHARACTER*400 OUTPUT
CHARACTER*6 ISTACK(NVAR)
N = 0
K = 0
DO 10 I = 1, NVAR
ISTACK(I) = '
10^CONTINUE
DO 50 I = 1, NVAR
J = 0
100^CONTINUE
K = K + 1
IF(K .LE. 400) THEN
IF(OUTPUT(K:K) .EQ. ';') GOTO 50
IF(OUTPUT(K:K) .NE. ") THEN
99
J = J + 1
IF(J .LE. 6) THEN
ISTACK(I)(J:J) = OUTPUT(K:K)
ELSE
GOTO 50
ENDIF
ENDIF
GOTO 100
ENDIF
GOTO 200
50^CONTINUE
200 CONTINUE
DO 400 I = 1, NVAR
IF(ISTACK(I) .NE.^') N = N + 1
400 CONTINUE
RETURN
END
1. Initialize
TOP 4- 0
VALUE 4- 0
1 00
NEXT < — GET_NEXT_TOKEN (REVERSE)
6. Finished? or error
if TOP=1 then
VALUE = STACK (TOP)
exit the program
else
write(Invalid expression')
end if
The general algorithm to read the infix expression from the control system input
file and transforms it into a reverse Polish expression to be calculated at each time
step is described below.
(a) Read infix expression and take all the blank characters out of it.
101
(b) Separate the tokens by colons (delimiters).
2. Inside the time loop — Call, at each time step, the subroutine CALCU (FORTRAN
code shown below) to evaluate the expression (following the algorithm above).
CALCU has the ability to recognize control system variable from real numbers
that could appear in the FORTRAN expressions.
C^Interpreter
SUBROUTINE CALCU(ISTACK,N,VALUE,II)
IMPLICIT^REAL*8 (A-H 2 O-Z), INTEGER*4 (I-N)
PARAMETER^(NSTKSIZ=400,NVAR=30,NFOR=18)
CHARACTER*6 ISTACK(NSTKSIZ),IVAR
CHARACTER*6 CHECK1, CHECK2
DIMENSION^STACK(NSTKSIZ)
EXTERNAL^RGHTJST,CONVERTION
INCLUDE^VAR1
C^Initialize
ITOP = 0
DO 10 I = 1, N
C^Check for a operator
102
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ENDIF
ELSE IF(ISTACK(I) .EQ. '-^') THEN
IF(ITOP .GT. 1) THEN
VALUE = STACK(ITOP-1) - STACK(ITOP)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE IF (ITOP .EQ. 1) THEN
STACK(ITOP) = -STACK(ITOP)
ELSE
WRITE(*,*) 'ERROR IN - OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '*^') THEN
IF(ITOP .GT. 1) THEN
VALUE = STACK(ITOP-1) * STACK(ITOP)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN * OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '/^') THEN
IF(ITOP .GT. 1) THEN
IF(STACK(ITOP) .EQ. O.DO) THEN
WRITE(*,*) 'DIVISION BY ZERO;'
WRITE(*,20) II
CALL ERROR('Error')
STOP
ENDIF
VALUE = STACK(ITOP-1) / STACK(ITOP)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN / OPERATION'
WRITE(*,20) II
103
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) . EQ. '** ^') THEN
IF(ITOP .GT. 1) THEN
IF(STACK(ITOP-1) .LT. 0.D0) THEN
WRITE(*,*) 'EXPONENTIATION OF NEGATIVE NUMBER'
WRITE(*,20) II
CALL ERROR('Error')
STOP
ENDIF
VALUE = STACK(ITOP-1) ** STACK(ITOP)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN ** OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'COS^') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DCOS(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN COSINE OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'SIN^') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DSIN(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN SINE OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'TAN^') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DTAN(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN TAN OPERATION'
104
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'COSH ') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DCOSH(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN COSH OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'SQRT ') THEN
IF(ITOP .GE. 1) THEN
IF(STACK(ITOP) .LT. O.DO) THEN
WRITE(*,*) 'SQUARE ROOT OF NEGATIVE NUMBER'
WRITE(*,20) II
CALL ERROR('Error')
STOP
ENDIF
STACK(ITOP) = DSQRT(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN SQRT OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'EXP^') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DEXP(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN EXP OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ACOS ') THEN
IF(ITOP .GE. 1) THEN
IF(STACK(ITOP).LT.-1.DO.OR.STACK(ITOP).GT.1.D0) THEN
WRITE(*,*) 'ACOS ARGUMENT EITHER >1 OR <-1;'
WRITE(*,20) II
CALL ERROR('Error')
105
STOP
ENDIF
STACK(ITOP) = DACOS(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ACOS OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ASIN ') THEN
IF(ITOP .GE. 1) THEN
IF(STACK(ITOP) .LT. O.DO) THEN
WRITE(*,*) 'ASIN ARGUMENT EITHER >1 OR <1;'
WRITE(*,20) II
CALL ERROR('Error')
STOP
ENDIF
STACK(ITOP) = DASIN(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ASIN OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ATAN ') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DATAN(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ATAN OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'TANH ') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DTANH(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN TANH OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'SINH ') THEN
106
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DSINH(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN SINH OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ALOG ') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DLOG(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ALOG OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ALOG10') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DLOG10(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ALOG10 OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. 'ABS ^') THEN
IF(ITOP .GE. 1) THEN
STACK(ITOP) = DABS(STACK(ITOP))
ELSE
WRITE(*,*) 'ERROR IN ABS OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.EQV. ') THEN
IF(ITOP .GT. 1) THEN
K = 1
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
107
ELSE
WRITE(*,*) 'ERROR IN .EQV. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.NEQV.') THEN
IF(ITOP .GT. 1) THEN
K = 2
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .NEQV. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.OR. ') THEN
IF(ITOP .GT. 1) THEN
K = 3
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .OR. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.AND. ') THEN
IF(ITOP .GT. 1) THEN
K = 4
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
108
ELSE
WRITE(*,*) 'ERROR IN .AND. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.NOT. ') THEN
IF(ITOP .GE. 1) THEN
K = 5
A = STACK(ITOP)
CALL CONVERTION1(A,VALUE)
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .NOT. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.EQ. ') THEN
IF(ITOP .GT. 1) THEN
K = 6
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .EQ. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.NE. ') THEN
IF(ITOP .GT. 1) THEN
K = 7
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .NE. OPERATION'
109
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.LE. ') THEN
IF(ITOP .GT. 1) THEN
K = 8
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .LE. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.LT. ') THEN
IF(ITOP .GT. 1) THEN
K = 9
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .LT. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.GE. ') THEN
IF(ITOP .GT. 1) THEN
K = 10
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .GE. OPERATION'
110
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE IF(ISTACK(I) .EQ. '.GT. ') THEN
IF(ITOP .GT. 1) THEN
K = 11
A = STACK(ITOP-1)
B = STACK(ITOP)
CALL CONVERTION(A,B,VALUE,K)
ITOP = ITOP - 1
STACK(ITOP) = VALUE
ELSE
WRITE(*,*) 'ERROR IN .GT. OPERATION'
WRITE(*,20) II
STOP 'ERROR'
ENDIF
ELSE
ITOP = ITOP + 1
READ(ISTACK(I),*,IOSTAT=NERROR) STACK(ITOP)
IF(NERROR .GT. 0) THEN
READ(ISTACK(I),'(1A6)') CHECK1
CALL RGHTJST(CHECK1)
C^Check if the operand is a control system variable or a real number.
C^If it is a variable, its value is in T_IVAR.
DO 9 KK = 1, LL(II)
CHECK2 = IVAR(II,KK)
IF(CHECK1 .EQ. CHECK2) STACK(ITOP) = T_IVAR(II,KK)
9^CONTINUE
ENDIF
ENDIF
10^CONTINUE
C^Check if ITOP = 1
111
VALUE = STACK(1)
ELSE
WRITE(*,30) ITOP
WRITE(*,20) II
WRITE(*,40) N
ENDIF
20 FORMAT(' FORTRAN EXPRESSION it',I3)
30 FORMAT(' ERROR IN THE END OF STACK - ITOP =',I3)
40 FORMAT(' NTOKENS = ',I3)
RETURN
END
Appendix B
113
C
C^output variables
33 OUT VAR1
C
C^connection variables
C
C^initial conditions
77 VAR2^O.DO
77 OUT^O.DO
C
C^end of file
114
C^output variables
33 INP OUT
C
C^connection variables
C^initial conditions
77 OUT^-4S.D-1
C
C^Dynamic limiter
C
C^k-block^auxiliar block
INP + SRC23 + AUX^ 1.D0
C
C^k-block^auxiliar block
AUX + SRC21^ 1.D0
C
C^s-block^(10**3)/s with limits (-.6,1.5)
1 OUT + INP 1.D3-5.D-1 1.5D0
1.D0
1.D0
C
C^output variables
33 INP OUT
C
C^connection variables
115
C
C^initial conditions
77^OUT^-6.D-1
C
C^end of file
C^source block
22SOURCE^1.D0^-60.D0^90.0
C
C^output variables
33 OUT VAR2FDBACK
C
C^connection variables
116
^
C^initial conditions
C^end of file
C^source block
22^SCR^1.D0^60.D0
C
117
-7.0D-01 4.90D-01
-6.5D-01 4.22D-01
-6.0D-01 3.60D-01
-5.5D-01 3.02D-01
-5.0D-01 2.50D-01
-4.5D-01 2.02D-01
-4.0D-01 1.60D-01
-3.5D-01 1.22D-01
-3.0D-01 9.00D-02
-2.5D-01 6.25D-02
-2.0D-01 4.00D-02
-1.5D-01 2.25D-02
-1.0D-01 1.00D-02
-5.0D-02 2.50D-03
0.D0 0.D0
6.00D-02 2.50D-03
1.00D-01 1.00D-02
1.50D-01 2.25D-02
2.00D-01 4.00D-02
2.50D-01 6.25D-02
3.00D-01 9.00D-02
3.60D-01 1.22D-01
4.00D-01 1.60D-01
4.50D-01 2.02D-01
5.00D-01 2.50D-01
5.60D-01 3.02D-01
6.00D-01 3.60D-01
6.50D-01 4.23D-01
7.00D-01 4.90D-01
7.50D-01 5.63D-01
8.00D-01 6.40D-01
8.50D-01 7.23D-01
9.00D-01 8.10D-01
9.50D-01 9.03D-01
1.D0 1.D0
1.05D0 1.1025D0
1.1D0 1.21D0
2.D0 4.D0
99999.D0
C
C^RMS block
^
60 VAR6 VAR5 60.D0
C
118
C^output variables
33 VAR1 VAR4 VAR5 VAR6
C
C^initial conditions
^
77 VAR2 1.D0
^
77 VAR4 1.D0
C
C^end of file
119
SS Input File
C^Arc modelling
C
&LIMA.OUT^ Input file name
&LIMA.AUX^ Auxiliar file name
&YN^(Apply fast Newton Method?),(Save number of iterations?)
C
C^k-block
0 ITACS + VEMTP^ 1.D-1
C
C^output variables
33 ITACS
C
C^initial conditions
^
77 ITACS 0.D0
C
C^end of file
120
1^PB + PINST^ 1.D0
1.D0
120.D0
C
C^k-block
0 AUX1 + SRC21 377.D0
C
C^k-block
0 AUX2 + VEMTP 1.D0
C
C^k-block
0 AUX5 + SCR23 1.D0
C
C^k-block
0 PAVER +^PB - PDEL 1.D0
C
C^time-delay block
66 PDEL^PB^8.33D-3
C
C^source block
21 SRC21^1.D0
^ ^
23 SCR23^3393.D0 1.D-1 5.D-2^ 5.D-2
C
C^output variables
33 ITACS PAVER
C
C^connection variables
44 ITACS VEMTP^31623D-4
C
C^initial conditions
^
77^INT 0.D0
^
77 PINST 0.D0
^
77^PB O.DO
C
121
C^end of file
SS Input File
&CASE17.INP
^ Time card
0.00005^0.2^ 1
*
^ Lumped RLC branch
1^2^1.D-19
92^2
2.^O.
9999999.
$>>>>>»End of level 1: Linear and nonlinear elements<<<<<<<<<
$>>>>>>>End of level 2: Switches and piecewise linear elements
122
^
BUS1A 4.011
BUS1B 4.011
BUS1C 4.011
BUS12ABUS13A 70.16
BUS12BBUS13B 70.16
BUS12CBUS13C 70.16
92 IL13A
2.^0.
9999999.
^
92 IL13B IL13A
^
92 IL13C IL13A
C
C^. .^. Constant-parameters line
-1 BUS7A BUS1A .03167 3.222.00787 144.4
-2 BUS7B BUS1B .0243 .9238^.0126 144.4
-3 BUS7C BUS1C
-1 BUS1ABUS12A .03167 3.222.00787 24.14
-2 BUS1BBUS12B .0243 .9238^.0126 24.14
-3 BUS1CBUS12C
$ = = End of level 1: Linear and nonlinear elements ^
BUS13A IL13A^0.^99999.
BUS13B IL13B^0.^99999.
BUS13C IL13C^0.^99999.
$ = = = End of level 2: Switches and piecewise linear elements
C
C^.^ .^. Voltage or current sources
14 THEVA 1 187.79 60. -1.
14 THEVB 1 187.79 60. -120. -1 .
14 THEVC 1 187.79 60. 120. -1.
$ = = = End of level 3: Sources
C
C^ . Voltage-output nodes
BUS1A
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case ^
SS Input File
C^CASE22.INP
C
C^Phase A
C
C^s-block
^
1ITACSA + INT_A 1.D0
11468.D-1^1.D0
123
^
1.D0
C
C^k-block
^
O AUX2A +VEMTPA 1.D0
C
C^Phase B
C
C^s-block
^
1ITACSB + INT_B 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
^
O AUX2B +VEMTPB 1.D0
C
C^Phase C
C
C^s-block
^
1ITACSC + INT_C 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
^
O AUX2C +VEMTPC 1.D0
C
C Auxiliar Blocks
C
C^k-block
O CONS1 +SRC211^ 1.D0
C
C^k-block
O CONS2 +SRC212^ 1.D0
C
C^k-block
O CONS3 +SRC213^ 1.D0
C
C^k-block
O CONS4 +SRC214^ 1.D0
C
C^k-block
O AUX2 + CONS1 + CONS2 + CONS3 + CONS4 ^ 1.D0
C
C^source block
124
21SRC211^1795.D-4
21SRC212 23715.D-4 5.D-2
21SRC213 28650.D-4 1.D-1
21SRC214 12293.D-4 15.D-2
C
C^output variables
33 CONS4
C
C^connection variables
44ITACSAVEMTPA^0.D0
44ITACSBVEMTPB^O.DO
44ITACSCVEMTPC^0.D0
C
C^initial conditions
^
77 INT_A O.DO
^
77 INT_B O.DO
^
77 INT_C O.DO
C
C^end of file
125
^
^ ^
2 THEVB BUS7B 0.0233-5.427 0.083334.563
^ ^ ^
3 THEVC BUS7C 0.0233-5.427 0.0233-5.427 0.083334.563
C
C^.^ . Lumped RLC branch
^
BUS1A 4.011
^
BUS1B 4.011
^
BUS1C 4.011
^
BUS12ABUS13A 70.16
^
BUS12BBUS13B 70.16
^
BUS12CBUS13C 70.16
92 IL13A
2.^0.
9999999.
^
92 IL13B IL13A
^
92 IL13C IL13A
C
C^.^ .^. Constant-parameters line
-1 BUS7A BUS1A .03167 3.222.00787 144.4
-2 BUS7B BUS1B .0243 .9238^.0126 144.4
-3 BUS7C BUS1C
-1 BUS1ABUS12A .03167 3.222.00787 24.14
-2 BUS1BBUS12B .0243 .9238^.0126 24.14
-3 BUS1CBUS12C
$ = = End of level 1: Linear and nonlinear elements ^
BUS13A IL13A^0. 99999.
BUS13B IL13B^0. 99999.
BUS13C IL13C^0. 99999.
$ = = = End of level 2: Switches and piecewise linear elements
C
C^. .^. Voltage or current sources
14 THEVA 1^187.79 60.
14 THEVB 1^187.79 60.^-120.
14 THEVC 1^187.79^60.^120.
$ = = = End of level 3: Sources ^
C
C^.^ . Voltage-output nodes
BUS1A
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case ^
SS Input File
C^CASE23.INP
C
C^Phase A
126
^
^
C
C^s-block
^
1ITACSA + INT_A 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
^
0 AUX2A +VEMTPA 1.D0
C
C^k-block
^
O AUX3A +ITACSA 1.D0
C
C^Phase B
C
C^s-block
^
1ITACSB + INT_B 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
^
O AUX2B +VEMTPB 1.D0
C
C^k-block
^
O AUX3B +ITACSB 1.D0
C
C^Phase C
C
C^s-block
^
1ITACSC + INT_C 1 .DO
11468.D-1^1.D0
1.D0
C
C^k-block
^
O AUX2C +VEMTPC 1.D0
C
C^Auxiliary blocks
C
C^k-block
^
O AUX3C +ITACSC 1.D0
C
C^k-block
^
O CONS1 + SRC21 1.D0
C
C^k-block
127
^
C^source block
21 SRC21^1795.D-4
^ ^
23 SRC23^524.D-2 1.D-1 5.D-2^ 5.D-2
C
C^output variables
33 AUX2B
C
C^connection variables
44ITACSAVEMTPA^0.D0
44ITACSBVEMTPB^0.D0
44ITACSCVEMTPC^0.D0
C
C^initial conditions
^
77 INT_A 0.D0
^
77 INT_B O.DO
^
77 INT_C O.DO
C
C^end of file
Without TCR
EMTP Input File
&CASE24.INP
C
128
C^.^ .^. Case identification card
THREE-PHASE VARIABLE LOAD WITHOUT TCR
C LOAD REPRESENTED INSIDE Ss (NODE BUS13A)
C
C^.^ . Time card
^
50.E-6^.2^1 1
C
C^.^ . Symmetric pi circuit
1 THEVA BUS7A^0.083334.563
2 THEVB BUS7B^0.0233-5.427^0.083334.563
3 THEVC BUS7C^0.0233-5.427^0.0233-6.427^0.083334.563
C
C^.^ . Lumped RLC branch
BUS1A^ 7.
BUS1B^ 7.
BUS1C^ 7.
BUS12ABUS13A^ 70.16
BUS12BBUS13B^ 70.16
BUS12CBUS13C^ 70.16
92 IL13A^ 11
2.^0.
9999999.
92 IL13B^IL13A^ 2
92 IL13C^IL13A^ 3
C
C^.^ .^. Constant-parameters line
-1 BUS7A BUS1A^.03167 3.222.00787 144.4
-2 BUS7B BUS1B^.0243 .9238 .0126 144.4
-3 BUS7C BUS1C
-1 BUS1ABUS12A^.03167 3.222.00787 24.14
-2 BUS1BBUS12B^.0243 .9238 .0126 24.14
-3 BUS1CBUS12C
$ = = End of level 1: Linear and nonlinear elements ^
BUS13A IL13A^O.^99999.
BUS13B IL13B^O.^99999.
BUS13C IL13C^O.^99999.
$ = = = End of level 2: Switches and piecewise linear elements
C
C^.^ . Voltage or current sources
14 THEVA 1^187.79^60.^ -1.
14 THEVB 1^187.79^60.^-120.^ -1.
14 THEVC 1^187.79^60.^120.^ -1.
$ = = = End of level 3: Sources ^
C
129
C^.^ . Voltage-output nodes
BUS1A
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case ^
SS Input File
C^CASE24.INP
C
&CASE24.0UT
&CASE24.AUX
&YN
C
C
C^Phase A
C
C^s-block
1ITACSA + INT_A 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
O CONS1 +SRC211 1.D0
C
C^k-block
O CONS2 +SRC212 1.D0
C
C^k-block
0 CONS3 +SRC213 1.D0
C
C^k-block
0 CONS4 +SRC214 1.D0
C
C^k-block
O AUX2A +VEMTPA 1.D0
C
C^k-block
O AUX2 + CONS1 + CONS2 + CONS3 + CONS4 1.D0
C
C^Phase B
C
C^s-block
1ITACSB + INT_B 1.D0
11468.D-1^1.D0
1.D0
130
C
C^k-block
^
0 AUX2B +VEMTPB 1.D0
C
C^Phase C
C
C^s-block
^
1ITACSC + INT_C 1.D0
11468.D-1^1.D0
1.D0
C
C^k-block
^
0 AUX2C +VEMTPC 1.D0
C
C^source block
21SRC211^1795.D-4
21SRC212^O.DO^ 5.D-2
21SRC213^64658.D-4^ 1.D-1
21SRC214^O.DO^ 15.D-2
C
C^output variables
33 VRMS
C
C^connection variables
44ITACSAVEMTPA^0.D0
44ITACSBVEMTPB^O.DO
44ITACSCVEMTPC^0.D0
C
C^initial conditions
77 INT_A^ O.DO
131
^
77 INT_B 0.D0
^
77 INT_C 0.DO
C
C^end of file
With TCR
EMTP Input File
&CASE25.INP
C
C^.^ .^. Case identification card
THREE-PHASE VARIABLE LOAD WITH TCR AT BUS 1
C LOAD REPRESENTED INSIDE SS (NODE BUS13A)
C
C^. . Time card
50.E-6 .2 1 1
C
C^.^.^. . Symmetric pi circuit
1 THEVA BUS7A 0.083334.663
2 THEVB BUS7B 0.0233-5.427^0.083334.563
3 THEVC BUS7C 0.0233-5.427^0.0233-5.427 0.083334.563
C
C^. . Lumped RLC branch
BUS1A 7.
BUS1B 7.
BUS1C 7.
BUS12ABUS13A 70.16
BUS12BBUS13B 70.16
BUS12CBUS13C 70.16
IL13A 6389.^5571.
IL13B 6389.^5571.
IL13C 6389.^5571.
IX13A 177.36154.65
IX13B 177.36154.65
IX13C 177.36154.65
92^TCRA 1
2.^O.
9999999.
92^TCRB TCRA 2
92^TCRC TCRA 3
C
C^. .^. Constant-parameters line
-1 BUS7A BUS1A^.03167 3.222.00787 144.4
132
-2 BUS7B BUS1B .0243 .9238^.0126 144.4
-3 BUS7C BUS1C
-1 BUS1ABUS12A .03167 3.222.00787 24.14
-2 BUS1BBUS12B .0243 .9238^.0126 24.14
-3 BUS1CBUS12C
$ = = End of level 1: Linear and nonlinear elements
BUS13A IL13A 0. .1 .0001
BUS13B IL13B 0. .1 .0001
BUS13C IL13C 0. .1 .0001
BUS13A IX13A .1 999999. .0001
BUS13B IX13B .1 999999. .0001
BUS13C IX13C .1 999999. .0001
BUS1A^TCRA 0. 99999.
BUS1B^TCRB 0. 99999.
BUS1C^TCRC 0. 99999.
$ = = =^End of level 2: Switches and piecewise linear elements ^
C
C^. . Voltage or current sources
14 THEVA 1^187.79 60. -1.
14 THEVB 1^187.79 60. -120. -1.
14 THEVC 1^187.79 60. 120. -1.
$ = = = End of level 3: Sources
C
C . Voltage-output nodes
BUS1A
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case ^
SS Input File
C^CASE25.INP
C
&CASE25.0UT
&CASE25.AUX
&YN
C
C
C^s-block 300/s
1 EPU +VRMSPU - UNITY 300.D0
1.D0
1.D0
C
C
C^k-block
^
0 BLGAM + EPU 125.D-2 0.D0125D-2
133
C
C
OVRMSPU + VRMS 7630823661.D-12
C
C^k-block
O UNITY + SRC21 1.D0
C
C^k-block
O EMTP1 +VEMTP1 1.D0
C
C^k-block
O EMTP2 +VEMTP2 1.D0
C
C^k-block
0 EMTP3 +VEMTP3 1.D0
C
C^Phase A - Busi
C^s-block 1/s
1ITACS1 + BGAMA 1.D0
1.D0
1.D0
C
C^Phase B - Busi
C^s-block^1/s
1ITACS2 + BGAMB 1.D0
1.D0
1.D0
C
C^Phase C - Bus1
C^s-block 1/s
1ITACS3 + BGAMC 1.D0
1.D0
1.D0
C
C^source block
21 SRC21^1.D0
C
134
^
C^output variables
33VRMSPU
C
C^connection variables
44ITACS1VEMTP1^0.D0
44ITACS2VEMTP2^0.D0
44ITACS3VEMTP3^0.D0
C
C^initial conditions
77 BGAMA^ 0.D0
77 BGAMB^ 0.D0
77 BGAMC^ 0.D0
77 EPU^ 0.D0
77ITACS1^ 0.D0
77ITACS2^ 0.D0
77ITACS3^ 0.D0
C
C^end of file
135
9999999.
$>>>>>>>End of level 1: Linear and nonlinear elements<<<<<<<<<
$>>>>>>>End of level 2: Switches and piecewise linear elements
SS Input File
C CASE40.INP
C BASIC HVDC MODELS - FIG. 7-10 - WORKBOOK IV - CHAP 7 - PAGE 7-12
C
&CASE40_1.0UT^ Input file name
&CASE40_1.AUX^ Auxiliar file name
&YN^(Apply fast Newton Method?),(Save number of iterations?)
C
C
C^k-block
O IDC +SCR211 + AUX3 + DCF^ 1.D0
C
C^k-block
O X + AUX2 +SCR212^ 1.D0
C
C^k-block
O ALPHA + CONT +SCR215^ 1.D0
C
C^k-block
^
0 AUX3 + SCR24 1.D0
C
C^k-block
^
O AUX4 +SCR216 1.D0
C
C^k-block
^
O BUS1 + VEMTP 1.D0
C
C^k-block
^
O AUX1 +^PI 1.D0
C
C^k-block
^
O XC +SCR213 1.D0
C
C^k-block
136
^
O A +SCR214^ 1.D0
C
C^s-block^120/s
1^C1P + PRODC^ 120.D0
1.D0
1.D0
C
C^s-block^120/s
1 S1P + PRODS 120.D0
1.D0
1.D0
C
C^k-block
O C1 +^C1P -^C1D^ 1.D0
C
C^k-block
O S1 +^S1P -^S1D^ 1.D0
C
C^k-block
O AUX2 + TIMEX^ 1.D0
C
C^source block
21SCR211^1.6 50.D-3^150.D-3
21SCR212^-0.1
21SCR213^9.08
21SCR214^0.8933
21SCR215^0.31416
21SCR216^107.79
24 SCR24^1.6 50.D-3^ 50.D-3
25 TIMEX
25^PI
C
137
99 PRODC =BUS1*COS(wt)
99 PRODS =BUS1*SIN(wt)
99^VM =SQRT(C1*C1+S1*S1)
99^CV =(C1*COS(wt)+S1*SIN(wt))/VM
99^SV =(C1*SIN(wt)-S1*COS(wt))/VM
C
C^DC system equation
C
99 PHI^=ACOS(COS(ALPHA)-(XC*IDC)/(A*SQRT(3)*VM))
C
C^AC current injection
C
99 IACF =(CV*COS(PHI)+SV*SIN(PHI))*A*2.0*SQRT(3)*IDC/AUX1
C
C^output variables
33^C1^CV IDC ALPHA
C
C^connection variable
44 IACF VEMTP^77.614
C
C^initial conditions
77^C1P^ 1.D0
77^S1P^ O.DO
77 DCF^ 0.D0
77 CONT^ O.DO
77 PRODC^77.614
77 PRODS^ O.DO
77^VM^ 3.6
77^CV^ 1.D0
77^SV^ 0.D0
77 PHI^.31434D0
77 IACF^ 0.D0
77^XP^ 0.D0
77^wt^ O.DO
C
C^end of file
138
^
&MOHAN5.INP
C^.^ .^. Case identification card
1-PHASE THYRISTOR RECTIFIER
C
C^.^ . Time card
50.0E-6^50.0E-3 ^ .5E-3
C
C^.^ . Lumped RLC branch
VSA VMA^ 0.2
VMA^VA^ 1.0
POSP^POS^ 16.0
POS NEG^2.0
POSP NEG^1.0E9
POSP^VA^200.0^1.0
POSP^POSP^VA
VA NEG POSP^VA
NEG POSP^VA
POSA POSP^0.01
POSG POSP^0.01
^
92 VSA 1
4.
0.
9999999.
92 POS VSA 2
$ = = End of level 1: Linear and nonlinear elements
C
C^.^ . Time-controlled switch
-1^VA POSA^ 0.002^60. 1
-1^NEG^ 0.002^60. 2
-1^POSG^ 0.002^60. 3
-1^NEG^VA^ 0.002^60. 4
$ = = = End of level 2: Switches and piecewise linear elements
C
C^.^ .^. Voltage or current sources
14^VSA^169.7^60.0^-90.0
$ = = = End of level 3: Sources
C^.^.^.^.^.^.^. Voltage-output nodes
VSA POSP
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case
SS Input File
C^MOHAN5.INP
C
139
&MOHAN5.0UT^ Input file name
&MOHANS.AUX^ Auxiliar file name
&YY^(Apply fast Newton Method?),(Save number of iterations?)
C
C^k-block
0 VSA + VEMTP^ 1.D0
OVCONTL +SRC211^ 1.D0
CO AUX1 + AUX^ 1.D0
OPLS1-2 + AUX^ 1.D0
C
C^source blocks
21SRC211^0.25
21SRC212^1.
C
C^fortran expression
99 AUX = RAMP .GE. VCONTL
C
C^output variables
33 RAMPPLS1-2PLS3-4
C
C^connection variables
44 ICSTP VEMTP^0.D0
55PLS1-2
55PLS1-2
55PLS3-4
S5PLS3-4
C
C^end of file
140
^
141
^
11^POS-1 -600.0E6
11^NEG-1^600.0E6
$ = = = End of level 3: Sources ^
C^ .^. Voltage-output nodes
VSA
$ = = = End of level 4: User-defined voltage output
$ = = = Level 5: End of data case ^
SS Input File
C^MOHAN8.INP
C
C MOHAN8_1.PLO - Simultaneous solution
C MOHAN8_2.PLO - One time-step delay
C MOHAN8_3.PLO - Two time-step delay
C
&MOHAN8.0UT^ Input file name
&MOHAN8.AUX^ Auxiliar file name
&YN^(Apply fast Newton Method?),(Save number of iterations?)
C
C^k-block
0^VSA +VEMTPA 1.D0
0^VSC +VEMTPC 1.D0
0^VSAC +^VSA - VSC 1.D0
OVCONTL +SRC211 1.D0
0^AUX1 +^AUX 1.D0
0^AUX3 +^AUX2 1.D0
0 PULS1 +^AUX4 1.D0
C
C^source blocks
142
21SRC211 .833333333
21SRC212^1.
C
C^fortran expression
99 AUX = RAMP .GE. VCONTL
99 AUX2 = (.NOT. DCMP) .AND. AUX1
C99 GATE1 = PULS1 .OR. PULS2
C99 GATE2 = PULS2 .OR. PULS3
C99 GATE3 = PULS3 .OR. PULS4
C99 GATE4 = PULS4 .OR. PULS5
C99 GATES = PULS5 .OR. PULS6
C99 GATE6 = PULS6 .0R. PULS1
C
C^output variables
33 PULS1 PULS2 PULS3 PULS4 PULS5 PULS6 RAMP
C
C^connection variables
44ICSTAPVEMTPA^0.D0
44ICSTCPVEMTPC^0.D0
55 PULS1
55 PULS2
55 PULS3
55 PULS4
55 PULS5
55 PULS6
C
C^initial conditions
^
77 AUX O.DO
^
77 AUX2 O.DO
C
C^end of file
143