You are on page 1of 56

An Open Source

Power System Analysis Toolbox


1
Universidad de Castilla-La Mancha
An Open Source
Power System Analysis Toolbox
Prof. Dr. Federico Milano
E-mail: Federico.Milano@uclm.es
Tel.: +34 926 295 219
Departamento de Ingenier!a El ectrica, Electr onica, Autom atica y
Comunicaciones
Universidad de Castilla - La Mancha, Espa na
Montreal, June 20, 2006 Introduction - 1
An Open Source
Power System Analysis Toolbox
2
Universidad de Castilla-La Mancha
Who I am
! Federico Milano received from the University of Genoa, Italy, the Electrical
Engineering degree and the Ph.D. degree in 1999 and 2003, respectively.
! From 2001 to 2002 he worked at the University of Waterloo, Canada, as a
Visiting Scholar.
! He is currently an assistant Professor at the University of Castilla-La
Mancha, Ciudad Real, Spain.
! His research interests include voltage stability, electricity markets and
computer-based power system analysis and control.
Montreal, June 20, 2006 Introduction - 2
An Open Source
Power System Analysis Toolbox
3
Universidad de Castilla-La Mancha
Contents
! Open Source vs. Commercial Power System Softwares
! Introduction to PSAT
! Examples
! Conclusions
Montreal, June 20, 2006 Introduction - 3
An Open Source
Power System Analysis Toolbox
4
Universidad de Castilla-La Mancha
Open Source vs. Commercial
Power System Softwares
Montreal, June 20, 2006 Power System Softwares - 1
An Open Source
Power System Analysis Toolbox
5
Universidad de Castilla-La Mancha
Power System Software Outlines
! Software packages for power system analysis can be basically divided
into two classes of tools:
" Commercial softwares.
" Educational/research-aimed softwares.
Montreal, June 20, 2006 Power System Softwares - 2
An Open Source
Power System Analysis Toolbox
6
Universidad de Castilla-La Mancha
Commercial Softwares
! Commercial softwares (the list is not complete!):
" PSS/E
" EuroStag
" Simpow
" CYME
" PowerWorld
" Neplan
Montreal, June 20, 2006 Power System Softwares - 3
An Open Source
Power System Analysis Toolbox
7
Universidad de Castilla-La Mancha
Commercial Softwares
! Commercial software packages follows an "all-in-one" philosophy and are
typically well-tested and computationally ef"cient.
! Despite their completeness, these softwares can result cumbersome for
educational and research purposes.
! Commercial softwares are "closed", i.e. do not allow changing the source
code or adding new algorithms.
Montreal, June 20, 2006 Power System Softwares - 4
An Open Source
Power System Analysis Toolbox
8
Universidad de Castilla-La Mancha
Open-Source Softwares
! For research purposes, the #exibility and the ability of easy prototyping
are often more crucial aspects than computational ef"ciency.
! At this aim, there is a variety of open source research tools, which are
typically aimed to a speci"c aspect of power system analysis.
! An example is UWPFLOW which provides an extremely robust algorithm
for continuation power #ow analysis.
Montreal, June 20, 2006 Power System Softwares - 5
An Open Source
Power System Analysis Toolbox
9
Universidad de Castilla-La Mancha
Compiled vs. Script Languages
! C anf FORTRAN are very fast but requires keen programming skills and
are not suitable for fast prototyping.
! Several high level scienti"c languages, such as Matlab, Mathematica and
Modelica, have become more and more popular for both research and
educational purposes.
! At this aim, there is a variety of open source research tools, which are
typically aimed to a speci"c aspect of power system analysis.
! Matlab proved to be the best user choice.
Montreal, June 20, 2006 Power System Softwares - 6
An Open Source
Power System Analysis Toolbox
10
Universidad de Castilla-La Mancha
Matlab-based Power System Toolboxes
! Matlab-based power system analysis tools (the list is not complete!):
" Power System Toolbox (PST)
" MatPower
" Voltage Stability Toolbox (VST)
" Power Analysis Toolbox (PAT)
" Educational Simulation Tool (EST)
" Power system Analysis Toolbox (PSAT)
Montreal, June 20, 2006 Power System Softwares - 7
An Open Source
Power System Analysis Toolbox
11
Universidad de Castilla-La Mancha
Matlab-based Power System Toolboxes
! Comparison of Matlab-based power system analysis softwares:
Package PF CPF OPF SSA TD EMT GUI GNE
EST
MatEMTP
MatPower
PAT
PSAT
PST
SPS
VST
Montreal, June 20, 2006 Power System Softwares - 8
An Open Source
Power System Analysis Toolbox
12
Universidad de Castilla-La Mancha
Matlab-based Power System Toolboxes
! The features illustrated in the table are:
" power #ow (PF)
" continuation power #ow and/or voltage stability analysis (CPF-VS)
" optimal power #ow (OPF)
" small signal stability analysis (SSA)
" time domain simulation (TD)
" graphical user interface (GUI)
" graphical network editor (GNE).
Montreal, June 20, 2006 Power System Softwares - 9
An Open Source
Power System Analysis Toolbox
13
Universidad de Castilla-La Mancha
Tools Currently not Available in Matlab
! The following tools are still not available as Matlab packages or toolboxes:
" Fault analysis.
" Grounding systems.
" Harmonic analysis.
" Protection analysis and coordination.
" Etc.
Montreal, June 20, 2006 Power System Softwares - 10
An Open Source
Power System Analysis Toolbox
14
Universidad de Castilla-La Mancha
Matlab vs. GNU/Octave
! An important but often missed issue is that the Matlab environment is a
commercial and "closed" product, thus Matlab kernel and libraries cannot
be modi"ed nor freely distributed.
! To allow exchanging ideas and effectively improving scienti"c research,
both the toolbox and the platform on which the toolbox runs should be
free (Richard Stallman).
! An alternative to Matlab is the free GNU/Octave project.
Montreal, June 20, 2006 Power System Softwares - 11
An Open Source
Power System Analysis Toolbox
15
Universidad de Castilla-La Mancha
Introduction to PSAT
Montreal, June 20, 2006 Introduction to PSAT - 1
An Open Source
Power System Analysis Toolbox
16
Universidad de Castilla-La Mancha
PSAT Features
! PSAT has been thought to be portable and open source.
! PSAT runs on the commonest operating systems
! PSAT can perform several power system analysis:
1. Continuation Power Flow (CPF);
2. Optimal Power Flow (OPF);
3. Small signal stability analysis;
4. Time domain simulations.
Montreal, June 20, 2006 Introduction to PSAT - 2
An Open Source
Power System Analysis Toolbox
17
Universidad de Castilla-La Mancha
PSAT Features
! PSAT deeply exploits Matlab vectorized computations and sparse matrix
functions in order to optimize performances.
! The latest beta version of PSAT also exploits Matlab classes to be more
versatile and to ease maintenance and extensions.
! PSAT also contains interfaces to UWPFLOW and GAMS which highly
extends PSAT ability to solve CPF and OPF problems, respectively.
Montreal, June 20, 2006 Introduction to PSAT - 3
An Open Source
Power System Analysis Toolbox
18
Universidad de Castilla-La Mancha
Synoptic Scheme
Analysis
Static
Simulink Other Data
Format
Data
Files
Saved
Results
Output
Text Results
Save
Graphic
Output
Library
Simulink
Settings
Simulink
Model
Conversion
Power Flow &
Initialization
State Variable
Conversion
Utilities
Time Domain
Simulation
Small Signal
Stability
Dynamic
Analysis
Optimal PF
Continuation PF
PMU Placement
Command
History
Plotting
Utilities
GAMS
UWpflow
Interfaces
Output
PSAT
Input
Models
User Defined
Models
Montreal, June 20, 2006 Introduction to PSAT - 4
An Open Source
Power System Analysis Toolbox
19
Universidad de Castilla-La Mancha
PSAT Features
! In order to perform accurate and complete power system analyses, PSAT
supports a variety of static and dynamic models.
! Dynamic models include non conventional loads, synchronous machines
and controls, regulating transformers, FACTS, wind turbines, and fuel
cells.
Montreal, June 20, 2006 Introduction to PSAT - 5
An Open Source
Power System Analysis Toolbox
20
Universidad de Castilla-La Mancha
PSAT Features
! Besides mathematical algorithms and models, PSAT includes a variety of
additional tools, as follows:
1. User-friendly graphical user interfaces;
2. Simulink library for one-line network diagrams;
3. Data "le conversion to and from other formats;
4. User de"ned model editor and installer;
5. Command line usage.
Montreal, June 20, 2006 Introduction to PSAT - 6
An Open Source
Power System Analysis Toolbox
21
Universidad de Castilla-La Mancha
Getting Started
! PSAT is launched by typing at the Matlab prompt:
>> psat
which will create all structures required by the toolbox and open the main
GUI.
! All procedures implemented in PSAT can be launched from this window
by means of menus, buttons and/or short cuts.
Montreal, June 20, 2006 Introduction to PSAT - 7
An Open Source
Power System Analysis Toolbox
22
Universidad de Castilla-La Mancha
Getting Started
! Main PSAT GUI:
Montreal, June 20, 2006 Introduction to PSAT - 8
An Open Source
Power System Analysis Toolbox
23
Universidad de Castilla-La Mancha
Simulink Library
! PSAT allows drawing electrical schemes by means of pictorial blocks.
! The PSAT computational engine is purely Matlab-based and the Simulink
environment is used only as graphical tool.
! A byproduct of this approach is that PSAT can run on GNU/Octave, which
is currently not providing a Simulink clone.
Montreal, June 20, 2006 Introduction to PSAT - 9
An Open Source
Power System Analysis Toolbox
24
Universidad de Castilla-La Mancha
Simulink Library
! PSAT-Simulink Library:


Montreal, June 20, 2006 Introduction to PSAT - 10
An Open Source
Power System Analysis Toolbox
25
Universidad de Castilla-La Mancha
Other Features
! To ensure portability and promote contributions, PSAT is provided with a
variety of tools, such as a set of Data Format Conversion (DFC) functions
and the capability of de"ning User De"ned Models (UDMs).
! The set of DFC functions allows converting data "les to and from formats
commonly in use in power system analysis. These include: IEEE, EPRI,
PTI, PSAP, PSS/E, CYME, MatPower, PST, etc. formats. On Matlab
platforms, an easy-to-use GUI handles the DFC.
Montreal, June 20, 2006 Introduction to PSAT - 11
An Open Source
Power System Analysis Toolbox
26
Universidad de Castilla-La Mancha
Data Format Conversion
! GUI for data format conversion:
Montreal, June 20, 2006 Introduction to PSAT - 12
An Open Source
Power System Analysis Toolbox
27
Universidad de Castilla-La Mancha
User Dened Models
! The UDM tools allow extending the capabilities of PSAT and help
end-users to quickly set up their own models.
! Once the user has introduced the variables and de"ned the DAE of the
new model in the UDM GUI, PSAT automatically compiles equations,
computes symbolic expression of Jacobians matrices and writes a Matlab
function of the new component.
! Then the user can save the model de"nition and/or install the model in
PSAT.
! If the component is not needed any longer it can be uninstalled using the
UDM installer as well.
Montreal, June 20, 2006 Introduction to PSAT - 13
An Open Source
Power System Analysis Toolbox
28
Universidad de Castilla-La Mancha
User Dened Models
! GUI for user de"ned models:
Montreal, June 20, 2006 Introduction to PSAT - 14
An Open Source
Power System Analysis Toolbox
29
Universidad de Castilla-La Mancha
Command Line Usage
! PSAT is provided with a command line version. This feature allows using
PSAT in the following conditions:
1) If it is not possible or very slow to visualize the graphical environment
(e.g. Matlab is running on a remote server).
2) If one wants to write scripting of computations or include calls to PSAT
functions within user de"ned programs.
3) If PSAT runs on the GNU/Octave platform, which currently neither
provides GUI tools nor a Simulink-like environment.
Montreal, June 20, 2006 Introduction to PSAT - 15
An Open Source
Power System Analysis Toolbox
30
Universidad de Castilla-La Mancha
Power System Model
! The standard power system model is basically a set of nonlinear
differential algebraic equations, as follows:
x = f(x, y, p)
0 = g(x, y, p)
where x are the state variables x R
n
; y are the algebraic variables
y R
m
; p are the independent variables p R

; f are the differential


equations f : R
n
R
m
R

R
n
; and g are the algebraic
equations g : R
m
R
m
R

R
m
.
Montreal, June 20, 2006 Introduction to PSAT - 16
An Open Source
Power System Analysis Toolbox
31
Universidad de Castilla-La Mancha
Power System Model
! PSAT uses these equations in all algorithms, namely power #ow, CPF,
OPF, small signal stability analysis and time domain simulation.
! The algebraic equations g are obtained as the sum of all active and
reactive power injections at buses:
g(x, y, p) =

g
p
g
q

g
pm
g
qm

cC
m

g
pc
g
qc

m M
where g
pm
and g
qm
are the power #ows in transmission lines, M is the
set of network buses, C
m
and [g
T
pc
, g
T
qc
]
T
are the set and the power
injections of components connected at bus m, respectively.
Montreal, June 20, 2006 Introduction to PSAT - 17
An Open Source
Power System Analysis Toolbox
32
Universidad de Castilla-La Mancha
Component Models
! PSAT is component-oriented, i.e. any component is de"ned
independently of the rest of the program as a set of nonlinear
differential-algebraic equations, as follows:
x
c
= f
c
(x
c
, y
c
, p
c
)
P
c
= g
pc
(x
c
, y
c
, p
c
)
Q
c
= g
qc
(x
c
, y
c
, p
c
)
where x
c
are the component state variables, y
c
the algebraic variables
(i.e. V and at the buses to which the component is connected) and p
c
are independent variables. Then differential equations f are built
concatenating f
c
of all components.
Montreal, June 20, 2006 Introduction to PSAT - 18
An Open Source
Power System Analysis Toolbox
33
Universidad de Castilla-La Mancha
Component Models
! These equations along with Jacobians matrices are de"ned in a function
which is used for both static and dynamic analyses.
! In addition to this function, a component is de"ned by means of a
structure, which contains data, parameters and the interconnection to the
grid.
Montreal, June 20, 2006 Introduction to PSAT - 19
An Open Source
Power System Analysis Toolbox
34
Universidad de Castilla-La Mancha
Component Models: Example
! Let`s consider the exponential recovery load (ERL).
! The set of differential-algebraic equations are as follows:
x
c
1
= x
c
1
/T
P
+ P
0
(V/V
0
)

s
P
0
(V/V
0
)

t
x
c
2
= x
c
2
/T
Q
+ Q
0
(V/V
0
)

s
Q
0
(V/V
0
)

t
P
c
= x
c
1
/T
P
+ P
0
(V/V
0
)

t
Q
c
= x
c
2
/T
Q
+ Q
0
(V/V
0
)

t
where and P
0
, Q
0
and V
0
are initial powers and voltages, respectively,
as given by the power #ow solution.
! Observe that a constant PQ load must be connected at the same bus as
the ERL to determine the values of P
0
, Q
0
and V
0
.
Montreal, June 20, 2006 Introduction to PSAT - 20
An Open Source
Power System Analysis Toolbox
35
Universidad de Castilla-La Mancha
Component Models: Example
! Component Data:
Column Variable Description Unit
1 - Bus number int
2 S
n
Power rating MVA
3 V
n
Active power voltage coef"cient kV
4 f
n
Active power frequency coef"cient Hz
5 T
P
Real power time constant s
6 T
Q
Reactive power time constant s
7
s
Static real power exponent -
8
t
Dynamic real power exponent -
9
s
Static reactive power exponent -
10
t
Dynamic reactive power exponent -
Montreal, June 20, 2006 Introduction to PSAT - 21
An Open Source
Power System Analysis Toolbox
36
Universidad de Castilla-La Mancha
Component Models: Example
! Exponential recovery loads are de"ned in the structure Erload, whose
"elds are as follows:
1. con: exponential recovery load data.
2. bus: Indexes of buses to which the ERLs are connected.
3. dat: Initial powers and voltages (P
0
, Q
0
and V
0
).
4. n: Total number of ERLs.
5. xp: Indexes of the state variable x
c
1
.
6. xq: Indexes of the state variable x
c
2
.
Montreal, June 20, 2006 Introduction to PSAT - 22
An Open Source
Power System Analysis Toolbox
37
Universidad de Castilla-La Mancha
PSAT Forum
! The Forum is a mailing list open to all PSAT users.
! The Forum is available at:
http://groups.yahoo.com/group/psatforum/
! Currently the Forum counts more than 750 members.
Montreal, June 20, 2006 Introduction to PSAT - 23
An Open Source
Power System Analysis Toolbox
38
Universidad de Castilla-La Mancha
PSAT Forum
Montreal, June 20, 2006 Introduction to PSAT - 24
An Open Source
Power System Analysis Toolbox
39
Universidad de Castilla-La Mancha
PSAT in the World
PSAT users
Montreal, June 20, 2006 Introduction to PSAT - 25
An Open Source
Power System Analysis Toolbox
40
Universidad de Castilla-La Mancha
Links
! Where to get PSAT:
http://www.power.uwaterloo.ca/fmilano/
http://groups.yahoo.com/group/psatforum/
Montreal, June 20, 2006 Introduction to PSAT - 26
An Open Source
Power System Analysis Toolbox
41
Universidad de Castilla-La Mancha
PSAT Examples
Montreal, June 20, 2006 Examples - 1
An Open Source
Power System Analysis Toolbox
42
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! IEEE 14-bus test system:
Bus 14
|V| = 1.0207 p.u.
<V = !0.2801 rad
Bus 13
|V| = 1.047 p.u.
<V = !0.2671 rad
Bus 12
|V| = 1.0534 p.u.
<V = !0.2664 rad
Bus 11
|V| = 1.0471 p.u.
<V = !0.2589 rad
Bus 10
|V| = 1.0318 p.u.
<V = !0.2622 rad
Bus 09
|V| = 1.0328 p.u.
<V = !0.2585 rad
Bus 08
|V| = 1.09 p.u.
<V = !0.2309 rad
Bus 07
|V| = 1.0493 p.u.
<V = !0.2309 rad
Bus 06
|V| = 1.07 p.u.
<V = !0.2516 rad
Bus 05
|V| = 1.016 p.u.
<V = !0.1527 rad
Bus 04
|V| = 1.012 p.u.
<V = !0.1785 rad
Bus 03
|V| = 1.01 p.u.
<V = !0.2226 rad
Bus 02
|V| = 1.045 p.u.
<V = !0.0871 rad
Bus 01
|V| = 1.06 p.u.
<V = 0 rad
Breaker
Breaker
Montreal, June 20, 2006 Examples - 2
An Open Source
Power System Analysis Toolbox
43
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Power #ow report:
Montreal, June 20, 2006 Examples - 3
An Open Source
Power System Analysis Toolbox
44
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Continuation power #ow analysis (GUI):
Montreal, June 20, 2006 Examples - 4
An Open Source
Power System Analysis Toolbox
45
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Continuation power #ow analysis (plots):
Montreal, June 20, 2006 Examples - 5
An Open Source
Power System Analysis Toolbox
46
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Nose curves at bus 14 for different contingencies for the IEEE 14-bus test
system:
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8
0
0.2
0.4
0.6
0.8
1

c
V
o
l
t
a
g
e
[
p
.
u
.
]
Base Case
Line 2-4 Outage
Line 2-3 Outage
Montreal, June 20, 2006 Examples - 6
An Open Source
Power System Analysis Toolbox
47
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Optimal power #ow analysis (GUI):
Montreal, June 20, 2006 Examples - 7
An Open Source
Power System Analysis Toolbox
48
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Comparison between OPF and CPF analysis:
Contingency BCP

MLC ALC
[MW] [p.u.] [MW] [MW]
None 259 0.7211 445.8 186.8
Line 2-4 Outage 259 0.5427 399.5 148.6
Line 2-3 Outage 259 0.2852 332.8 73.85
! Because of the de"nitions of generator and load powers P
G
and P
L
, one
has
c
=

+ 1.
Montreal, June 20, 2006 Examples - 8
An Open Source
Power System Analysis Toolbox
49
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Time domain simulation:
" It has been used a 40% load increase with respect to the base case
loading, and no PSS at bus 1. A Hopf bifurcation occurs for the line
2-4 outage resulting in undamped oscillations of generator angles.
" A similar analysis can be carried on the same system with a 40% load
increase but considering the PSS of the generator connected at bus 1.
In this case the system is stable.
Montreal, June 20, 2006 Examples - 9
An Open Source
Power System Analysis Toolbox
50
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Time domain simulation (without PSS):
0 5 10 15 20 25 30
0.998
0.9985
0.999
0.9995
1
1.0005
1.001
1.0015
1.002

1
- Bus 1

2
- Bus 2

3
- Bus 3

4
- Bus 6

5
- Bus 8
G
e
n
e
r
a
t
o
r
S
p
e
e
d
s
[
p
.
u
.
]
Time [s]
Montreal, June 20, 2006 Examples - 10
An Open Source
Power System Analysis Toolbox
51
Universidad de Castilla-La Mancha
IEEE 14-bus Test System
! Eigenvalue analysis (with PSS):
!1 !0.8 !0.6 !0.4 !0.2 0 0.2
!10
!8
!6
!4
!2
0
2
4
6
8
10
Real
I
m
a
g
Montreal, June 20, 2006 Examples - 11
An Open Source
Power System Analysis Toolbox
52
Universidad de Castilla-La Mancha
Conclusions
Montreal, June 20, 2006 Conclusions - 1
An Open Source
Power System Analysis Toolbox
53
Universidad de Castilla-La Mancha
What is PSAT for?
! PSAT is ideal for teaching and for explaining basic power system analysis
and control concepts.
! PSAT is useful for research purposes because allows easy and fast
prototyping of new models and algorithms.
! PSAT is also useful for creating bridges between Matlab and other
specialized software packages (e.g. GAMS).
Montreal, June 20, 2006 Conclusions - 2
An Open Source
Power System Analysis Toolbox
54
Universidad de Castilla-La Mancha
Some Current Advanced Usages of PSAT
! Prototyping of OPF-based market clearing algorithms for the 15000-bus
WECC network. Collaboration with NCPA (Northern California Power
Agency) and University of Waterloo, Canada.
! Study of the impact of increasing wind generation in the Castilla-La
Mancha subtransmission network. Contract with the local government of
Castilla-La Mancha.
Montreal, June 20, 2006 Conclusions - 3
An Open Source
Power System Analysis Toolbox
55
Universidad de Castilla-La Mancha
Thanks for your attention!
Montreal, June 20, 2006 Conclusions - 4
An Open Source
Power System Analysis Toolbox
56
Universidad de Castilla-La Mancha
Questions?
Montreal, June 20, 2006 Conclusions - 5

You might also like