You are on page 1of 6

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

MatSim - A Tool to Perform Power System


Stability Studies
Vinayaka G Yaji, Abhishek G.S and K.N. Shubhanga

AbstractIn this paper, the features and flexibilities of an


analysis and visualization tool, MatSim, are presented. Using
this tool we can carry out power flow, transient and small-signal
stability analysis of large power systems on the widely used
MATLAB environment. This tool facilitates easy visualization of
complex power systems using a versatile single-line editor module
which is also developed on the same platform as that of the
MatSim. Such an integration not only simplifies the feeding in of
enormous amounts of data required by the power system analysis
software, but also permits displaying of power system analysis
results in an interactive fashion on the one-line-diagram of the
system using the inherent and powerful plot-handling features of
the MATLAB. Since MATLAB is a widely used software, the tool
offers an ideal choice for beginners as against any industry grade
costly packages. The tool provides many dynamic models such
as generators, load, various IEEE-suggested excitation, prime
mover and power system stabilizer controllers, fault, line trip
and perturb Vref models to create disturbances. The models are
implemented with default standard parameters which facilitate
easy experimentation with power system examples of any size
including an SMIB system.
Index TermsLoad flow, MATLAB/SIMULINK, Power system
analysis, Power system stability. Single-line-editor.

I. I NTRODUCTION
T is well known that power system stability analysis is an
integral part of power system planing studies [1]. In such
studies, handling large amount of system data and visualization
of results are a real challenge to power system engineers. This
has lead to the development of several software tools for the
analysis and visualization of large power systems. PSAT [2],
UWPFLOW [3], Power System Toolbox [4], MatPower [5],
Voltage Stability Toolbox (VST) [6], MatEMTP [7], SimPowerSystems (SPS) [8], Power Analysis Toolbox [9], Educational
Simulation Tool (EST) [10] and PowerWorld software [11] are
some of the tools noted from the exhaustive list. However,
among these, PSAT and MatPower are not only open-source,
but also are MATLAB-based packages.
In this paper, the features and flexibilities of MatSim [12], a
MATLAB/SIMULINK-based tool for performing both smallsignal and transient stability analysis of multimachine power
systems are explained. It contains a front-end MATLAB-based
GUI which facilitates the following:
1) Creation of pictorial representation of a power system in
terms of a single-line diagram using SIMULINK library
modules.
2) Automatic generation of data files employing dedicated
function/script files.

The authors are with Department of Electrical Engineering, National


Institute of Technology Karnataka, Surathkal, 575025, INDIA, E-mail:
knsa1234@yahoo.com.

3) Selection and run of a desired analysis among eigenvalue


analysis (which involves mode identification, generation
of frequency response, compass plots and PSS design)
and time-domain simulation. This is carried out using a
separate set of .m and .mdl files.
4) Visualization of results wrt the single-line diagram.
To mention a few result variables: (a) the steady-state
power-flow: bus-specifications and line-flows (b) timedomain simulation results: machine speeds, rotor angles,
line angles, apparent impedance-trajectory relative to a
Mho characteristic and Loss-of-field impedance tracking
for generators.
In the visualization section, many options are provided to
plot the variables either individually or in multiples, i.e., plot
on same axis. This feature especially helps while analyzing
the participation of machines in a given oscillatory mode
of a power system. Following are the important features of
MatSim:
Default values for models for easy experimentation.
Once the single-line diagram is prepared, either power
flow study or small-signal/transient stability study can be
conducted with ease by just a selection from the list of
analysis without making any changes to the single-line
diagram.
A power system of any size (even an SMIB system) can
be handled conveniently.
Easy visualization of type of controller/disturbance chosen for a system in the single-line diagram itself instead
of their selection via a file.
Many output variables to visualize. Only a basic set of
variables are stored in the file after the analysis for offline use. Just a click on a component in the singleline diagram, plots the chosen variables. Some time, the
desired variables are calculated on the fly before plotting.
The developed MatSim code can be run on any version
of MATLAB, though it is developed on MATLAB 5.3.
This paper attempts to throw light on the basic usage of
MatSim and the associated GUI. This paper is organized as
follows. Section-II describes the basic implementation details.
The usage of the package has been demonstrated through
a well known 4-machine and the IEEE 50-machine power
systems in section-III.
II. I MPLEMENTATION I SSUES
In this section, the implementation details of the single-line
diagram editor (SLE) and the features of the result-display
GUI have been discussed.

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

A. Features of Single-Line Diagram Editor:


The SLE algorithm mainly exploits the ASCII nature of the
saved SIMULINK model file to extract all the data contained
in the model file.
1) SLE Library Components: A fully-equipped library
namely electricallib5_3.mdl, is provided using which, singleline diagram of the power system can be effortlessly created.
A glimpse of the electricallib5_3.mdl is shown in Fig. 1.
The library is equipped with a fairly huge set of components,

Fig. 2.

Fig. 1.

Electrical library for the single-line-editor.

including most common constituents of power systems, viz.


Bus, Generator, Line, Load, Shunt, Transformer. Furthermore,
three types of controllers for the Generator, viz. Automatic
Voltage Regulators (AVR), Turbines and Power System Stabilizers (PSS) are available. In this library, six types of exciters
namely Static, the IEEE-AC1A, IEEE-AC4A, IEEE-DC1A,
IEEE-ST1A, IEEE-ST2A [13] are provided. Similarly, Reheattype, Non-Reheat-type, Hydro-types of turbines [14] are also
provided. Slip-input, Power-input, Power-Slip-input are the
varieties of PSS provided. A click and zoom into each of the
blocks provides the complete transfer function representation
of the controller. This guides the parameter entry in its menu.
An important feature of MatSim is that it supports modelling
of disturbances in the single-line diagram to perform dynamic
analysis. Hence, four additional blocks have been provided
for disturbance analysis, namely, Fault, Line_trip, Pert_Vref
and Loss-of-field disturbance. The data common to the entire
system like system-frequency, and voltage- and frequencydependent load model details are entered into one block called
system_para. For brevity, we would like to dwell upon the
features of only the Generator block in the following lines.
2) Generator Block: Fig. 2 shows the generator block,
which has been dragged and dropped into a .mdl file and the
menu that pops up when the block is double-clicked upon. The
various fields can be set appropriately. The generator can be
made a Slack-bus or a PV-bus by simply setting the Slack (1)
or PV (0) bit to 1 or 0. As mentioned earlier, the generator
needs to be connected to three controllers, namely AVR,

Generator block and its menu for entry of parameters.

PSS and Turbine. They can be disabled/enabled by simply


setting the corresponding fields appropriately.This eliminates
the need to remove/add the blocks each time it has to be
disabled/enabled. The Generator block accounts for the 6th
order full blown model and any simplified model (and even
the infinite bus model) can be employed for the generator by
appropriately setting the data.
3) Single-Line Diagram of Large Systems: It becomes
very difficult to visualize huge power-systems in a single
window. Hence it becomes extremely necessary to resort to an
inherent feature of MATLAB: subsystem. Using subsystems,
it is possible to organize the power system into various
sections, and interconnect them, making the representation
more meaningful and easily comprehensible. SLE, by virtue
of its unique algorithm, fully supports subsystems, there being
no limit on the number. Moreover, it also supports nested
subsystems to any depth, i.e., subsystems can be created within
one another to any extent. This is one of the very important
features of SLE, which is useful to represent areas/regions in
a large system. Further, SLE, supported by an intelligent error
display feature, can be run on partially connected systems as
well. This guides the user in successfully building the singleline diagrams of large systems in stages.
B. Sample Power Systems:
The usage of MatSim has been demonstrated for the following systems: 4-machine, 10-bus power system and the IEEE
50-machine power system.
4-machine power system [17]: Fig. 3 shows the single-line
diagram of the 4-machine system created using library blocks
and SIMULINK in-built lines. Necessary data are entered
in the menu for each block. Note that a Fault block is
connected to bus 5 to create a 3 phase symmetrical fault-toground. A Line_trip block is used to trip line-9 to signify the
fault clearing. Instead of a Fault block if a Pert_Vref block

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

Fig. 3.

Four-machine power systems.

is placed in the .mdl file, it perturbs the reference voltage


of AVR of a specific generator. The menu-fields in each of
the disturbance blocks enables the entry of appropriate faultdetails.
IEEE 50-machine power systems [19]: This system has 145
buses, 401 lines, 52 transformers, 64 loads and 97 shunts. This
system is a classic example to demonstrate the need for the
creation of subsystems. The entire system is modularized into
nested subsystems. Creation of subsystems does not call for
any changes in running the programme. Likewise, no changes
are seen in the .dat files so produced. Fig. 4 depicts one such
subsystem.

Fig. 4.

3) Running of power-flow/eigenvalue analysis/transient stability programmes using the data files.


4) Displaying of results: This part of the GUI loads the
single-line diagram of the system and through a mouse
click it permits the selection of a component for which
a desired plot can be obtained.
The main menu which offers the above features is shown
in Fig. 5. The figure also shows the submenus that pop up for
extraction of data files and the menu for designing a PSS. In
the figure the PSS menu contains a button using which the
generator number can be obtained directly from the one-line
diagram.

A subsystem of 50-machine power systems.

C. Result Display GUI:


The GUI developed permits:
1) Creation of single-line diagram: This uses the
component-library file and the SIMULINK editor to
build a power system.
2) Generation of data files: It invokes the data-extractor
programme through menu selection to generate the data
files from the .mdl file.

Fig. 5. MatSim main -window along with Extract data files & PSS design
-window.

D. Implementation of the GUI:


The GUI with the features indicated in the previous section
has been implemented through a set of .m files. With a proper
folder structure it accesses data-extractor folder, MatSim folder

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

and the display-related files. The GUI has the following 3


modes:
1) Extract mode.
2) Analyse mode.
3) Display mode.
In Extract mode, many .mdl files can be kept open for
the purpose of developing the single-line diagram of different
power systems. It prompts the user to enter the specific .mdl
file name with extension, from which data files are to be
extracted (see Fig. 5). It creates a separate folder for each
of the systems.
In Analyse mode, it permits the user to perform the stability
analysis of a power system. The systems for which the data
files have been successfully extracted get listed in the main
menu (see Fig. 5). Upon selection of a system out of the listed
systems, the Analyse mode will become active and the analysis
is carried out for the respective system. The Analyse mode
provides option to perform transient stability analysis and
eigenvalue analysis.The transient stability analysis option runs
a SIMULINK model file (at the back-end) to solve the power
system equations in the form of set of differential algebraic
equations (DAEs) given by
x

YBU S V

= f (x, V , u)
V , SL )
= I(x,

mode also facilitates plotting multiple traces on a same figure


window. With such an option, the grouping of machines in a
given swing-mode can be conveniently verified.

Fig. 6. Result display properties -window displaying result-display properties


for generator.

(1)

III. C ASE STUDIES

(2)

In this section, some case studies carried out on a 4-machine


and the IEEE 50-machine power systems are discussed.

where,
x represents the vector of the state-variables
u represents the vector of inputs
I denotes the bus-current injection vector, V -represents the
bus-voltage vector, SL represents the bus-power injections and
YBU S denotes the bus-admittance matrix.
For eigenvalue analysis, the above equations are linearized
to obtain the linearized state-equations given by
x = Ax + Bu

(3)

y = Cx + Du

(4)

The eigenvalue analysis option in the Analyse mode, evaluates


the eigenvalues of the A-matrix using eig function of MATLAB. Further, by calculating the right and left eigenvectors and
by computing the participation factor [15], [16], the modalclassification is done. This also permits the determination of
grouping of machines in a swing-mode. The implementation
of the task exploits the vectorization of the variable with
period operation and sparsity solution techniques inherent to
MATLAB [20], [21]. This makes the programme modular and
removes the restriction on the size of the system that can be
handled.
In Display mode, the user is prompted to load the singleline diagram of a power system for which study results are
available. This facilitates an intelligent display of steadystate power-flow and time-domain study results referring them
to the component interconnection depicted in the single-line
diagram. For each of the components, a number of plot options
are provided. For example, Fig. 6 shows these for Generator.
Having selected the desired variables from the list and having
activated the Display mode, a mouse click on the generator
block plots the selected variable on the figure window. This

A. 4-machine Power Systems:


The steady-state power-flow in line-1 is shown in Fig. 7,
for a typical generation-load specification [17].

Fig. 7.

Steady-state power flow in Line-1 for 4 machine power systems.

This is obtained by selecting: Line/Initial-values/power-flow


option in the plot-list and finally clicking on line-1 in the
single-line diagram.
For the said operating condition, the eigenvalue analysis is
carried out and Fig. 8 displays the eigenvalue listing. This
figure also shows an interarea mode (Sl.no.22) (0.2653 +
j4.5064) being highlighted for the participation-factor analysis. The state variables which take part to a large extent in this
mode are listed in Fig. 9.
The figure provides a Visualize button to identify the grouping of machines on the one-line diagram of the system. The
associated right-eigenvector (speed variable) plot is depicted
in Fig. 10. This further demonstrates that machines 1 & 2

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

90
0.001
120

60
0.0008
0.0006
30

150
0.0004
SG1
0.0002

180

SG2
SG3
SG4
210

330

240

300
270

Fig. 8.

Eigenvalue listing for 4-machine power systems.

Fig. 10. Compass plot of right-eigenvectors (slip) pertaining to the interarea


mode.
3

Slip vs Time

x 10

2
m/c2
m/c1

Slip wrt SlipCOI

1
m/c3
m/c4
2

Fig. 11.

10
TIME (s)

12

14

16

18

20

Slip plots for 4 machine power systems.

Fig. 9. State variable listing for the selected eigenvalue 0.2653 j4.5064.

B. IEEE 50-machine Power System


together swing against the machine group 3 & 4. A transient
stability run is carried out with a Pert_Vref block for machine
1. The resulting slip plots for all 4-machines are shown in Fig.
11. The figure indicates the dominant interarea swing-mode,
considering a slip-signal-based PSS on generator-1.
With static exciters and constant impedance type load
model, the damping factor for interarea mode is found to be
0.0083. To provide adequate damping for the interarea mode
a slip-signal based PSS is designed for generator-1 using the
PSS-design module shown in Fig. 5. This machine is chosen
for PSS placement having noted through the participation factor analysis that it has the highest participation in the interarea
mode. This is done by a PSS-selection routine (activated from
the Run option in the main menu).
The PSS-design module enables PSS design by employing
the following steps:
1) Determination of the angle of the GEPS(s) [16].
2) Compensator design.
3) Determination of an optimal gain from root-locus technique.
Thus, a PSS is designed with the specification given by
TW = 10s, m = 20o and the center frequency = 3 Hz.
This improves the damping for the interarea mode to 0.058
with PSS gain Ks = 15. The time-domain plot of slip variable
(see Fig. 11) clearly demonstrates this case.

For this system, eigenvalue analysis is carried out and of 49


swing modes, only 4 modes whose damping is predominantly
negative are listed in Table I. The table also denotes the
generator having the highest participation. These generators
are chosen for placement of slip-signal based PSS. Further, it is
to be noted that the PSS designs are carried out in a sequential
fashion stabilizing one mode at a time. A PSS gain of 15 and
20 is chosen for generators 104 and 111, respectively; and for
generators 93 and 110, KS is set 05.
TABLE I
A PARTIAL LIST OF SWING MODES FOR 50- MACHINE SYSTEMS .
SL No
1
2
3
4

Eigenvalues
0.17459 j 9.9806
0.14482 j 8.0559
0.03353 j 2.8531
0.01192 j2.6584

DF
-0.01749
-0.017974
-0.011752
-0.00448

Freq.(Hz)
1.5885
1.2821
0.4540
0.4231

Generator part.
111, 104
104, 111
110, 93
110, 93

For the case considered, the frequency response of the


e(s)
transfer function VTref
(s) for generator 104 has been plotted
in Fig. 12, with and without PSS, using a Frequency response
plot routine available in the main menu. It can be seen that
with PSS, there is a reduction in the amplitude of the response,
denoting the effectiveness of PSS.
To demonstrate the versatility of the programme, a lossof-field excitation disturbance is considered on machine 104.
This disturbance has been modelled in the SIMULINK by

CENTENARY CONFERENCE, 2011 - ELECTRICAL ENGINEERING, INDIAN INSTITUTE OF SCIENCE, BANGALORE

Frequency response of Te(s)/Vref(s) for Generator 104

R EFERENCES

900

800

700

Amplitude (p.u.)

600
No PSS
500

400

300
With PSS
200

100

Fig. 12.

0.5

1.5

Frequency response of

2
Frequency (Hz)

T e(s)
V ref (s)

2.5

3.5

for generator 104.

forcing the field voltage Ef d to zero. Such a fault is detected


by computing the apparent impedance as seen from the generator terminals and superimposing it on the off-setted Mho
characteristic [18]. In the Display mode, upon the appropriate
selection, the MatSim plots the complete trajectory as shown
in Fig. 13. Similar plots can be obtained by clicking on the
corresponding generator in the single-line diagram.
Impedence trajectory
0.02
Apparent impedence as seen from the
generator terminals.

0.02
Mho104
Generator104

0.04

0.06

0.08

0.1

0.12
0.06

0.04

0.02

0
R

0.02

0.04

0.06

Fig. 13. Impedance trajectory superimposed over LOF relay characteristic


for m/c-104.

IV. C ONCLUSIONS
In this paper, the key features of a versatile power system analysis tool, MatSim, are presented. Since this is a
MATLAB-based tool it is very convenient for the users at
the UG/PG/research level to carry out advanced power system
studies without much introduction. Thus, with the authors
experience, it is found to be a ready-to-use and cost effective
tool to augment classroom study. Further, due to flexible
structure of the algorithm, any new components such as
FACTS devices, HVDC systems etc. can be added to the
MatSim. These development is also being looked at from the
point-of-view of designing a virtual lab under the ICT project,
Govt. of India.
ACKNOWLEDGMENT
The authors would like to thank Prof. A.M. Kulkarni (IIT
Bombay) for his valuable suggestions.

[1] P. Kundur, J. Paserba, V. Ajjarapu, G. Anderson, A. Bose, C. Canizares,


N. Hatziargyriou, D. Hill, A. Stankovic, C. Taylor, T.V. Cutsem, and V.
Vittal. Definition and Classification of Power System Stability, IEEE
Transaction on Power Systems, Vol.19, No. 2, pp. 1374-1389, Aug.,
2004.
[2] F. Milano. (2002) PSAT, Matlab-Based Power System Analysis Toolbox,
[Online] available at: http://thunderbox.uwaterloo.ca/fmilano.
[3] C. A. Caizares, et al., (1999) UWPFLOW, [Online] available at http:
//www.power.uwaterloo.ca.
[4] J. H. Chow and K. W. Cheung, A toolbox for power system dynamics
and control engineering education and research, IEEE Transaction on
Power Systems, Vol. 7, No. 4, pp. 1559-1564, Nov., 1992.
[5] R. D. Zimmerman, C. E. Murrillo-Snchez, and D. Gan.
(2005) Matpower, Version 3.0.0, [Online] available at:
http://www.pserc.cornell.edu/matpower/matpower.html.
[6] A. H. L. Chen, C. O. Nwankpa, H. G. Kwatny, and X. Yu, Voltage
stability toolbox: an introduction and implementation, in Proc. 28th
North American Power Symp., Nov., 1996.
[7] J. Mahseredjian and F. Alvarado, Creating an electromagnetic transient
program in MATLAB: MatEMTP, IEEE Transaction on Power Delivery, Vol. 12, No. 1, pp. 380-388, Jan., 1997.
[8] G. Sybille. (2004) SimPowerSystems, Version 4, [Online] available at:
http://www.mathworks.com.
[9] K. Schoder, A. Hasanovic, A. Feliachi, and A. Hasanovic, PAT: a power
analysis toolbox for MATLAB/Simulink, IEEE Transaction on Power
Systems, Vol. 18, No. 1, pp. 42-47, Feb., 2003.
[10] C. D. Vournas, E. G. Potamianakis, C. Moors, and T. Van Cutsem,
An educational simulation tool for power system control and stability,
IEEE Transaction on Power Systems, Vol. 19, No. 1, pp. 48-55, Feb.,
2004.
[11] PowerWorld,
(2010),
[Online]
available
at:
http://www.powerworld.com/transientquickstart.asp.
[12] K.N. Shubhanga, et al., (2006), MatSim, [Online] available at:
www.ee.iitb.ac.in/peps/downloads.html.
[13] IEEE Recommended Practice for Excitation System Models for Power
System Stability Studies, IEEE Std. 421.5-1992.
[14] IEEE Committee Report, Dynamic Models for Steam and Hydro
Turbines in Power System Studies, IEEE Trans. on Power Apparatus
and Systems, Vol.PAS-92, pp.1904-1915, Nov/Dec., 1973.
[15] F.L.Pagola,I.J. Perez-Arriaga and G.C Verghese,On Sensitivities,
Residues and Participations: Applications to Oscillatory Stability Analysis and Control, IEEE Trans. on power systems, Vol.PWRS-4, No. 1,
pp. 278-285, February., 1989.
[16] Graham Rogers, Power System Oscillations, Kluwer Academic Publishers, London, 2000.
[17] K.R. Padiyar, Power System Dynamics - Stability and Control, BS
Publications, Hyderabad, India, 2002.
[18] P. Kundur, Power System Stability and Control, McGraw-Hill Inc., NY,
1994.
[19] Power
System
Test
Cases
Archive,
UWEE,
www.ee.washington.edu/research/pstca.
[20] Using MATLAB, Version 5.3, Release 11, The Math Works Inc.
[21] Using Simulink, Version 3, Release 11, The Math Works Inc.

You might also like