Power Applications GAMS

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

IEEE Transactions on Power Systems, Vol. 14, No.

1, February 1999 15

APPLICATION OF GENERAL ALGEBRAIC MODELING SYSTEM TO POWER


SYSTEM OPTIMIZATION

Debabrata Chattopadhyay

KGM Power Technologies, Inc, - India


New Delhi, India

Abstract: This paper gives a systematic exposure to modeling transformation capabilities. These two developments have enabled
language as applied to power system optimization problems. the modelers to develop and test optimization models efficiently.
Specific reference to the GAMS (General Algebraic Modeling The tremendous effort that goes in developin,g an optimization
System) language has been made keeping in mind the popularity, model has a significant part in debugging lengthy computer codes
flexibility and available algorithmictools in it. An overview of the
GAMS language followed by simplistic examples are provided to (such as FORTRAN), data preparation, data transformation and
illustrate the ease and efficiency with which power system models report generation. A number of efficientmodeling languageshave
can be developed and experimentedwith. References are cited to been developed which makes use of both the development in
the related mathematicalprogramming literature as well as some improved database management and mathematical programming
selected application of GAMS in power system area. Finally the techniques. One of the most popular and flexible languages among
pros and cons of reliance on modeling languages have been these is the General Algebraic Modeling Sys1.em (GAMS) [I].
discussed. GAMS was originally developed through a World Bank funded
Keywords: Optimization, Modeling Language, Planning
study in 1988. The initial impetus for the development of GAMS
arose 'lout of the frustruting experiences of an economic modeling
I. INTRODUCTION group at the WorldBank ... The programmers in the group wrote
FORTRANprograms to prepare each model for solution; the
Application of optimization techniques to power system work was dull but demanding, and errors were easy to make and
problems have been several decades old now and there seems to hard toJind'.Since similar experiences are experienced by and
be a competition among the sophistication of the optimization large in most of the application areas of optimization, GAMS as
algorithms and the growing complexity of power system planning well as other modeling languages have found application in a
and operations related problems. The growth in complexity in variety of disciplines like finance, engineering, energy,
power system optimization problems has stemmed fiom three environment, management, economics and mathematics. It has
basic objectives: improving accuracy of the power system models also found some useful application in power system in recent
to capture the reality better, growing system size because of years.
integration of system over larger geographical areas for better
economy and reliability of operation, and also due to new This paper details the various features of GAMS with
emerging issues e.g., environmental issues, regulatory issues. specific reference to its applicability in various classes of
Research in power system optimization model development, thus, optimizationproblems in power system. It provides some simple
continue to be an active area. Development of optimization examples to illustrate model development in GAMS for power
models also form a part of learning and understanding several system planning related problems. Finally, it gives a partial list of
power system phenomena in most of the graduate level power some applications of GAMS available in the power system
system programs. There has been tremendous growth in literature. In the concluding session, a summary of the various
mathematical programming techniques and development of features of GAMS is presented and cases where application of
computer codes to solve large scale optimization models over the modeling languages should be limited have belen discussed. The
past four decades. There has also been significant development prime objective of h s paper has been to motivate students and
in relational database for improved data organization and researchers in the field of power system to make use of the
advancement in the modeling languages for optimization model
development in an efficient way. The specific reference to GAMS
PE-640-PWRS-0-12-1997 A paper recommended and approved by has been made keeping in mind its popularity, flexibility and
the IEEE Power Engineering Education Committee of the IEEE Power constant research and development to add new features to it over
Engineering Society for publication in the IEEE Transactions on Power
Systems. Manuscript submitted October 7, 1996; made available for
the years. However, the emphasis has been laid primarily on
printing December 12, 1997. exposing the readers to a generic description of modeling language
features, why, how and where these should be used, rather than
"teaching GAMS language". Section I1 of the paper gives an
overview of the GAMS language , In section 111, some simple
illustrative examples are given to help understanding how the
modeling language simpllfy programmingfor model development.
Section IV concludes the paper with a caution why blind reliance
on modeling languages for power system modeling may not be the
best thing to do.

0885-8950/99/$10.00 0 1997 IEEE


16

OW GAMS LANGUAGE sets


2.1 W h y GAMS? Declaration and assignment of members
e.g.,{buses, generators, lines etc.}
GAMS is a high level language for developing mathematical
models with concise algebraic statements. It makes use of
relational database theory and mathematical programming and
further merges them to suit the need of mathematical modelers. Data in the form ofscalars, Parameters and Tables
Apart from a wide variety of optimization problems, it can
handle simultaneous linear and non-linear equation systems and
further development would include (linear and non-linear) Declaration and assignment of values
complementarity problems and general equilibrium problems. e.g.,{generator ratings, costs, line parameters,
The two most attractive features of a modeling language are: MW and MVAr loads etc}
* separability of the mathematical problem and the
solution method - concise description of models
through algebraic statements independent of the Decision Variabks
algorithm to be used. So the user can implement
different algorithm for the same problem without Declaration, assignment of type, bounds, initial
. changing the basic model structure;
separability of data and logic - it makes incremental
addition to the model convenient . Basically, the
values
e.g., {generation level, line flow, load bus
voltages, tap setting etc}
mathematical description of the model can be retained
while increasing/decreasing the size of the problem;

2.2 How does an optimization model look like in GAMS? Equations

The basic structure of a mathematical model coded in GAMS has Declaration and definition
the components: sets, data, variable, equation, model and output e.g.,(load flow constraints,voltage limit,
(Fig.1). An example of the elements of an optimal power flow generation limits on MW and MVAr, cost functioi
(OPF) model is given for the readers to relate these components etc.}
to power system problem. In general, any optimizationproblem
can be formulated using these components. The data
presentation in GAMS can be done in its most elemental form
using tables, columns etc. There are standard IF-ELSE, WHILE, Model and Solve Staemene
LOOP, exception handling (CONTROL statements) logic
available which give the mherent flexibility to use GAMS almost Declaration, assignment of appropriate solver
like any programming language while retaining the basic e.g., {Model OPF; Solve OPF Using NLP
advantages. There are p o w e h l output specification facilities Minimizing Cost}
like PUT whch can generate reports in any desired format Also,
the output can be directly linked to spread-sheet programs for output
graphical analysis etc. Excellent debugging features exist for
quick and effective identification of errors. No attempt is made
Display, Put
here to give the syntax of GAMS and the interested readers are
referred to GAMS Users' Guide [I] for such details. e.g., (display optimal generation level, line flows,
voltage levels etc}
2.3 The GAMS Tool kit
Fig.1: Structure of a GAMS model
GAMS provides powefil solvers for the following classes of
optimization problems: The tool kit in GAMS embodies several man-years of research that
has gone into developing and fine tuning the algorithms in each
* Linear programming (LP) variants of Simplex category of problems. GAMS also has the unique feature of
methods and Interior Point methods primal, Primal- providing a common language that can make use of a variety of
Dual and Primal-Dual Prcdiotor-CorreGtor mGthods) solvers developed by dmerent research group/companies. Table- 1
Non-linear programming (TVLP) (variants of Gradient gives the list of currently available GAMS solvers. References to
. methods)
Linear mixed integer programming (MIL& (various
the basic literaturelreferencemanuals have been made for further
explorationon specific solvers. There is probably no solver which
. Branch and Bound Algorithms)
Non-linear mixed integer programming (MINLP)
(based on Outer Approximation Algorithm)
can be labeled as "best" and their performance is closely linked to
the structure of the problem. The choice of solver is thus dependent
on the understanding of the special structure of the problem and
some experimentation.
B-matrix
Table LossCoff (ij)
1 2 3
LP BDMLP,MINOS 5 [2],ZOOM[3],
MPSX [4] , SCICOMC [5],APEX 1 0.000136 0.0000175 0.000184
2 0.0000175 0.000154 0.000283
IV [6], LAMPS, OSL, XA, CPLEX 3 0.000184 0.000283 0.00161
[71
MINOS 5 , CONOPT [8], GRG 2 Scalar Load /300/ ;
[9], NPSOL [lo] "3. Declaration of variables with explanatory text
Variables
IV, XA, OSL, LAMPS
P(i) optimal generation level of i
I I DICOPT-H [l 11 I Cost minimum cost

* Defining variable type vu. positive, negative, binary etc


whlle the available solvers provide access to most of the state of
the art optimization tools, new solution algorithms for speclfc positive variables p ;
applications can be developed using the existing ones and the * Assigning variable limits by .UP (upper) and .LO (lower)
basic features of GAMS with much lower efforts than needed in
a conventional programming language like FORTRAN. Various P.UF'(i) = Data(i,"Upp") ;
other optimization techniques like decomposition techniques P.LO(i) = Data(i,"Low") ;
(Bender's decomposition, Dantzig-Wolfe decomposition), multi- *4. Declaration of equations with explanatory text
objective analysis (Goal Programming, Compromise
Programming), Lagrangian Relaxation, StochasticProgramming, Equations
Monte Carlo simulation etc have been implemented using CostEq total generation cost
GAMS. DemEq Demand-supply balance

ID.ILLUSTRATIVE EXAMPLES OF MODEL * Mathematical expression of the equations - given by


DEVELOPMENT * EqunName.. L.H.S =I= {<},or -e= {=}, or = g = { t } R.H.S
* Sum(i,P(i) standsfor C;P(i)
In this section, three well-known power system problems,
Economic Dispatch Calculation (real-time), Unit Commitment CostEq..Cost =e= Sum(i, Data(i,"a")*Power( P(i),2) + Data(i,"b")*
P(i)+ Data(i,''c")) ;
(short term) and Investment Planning (long term) are solved
using GAMS. Some of the large scale GAMS based programs DemEq.. Sum& P(i)) - Sum(($, P(i)*LossCoff(ij)*P(i)) =G= Load ;
in various other planning areas have been listed next.
*5. Model and Solve statement
* Model MODELNAME /list of equations/ -- ALL is a keyword for all equations
3.1 Example 1: Economic Dkpatch Calculation 1121 * listed in the section EQUATIONS
Model EDC /CostEq, DemEq/ :
The first example is a simple Economic Dispatch Calculationfor
a 3-generator system with transmission losses modeled using B- NLP=MINOS
matrix formulation. The GAMS model is reproduced below Solve EDC using NLP ' gcost;
(Fig.2) and is nearly self-explanatoxy. All bold words are *6. Reporting results
reserved words in GAMS language. Explanatory texts are
inserted at relevant places (precededby asterisk mark). * variable name.1 represents optimal level
*l.Set Delinitions: l*Nimplies 1,2,...,N display p.l;
set i generatingunits /1*3/:
set head flow, upp, a,b,c/ ; Fig.2: GAMS Code for EDC

alias (ij) ; After solving the model EDC, the output (Fig.3) looks like:
* implies set i = set j
*2. Data presentation
____ 57 VARIABLE P.L optimal generation level of i
Table Data(i,head)
1 193.974, 2 69.765, 3 53.000
Low UPP A B C ____ 57 VARIABLE C0ST.L 3666.122 minimum cost
* MW MW %/MWz %fMW 0 =

1 120 250 0.00525 8.663 328.13 EXECUTION TIME = 0.160SECONDS


2 5 137 0.00609 10.04 136.91
3 53 100 0.00592 9.76 59.16 FigJi Bwlution Eo the BDC problem
18

One can immediately see the major advantages of using GAMS DemCons(@.. Sum((i,step),S(i,step,q))+Sum(i,Minm(i)*w(i,q)) =g=
Demand(q)+LOSS(q) ;
even for this simple problem:
coding is easy, fast and compact CapCons(i,step,q).. S(i,step,q) =1= Power(i,step)*w(i,q) ;
the number of generators can be 'increased by simply
adding the member to the set and data set without * Relwul fixes the initial state of all units to "on" position
Relwul(i,"l").. w(i,"l")-1 =I= u(i,"l") ;
changing the variables, equations, model, solve
statements. In fact, the 40 unit Tai Power system case Relwu2(i,q)$(ord(q) gt l)..w(i,q)-w(i,q-l) =I= u(i,q) ;
study reported in [12] has been carried out with
* Relwvl fixes the initial state of all units to "on" position
prohibitive zones in the heat rate curve modeled using
MINOS using the same model with additional
-
Relwvl(i,"l").. 1 w(i,"l") =I= v(i,"l") ;

constraints; RelwvZ(i,q)$(ord(q) gt l).. w(i,q-l)-w(i,q) =I= v(i,q) ;


0 choice of variety of NLP algorithms without altering Model UnitCom /all/ ;
rest of the model;
OPTION MIP=XA;
3.2 Example 2: Unit CommitmentProblem (131: Solve unitcom using MIP minimizingcost ;
The complete data in this case has not been reproduced and only displays.l,u.l, w.l,v.l, cost.1;
the model structure in GAMS is given in Fig.4. A full-fledged
unit commitmentmodel with additional complexity like minimum
up time, minimum down time, hydro constraints etc can also be Fig.4: GAMS Code for Unit Commitment
developed with marginal effort:
Once again, the previous comments are applicable. While this is a
Set i generators /1*3/ straightforward application of XA algorithm, one can also develop
th(i) thermal generators /1*3/ more efficient and "power system specific" Branch and
q time periods /1*4/ BoundLagrangian relaxation algorithm utilizing the GAMS
step steps in cost hnction which is piece-wise linear /I/ ;
language features and the L P M P solver for solving the basic
Parameter c(i) start-up cost continuous model iteratively. The point is whether one directly
Parameter sh(i) shut-down costs employs the algorithms available within GAMS tool kit, or
Parameter Maxm(i) maximum rating develops special algorithms, the basic GAMS &timework has the
Parameter Minm(i) minimum rating
Parameter k(i) cost at minimum rating advantage of writing codes efficiently and in very compact form.
Table g(i,step) generation cost of each step
Table power(i,step) power available in each step 3.3 Exampk 3: Generation Investment Planning [14]
Parameter Res(q) demand plus spinningreserve;
Parameter Demand(q) demand in period q;
This example is drawn fi-omthe GAMS Model Library [1,Ch.191.
Res(@ = Demand(@* 1.1; This is an investment planning model for the Turhsh power sector
to determine the least cost expansion pattern. Again, all data axe
Variables
omitted and the basic purpose is to expose the readers to more
S(i,dep,q) power output in MW complex models and also use of more involved features (Fig.5)
u(i,q) start-up decision 1 or 0
v(i,@ back-down decision 1 or 0
w(i,q) unit status ON or OFF
cost total system cost SET
TIME TIME PERIODS / 1975*2005 /
positive variables s,uy; TE(T1ME) EXTENDED TIME HORIZON
binary variables w ; * T is a sub-set of TE
;(TE) TIME PERIODS EXCLUDING BASE YEAR
Equations LOAD BLOCKS / PEAK, HIGH, MEDIUM, LOW /
M PLANT TYPES / HYDRO-l*HYDRO-13, GAS-T, OK,,
obj total cost --- objective & d o n LIGNITE-1 * LIGNITE-3, NUCLEAR /
ramp constraint - upward MH(M) HYDRO UNITS / HYDRO-1'HYDRO-13 /
Ramp l(tl5step,q) THERMAL UNITS - WITH VINTAGE
Ramp2(tMep,q) -
ramp constraint downward MT(M)
THERMAL UNITS WITH LIMITATIONS ON TOTAL
rescons(q) reserve constraint MC(M)
relwul(i,q) logical constraint on unit status NEW CAPACITY / LIGNITE-1 * LIGNITE-3 /
relwuZ(i,q) logical constraint on unit status
relwvl(i,q) logical constraint on unit status * Alias (T,V) means set T = set V
relwv2(i,q) logical constraint on unit status
DemCons(q) demand-supply balance ALIAS (T,V),(B,BP);
CapCons(i,step,q) capacity constraint
* Thermal and Hydra al-e oomplemenbry seb
MT(M) = NOT MH(M);
Obj.. cost =e= Sum((i,q), c(i)*u(i,q)+sh(i)*v(i,@+k(i)*w(i,@)
+ Sum((i,q,step), g(i,step)*S(i,step,q)) ;
* Defining labels of a table using set - very convenient way of input
* The dollar option is used for exception handling SET LABELS FOR PLANT DATA / INITCAP, AVAIL, E-FACT
OPCOST, OPCOST-G ,CAPCOST, CAPCOST-G, LIFE, MAXCAP, /
Rampl(th,step,q)$(ord(q) gt l).. S(th,step,q) =g= 0.7*S(th,step,q-l) ;
Ramp2(th,step.@$(ord(q) @ 1)- S(thstep,q) =I= 1.3*S(th,step,q-l) ; TABLE MDATAH(M,LABELS) DATA FOR HYDRO PLANTS
Rescons(q).. Sum(i, Mam(i)*w(i,S)) =g= Res($ ;
19

TABLE MDATAT(M,LABELS) DATA FOR THERMAL PLANTS ECH(MH,T).. SUM(B, DUR(B)*ZH(MH,B,T)) =L=
MDATAH(MH,"E-FACT")
TABLE TUF'(M,TE) UPPER BOUND ON THERMAL UNIT EXPANSIONS *(MDATAH(MH,"INITCAP") t SUM(V%VS(T,V),

TABLE DD(B,*) DEMAND DATA FOR 1975


HCC(T).. SUM(MH, MDATAH(MH,"INITCAP") + SUM(V$VS(T,V),
PARAMETERS HH(MH,V))) =L= R*D("PEAK",T);

HLO(M,TE) LOWER BOUND: HYDRO UNIT EXPANSIONS (MW) RCH(MH).. SUM(T, HH(MH,T)) =L= MDATAH(MH,"MAXCAP");
HUP(M,TE) UPPER BOUND: HYDRO UNIT EXPANSIONS (MW)
TM(M,TE) LOWER BOUND: THERMAL UNIT EXPANSIONS (MW) CAT(MT).. HTT(MT) =E= SUM(V, HT(MT,V));

SCALAR AK(T).. PHIC(T) =E= SUM(MH,


RHO INTERESTRATE SIGMA(MH)*MDATAH(MH,"CAF'COST")*SUM(V$VS(T,V),
PRR PEAK RESERVE REQUIREMENT (%) HH(MH,V))) + SUM(MT, SIGMA(MT)*SUIVI(V,
R MAXIMUM AGGREGATE HYDRO CAPACITY CAPCOSTT(MT,V,T)*HT(MT,V)));
G DEMAND GROWTH RATE (ANNUAL Yo)
AO(T).. PHIO(T) =E= SUM(MH, MDATAH(MH,"OPCOST")*SUM(B,
PARAMETER DUR(B)*ZH(MH,B,T))) + SUM((MT,V)$VS(T,V),
LENGTH(T1ME) DISTANCE FROM BASE YEAR OPCOSTT(MT,V,T)*SUM(B, DUR(B)*ZT( MT,V,B,T)));
D(B.TE) POWER DEMAND BY BLOCK (MW',
~irric~j LOAD DURATION OF BLOCK . ' OBJ.. PHI =E= SUM(T, DELTA(T)*(PHIC(T) + PHIO(T)));
OPCOSTT(M,V,T) OPERATINGCOST FOR THERMAL UNITS
CAPCOSTT(M,V,T) CAPITAL COST FOR THERMAL UNITS * Variable name.LO and name.LJP represents the lower and upper bounds
SIGMA(M', CAPITAL RECOVERY FACTOR * respectively -this is simply a compact way of representation
DELTA(Tj DISCOUNT FACTOR
BS(B,B) LOAD ORDER MATRIX HH.LO(MH,T) = HLO(MH,T); HH.UP(MH,T) = HUP(MH,T);
VS(T,V) VINTAGE TIME MATRIX HT.LD(MT,T) = TLO(MT,T); HT.UP(MT,T) = TUP(IV[T,T);
NT(M,V) INITIAL CAPACITY FOR THERMAL, UNITS (MW); HTT.UP(MT) = MDATAT(MT,"MAXCAF"');

VARIABLES * ALL stands for all equations under EQUATIONS


PHI TOTAL DISCOUNTED COST
PHIC(TE) CAPITAL CHARGES MODEL TURKEY / ALL L
PHIO(TE) OPERATING COSTS SOLVE TURKEY MINIMIZING PHI USING L P
HH(M.TE\ CAPACITY ADDITIONS: HYDRO UNITS
HT~M,v)' CAPACITY ADDITIONS: THERMAL UNITS
HTT(M) CAPAClTY ADDITIONS: TOTAL THERMAL UNIT Fig.5: GAMS code for investment planning
ZH(M,B,T) POWER OUTPUT: HYDRO
ZT(M,V,B,T) POWER OUTPUT: THERMAL
This model of generation investment planning is fairly
POSITIVE VARIABLES ZH,ZT,XH,XT,HH,HT representative of most other investment problems e.g.,
EQUATIONS
transmission, capacitor placement, emission control equipment.
DB(B,TE) DEMAND BALANCE This basic framework can be extended to add more complicating
CCH(M.TE\ CAPACITY CONSTRAINT HYDRO factors like uncertainty, non-linearity, demand-side options,
CCT~M.'V.TE\ CAPACITY CONSTRAINT: THERMAL emissions constraints etc.
ECH~M~TE) ' HYDRO ENERGY CONSTRAINT
HCC(TE) HYDRO CAPACITY CONSTRAINT
RCH(M) RESOURCE CONSTRAINT ON NEW HYDROS 3.4 Some of the GAMS models in power system literature:
CATiMj CAPACITY ACCOUNTING: TOTAL NEW
ACCOUNTING: CAPITAL CHARGES
E${
OBJ
ACCOUNTING: OPERATING COSTS
TOTAL DISCOUNTED COST
While the above examples serve the purpose of giving sufficient
insight into modeling language, a short list (of some important
power system applications using GAMS are provided below:
* $( ) implies "such that" e.g., BP$BS(BP,B) means pick only those BP elements
* which are elements of BS(BP,B)
1. Optimal power flow based pricing [15,161
DB(B,T).. SUM(BP%BS(BP,B), SUM(MH, ZH(MH,BP,T)) + 2. Fuel supply optimization, integrated operation of utilities,
SUM((MT,V)$VS(T,V), ZT(MT,V,BP,T))) =G= D(B,T); (deterministicLP-based) production costing [171
* The relevant elements from a set may be extracted by putting the name of the 3. Power brokerage model [ 181
* element in '' '' e.g., MDATAH(MH,"AVAIL") 4. Load management [ 191
5. Generation and transmission investment planing using
PR(T).. SUM(MH, Bender's decomposition includiing probabilistic
MDATAH(MH,"AVAIL")*(MDATAH(MH,"INITCAP") +
SUM(V%VS(T,V), HH(MH,V)))) SUM(MT, + production costing [20]
MDATAT(MT,"AVAIL")*SUM(V$VS(T,V), KIT(MT,V) + 6. Integrated Resource Planning with transmission [21] and
HT(MT,V))) =G= (1 + PRR)*D("PEAK",T); multi-objective analysis [22]
CCH(MH,T).. SUM(B, ZH(MH,B,T)) =L= 7. Maintenance scheduling using MIP [23]
MDATAH(MH,"AVAIL")*(MDATAH(MH,"INITCAP 8. Reactive power planning [24]
") + SUM(V$VS(T,V), HH(MH,V)));

* $( ) statement here applies on the equation name -this is a very useful way of This list is far from exhaustive and is intended to just give an idea
* restricting the redundant equations while keeping the general equation format of the variety of optimization problems that has been addressed
using modeling languages.
CCT(MT,V,T)%VS(T,V).. SUM(B, ZT(MT,V,B,T)) =L=
MDATAT(MT,"AVAIL"y(KIT(MT,V)
t HT(MT,V),
20

IV.CONCLUDING REMARKS REFERENCES


I. Modeling Language Related References:
This paper is intended to serve a modest purpose of introducing
modeling language(s) to power system optimization problems, ABrooke, D.Kendrick, AMeeraus, GAMS - A Users' Guide, Release
both for research and education. Though there are some 2.25, Boyd and Fraser Publishing Company, The Scientific Press Series,
Danvers, MA, 1992.
applications already in power system field, a systematic way of B.A Murtagtz M.ASaunders,"MINOS 5.1 User's Guide" Report SOL
understandingthe basic capabilities of modeling language is still 83-20R, 1987, Stanford University:
lacking. The General Algebraic Modeling Language (GAMS) J.Singhal, R.Mastem and T.Morh,"Fixed order branch-and-bound
methods for mixed integer programming: the ZOOM system" Working
language has been chosen for the purpose keeping in mind the Paper, Management Information Science Department, The University
edge it has over others. The key advantages have been shown to of Arizona, Tuscon, Arizona, Dec, 1987.
be the compact, easy and extremely fast model development IBM Corpn., Mathematical Programming System Extended WPS)
capabilities, separability of data, mathematical model and and Generalized UpperBounding (GUB), IBM Manual SH 204968-
1, White Plains, New York, 1978.
solution algorithm and the choice of a number of powerful Scicon Ltd,Scicon VM User Guide ver 1.40, Milton Keynas, England,
commercial solvers. GAMS has the flexibility of implementing 1986.
a wide variety of optimization problems and has found Control Data Corporation, APEYIVReferenceManual, CDC ManuaL
84002550, Minneapolis, MN. 1982.
applications in several disciplines. It has also found some GAMS Development C o p , GAMS - The SolversManual ,Washington
applications in power system area. Though it gives an initial DC, 1992. (http://w.gams.com)
impression that it provides a "ready-made solution" to any and ADrud, "CONOPT-A GRG code for large sparse dynamic non-linear
every power system optimization problem, experience with optimization prob1ems"Math. Programming, Vol.3 1, 1985, pp.153.
L.S.Lasdon, AD.Waren, AJain, M.Ratner,"Design and testing of
modeling languages over the years suggest the following generalized reduced gradient code for non-linear programming"ACM
"Do's''and "Do not's": Trans on Mathematical Software, Vo1.4, pp.34.
E.P.Murray, MASaunders, M.H.Wright, User's Guide for NPSOL
Do's: (version 4.0):A FORTRANpackage for non-linear programming"
* Report SOL 86-2, Dept. of Op. Research, Stanford University, 1986.
Basic understanding of the optimization process J.Viswanathan, I.E.Grossmann, "A combined penalty fimction and

. i.e.,how the solvers work, is a must


Develop prototype models for hands on learning of
optimizationmodels, testing new ideas, bench-marking
Outer Approximation method for MINLP optimization" Computers
and Chemical Engineering, Vol. 14, pp.769-782.
11. Power System Related References:
performance of different models etc.
e Apply where computational time is not the biggest L.Chen et al, "Large-scale economic dispatch by genetic algorithm"
limiting factor IEEE Trans PWRS, Vol.10, No.4, Nov, 1995, pp.1919
J.AMuckstadt and R.C.Wilson,"An application of mixed-integer
Improvise to make use of the power system properties programming duality to scheduling thermal generating systems" IEEE
to the extent possible rather than a "brute force T-PAS, Vol.PAS-87, Dec.'68, pp.1968-1978.
method" R.Turvey and D.Anderson, Electricity economics: essays and case
studies, Johns Hopkins University R e s , Baltimore and London, 1977.
M.C.Rosevear and B.J. Ring, Implementation of TransmissionPricing
.
Do not's:
Prohibit applications in problems where the inherent
inflexibility of modeling language does not allow full
Using a GAMSModel EMRG-W-92-01, Dept of Managemenf UNv
of Canterbury, New Zealand, 1995.
W.W. Hogan,"Contract networks for electric power transmission:
Technical reference" Energy and Environmental Policy Center, JFK
. exploitation of the power system properties
Blind reliance on commercialsolvers may not be a good
idea since they are completely devoid of special power
School of Govt, HarvardUniversity, 1991.
J.P& and D.Chattopadhyay,"A multi-area linear programmingmodel
for analysis of economic operation in India" iEEE T-PKW, Feb, 1996.
system properties and some knowledge of power G.Fahd, D.Richards and G.B. Sheble,"The implementation of an energy
brokerage system using linear progra"ing"IEEE T-PWRS, Vo1.7,
system theory invoked might greatly s i m p l e No.1, Feb, 1992, pp.90-96.
. computations
GAMS models are not necessarily a substitute for
commercial power system software. The latter
S.Majumdar, D.Chattopadhyay, and J.Pari!&"Intermptible load
management using optimal power flow analysis"1EEE T-PWRSs,May,
1996.
S.AMalcolm, Electricip investment Planning Under Uncertaintyand
embodies power system properties and expertise of a Environmental Constraints, Ph.D. Thesis, Dept. of Systems
number of company-years and normally perfoms far Engineering Univ. of Pennsylvania, 1995.
superior to a simplistic GAMS model S.Siddiqui and M.Baughman,"Integrated Resource Planning :Part 1 and
2" IEEET-PUBS, May, 1995.
D.Chattopadhyay, R.Banerjee and J.Parikh,"Integrating demand side
Despite the (seemingly obvious) reservations, modeling options in electric utility planning" IEEE T-PmS,Feb, 1995.
languages are expected to be a very useful compromise among D.Chattopadhyay, K.Bhattacharya and J.Parikh,"A systems approach
tedious lengthy coding and ready-made power system software. to maintenance scheduling for an interconnected power system"IEEE T-
PctaS,Nov, 1995.
It should thus fill the void in education and research by replacing D.Chattopadhyay, K.Bhattachawa and J.Parikh."Optimal reactive
repetitive and time-Cionmamhs prow-srmmingefforts, to the entat powsr p1kin"g knd ID &potpnokg. m Integrated approaGh1m I;
that it does not defeat the very purpose. PctaS, Nov, 1995.

ACKNOWLEDGEMENT Deb Chattopadhyay received his B.Engg degree in 1990. He was with the Indira
Gandhi Institute of Development Research (IGIDR) between 1990 and 1995. He
I take this opportunity to thank Dr.Alex Meeraus and Dr.Ramesh Raman of spent a year (1995-96) at the Howard University, USA He served the Indian set up
GAMS Development Corp, for helpful discussions and providing an evaluation of PTI between 1996-97. He is currently an academic staff with the Dept of
copy of GAMS software. The opinions expressed in this paper, however, do not Management, Univ of Canterbury, New Zealand. His research interests include
necessarily reflect their views. application of optimization techniques to power system planning and operations.
21

Discussion Cmi(n,nl,k) nl-n ma): line trapsmission capacity;

Cost(p). .objs=e=sum(t,G(t,’vc’)~a(t,p));

A. J. Conejo, N. Alguacil (Universidad de Castilla-La Bpw(n,p), .sum(t$nc(t,n) ,o(t,p))+~um(nl,(Ln(n,nl,’ss’)*


(ag(nl,p)-ag(n,p))+Lnn(nl,n,’ss’)*(ag(nl,p)-ag(n,p))))=e=~(n,p) ;
Mancha, Ciudad Real, Spain): We would like to congrat-
ulate Mr. Chattopadhyay for his relevant contribution. Pma(t,p) ..o(t,p)=l=G(t,’pmax’)*v(t,p);

The paper makes available useful information on model- Pmi(t,p). .o(t,p)=g=G(t, ’pmin’)*v(t,p) ;
ing languages to students, researchers and practitioners Cma(n,nl,p)..Ln(n,nl,’ss’)t(ag(n,p)-ag(nl,p))=l=Ln(n,nl,’cp’);
in a convenient and compact fashion. We would like to
Cmi(n,ni,p). .Ln(n,nl,’ss’)*(ag(n,p)-ag(nl,p))=~-Ln(n,ni,’=p’) ;
make the following remarks:
*** 5 . Declaration and definition of master problem equations
Equations Mast Benders master problem cost
1. A fundamental capability of current modeling lan- Cutci)
Rvy(t.k)
Benders cut
Logic of plant operation
guages is the ability to perform loops. This makes it Fact(k) Feasibility cut;
possible the implementation of decomposition proce- Mast..abjm=e=r+sum((k.t)$p(k).C(t,’fc’)*tpv(t,k)+C(t,’sc1)*tpy(t,k));
dures and therefore the treatment of dynamic mul-
Cut (it), .r=g=tot(it)+sum((t ,k)$p(k) ,l(it ,t ,k)*(tpv(t,k)-val(it ,t,k))) ;
tiperiod problems, such as power system planning
problems. Through the use of dynamic sets it is Rvy(t,k)$p(k). .tpy(t,k)=g=tpv(t,k)-tpv(t.k-l);
possible to sequentially solve problems of increasing Fact(k) $p (k) .. sum(t, G(t ,’pmax ’) *tpv(t .k) 1=g=sum(n, Ld (n ,k) ) ;
dimension, and these problems appear in decompo- t** 6 . Initial values
sition procedures. Figure A below shows a GAMS tpv.fx (t , ini’)EO:
code to solve a multiperiod DC OPF problem in- I** 7. Model and Solve statement in a LOOP
cluding start up and shut down of units, using Ben- Model SBP Benders Subproblem / C a s t , B p w , P m a , P m i , C , C m i / ;
Model MST Benders Master Problem /Mast,Cut,Rvy,Fact/;
ders decomposition. This figure illustrates the use of
loops and dynamic sets in GAMS. Loop(i$((abs(ap-in)/(abs(in)+l)) gt le-10).

c initial period is not considered *


2. A powerful MILP solver is CPLEX [A] which is not p(k) = yes:
referenced in Table-1 of the paper. p(k)$(ord(k) eq 1) = no;

add a Benders cut and solve master problem


3. Modeling languages AMPL [B] and AIMMS [C] have it(i) = yes;
L

basically the same modeling capabilities as GAMS. Solve MST using MIP minimizing objm;

t
in
v.fx(t.k)
-
variables updating *
0bjm.L;
= tpv.l(t,k);
*** 1. Set Definitions y.fx(t,k) = tpy.L(t,k);
Sets k periods of time /ini,1*3/ tot(i+l) = 0.;
1 loop iterations /1*10/
n
t
nc(t.n)
buses
thermal units
bus-unit
/bl,b2/
/al,a2/
/al.bi.aZ.b2/
*
p(k)$(ord(k) ne 2) no; -
only first period is considered I

cgt thermal data /pmax.pmin,vc.fc,sc/ Loop(j$(ord(j) gt 1).


cln line data /ss,cp/ Solve subproblem J *
p(k) dynamic subset of time periods Solve SBP using LP minimizing objs;
it(i) dynamic subset of iterations;
1 variables updating *
alias (n,nl); alias (k,j); tot(i+l) = tot(i+l)+objs.L;
l(i+l,t,j) = v.m(t,j);
*** 2. Data presentation val(i+l,t,j) = v.l(t,j);
Table G(t,cgt) thermal unit data
pmax pmin vc fc sc * next period is considered *
* (PUW) (PUW) (PU$/PUW) (pu$) (pu$) p(j) = no;
a1 1.3 0.02 0.1 10. 20. p(j+l) = yes;
a2 2.5 0.02 0.125 17. 18. );
s p = tot(it1)tobjm.l-r.1;
Table Ld(n,k) load );
1 2 3
* (puW) (PUW) (PUW) F i g u r e A: Multiperiad OPF in GAMS
bl 1.0 2 . 6 0.2

Table Ln(n,nl,cln) line susceptance and capacity limit We finally would like to congratulate again the author
88 cp for an educationally useful paper.
* (puOhm) (puMVa)
bl.b2 1.2 1.5;
References
Scalars sp upper bound cost /inf/
in lower bound cost /-inf/;
[A] A. Brooke, D. Kendrick and A. Meeraus. GAMS/Cplex 4.0
Parameters l(i,t,k) marginal cost /l.(al,a2).1*3 O./
val(i.t,k) value of status variable /l.(al,a2).1+3 O./
User Notes. GAMS Development Corporation. Washington,
tot(i) subproblem cost /l o./; 1996.
*t8 3. Declaration of variables [B] R. Fourer, D. M. Gay and B. W. Kerninghan. A M P L : A
Positive Variables o(t,k) ,v(t,k) ,y(t,k),r;
Free Variables ag(n,k) ,objs,objm;
Modeling Language for Mathematical Prqgmmming. Scien-
Binary Variables tpv(t,k) ,tpy(t,k) ; tific Press. San Francisco, 1993.
ttt 4 . Declaration and definition Of subproblem equations [C] J. Bisschop and R. Entriken. AIMMSr The Modeling System.
Equations Cast Benders subproblem cost Paragon Decision Technology. Haarlem, 1993.
Bpv(n.k) Power balance at every bus
Pma(t,k) Maximum output power
Pmi(t,k) Mini” output power
Cma(n,nl,k) n-nl m a x line transmission capacity
22

Deb Chattopadhyay (University of Canterbury, solvers may be obtained from the GAMS web page:
Christchurch, New Zealand): I greatly appreciate the http://www.gams.com;
comments by Dr. Conejo and Dr. Alguacil which add value to
the content of the original paper. The intent of the paper has 3. Other Modelling Languages: AMPLIAIIMS are of
been to provide a comprehensive overview of modelling more recent origin compared to GAMS. In my
language to enable students and researchers in power system opinion, both these languages have relatively easier
area with basic information. Nevertheless, the additional syntax compared to GAMS, and hence easier to
information provided by the discussors is useful. Further to learn. As mentioned in the paper, reference to
their comments, I would like to add the following: GAMS was made mainly because it

Solving within a LOOP: The multi-period OPF using e has been more widely used in a range of
Bender’s decomposition (Figure-A) is an excellent disciplines for several years now,
example of using the solve facility within a LOOP. It 0 provides access to a much larger number of
should be reckoned that, commercial solvers. Some of the solvers are not
(a) This special application of Bender’s available to any other modelling languages for
decomposition could be achieved at a much special classes of problems such as DICOPT
lower effort using GAMS features compared to (non-linear MIP problems), MILES/PATH
its implementation using conventional (MCP problems), and MPSGE (for CGE
programming language, and, problems), and
(b) ?‘he Bender’s decomposition computational a has found some application in power system
scheme for the multi-period OPF problem (for area;
large scale application) may be conveniently
benchmarked with standard MIP algorithms I wish to thank Dr. Conejo and Dr. Alguacil for making
like CPLEXlXNZOOM etc at minor this educational paper more informative.
incremental efforts.
Some explanatory comments on the program in Figure-A [D] Y. Smeers and W. Jing-Yuan, “Spatially ohgopolistic
may be useful. Firstly, the two sub-models (Master and model with opportunity cost pricing for transmission
Slave sub-problems in Bender’s iterative scheme) are capacity reservations: a variational inequality approach’
CORE Discussion Paper 9717, Center for Operations
defined in sections 1-6 (Fig A). In section 7, the first Research and Econometrics, Universite Catholique de
(outer) LOOP is defined over a set I and includes a solve Louvain, Belgium.
statement for the Master. A conditional statement using $
is stated to define the convergence criterion on the
difference between upper and lower bounds produced by
the Master and Slave respectively. The second (inner)
loop includes the Slave problem which uses information
from the Master. For example, the MW output from
generator t in period p denoted as o(t,p) is constrained in
the Slave by the status of the unit (ON/OFF) v(t,p)
determined in the Master problem. Note that
v.fx(t,k)=tpv.l(t,k) (in section 7 ) means variable v() is
fixed at the level of tpv() where the later is the binary
decision variable in the Master). Many other iterative
schemes can be implemented using this facility. It should
be mentioned that load flow schemes can also be
implemented using GAMS as a simultaneous system of
non-linear equations and further, may be included as part
of an iterative scheme;

2. Additional Solvers: I had omitted some of the more recent


additions to GAMS Solver family because I referred to an
outdated GAMS 1992 manual. Apart from CPLEX, there
is GAMS/OML for LP/MIP problems. It should also be
mentioned that GAMS has additional capabilities to solve
Mixed Comeplementarity Problems (MCP) using PATH/
MILES solvers, and Computible General Equilibrium
(CGE) problems using MPSGE solver. The MCP
problem, in particular, is receiving some attention in
power system area in the context of transmission pricing.
Smeers and Jing-Wuan have developed a GAMS/MILES
model for 4 European countries [D] Information on the

You might also like