# A Student Friendly Toolbox for Power System Analysis Using MATLAB

**ABSTRACT** Programs developed in this software package cover all the topics of basic power system analysis course. Examples from various widely available textbooks (Bergen & Vittal, 1999; Elgerd, 1983; Glover, 2007; Grainger & Stevenson, 1994; Saadat, 2009; Stevenson, 1982; Wood & Wollenberg, 1996) are taken as examples. These textbooks are used all over the world. So, students running the software find a familiar environment around. Apart from this, other examples can be tested using this toolbox since the programs are written in a generalised

**4**Bookmarks

**·**

**360**Views

- Citations (0)
- Cited In (0)

Page 1

A student friendly toolbox for power system analysis using MATLAB67

X

A student friendly toolbox for

power system analysis

using MATLAB

A. B. M. Nasiruzzaman

Department of Electrical & Electronic Engineering,

Rajshahi University of Engineering & Technology

Bangladesh

1. Introduction

There are various premier software packages available in the market, either for free use or

found at a high price, to analyse the century old electrical power system. Universities in the

developed countries expend thousands of dollars per year to bring these commercial

applications to the desktops of students, teachers and researchers. For teachers and

researchers this is regarded as a good long-term investment. As well, for the postgraduate

students these packages are very important to validate the model developed during course

of study. For simulating different test cases and/or standard systems, which are readily

available with these widely used commercial software packages, such enriched software

plays an important role. But in case of underdeveloped and developing countries the high

amount of money needed to be expended per year to purchase commercial software is a far-

fetched idea. In addition, undergraduate students who are learning power system for the

very first time find these packages incongruous for them since they are not familiar with the

detailed input required to run the program. Even if it is a simple load flow program to find

the steady-state behaviour of the system, or an elementary symmetrical fault analysis test

case these packages require numerous inputs since they mimic a practical power system

rather than considering simple test cases. In effect, undergraduate students tend to stay

away from these packages. So rather than aiding the study in power system, these create a

bad impression on students‘ mind about the very much interesting course.

Many researchers have tried a lot to solve this overarching problem. With the advent of

personal computers (PCs) the solution to this issue has been very easy. Then came

MATLAB, a flagship software for scientific and engineering computation. A revolution

occurred in the field of science. Teaching and learning became very much easier than ever

with the powerful graphical tools of MATLAB. Many researchers have developed various

attractive software packages to aid to the power system analysis and design. A few have

focused on the power engineering education field. This chapter discusses an excellent

software package based on MATLAB developed mainly to aid in power system study.

Although the program is developed using MATLAB, it is compiled such that it can be used

outside MATLAB environment.

4

Page 2

Matlab - Modelling, Programming and Simulations68

2. Overview of Software Packages for Power Engineering

To facilitate power engineering analysis and design various companies have developed

diverse software. Among them some are used widely and some are built to meet specific

purpose of a company. There are PSS®E, ETAP, NEPLAN and much more commercial

programs. PSAT, Power World Simulator, and POWERHU basically developed to facilitate

power engineering education and sometimes available with textbooks. Among these

programs some are code based and some are model based. Some written in C, and Java,

others depend on MATLAB.

PSS®E (Siemens, 2009) developed by Siemens Power Technologies International (Siemens PTI)

has various modules like power flow, short circuit, dynamic simulation, contingency analysis,

optimal power flow, linear network, reliability assessment, and small signal analysis. These

modules requires a solid idea about the whole generation, transmission, and distribution

system, various control devices used at different points to improve power system quality. This

software is a benchmark against which other newly developed software is tested.

ETAP (Operation Technology, 2009) offers a group of fully integrated power engineering

software solutions including arc flash, load flow, short circuit, transient stability, relay

coordination, optimal power flow, and more. Its modular functionality can be customized to

fit the needs of any company, from small to large power systems. ETAP is a comprehensive

analysis platform for the design, simulation, operation, and automation of generation,

distribution, and industrial power systems. As a fully integrated enterprise solution, ETAP

extends to a real-time intelligent power management system to monitor, control, automate,

simulate, and optimize the operation of power systems.

BCP (i.e., Busarello + Cott + Partner AG) was founded 1988 in Zurich, Switzerland and is

specialized in the field of power systems engineering. BCP is the developer and owner of

the power system analysis tool NEPLAN (BCP, 2010). Small and large utilities, industrial

organizations, engineering companies and universities in more than 80 countries around the

world use this product. NEPLAN is the planning, optimization and simulation tool for

transmission, distribution, generation and industrial networks. It covers all aspects of

modern power system planning and analysis. NEPLAN offers several starter packages.

These starter packages are extendable with many useful modules. All these modules may be

added to a starter package at any time. It is available in 9 languages.

The Power System Analysis Toolbox (PSAT) is a MATLAB toolbox for electric power system

analysis and simulation (Milano, 2005). All operations can be assessed by means of

graphical user interfaces (GUIs) and a SIMULINK based library provides a tool for network

design. The main features of PSAT are: power flow, optimal power flow, small signal

stability analysis, time domain simulation, FACTS models, wind turbine models, conversion

of data files from several formats; Export results to MS Excel and LaTeX files.

PowerWorld Simulator (PowerWorld Corporation, 2009) is an interactive power systems

simulation package designed to simulate high voltage power systems operation on a time

frame ranging from several minutes to several days. The software contains a highly effective

power flow analysis package capable of efficiently solving systems with up to 100,000 buses.

Page 3

A student friendly toolbox for power system analysis using MATLAB 69

PowerWorld Simulator is ideally suited for teaching power systems operations and analysis

and for performing research. In fact, the original version of the simulator software was built

as a tool for teaching power systems and presenting power systems analysis results to

technical and non-technical audiences alike. Since that time, simulator has evolved into the

highly powerful power systems analysis and visualization platform that it is today.

Simulator has been, and continues to be, used effectively in undergraduate and graduate

level classes in power systems operation, control, and analysis. Concepts are presented

simply, yet the software has sufficient detail to challenge advanced engineering students.

MATLAB 4.0 was used to develop a software package named POWERHU (Songur & Ercan,

1997) keeping in mind power engineering students. It has the excellent feature of solving

problems in a way that most widely used power system analysis textbooks use. It is capable

of performing load flow study, impedance calculation, fault calculation, and transient

stability analysis.

PSS®E, ETAP, and NEPLAN are mainly used in industries and for research purposes. They

are not suitable for first time learners of power system. PSAT and PowerWorld Simulators

are excellent tools that can be used to teach and learn power system. But the problem here is

that these packages are mainly model based and does not give the chance to see the inner

structure of the program. It just takes inputs and provides outputs after some processing.

The students may not see the inner structure of the program which is required very much to

develop insight into the behaviour of various components of power system. POWERHU

takes into account the problems of PSAT and PowerWorld Simulator. It provides a step by

step solution so that the confidence can be built up towards solving more complex

problems. But this program is not MATLAB independent. One has to start MATLAB first to

run this program, and the size and cost of MATLAB license is increasing day by day. This is

why; it may not be possible for students in some developing countries to use this program

in the laboratories since they may not have the high performance computers. Also, the

program may not run in the recent versions of MATLAB since many old commands of

MATLAB have been obsolete. The POWERHU is neither standalone nor it is made version

independent. It was developed and tested in MATLAB 4.0 and no improvement was

reported after that.

3. Structure of Student Friendly Power System Analysis Toolbox

Power system analysis courses taught in undergraduate levels cover mainly basic concepts

of power system like single-line diagram, per unit system, modelling of generators,

transformers, transmission lines and loads, load flow analysis, fault analysis, stability

studies etc. The purpose of such courses is to develop a fundamental idea about the power

system among the undergrads so that they can develop their own skills and aptitudes for

solving real world power engineering problems. The huge computations required for these

courses are handled by computers and now-a-days MATLAB is used extensively for

scientific and engineering computation. In this chapter, a student friendly toolbox

developed to assist students during their course of study in basic power system courses is

presented. The toolbox takes into account the fresh students having no idea about the course

and can alone be used as a textbook. The help menu in the toolbox provides details of

problems solved with sufficient background materials so that each and every module can be

Page 4

Matlab - Modelling, Programming and Simulations70

grasped and mastered with ease. One can easily see the inner structure of the program to

understand how to code a power engineering problem. The main advantage of the toolbox

is that apart from using the software within MATLAB it is made version compatible and can

be used without MATLAB. So it can be regarded as a standalone software package for

power system analysis. The software was developed in MATLAB 6.5 and now successfully

tested in the recent version of MATLAB 2010a. The toolbox is divided into different modules

to focus different areas of power system as follows:

a) Fault analysis of a motor-generator set

b) Demonstration of symmetrical components

c)

Fault analysis of unloaded alternator

d) Synchronous machine transients (balanced)

e)

Synchronous machine transients (unbalanced)

f)

Fault analysis of interconnected buses

g) Single machine stability analysis (classical)

h) Single machine stability analysis (modern)

i)

Load flow

When the program is run the main window appears as in Fig. 1.

Fig. 1. Main window of student friendly power system analysis toolbox

Page 5

A student friendly toolbox for power system analysis using MATLAB 71

4. Fault Analysis of a Motor-Generator Set

This toolbox can be used to study various types of faults encountered in power system and

was reported on (Rabbani et al., 2006) which is again presented here in a slight different

format.

The effect of a fault in the line connected in between the motor and generator can be

visualised using this module which is shown in Fig. 2. The effect of change of various

parameters is visualised using this module. This example is taken from a classical textbook

of power system (Stevenson, 1982).

Fig. 2. Symmetrical fault analysis of a motor-generator set

The idea behind the example is to consider a case when a symmetrical three phase fault

occurs in the connecting line of a motor-generator set when the system was running full

load. The fault current is the contribution from both generator and motor. The magnitude

and angle of the fault, generator and motor currents are found by simulating the program.

The effect of the pre-fault operating conditions like input power, power factor, and pre-fault

voltages on the fault currents can be observed. The impedances of motor, generator, and

transmission lines can be changes individually and their impact on fault current can be

noticed. The power and voltage ratings of the motor and generator can be modified to see its

influence on fault currents. This problem is analysed here with a very attractive user

friendly Graphical User Interface (GUI) (MathWorks, 2009) developed using MATLAB

GUIDE (GUI Design Environment).

Page 6

Matlab - Modelling, Programming and Simulations 72

One need not go to the main program each time, save this and run again and need not be

worried about unintentionally changing the program and generate an unexpected error. It

also provides a help menu for an easy understanding of the problem for the first time user

and a step by step procedure of developing program to solve the problem using PC. It

provides a complete formulation and solution of the problem. A glimpse of the help file for

this module is given in Fig. 3. The help file first describes the problem then the inputs

required for running the program are clarified. The next step is to provide a step by step

solution procedure for the problem which is given in the textbooks. The last step describes a

complete methodology to develop MATLAB program for solving the problem.

After analysing this module a student develops the very basic idea of a fault encountered in

power system. By varying various parameters he can verify hand calculation which builds a

confidence within him. This hands-on, user friendly interactive module excites the learners

to pursue their study of power system. The preliminary objective of providing such a basic

problem first is to reinforce students’ decision to take power system analysis course,

immediately upon starting the course, and help them feel included.

Fig. 3. A portion of help file for symmetrical fault analysis of a motor-generator set

5. Demonstration of Symmetrical Components

Symmetrical components allow unbalanced phase quantities such as currents and voltages

to be replaced by three separate balanced symmetrical components. The concept of

symmetrical components is an indispensible tool for investigating unbalanced systems. The

idea of symmetrical components is found in the paper (Fortescue, 1918). According to

Fortescue’s theorem, three balanced system of phasors can be constructed from three

unbalanced phasor quantities. The balanced components of phasors have the following

properties:

Page 7

A student friendly toolbox for power system analysis using MATLAB73

a) The positive sequence components have three phasors equal in magnitude. Each

are displaced 1200 with each other in phase. It has the phase sequence of the

original phasor.

b) The negative sequence components also have three phasors equal in magnitude,

displaced 1200 with each other in phase. The difference with the positive

sequence component is that the negative sequence components have the

opposite phase sequence than that of the positive one.

c)

The zero sequence components are equal in magnitude and zero phase difference

from each other.

In this module as shown in Fig. 4 unbalanced phasors are converted to balanced set of

positive, negative, and zero sequence components.

Fig. 4. Conversion of unbalanced phasor to symmetrical components

Page 8

Matlab - Modelling, Programming and Simulations 74

The a-b-c set in the figure is the unbalanced set of phasors which can be entered in the

system using the editable text boxes named as Magnitude and Angle. In this particular

example the magnitudes of three phasors are 1.6, 1.0, and 0.9, while the angles are 250, 1800,

and 1320 respectively. The GUI also has the provision to change the angles using the slider

whose range varies from 0 to 360 degrees. After setting all these parameters the user needs

to press the Transform button and the results are displayed in the three figures titled Zero,

Positive, and Negative-sequence set. Like other modules of this toolbox the Help button

provides a detail description of the symmetrical components and some worked out

examples to facilitate plumbing the concept. Close button terminates the program. By

pressing the pushbutton Main the main window of the toolbox as in Fig. 1 is returned.

6. Fault Analysis of an Unloaded Alternator

Fig. 5. Module for different types of fault analysis of an unloaded alternator

This module of the toolbox shown in Fig. 5 is used to study the effect of symmetrical three

phase, single line-to-ground, line-to-line, and double line-to-ground faults at the terminal of

a previously unloaded alternator which has a rating 20MVA and 13.8kV in this default

Page 9

A student friendly toolbox for power system analysis using MATLAB75

example taken from (Stevenson, 1982). The ratings of the alternator (MVA and kV) can be

changed as well as the sequence reactance (Z0, Z1, and Z2) of the machine can be modified

to see the effect of various types of faults on fault currents and voltages. If Data button is

pressed fault currents and voltages are displayed in a separate window. Initially there is no

fault selected as reflected by Fig. 5. If Line-to-Line fault is selected then GUI is modified as

in Fig. 6 and the result on the analysis is presented in Fig. 7 respectively.

Fig. 6. Modified GUI for simulating line-to-line fault at the terminal of an unloaded alternator

The voltage and current data as shown in Fig. 7 validates some general concept of power

system. The first one is the phase a current is zero since the machine was previously

unloaded and the line-to-line fault is simulated in phases b and c. Also the voltage

difference between phases b and c is zero since these two phases are short-circuited

together. The b and c phase currents are same in magnitude but are of opposite phases since

they are directly opposing each other as viewed in Fig. 6. This statement is also valid for Vab

and Vca. The Help, Close, and Main buttons perform functions as described earlier and the

Reset button initializes the module. Table 1 provides voltage and current data by running

the program using the ratings as it is shown in Fig. 5 for different types of faults.

Page 10

Matlab - Modelling, Programming and Simulations76

Fig. 7. Voltages and currents after fault

Fault Symmetrical 3 Phase Single Line-to-Ground Line-to-Line

Double-Line-to-

Ground

Quantity Magnitude Angle degree Magnitude

Angle

degree

-90

0

0

77.78

-90

102.2

Magnitude

Angle

degree

0

180

0

0

0

180

Magnitude

Angle

degree

0

132.2

47.78

0

0

180

Ia

Ib

Ic

Vab

Vbc

Vca

3346.9981

3346.9981

3346.9981

0

0

0

-90

30

150

0

0

0

3586.0265

0

0

8.0684

15.7714

8.0684

0 0

2415.4589

2415.4589

13.943

0

13.943

4021.2983

4021.2983

5.6717

0

5.6717

Table 1. Currents and Voltages of various types of faults after simulating the system in Fig. 5

7. Balanced and Unbalanced Synchronous Machine Transients

Under steady state condition the rotor m.m.f. and the resultant stator m.m.f. are stationary

with respect to each other. So the flux linkages with the rotor circuit do not change with

time and no voltage is induced in the rotor circuit. When a balanced or unbalanced fault

occurs flux linkages with the rotor circuit changes with time. This causes transient currents

in the rotor circuit which in turn creates effect on armatures. This transient analysis is

visualised in this module as depicted in Fig. 8 for balanced 3 phase short circuit and in Fig. 9

for unbalanced fault (line-to-line) at the terminal of an alternator.

The field voltage, self and mutual inductances, resistances, frequency, initial torque angle,

and time span are the inputs for the module. Two standard frequencies (50 and 60Hz) can

be chosen from the drop-down menu in the GUI. The time span can be varied according to

the region of interest of the simulation. In case of unbalanced fault analysis there is an extra

provision to select between line-to-line and line-to-ground fault. These two modules can be

switched using the Unbalanced and Balanced buttons in the balanced and unbalanced

modules respectively. By pressing the Simulate button the transient curves can be obtained

which takes some time depending upon the time span since it is required to solve

differential equations.

Page 11

A student friendly toolbox for power system analysis using MATLAB 77

Fig. 8. Currents in various phases of an alternator after a three phase short circuit occurs at

its terminal

8. Fault Analysis of Interconnected Buses

In this module a very much challenging problem of power system analysis course is

described. The generalised case of finding voltages and currents after the occurrence of

symmetrical three phase fault at any bus of a power system is either solidly grounded or

shorted with some impedance is the most interesting problem in this toolbox. For example, a

simple 11 bus test case is considered as shown in Fig. 10. The pre-fault voltages at various

buses can be found by load flow study. Generally, if such accuracy is not important the pre-

fault bus voltages are assumed to be unity. The transient impedance of the generators are on

a 100MVA base are given in Table 2.

Generator Ra

/

d

X

1 0 0.20

10 0 0.15

11 0 0.25

Table 2. Generator resistance and reactance for simple 11 bus system in Fig. 10

Page 12

Matlab - Modelling, Programming and Simulations78

Fig. 9. Simulation of line-to-line fault at the terminal of a 50Hz alternator for 2 seconds

Fig. 10. Simple 11-bus power system for fault studies (Saadat, 2009)

Page 13

A student friendly toolbox for power system analysis using MATLAB79

The line and transformer data along with the half of susceptance value is given in Table 3 in per

unit. These data are incorporated in the program and the pre-fault bus voltages are assumed to

be 1 and a solid 3 phase symmetrical fault is simulated at bus 8. The resulting GUI looks like Fig.

11. The Voltage Data corresponds to the various bus voltages after the fault and the Current

Data represents various currents flowing in various lines in the system after the fault has

occurred. The voltage and current data after the fault are given in Fig. 12 and Fig. 13 respectively.

If any bus was faulted with some impedance this can be done by entering Fault Impedance as

r+jx format.

Fro

m

Bus

1 2 0.00

2 3 0.08

2 5 0.04

2 6 0.12

3 4 0.10

3 6 0.04

4 6 0.15

4 9 0.18

4 10 0.00

5 7 0.05

6 8 0.06

7 8 0.06

7 11 0.00

8 9 0.052

Table 3. Line and transformer data for simple 11 bus system in Fig. 10

To

Bus

R

pu

X

pu

½ B

pu

0.06

0.30

0.15

0.45

0.40

0.40

0.60

0.70

0.08

0.43

0.48

0.35

0.10

0.48

0.0000

0.0004

0.0002

0.0005

0.0005

0.0005

0.0008

0.0009

0.0000

0.0003

0.0000

0.0004

0.0000

0.0000

Fig. 11. GUI for analysing solid fault at bus 8 of 11 bus system

Page 14

Matlab - Modelling, Programming and Simulations80

Fig. 12. Voltage at various buses after a 3 phase symmetrical fault at bus 8 of Fig. 10

Fig. 13. Currents at various lines after a 3 phase symmetrical fault at bus 8 of Fig. 10

Page 15

A student friendly toolbox for power system analysis using MATLAB81

9. Stability Analysis

Power system stability is defined as ‘Power system stability is the ability of an electric power

system, for a given initial operating condition, to regain a state of operating equilibrium

after being subject to a physical disturbance, with most system variables bounded so that

practically the entire system remains intact by (Kundur et. Al., 2004). Broadly, the power

system stability is classified as:

a) Rotor angle stability

b) Voltage stability

c)

Frequency stability

In this module mainly the rotor angle stability is considered. When a 3 phase short circuit

occurs in a line very close to a generator bus of an interconnected power system, the voltage

of the bus essentially becomes zero. So the electrical output power also becomes zero. But

the mechanical power input to the turbine-generator system remains constant. Hence the

generator accelerates. This acceleration means that the rotor angle of the generator will keep

increasing. Now, in order to clear the fault the circuit breakers are tripped to remove the

faulted line out of the system. Depending upon the time of tripping the rotor angle of the

generator of the faulted bus will then wither settle down to a new equilibrium, or keep on

increasing resulting in instability. This is an example of rotor angle stability which occurs

mainly due to the mismatch of electrical output and mechanical input power of the

alternator. Rotor angle stability can be analysed for either for small or large disturbances

and generally this type of stability analysis if performed for 2 to 10 seconds i.e., this is an

example of short term stability.

Fig. 14. Stability analysis module

#### View other sources

#### Hide other sources

- Available from A. B. M. Nasiruzzaman · May 30, 2014
- Available from InTech