Soroudi 2017
Soroudi 2017
Soroudi 2017
Power System
Optimization
Modeling in
GAMS
Power System Optimization Modeling in GAMS
Alireza Soroudi
123
Alireza Soroudi
School of Electrical Engineering
University College of Dublin
Belfield, Dublin, Ireland
v
vi Preface
This book would have not been finished without the contributions of several globally
recognized experts in the power system field. A special thanks to Dr. Turaj Amraee
who introduced GAMS to me for the first time.
I would like to thank those who gave me insight about the power system studies,
especially Dr. Raphael Caire at Grenoble INP, Dr. Andrew Keane at University
College Dublin, and Dr. Jonathon O’Sullivan at EirGrid.
This book is dedicated to my lovely wife, Soudeh, who supported me in putting
together all the details. Finally, I appreciate all that my parents, Simin and Shahryar,
and my sister, Mona, have done for me.
vii
Contents
ix
x Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
List of Figures
xiii
xiv List of Figures
xix
xx List of Tables
The General Algebraic Modeling System (GAMS) is a modeling tool for mathemat-
ical programming and optimization purpose. This chapter provides the instruction
on different programming elements in GAMS. It can be used in solving different
types of optimization problems. Some basic optimization models used in power
system literature are described in this chapter.
The power system optimization problems are broadly categorized as operation and
planning problems. The operation problems are usually related to how to exploit
the existing devices/power plants. For example, optimal power flow is an operation
problem. The planning problems usually refer to those problems which investigate
whether to invest or not in some assets. For example, the decisions regarding
the transmission network expansion belong to planning category. Some of these
problems are shown in Fig. 1.1. Some power system planning problems are listed as
follows:
• Generation expansion planning (GEP) [1, 2]: In GEP, the decision maker is trying
to find out the investment decision regarding the generation technology, size, and
time of investment.
• Transmission expansion planning (TEP) [3, 4]. In TEP, the decision maker is
trying to find out the investment decision regarding the planning option and time
of investment. The planning options include but not limited to: building new
lines, reconductoring the existing lines, building, or reinforcing the substations.
• Distribution network planning [5]: this problem is trying to make smart invest-
ments in new feeders/substations to meet the technical constraints.
The first step is downloading the appropriate installation file from the following
address:
https://www.gams.com/download/
1.2 GAMS Installation 7
Platform Description
MS Windows 32 bit Windows Vista or newer on AMD- or Intel-based
(x86) architectures.
MS Windows 64 bit Windows Vista or newer on AMD- or Intel-based
(x64) architectures.
Linux 64 bit AMD- or Intel-based 64-bit (x64) Linux systems
with glibc 2.7 or higher.
MacOS X Intel-based 64-bit (x64) Macintosh system with
MacOS X 10.10 (Yosemite) or higher.
Solaris i86pc AMD- or Intel-based 64-bit (x64) Solaris system.
Built on Solaris 11.0.
Solaris SPARC 64bit Sparc-based 64-bit (sparc-64) Solaris system.
Built on Solaris 10.
IBM AIX PowerPC based 64-bit (ppc-64) AIX system. Built
on AIX 6.1
Table 1.1 Data for Required time for task completion (h)
illustrative example
Machine P1 P2 P3
M1 2 5 2
M2 3 4 1
Profit per kg ($/kg) Machine availability (h)
P1 10 M1 16
P2 12 M2 12
P3 13.5
for each product are considered as the input data. The profits/kg of each item is also
known. The input data of this example is described in Table 1.1.
• Sets: Two sets should be defined: machines (M) and products (P) Sets M=m1
m2=; P=p1 p3=;
• Data: Looking at Table 1.1 shows that we have a table (required time for task
completion) and two parameters (Profit per item and Machine availability). The
task completion table is defined over two sets (machines and products), the profit
per item parameter is defined over products while the machine availability is
defined over product set. It is assumed that the minimum required amount of
each product is 1 kg.
Parameter profit(P)
/p1 10
p2 12
p3 13.5/;
Parameter availability(M)
/m1 16
m2 12/;
Table task(m,p)
p1 p2 p3
m1 2 5 2
m2 3 4 1;
• Solve statement: The solve statement tells GAMS that the model is linear and the
direction of the optimization should be toward maximizing the total benefits.
The model type used in this code is linear programming (LP). There are
various models that can be coded in GAMS coding as follows:
1.3 GAMS Elements 11
• Output: The outputs of the GAMS model can be displayed and also saved in an
XSL file.
Display X . l , Of . l ;
execute u n l o a d ” Example . gdx ” X . l
execute ’ gdxxrw . e x e Example . gdx v a r =X r n g = P r o d u c t ! a1 ’
execute u n l o a d ” Example . gdx ” OF . l
execute ’ gdxxrw . e x e Example . gdx v a r =OF r n g =OF ! a1 ’
The overall GAMS code for solving the illustrative example is provided in
GCode 1.1.
Once the model is solved the solve summary is available by clicking on the file.lst.
The structure of GAMS listing file is shown in Fig. 1.6.
The listing file is explained as follows:
SOLVESUMMARY
MODEL example OBJECTIVE OF
TYPE LP DIRECTION MAXIMIZE
SOLVER CPLEX FROM LINE 23
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
**** OBJECTIVE VALUE 82.7500
The summary shows that the name of the model is example. The objective
function to be optimized is named OF. The type of the model is linear programming
(LP). The direction of the optimization is maximization. The solver used for solving
the LP model is CPLEX. The solver status is 1 which means that the model is
normally solved without error. The model status is 1 optimal. It means that the
global optimal solution is found. The value of the objective function (OF) is 82.75.
Different solver status might be reported once the model is solved.
1.3 GAMS Elements 13
The model statistic can provide some useful information regarding the developed
model. It is indicating that there are two blocks of equations (eq1,eq2) in the
developed model. The single equations are three because eq1 has two single
14 1 Introduction to Programming in GAMS
equations (m1; m2) and the eq2 has only one equation. There are two blocks of
variables x, OF but since X has three variables (p1; p2; p3), then the number of total
variables is 4.
MODEL STATISTICS
BLOCKS OF EQUATIONS 2 SINGLE EQUATIONS 3
BLOCKS OF VARIABLES 2 SINGLE VARIABLES 4
By clicking on the SolVar tab, some useful information regarding the variables
will be obtained as follows:
This means that the minimum limit of variable X is 1 and the upper limits
are C1. The marginal values are also revealed. Each variable in GAMS has five
attributes as follows:
• Variable.lo: indicates the minimum limit of a variable
• Variable.up: indicates the maximum limit of a variable
• Variable.l: indicates the level of the variable. In other words, this is the actual
value of the variable.
• Variable.fx: indicates the level of the variable is fixed and is not changing. It has
the same impact of defining the low and up attributes the same as each other.
• Variable.m: indicates the marginal value of a variable. It shows how much
sensitive is the objective function to the changes of this variable. For example,
X:m.p1/ D 3:5 this means that for 1 unit of increase in X.p1/ the objective
function will reduce by 3:5.
The variables used in this code are all real variables; however, different types of
variables can be defined in GAMS as follows:
1.4 Conditional Statements 15
It should be noted that the default values for variable limits can be modified by
the user.
The Dollar ($) condition is broadly used in GAMS coding. Various applications are
explained through some examples.
• Suppose we need to have a conditional statement like this if A D C then B D D.
This statement is modeled as follows:
(B=D)$(A=C)
B=D$(A=C)
• Suppose that we need to filter some elements in eq1(m). In other words, this
equation should be valid for every m elements except some of them.
This would force the equation only for m2 and m3. It should be noted that no
variable can exist in conditional statement.
• If A and B then C D D, this is coded as follows:
(C=D)$( A and B)
The looping is used for executing one or more statements repeatedly. There are
different forms of looping in GAMS as follows:
One of the techniques for defining the loop in GAMS is loop statement.
Loop(setname,
Statement 1 ;
Statement 2 ;
Statement 3 ;
);
The statements 1–3 are executed N times. N is equal to the cardinality of the
“setname.” These statements can assign values to the variable limits or describe the
relation between some parameters (not the variables). No variable can appear in the
loop statements.
In the first counter, the minimum values of all X variables would be 0:11 and the
model is solved. The second counter sets the minimum values of X variable equal
to 0:1 2 D 0:2 and then the model is solved. The point that should be noted here
is that the set/parameter/variable/model definition should be outside the loop.
This kind of modeling would be useful in conducting sensitivity analysis. Some
parameters are varied and then the impacts on the objective function are investigated
as follows:
One of the techniques for defining the loop in GAMS is while statement.
while (condition,
Statement 1 ;
Statement 2 ;
Statement 3 ;
);
The statements 1–3 are executed as far as the condition is true. The condition will
be changed inside the loop based on some logic otherwise the loop will continue
forever!
One of the techniques for defining the loop in GAMS is FOR statement.
18 1 Introduction to Programming in GAMS
One of the techniques for defining the loop in GAMS is Repeat-until statement.
repeat ( Statement 1 ;
Statement 2 ;
Statement 3 ;
until condition );
The statements 1–3 are executed until the condition becomes logically true (it
should be initially false).
GAMS is able to read the data from xls files. It is also convenient to use xls as
an interface between GAMS and other platforms. Reading the data from xls file is
straightforward as follows:
P a r a m e t e r L e v e l (m, p ) ;
n$CALL GDXXRW. EXE Example . x l s p a r = L e v e l r n g = t a s k ! E5 : H7
n$GDXIN Example . gdx
n$LOAD L e v e l
In this case, a parameter like Level (m; p) is defined. The xls file name
(Example.xls) is indicated and the range of data is specified (sheet=task, cells:
1.7 Error Debugging in GAMS 19
E5:H7). The data is read from xls file and is written on Example.gdx file. The
parameter level is loaded and can be used in the code.
It is usually desirable to save the output of a GAMS code in an excel file. The
procedure is quite straightforward.
For variables, the following commands should be executed. The user can indicate
which variable (X.l,OF.l) should be written in Excel file. The name of the excel
file (Example.xls) and what would be the sheet name (product, OF). The cell a1 is
chosen as the starting cell in the specified sheet for writing the data.
If the user wants to write the parameter X to an excel file then the command
would be as follows:
e x e c u t e u n l o a d ” Example . gdx ” X
e x e c u t e ’ gdxxrw . e x e Example . gdx P a r =X r n g = P r o d u c t ! a1 ’
Once the code is written the “Shift key + F9” should be pressed. The GAMS
compiler will check the developed code without executing it. The coding errors
are unavoidable in every programming language, and GAMS is not an exception.
Usually, a list of errors is generated which should be taken care of. The first thing to
keep in mind is to start from the first error and fix them one by one. In this section,
some common coding errors and best way of debugging them are explained.
• Error 140: Unknown symbol: GAMS compiler generates this error when there
are some undefined symbols in the model.
• Error 246: Objective variable is not a free variable
This error will usually happen when the objective function (which should be
minimized/maximized) is not set as a free variable. For example, it is defined as
a positive/negative variable. In case that the decision maker needs the objective
function be a positive variable, the lower limit of the variable should be specified
using :lo D 0 command.
20 1 Introduction to Programming in GAMS
The equation should be valid for every m, but the equation label is not defined
over the set m. The correct format for defining this equation is as follows:
x(p)=1;
This is not a valid way of doing this. If the variable X.p/ should be fixed to a
constant value it should be defined as follows:
x.fx(p)=1;
As a general rule, the variables cannot appear outside the equations. Only
the variable’s attributes can be modified outside the equation environment.
1.7 Error Debugging in GAMS 21
This means X:lo.p/, X:l.p/, X:up.p/ can be changed without using equation
environment.
Another situation that this error might happen is in display command.
Consider the following part of a GAMS code:
This is because X is a variable and display command can only show the
attributes of the X variable. The correct form for showing the value of X variable
is as follows:
m2 12/;
Table task(m,p)
p1 p2 p3
m1 2 5 2
m2 3 4 1 ;
Equations eq1,eq2;
eq1(m) .. sum(p, task(m,p)*x(p))=l=availability(M);
eq2 .. of=l=sum(p, profit(p)*x(p));
X.lo(p)=1;
Model example /all/;
Solve example us LP max OF;
display X.l , Of.l , Z.l;
This code would generate Error 141 because although variable Z is defined but
since it has no initial assignment and does not appear in the model then GAMS
knows nothing about it.
• Error 225: Floating entry ignored
This error is a very common error specially for beginners. This happens when
a table is not properly typed in GAMS. All data should be aligned under the
column label.
P1 P2 P3
M1 2 5 2
M2 3 4 1
P1 P2 P3
M1 2 5 2
M2 3 4 1
Handling the large tables in GAMS would be much easier if the tool named
“xls2gams.exe” is used. This tool is available in the same folder that GAMS
is installed. The function of this tool is copying data from xls file into GAMS
format. Using this tool to import xls data to GAMS is highly recommended.
• Error 56: Endogenous operands for * not allowed in linear models
1.7 Error Debugging in GAMS 23
The following error will be generated after compiling this code. In order to
find out why this error is happening we should double-check the model. The
solve statement is indicating that the model is LP but in eq2 we can see profit.p/
x.p/ x.p/. This means that the model is not LP and solve statement should be
modified as follows:
• Error 37:
Consider the following line in a GAMS code:
This line is not properly defined because the correct operator for stating the
equality is not used in equation environment. The only operators that can be used
are ‘=l=’ or ‘=e=’ or ‘=g=’. the correct format is as follows:
• Error 409:
Consider the following lines in a GAMS code:
Like other programming languages, there are different ways of modeling the
problem in GAMS. The so-called “best way” is yet to be discovered. Some
programming tips are given in this section as follows:
• GAMS compiler is not case sensitive. The lowercase letters and capital letters
are not distinguished. For example, P.t/ is the same as p.T/ or P.T/ or p.t/.
• Try to add explanations for your equations and symbols you define in your code.
Use * for commenting a line or $ontext $offtext for a block of comments.
• Choose the symbol names carefully and meaningfully. For example for the power
generated by power plants, P.g/ is a better choice than X.i/. You can define g as
the set of generating units and variable P as the generated power.
• Don’t get frightened by the errors once your code is compiled. The best thing to
see is the error flag. Sometimes although the model does not generate any error
flag (since you have obeyed the GAMS syntax) but it is not correctly modeling
the given problem.
• Keep in mind that the machine is always right so GAMS cannot go wrong.
Debugging is also a part of the coding process.
• Always check the GAMS output. The variables, model statistics, and solver
statistics should be checked to see if any flag is raised. If the output of GAMS
model is not what you expect then there should be something wrong with your
model (not the GAMS). Double-check the equations and see if the developed
model is actually what it is desired to be or not.
1.8 General Programming Remarks 25
• If you need to specify some limits for your variables then try to do it using .lo
or .up attributes. Although creating a new equation for modeling this constraint
is “legal”, however, it is totally “inappropriate”. For example, you need to state
that the minimum value of variable P.g/ is 1 then it can be easily done using
P.lo(g) = 1. Sometimes the variables should be limited using some tables of
parameters. For example, the minimum values of P.g/ are stored in a parameter
Pmin(g) then P.lo(g) = Pmin(g) will do the job. As far as no variable exists then
no equation is needed. If Pmin(g) is a variable, then the following line will be
appropriate for modeling this constraint.
eq(g) .. P(g)=g=Pmin(g);
It should be noted that eq is defined over the set g since the inequality should
be valid for every element belonging to the set g.
• Although GAMS is a robust programming language less number of variables and
equations are always welcome. Try to avoid unnecessary equations and variables.
Use filtering to omit unnecessary equations. For example, we need to define an
equation which calculates the power flow of a line connecting ‘bus’ to ‘node’
in DC power flow formulation. The following GAMS code might be the first
attempt to model it.
Eq(bus,node) .. Pij(bus,node)=e=(d(bus)-d(node))/data(bus,node,’x’);
Suppose the network has 186 lines and 118 buses. This kind of coding would
create two problems:
– The parameter data(bus, node,‘x’) is zero when bus and node are not
connected to each other. GAMS might generate a division by Zero error! It’s
not always easy to find and remove the cause of error.
– If you check the model you can see that this equation adds 13,924 single
equations to the model. You might ask yourself why? We were expecting to
have only 186 equations (or double that since flow in opposite direction should
also be calculated). It is almost 74 times bigger than what we were expecting
to have. This is because GAMS is considering every combination between
“bus” and “node” (118*118).
The better way to code this line is as follows:
Eq(bus,node)$branch(bus,node,’x’)..Pij(bus,node)=e=(d(bus)-
d(node))/data(bus,node,’x’);
26 1 Introduction to Programming in GAMS
In this way, the equation is filtered and is only valid for those lines which have
nonzero reactance values. It also reduces the computation time and the chance of
difficulties in finding a feasible/optimal solution.
• Don’t forget to put a semicolon (;) at the end of every line (sometimes it is not
necessary but if you have just started coding in GAMS, do it).
• Different solvers might use different approaches to solve the model. Try different
solver to find out which one is more successful/faster in finding a solution for
your problem.
• The default value for undefined elements of a table or parameter is zero. For
example, consider a parameter like Data(bus,node) representing the line reac-
tance; Suppose that we define Data(‘2’,‘4’)=0.5; If this parameter is displayed,
you can see that all elements are zero except Data(‘2’,‘4’). If you are a power
engineer, you know that the reactance between bus number 2 and bus number
4 should be the same as reactance between bus number 4 and bus number 2. In
other words, it should be symmetrical. Unfortunately (or fortunately) GAMS is
not a power system engineer and does not understand even a word from power
system or electrical engineering. GAMS only understands whatever it is told by
the user (code developer).
• Go to your GAMS model library and have a look at those developed codes. There
are loads of new things to learn even for experienced GAMS code developers.
The GAMS model library can be accessed through the interface as shown in
Fig. 1.7.
• Try to provide all of the variables appropriate upper and lower limits as well as
initial starting values. The initial values can be assigned to the variables using .l
expression (do it before solving statement). For example, voltage variables can
be assigned 1 per unit values as the initial starting values. This is a double-edged
sword. This is because providing a good starting value can highly improve the
solution procedure especially in nonlinear or mixed integer nonlinear models but
a poor starting value might slowdown the solver.
• It is very likely that you get an infeasible status for your model. Especially when
the model is large and includes a large number of variables. The following steps
might be helpful in resolving the problem:
– Check to see if you can better express your model. It is always desired to stay
as close as possible to the linear form of expressing the equations.
– Provide better initial values for your variables.
– Relax the variable limits, rerun the model. If the problem is resolved, then
it means that the variable limits should be revised. If your model contains
integer/binary variables, then you can solve the model using relaxed option.
For example, the MIP model can be solved using RMIP. This would ask the
GAMS to neglect integer nature of the variables (the variable limits remain
unchanged). For relaxing the MINLP and MIQCP, you should use RMINLP
and RMIQCP, respectively.
– Remove some equations or add some slack variables to the model to see if you
can find the trouble making equations
– Ask support from those experienced GAMS code developers (if they have
time and are willing to contribute to your project). This option is intentionally
placed at the end of suggestion list.
There is a set of good resources that can be accessed through the GAMS interface as
it is shown in Fig. 1.8. Additionally, some other useful tutorials are listed as follows:
• A GAMS tutorial [70]
• GAMS language guide [71]
• GAMS—Modeling and Solving Optimization Problems [72]
• GAMS and MATLAB interface [73–75]
• Grid-enabled optimization with GAMS [76]
• Practical financial optimization in GAMS [77]
transmission switching have been discussed in this chapter. The GAMS code
for solving each optimization problem is developed and discussed.
• Chapter 10 provides a solution for Energy System Integration (ESI) problem in
GAMS. The question which is answered in this chapter is how to harvest the
flexibilities in different energy sectors by coordinated operation of these sectors.
References
1. J.L.C. Meza, M.B. Yildirim, A.S.M. Masud, A model for the multiperiod multiobjective power
generation expansion problem. IEEE Trans. Power Syst. 22(2), 871–878 (2007)
2. S. Kannan, S. Baskar, J.D. McCalley, P. Murugan, Application of NSGA-II algorithm to
generation expansion planning. IEEE Trans. Power Syst. 24(1), 454–461 (2009)
3. R. Fang, D.J. Hill, A new strategy for transmission expansion in competitive electricity
markets. IEEE Trans. Power Syst. 18(1), 374–380 (2003)
4. R. Romero, A. Monticelli, A. Garcia, S. Haffner, Test systems and mathematical models for
transmission network expansion planning. IEE Proc. Gener. Transm. Distrib. 149(1), 27–36
(2002)
5. V. Miranda, J.V. Ranito, L.M. Proenca, Genetic algorithms in optimal multistage distribution
network planning. IEEE Trans. Power Syst. 9(4), 1927–1933 (1994)
6. S. Gerbex, R. Cherkaoui, A.J. Germond, Optimal location of multi-type facts devices in a
power system by means of genetic algorithms. IEEE Trans. Power Syst. 16(3), 537–544 (2001)
7. C. Wang, M.H. Nehrir, Analytical approaches for optimal placement of distributed generation
sources in power systems. IEEE Trans. Power Syst. 19(4), 2068–2076 (2004)
8. W. El-Khattam, K. Bhattacharya, Y. Hegazy, M.M.A. Salama, Optimal investment planning
for distributed generation in a competitive electricity market. IEEE Trans. Power Syst. 19(3),
1674–1684 (2004)
9. A. Keane, M. O’Malley, Optimal allocation of embedded generation on distribution networks.
IEEE Trans. Power Syst. 20(3), 1640–1646 (2005)
10. S. Sundhararajan, A. Pahwa, Optimal selection of capacitors for radial distribution systems
using a genetic algorithm. IEEE Trans. Power Syst. 9(3), 1499–1507 (1994)
11. B. Milosevic, M. Begovic, Nondominated sorting genetic algorithm for optimal phasor
measurement placement. IEEE Trans. Power Syst. 18(1), 69–75 (2003)
12. B. Gou, Generalized integer linear programming formulation for optimal PMU placement.
IEEE Trans. Power Syst. 23(3), 1099–1104 (2008)
13. Y.M. Atwa, E.F. El-Saadany, Optimal allocation of ESS in distribution systems with a high
penetration of wind energy. IEEE Trans. Power Syst. 25(4), 1815–1822 (2010)
14. H. Oh, Optimal planning to include storage devices in power systems. IEEE Trans. Power Syst.
26(3), 1118–1128 (2011)
15. P. Maghouli, A. Soroudi, A. Keane, Robust computational framework for mid-term techno-
economical assessment of energy storage. IET Gener. Transm. Distrib. 10(3), 822–831 (2016)
16. A. Soroudi, M. Afrasiab, Binary PSO-based dynamic multi-objective model for distributed
generation planning under uncertainty. IET Renew. Power Gener. 6(2), 67–78 (2012)
17. G. Blanco, F. Olsina, F. Garces, C. Rehtanz, Real option valuation of facts investments based
on the least square monte carlo method. IEEE Trans. Power Syst. 26(3), 1389–1398 (2011)
18. B. Chen, J. Wang, L. Wang, Y. He, Z. Wang, Robust optimization for transmission expansion
planning: minimax cost vs. minimax regret. IEEE Trans. Power Syst. 29(6), 3069–3077 (2014)
19. V. Miranda, M.A.C.C. Matos, Distribution system planning with fuzzy models and techniques,
in 10th International Conference on Electricity Distribution, 1989 (CIRED 1989), vol. 6,
Brighton (1989), pp. 472–476
30 1 Introduction to Programming in GAMS
20. S. Civanlar, J.J. Grainger, H. Yin, S.S.H. Lee, Distribution feeder reconfiguration for loss
reduction. IEEE Trans. Power Delivery 3(3), 1217–1223 (1988)
21. M. Carrion, J.M. Arroyo, A computationally efficient mixed-integer linear formulation for the
thermal unit commitment problem. IEEE Trans. Power Syst. 21(3), 1371–1378 (2006)
22. J.M. Arroyo, A.J. Conejo, Optimal response of a thermal unit to an electricity spot market.
IEEE Trans. Power Syst. 15(3), 1098–1104 (2000)
23. D.W. Ross, S. Kim, Dynamic economic dispatch of generation. IEEE Trans. Power Apparatus
Syst. PAS-99(6), 2060–2068 (1980)
24. Z.-L. Gaing, Particle swarm optimization to solving the economic dispatch considering the
generator constraints. IEEE Trans. Power Syst. 18(3), 1187–1195 (2003)
25. J. Endrenyi, S. Aboresheid, R.N. Allan, G.J. Anders, S. Asgarpoor, R. Billinton, N. Chowdhury,
E.N. Dialynas, M. Fipper, R.H. Fletcher, C. Grigg, J. McCalley, S. Meliopoulos, T.C. Mielnik,
P. Nitu, N. Rau, N.D. Reppen, L. Salvaderi, A. Schneider, C. Singh, The present status of
maintenance strategies and the impact of maintenance on reliability. IEEE Trans. Power Syst.
16(4), 638–646 (2001)
26. A.G. Bakirtzis, P.N. Biskas, A decentralized solution to the DC-OPF of interconnected power
systems. IEEE Trans. Power Syst. 18(3), 1007–1013 (2003)
27. R.D. Zimmerman, C.E. Murillo-Sanchez, R.J. Thomas, Matpower: steady-state operations,
planning, and analysis tools for power systems research and education. IEEE Trans. Power
Syst. 26(1), 12–19 (2011)
28. Y.M. Atwa, E.F. El-Saadany, M.M.A. Salama, R. Seethapathy, Optimal renewable resources
mix for distribution system energy loss minimization. IEEE Trans. Power Syst. 25(1), 360–
370 (2010)
29. K.R.C. Mamandur, R.D. Chenoweth, Optimal control of reactive power flow for improvements
in voltage profiles and for real power loss minimization. IEEE Trans. Power Apparatus Syst.
PAS-100(7), 3185–3194 (1981)
30. Y. Bai, H. Zhong, Q. Xia, C. Kang, A two-level approach to ac optimal transmission switching
with an accelerating technique. IEEE Trans. Power Syst. 32(2), 1616–1625 (2017)
31. N. Rotering, M. Ilic, Optimal charge control of plug-in hybrid electric vehicles in deregulated
electricity markets. IEEE Trans. Power Syst. 26(3), 1021–1029 (2011)
32. F. Wen, A.K. David, Optimal bidding strategies and modeling of imperfect information among
competitive generators. IEEE Trans. Power Syst. 16(1), 15–21 (2001)
33. A. Baillo, M. Ventosa, M. Rivier, A. Ramos, Optimal offering strategies for generation
companies operating in electricity spot markets. IEEE Trans. Power Syst. 19(2), 745–753
(2004)
34. H.B. Gooi, D.P. Mendes, K.R.W. Bell, D.S. Kirschen, Optimal scheduling of spinning reserve.
IEEE Trans. Power Syst. 14(4), 1485–1492 (1999)
35. K.A. Papadogiannis, N.D. Hatziargyriou, Optimal allocation of primary reserve services in
energy markets. IEEE Trans. Power Syst. 19(1), 652–659 (2004)
36. A. Soroudi, P. Siano, A. Keane, Optimal DR and ESS scheduling for distribution losses
payments minimization under electricity price uncertainty. IEEE Trans. Smart Grid 7(1), 261–
272 (2016)
37. S. Dutta, S.P. Singh, Optimal rescheduling of generators for congestion management based on
particle swarm optimization. IEEE Trans. Power Syst. 23(4), 1560–1569 (2008)
38. C. Murphy, A. Soroudi, A. Keane, Information gap decision theory-based congestion and
voltage management in the presence of uncertain wind power. IEEE Trans. Sust. Energy 7(2),
841–849 (2016)
39. B. Hayes, I. Hernando-Gil, A. Collin, G. Harrison, S. Djoki, Optimal power flow for
maximizing network benefits from demand-side management. IEEE Trans. Power Syst. 29(4),
1739–1747 (2014)
40. A.J. Conejo, J.M. Morales, L. Baringo, Real-time demand response model. IEEE Trans. Smart
Grid 1(3), 236–242 (2010)
41. A. Rabiee, A. Soroudi, A. Keane, Information gap decision theory based OPF with HVDC
connected wind farms. IEEE Trans. Power Syst. 30(6), 3396–3406 (2015)
References 31
42. A. Soroudi, A. Rabiee, A. Keane, Information gap decision theory approach to deal with wind
power uncertainty in unit commitment. Electr. Power Syst. Res. 145, 137–148 (2017)
43. A.J. Conejo, M. Carrión, J.M. Morales, Decision Making Under Uncertainty in Electricity
Markets, vol. 1 (Springer, New York, 2010)
44. E. Zio, The Monte Carlo Simulation Method for System Reliability and Risk Analysis (Springer,
London, 2013)
45. A. Soroudi, Possibilistic-scenario model for DG impact assessment on distribution networks
in an uncertain environment. IEEE Trans. Power Syst. 27(3), 1283–1293 (2012)
46. S. Granville, Optimal reactive dispatch through interior point methods. IEEE Trans. Power
Syst. 9(1), 136–146 (1994)
47. T. Ding, R. Bo, F. Li, H. Sun, A bi-level branch and bound method for economic dispatch with
disjoint prohibited zones considering network losses. IEEE Trans. Power Syst. 30(6), 2841–
2855 (2015)
48. S. Binato, M.V.F. Pereira, S. Granville, A new benders decomposition approach to solve power
transmission network design problems. IEEE Trans. Power Syst. 16(2), 235–240 (2001)
49. D.K. Molzahn, J.T. Holzer, B.C. Lesieutre, C.L. DeMarco, Implementation of a large-scale
optimal power flow solver based on semidefinite programming. IEEE Trans. Power Syst. 28(4),
3987–3998 (2013)
50. R.A. Jabr, Exploiting sparsity in SDP relaxations of the OPF problem. IEEE Trans. Power Syst.
27(2), 1138–1139 (2012)
51. T. Wu, M. Rothleder, Z. Alaywan, A.D. Papalexopoulos, Pricing energy and ancillary services
in integrated market systems by an optimal power flow. IEEE Trans. Power Syst. 19(1), 339–
347 (2004)
52. J.M. Arroyo, F.D. Galiana, On the solution of the bilevel programming formulation of the
terrorist threat problem. IEEE Trans. Power Syst. 20(2), 789–797 (2005)
53. D.I. Sun, B. Ashley, B. Brewer, A. Hughes, W.F. Tinney, Optimal power flow by Newton
approach. IEEE Trans. Power Apparatus Syst. PAS-103(10), 2864–2880 (1984)
54. F. Milano, Continuous Newton’s method for power flow analysis. IEEE Trans. Power Syst.
24(1), 50–57 (2009)
55. E.C. Finardi, E.L. da Silva, Solving the hydro unit commitment problem via dual decomposi-
tion and sequential quadratic programming. IEEE Trans. Power Syst. 21(2), 835–844 (2006)
56. I.P. Abril, J.A.G. Quintero, Var compensation by sequential quadratic programming. IEEE
Trans. Power Syst. 18(1), 36–41 (2003)
57. B. Enacheanu, B. Raison, R. Caire, O. Devaux, W. Bienia, N. HadjSaid, Radial network
reconfiguration using genetic algorithm based on the matroid theory. IEEE Trans. Power Syst.
23(1), 186–195 (2008)
58. P. Maghouli, S.H. Hosseini, M.O. Buygi, M. Shahidehpour, A scenario-based multi-objective
model for multi-stage transmission expansion planning. IEEE Trans. Power Syst. 26(1), 470–
478 (2011)
59. T. Amraee, A.M Ranjbar, R. Feuillet. Immune-based selection of pilot nodes for secondary
voltage control. Eur. Trans. Electr. Power 20(7), 938–951 (2010)
60. T. Satoh, K. Nara, Maintenance scheduling by using simulated annealing method [for power
plants]. IEEE Trans. Power Syst. 6(2), 850–857 (1991)
61. J.G. Vlachogiannis, K.Y. Lee. Quantum-inspired evolutionary algorithm for real and reactive
power dispatch. IEEE Trans. Power Syst. 23(4), 1627–1636 (2008)
62. C. Dai, W. Chen, Y. Zhu, X. Zhang, Seeker optimization algorithm for optimal reactive power
dispatch. IEEE Trans. Power Syst. 24(3), 1218–1231 (2009)
63. T. Amraee, Coordination of directional overcurrent relays using seeker algorithm. IEEE Trans.
Power Delivery 27(3), 1415–1422 (2012)
64. D.N. Vo, P. Schegner, W. Ongsakul, Cuckoo search algorithm for non-convex economic
dispatch. IET Gener. Transm. Distrib. 7(6), 645–654 (2013)
65. A.A. El-fergany, A.Y. Abdelaziz, Capacitor allocations in radial distribution networks using
cuckoo search algorithm. IET Gener. Transm. Distrib. 8(2), 223–232 (2014)
32 1 Introduction to Programming in GAMS
66. M. Barati, M.M. Farsangi, Solving unit commitment problem by a binary shuffled frog leaping
algorithm. IET Gener. Transm. Distrib. 8(6), 1050–1060 (2014)
67. R. Roche, L. Idoumghar, B. Blunier, A. Miraoui, Imperialist competitive algorithm for dynamic
optimization of economic dispatch in power systems, in International Conference on Artificial
Evolution (Evolution Artificielle) (Springer, Berlin, 2011), pp. 217–228
68. W.-M. Lin, F.-S. Cheng, M.-T. Tsay, An improved tabu search for economic dispatch with
multiple minima. IEEE Trans. Power Syst. 17(1), 108–112 (2002)
69. C.F. Chang, Reconfiguration and capacitor placement for loss reduction of distribution systems
by ant colony search algorithm. IEEE Trans. Power Syst. 23(4), 1747–1755 (2008)
70. R.E. Rosenthal, A GAMS tutorial. Technical note (1992)
71. A. Brooke, D. Kendrick, A. Meeraus, R. Raman, R.E. Rosenthal, Gams. A Users Guide (GAMS
Development Corporation, Washington, DC, 2005)
72. A. Geletu, Gams-Modeling and Solving Optimization Problems (TU-Ilmenau, Faculty of Math-
ematics and Natural Sciences, Department of Operation Research & Stochastrics, Ilmenau,
2008)
73. M.C. Ferris, Matlab and GAMS: interfacing optimization and visualization software. Mathe-
matical Programming Technical Report, 98:19 (1998)
74. L. Wong et al., Linking Matlab and Gams: A Supplement (University of Victoria, Department
of Economics, Victoria, BC, 2009)
75. M.C. Ferris, R. Jain, S. Dirkse, Gdxmrw: Interfacing GAMS and matlab (2011). http://www.
gams.com/dd/docs/tools/gdxmrw.pdf
76. M.R. Bussieck, M.C. Ferris, A. Meeraus, Grid-enabled optimization with GAMS. INFORMS
J. Comput. 21(3), 349–362 (2009)
77. S.S. Nielson, A. Consiglio, Practical Financial Optimization: A Library of GAMS Models
(Wiley, New York, 2010)
Chapter 2
Simple Examples in GAMS
The main concept that is developed in this chapter is explaining some optimization
categories that can be modeled in GAMS. These models include linear programming
(LP), mixed integer programming (MIP), nonlinear programming (NLP), quadratic
programming (QCP), mixed integer non-linear programming (MINLP), and multi-
objective optimization problems.
Understanding the materials presented and discussed in this chapter does not
require any background in power system studies. This makes it suitable for anybody
who might be interested to start optimization modeling in GAMS.
G.X; I/ 0 (2.1b)
H.X; I/ D 0 (2.1c)
where f is objective function, G and H are set of equality and inequality constraints,
respectively, I is the input data of the optimization problem, and X is the set of
decision variables that should not only satisfy G and H but also optimizes the
f value.
The linear programming problems are those that f , G, H are all linear in (2.1).
2.1.1.1 LP Example
x1 C 2x2 3 (2.2b)
x3 C x2 5 (2.2c)
x1 C x3 D 4 (2.2d)
v a r i a b l e s x1 , x2 , x3 , o f ;
Equations
eq1
eq2
eq3
eq4 ;
eq1 . . x1+2x2 =g = 3 ;
eq2 . . x3+x2 =g = 5 ;
eq3 . . x1+x3 =e = 4 ;
eq4 . . x1+3x2 +3x3=e=OF ;
model LP1 / a l l / ;
S o l v e LP1 US LP min o f ;
d i s p l a y x1 . l , x2 . l , x3 . l , o f . l ;
3 2
2 3
x1 0:333
6 x2 7 6 1:333 7
The optimal solution is 6 7 6 7
4 x3 5 D 4 3:667 5. Clicking on the model statistic tap
OF 15:333
shows that this model has four blocks of equations (four single equations). It has
also four variables (x1;2;3 ;OF). The solution report would be as follows:
SOLVESUMMARY
MODEL LP1 OBJECTIVE of
TYPE LP DIRECTION MINIMIZE
SOLVER CPLEX FROM LINE 12
**** SOLVER STATUS 1 Normal Completion
**** MODEL STATUS 1 Optimal
(continued)
2.1 Different Types of Optimization Models 35
It means that the solver has successfully solved the model and the solution is
globally optimal. The solver used for solving the model is CPLEX [1]. It states that
the value of objective function is 15.333. It also gives the user some info regarding
the computational burden needed for solving the problem. RESOURCE USAGE is
indicating how much time was needed to solve the model in seconds (0.016 s) and
what was the maximum time allowed to do so (1000 s). The number of iterations
needed for finding the optimal solution is two in this case. The default value for this
limit is 2,000,000,000.
Clicking on the SolEQU tab would show the following info regarding the model:
The lower limits of eq1,eq2 have some finite values (3,5) but their upper limits
are +1. This means that these two equations are of type. Equations eq3,eq4
have equal values for lower and upper limits. This means that these equations are
of equality type. The interesting part of the analysis is given in marginal column
(the last column). As it can be seen, the level values of eq1,eq2,eq3 are equal to
their lower limits. This has a certain meaning that these constraints are binding
constraints. This means that if the lower limits are changed then the objective
function value would change. The marginal values actually show the sensitivity
coefficients of objective function to these equations. Let’s check them in more
OF
detail. The marginal value of eq1 is 0.333. This means that RHS eq1
D 0:333.
The right-hand side of eq1 is 3 so if it is increased to 3.2 then RHS eq1 D
3:2 3 D 0:2. The marginal value indicates that the new objective function would
be 15:333 C 0:333 0:2 D 15:3996. If the GAMS model is solved using the new
RHS value of eq1 (3.2) then OF would be 15.4. The obtained value is close but not
exactly what we were expecting but why? This is because the marginal values are
accurate for very small change in RHS values of the equations. If the variations are
small enough then the approximation would be accurate enough.
The marginal values constitute the values of dual variables. The decision maker
can understand which constraint is binding (has nonzero marginal value) and also
shows the most influential constraint on objective function (the biggest marginal
value).
36 2 Simple Examples in GAMS
Clicking on the SolVAR tab would show the following info regarding the model:
The variable attributes are given in the table above. The lower and upper limits
of all variables are 1 and C1, respectively. The marginal values are zero (this
is because no bound is defined for variables). Suppose that we define a lower limit
for x2 which is 2 x2 . Let’s see the impact on marginal values of equations and
variables: The code would be as follows:
Variables x1,x2,x3,of;
Equations eq1,eq2,eq3,eq4;
eq1 .. x1+2*x2 =g=3;
eq2 .. x3+x2 =g=5;
eq3 .. x1+x3 =e=4;
eq4 .. x1+3*x2 +3*x3=e=OF;
Model LP1 /all/;
x2.lo=2;
Solve LP1 US LP min of;
display x1.l,x2.l,x3.l,of.l;
Clicking on the SolEQU tab would show the following info regarding the model:
This table shows that eq1 is no longer the binding equation. This means that
small change of RHS (which is 3 here) won’t change the objective function. The
marginal value of this equation is zero. The eq2 and eq3 are binding equations (they
have nonzero marginal values and also their level is equal to their lower value).
2.1 Different Types of Optimization Models 37
Clicking on the SolVAR tab would show the following info regarding the model:
The marginal values of all variables are zero except x2 which is 1. This means
that setting a lower limit for x2 caused this situation. Originally, the optimal value of
x2 was 1.333 and now the lower limit (which is set to be 2) stops it from reaching its
optimal value. Any possible decrease in x2 can help reducing the overall objective
function.
V a r i a b l e s x1 , x2 , x3 , o f ;
Equations
eq1 , eq2 , eq3 , eq4 ;
eq1 . . x1+2x2 = l = 3 ;
eq2 . . x3+x2 = l = 2 ;
eq3 . . x1+x2+x3 =e = 4 ;
eq4 . . x1+2x2 3x3=e=OF ;
Model LP1 / a l l / ;
x1 . l o = 0 ; x1 . up = 5 ; x2 . l o = 0 ; x2 . up = 3 ; x3 . l o = 0 ; x3 . up = 2 ;
S o l v e LP1 US LP max o f ;
d i s p l a y x1 . l , x2 . l , x3 . l , o f . l ;
S o l v e LP1 US LP min o f ;
d i s p l a y x1 . l , x2 . l , x3 . l , o f . l ;
Sometimes it is needed to find the maximum and minimum of the objective function
for a given model. This means that the problem should be solved two times. The
example given in (2.3) is describing such a situation.
x1 C 2x2 3 (2.3b)
x3 C x2 2 (2.3c)
x1 C x2 C x3 D 4 (2.3d)
38 2 Simple Examples in GAMS
0 x1 5 (2.3e)
0 x2 3 (2.3f)
0 x3 2 (2.3g)
Please pay special attention to (2.3e)–(2.3g). These three constraints can be easily
treated in GAMS using :lo and :up statements. In order to reduce the number of
equations in the model it should be avoided defining them as six extra equations.
The Gcode 2.2 for solving (2.3) is provided as follows:
2 3 2 3
x1 3
6 x2 7 607
The problem is solved and the solutions are obtained as 6 7 6 7
4 x3 5 D 415 and
OF 0 max
2 3 2 3
x1 2
6 x2 7 607
6 7 D 6 7 . The application of this model is in interval optimization [2],
4 x3 5 425
OF 4 min
fuzzy optimization [3], and DC power flow (which will be discussed in Chap. 6)
In mixed integer programming (MIP) problems, the decision maker is faced with
constraints and objective function that are linear but there exist some integer/binary
variables.
Variables x , of ;
Binary v a r i a b l e y ;
E q u a t i o n s eq1 , eq2 , eq3 ;
eq1 . . 3x+2y =g = 1 ;
eq2 . . 8x+10y = l = 1 0 ;
eq3 . . x+y=e=OF ;
Model MIP1 / a l l / ;
x . up = 0 . 3 ;
S o l v e MIP1 US MIP max o f ;
d i s p l a y y . l , x . l , of . l ;
2.1 Different Types of Optimization Models 39
max OF D x C y (2.4a)
x;y
3x C 2y 1 (2.4b)
8x C 10y 10 (2.4c)
y 2 f0; 1g ; 0:3 x (2.4d)
y is a binary variable and x is a real number. The GAMS code for solving (2.4) is
provided in GCode 2.3:
2 3
x
By running the GAMS code the optimal solution is found as follows: 4 y 5 D
OF
2 3
0:3
415
1:3 max
The N-queen problem is a classic MIP problem [4]. In this problem, it is tried to
maximize the number of queens that can sit on a chessboard without attacking
each other. The procedure is simple as follows: First of all, it is needed to define
a variable xij which is a binary variable (0/1) and states whether the queen should sit
(1) on block ij (row i, column j) or not (0). Additionally, if the queen is on block ij
then no other queen can sit on row i or column j or the diagonal that contains cell ij.
This is mathematically stated as follows:
X
max OF D xij (2.5a)
xij
i;j
X
xij 1 8j (2.5b)
i
X
xij 1 8i (2.5c)
j
X ˇ ˇ
ˇi rˇ
xc;r ˇ
1 8i; j 2 ˇ ˇD1 (2.5d)
c;r
j cˇ
If a queen is on a cell then no other queen can exist on the same column (2.5b) or the
same row (2.5c) or the same diagonal (2.5d). The GAMS code for solving N-queen
problem (2.5) is given in GCode 2.4:
The N-queen problem is solved two times in Gcode 2.4. Two models are defined
in this code namely MIP2a and MIP2b. The Queen placement is solved on a 4 4
board, Fig. 2.1a shows the wrong placement. This solution is obtained from MIP2a
40 2 Simple Examples in GAMS
and considers eq1;2;3 . This is because we are not considering diagonal movement of
queen. In order to overcome this shortcoming two additional constraints eq4;5 are
considered in Model MIP2b. The correct solution is depicted in Fig. 2.1b.
It should be noted that the solution for the defined problem is optimal but not
unique. This means that other configurations might be obtained that can satisfy the
defined constraints. The developed GCode 2.4 is general and can be used for solving
the problem for various sizes of the board. The optimal solution for queen placement
on a (a) 8 8 chessboard and (b) 16 16 board is shown in Fig. 2.2.
1 2 3 4 1 2 3 4
1 1
2 2
3 3
4 4
(a) (b)
Fig. 2.1 Queen placement on a 4 4 board: (a) wrong placement, (b) optimal placement
2.1 Different Types of Optimization Models 41
Consider six cities (1–6) which are located at different distances to each other. Each
city should have access to an emergency center within a short period of time. The
time required for moving from one city to another one is given in the following table
in minutes.
1 2 3 4 5 6
1 0 30 16 22 24 29
2 0 54 32 43 24
3 0 44 50 28
4 0 14 43
5 0 12
6 0
It should be noted that the values of this table are symmetrical. For example,
distance from city 1 to city 2 is 30 min. It means that the distance from city 2 to city
1 is also 30 min. The critical time for reaching to the emergency center is assumed
to be 20 min. The question is what is the minimum number of cities that should host
emergency center? Which cities should be chosen?
By observing the first row of distance matrix, it is understood that if city 1 or
city 6 have the emergency center then city 1 meets the access requirement. The
same concept applies for city 2. City 2 should definitely have an emergency center
because no other city is located within 20 min distance of this city. If the allocation
decision is defined as a binary variable xi then the following inequality should be
satisfied for city 1:
x1 C x6 1 (2.6)
42 2 Simple Examples in GAMS
x2 1 (2.7)
x1 C x6 1 (2.8)
x2 1 (2.9)
x3 C x5 1 (2.10)
x4 C x5 1 (2.11)
x3 C x4 C x5 C x6 1 (2.12)
x1 C x5 C x6 1 (2.13)
Two different approaches will be presented here for modeling this problem.
Scalar equations:
In this approach, we initially analyzed the distance data and understood what kind
of relations should be enforced for different variables. The GCode 2.5 is describing
how to do this.
b i n a r y v a r i a b l e x1 , x2 , x3 , x4 , x5 , x6 ;
v a r i a b l e OF ;
equations
eq1 , eq2 , eq3 , eq4 , eq5 , eq6 , eq7 ;
eq1 . . x1+x6 =g = 1 ;
eq2 . . x2 =g = 1 ;
eq3 . . x3+x5 =g = 1 ;
eq4 . . x4+x5 =g = 1 ;
eq5 . . x3+x4+x5+x6 =g = 1 ;
eq6 . . x1+x5+x6 =g = 1 ;
eq7 . . x1+x2+x3+x4+x5+x6 =e=OF ;
Model e m e r g e n c y / a l l / ;
S o l v e e m e r g e n c y u s mip min o f ;
The optimal answer is OF = 3 (three cities should host emergency centers). The
candidate cities are x1 ; x2 ; x5 . The problem with this kind of modeling is that it needs
pre-processing of the raw data and also in case, the number of cities are changed then
it is need to extensively modify the code. A much more efficient way of coding this
problem is using the extended equations.
Indexed equations:
2.1 Different Types of Optimization Models 43
set c i t y /16/ ;
a l i a s ( c i t y , town ) ;
binary variable x( city ) ;
v a r i a b l e OF ;
t a b l e d a t a ( c i t y , town )
1 2 3 4 5 6
1 0 30 46 22 24 19
2 0 54 32 43 24
3 0 44 16 28
4 0 14 43
5 0 12
6 0;
d a t a ( c i t y , town ) $ d a t a ( town , c i t y ) = d a t a ( town , c i t y ) ;
scalar criticaltime /20/;
Equations
eq1 , eq2 ;
eq1 ( c i t y ) . . sum ( town$ ( d a t a ( c i t y , town )< c r i t i c a l t i m e ) , x ( town ) ) =g
=1;
eq2 . . OF=e=sum ( c i t y , x ( c i t y ) ) ;
Model e m e r g e n c y / a l l / ;
S o l v e e m e r g e n c y u s mip min o f ;
The developed code will provide the same answer as before but it has the following
features:
• It is not needed to manually write one equation for each constraint.
• It works for any number of cities.
• The distance data is fed to the model using a table. This will be useful for cases
that the input data might change.
• Debugging and tracing the code are much easier for the users.
• The code does not change if the critical access time is updated.
The following line of the code is to make the data matrix symmetrical.
data(city,town)$data(town,city)=data(town,city);
The following line describes the condition for accessing the emergency center
(for each city). The equation eq1 is defined over the set “city.”
—- VAR x
LOWER LEVEL UPPER MARGINAL
1 . . 1.000 1.000
2 . 1.000 1.000 1.000
3 . . 1.000 1.000
4 . . 1.000 1.000
5 . 1.000 1.000 1.000
6 . 1.000 1.000 1.000
x1 x2 x3 x4 20 (2.14b)
x12 C x22 C x32 C x42 D 30 (2.14c)
1 x1 ; x2 ; x3 ; x4 3 (2.14d)
The GAMS code for solving example (2.14) is given in GCode 2.7:
v a r i a b l e of , x1 , x2 , x3 , x4 ;
equations
eq1 , eq2 , eq3 ;
eq1 . . x1x4 ( x1+x2+x3 ) + x2=e=OF ;
eq2 . . x1x2x3x4 =g = 2 0 ;
eq3 . . x1x1+x2x2+x3x3+x4x4=e = 3 0 ;
x1 . l o = 1 ;
x1 . up = 3 ;
x2 . l o = 1 ;
x2 . up = 3 ;
x3 . l o = 1 ;
x3 . up = 3 ;
x4 . l o = 1 ;
x4 . up = 3 ;
Model NLP1 / a l l / ;
S o l v e NLP1 US NLP max o f ;
2.1 Different Types of Optimization Models 45
It is worth noting that providing a starting point for the variables can help the
GAMS in finding a better solution. Generally speaking, finding the optimal solution
of the model is not guaranteed in NLP problems. The initial values for variables are
set by “X.l=initial value” command before solve statement.
Suppose there are n circles with known radius values (Ri ). The question is: what
is the minimum surface of the table that these circles can be placed on it without
any overlapping. The concept of optimal circle placement on a given table is shown
in Fig. 2.3. The decision variables of this problem are table dimensions fw; hg and
center locations fxi ; yi g . The objective function is defined as the surface of the table
(OF D w h). The constraints are described as:
• Each circle should be completely on the table. This requires: Ri xi w Ri
and similarly Ri yi h Ri .
• For every two circles, no overlap should happen. This means that: .xi xj /2 C
.yi yj /2 .Ri C Rj /2
The circle placement problem is formulated as:
min OF D hw (2.15a)
xi ;yi ;w;h
Ri xi w Ri (2.15b)
Ri yi h Ri (2.15c)
.xi xj /2 C .yi yj /2 .Ri C Rj /2 (2.15d)
It is assumed that Ri are known in advance and they are treated as input data. It is
also assumed that there are six circles available. The GAMS code for solving circle
placement example (2.15) is as GCode 2.8:
46 2 Simple Examples in GAMS
As it is observable in GCode 2.8, the radius of circles are given as parameters. The
constraint given in (2.15b) is actually two constraints Ri xi and xi w Ri . The
first one should be treated using :lo statement and the second one should be modeled
using equations. This is because it involves two variables xi ; w which should be valid
for every member of set i. This is why the equation eq2 is defined over set i.
The optimal solution of circle placement on a table is given in Fig. 2.4.
14 w
13 PARAMETER report
12
X y R
11 . R=3.2
10 1 2.204 5.571 2.000
2 1.200 2.533 1.200
9 3 4.600 2.622 1.800
y axis
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
x axis
Suppose that we have some limited meters of wire fences (C) and are requested to
enclose an area (right triangle shape). Determine the dimensions of such a triangle.
Considering Fig. 2.5, the following optimization should be solved:
HB
max OF D (2.16a)
H;B 2
p
HCBC H 2 C B2 D C (2.16b)
where C is the length of the available wire fence. H and B are the height and base of
the triangle, respectively. The GCode 2.9 provides the solution for maximizing the
area of a triangle with constant circumference.
Positive variables h , b;
V a r i a b l e OF ;
S c a l a r C / 1 5 / ; h . up=C ; b . up=C ;
E q u a t i o n s eq1 , eq2 ;
eq1 . . h+b+ s q r t ( hh+bb ) = e=C ;
eq2 . . OF=e =0.5 hb ;
Model t r i a n g l e / a l l / ;
S o l v e t r i a n g l e u s n l p min o f ;
48 2 Simple Examples in GAMS
B
H
2.1.4 Quadratic Constrained Programming (QCP)
v a r i a b l e of , x1 , x2 ;
equations
eq1 , eq2 , eq3 ;
eq1 . . 3x1x1 10x1 +x2x23x2=e=OF ;
eq2 . . x1+x2x2 =g = 2 . 5 ;
eq3 . . 2x1+x2=e = 1 ;
Model QCP1 / a l l / ;
S o l v e QCP1 US QCP max o f ;
2.1 Different Types of Optimization Models 49
x12 C x2 5 (2.18b)
2x1 x2 1 (2.18c)
V a r i a b l e of , x1 , x2 ;
E q u a t i o n s eq1 , eq2 , eq3 ;
eq1 . . x1x1 10x1 +x2x23x2=e=OF ;
eq2 . . x1x1+x2 = l = 5 ;
eq3 . . 2x1x2=g = 1 ;
Model QCP1 / a l l / ;
S o l v e QCP1 US QCP min o f ;
The transportation problem is a classic example which has been modified for this
example. There are some suppliers (node i) and some demands (node j) which
should be supplied. The problem is to determine how much each supplier should
produce and how to transfer them to the demand points. The transportation costs
should be minimized.
The cost of transportation is assumed to be related to the square of quantity
transported from node i to node j . The transportation costs are proportional to
the square of product transported from i to j and the length of the rout. The
object is minimizing the total transportation costs and supplying all demand in
different nodes. The optimal transportation problem is depicted in Fig. 2.6. The cost
coefficient and maximum flow of each rout (Cij ), demand (Dj ), and capacity of each
producer are known.
sets
i / s 1s 3 /
j / D1D4 / ;
t a b l e C( i , j )
d1 d2 d3 d4
s1 0.0755 0.0655 0.0498 0.0585
s2 0.0276 0.0163 0.096 0.0224
s3 0.068 0.0119 0.034 0.0751;
table data ( i ,)
’ Pmin ’ ’ Pmax ’
s 1 100 450
2.1 Different Types of Optimization Models 51
s 2 50 350
s 3 30 500;
p a r a m e t e r demand ( j )
/ d1 217
d2 150
d3 145
d4 2 4 4 / ;
v a r i a b l e of , x ( i , j ) , P ( i ) ;
b i n a r y v a r i a b l e U( i ) ;
equations
eq1 , eq2 , eq3 , eq4 , eq5 ;
eq1 . . OF=e=sum ( ( i , j ) , C ( i , j ) x ( i , j ) x ( i , j ) ) ;
eq2 ( i ) . . P ( i ) = l = d a t a ( i , ’ Pmax ’ )U( i ) ;
eq3 ( i ) . . P ( i ) = g= d a t a ( i , ’ Pmin ’ )U( i ) ;
eq4 ( j ) . . sum ( i , x ( i , j ) ) = g=demand ( j ) ;
eq5 ( i ) . . sum ( j , x ( i , j ) ) = e=P ( i ) ;
P . lo ( i )=0;
P . up ( i ) = d a t a ( i , ’ Pmax ’ ) ;
x . lo ( i , j )=0;
x . up ( i , j ) = 1 0 0 ;
Model m i n l p 1 / a l l / ;
S o l v e m i n l p 1 US m i n l p min o f ;
Pmin
i Pmax
i j
i 100 450 0.0755 0.0655 0.0498 0.0585
50 350 0.0276 0.0163 0.096 0.0224
30 500 0.068 0.0119 0.034 0.0751
Dj 217 150 145 244
52 2 Simple Examples in GAMS
Pi Xij
199.245 55.443 14.255 48.601 80.946
282.494 100 57.282 25.212 100
274.261 61.557 78.463 71.187 63.054
The GAMS code for solving the example (2.20) is given in GCode 2.13.
The solution for example (2.20) obtained by GCode 2.13 is as follows:
Pi Xij
i 0 0 0 0 0
137.377 32.609 55.215 9.375 40.179
0 0 0 0 0
2.2 Random Numbers in GAMS 53
Random number generation in GAMS is a simple task. There are different built-in
probability density function that can be used for generating random numbers. Some
popular random number generators are listed as follows:
• Beta function
.˛ C ˇ/
.1 x/ˇ1 .x/˛1 (2.21)
.˛/ .ˇ/
sets
i / s 1s 3 /
j / D1D4 / ;
scalar k /1.8/;
t a b l e C( i , j )
d1 d2 d3 d4
s1 0.0755 0.0655 0.0498 0.0585
s2 0.0276 0.0163 0.096 0.0224
s3 0.068 0.0119 0.034 0.0751;
table data ( i ,)
’ Pmin ’ ’ Pmax ’
s 1 100 450
s 2 50 350
s 3 30 500;
p a r a m e t e r demand ( j )
/ d1 217
d2 150
d3 145
d4 2 4 4 / ;
v a r i a b l e of , x ( i , j ) , P ( i ) ;
b i n a r y v a r i a b l e U( i ) ;
54 2 Simple Examples in GAMS
equations
eq1 , eq2 , eq3 , eq4 , eq5 ;
eq1 . . OF=e=sum ( i , kP ( i )) sum ( ( i , j ) , C ( i , j ) x ( i , j ) x ( i , j ) ) ;
eq2 ( i ) . . P ( i ) = l = d a t a ( i , ’ Pmax ’ )U( i ) ;
eq3 ( i ) . . P ( i ) = g= d a t a ( i , ’ Pmin ’ )U( i ) ;
eq4 ( j ) . . sum ( i , x ( i , j ) ) = l =demand ( j ) ;
eq5 ( i ) . . sum ( j , x ( i , j ) ) = e=P ( i ) ;
P . lo ( i )=0;
P . up ( i ) = d a t a ( i , ’ Pmax ’ ) ;
x . lo ( i , j )=0;
x . up ( i , j ) = 1 0 0 ;
Model m i n l p 2 / a l l / ;
S o l v e m i n l p 2 US m i n l p max o f ;
where N is the total integer numbers in [a; b] interval. The format of this
function in GAMS is uniformint(a; b)
Circle area n
D (2.24)
Square area N
R2 n
2
D (2.25)
4R N
s c a l a r low / 0 / , High / 1 / , p i s t i m a t e ;
s e t c o u n t e r / c1c200 / ;
parameter report ( counter , ) ;
r e p o r t ( c o u n t e r , ’ x ’ ) = u n i f o r m (LOW, HIGH ) ;
r e p o r t ( c o u n t e r , ’ y ’ ) = u n i f o r m (LOW, HIGH ) ;
p i s t i m a t e =4sum ( c o u n t e r $ ( power ( r e p o r t ( c o u n t e r , ’ x ’ )
0 . 5 , 2 ) + power ( r e p o r t ( c o u n t e r , ’ y ’ ) 0 . 5 , 2 ) < = 0 . 2 5 ) , 1 ) / c a r d ( c o u n t e r ) ;
display report , pistimate ;
The random numbers can be used for calculating the integration problems. A simple
example is given as follows:
Z 1
ZD 1 xsin.20x/dx (2.26)
0
In order to calculate the area under the graph as it is shown in Fig. 2.8, the following
steps are followed:
• Set Counter = 1; n = 1;
• Generate a pair of random numbers .x; y/ where 0 X 1 and 0 Y 2.
• Check if y f .X/
• Set Counter = Counter + 1;
This procedure is repeated for max number of counter (N). For large values of N,
the Z can be calculated using the following relation:
Z n
D (2.27)
21 N
The following command should be added to the code (before calling the uniform
function) in order to have a set of new random numbers every time the code is run:
56 2 Simple Examples in GAMS
1.8
1.6
1.4
Y=1+xCos(20x)
1.2
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1
X
Scalar Zstimate ;
S e t c o u n t e r / c1c200000 / ;
parameter report ( counter , ) ;
r e p o r t ( c o u n t e r , ’ x ’ )= uniform ( 0 , 1 ) ;
r e p o r t ( c o u n t e r , ’ y ’ )= uniform ( 0 , 2 ) ;
Z s t i m a t e =2sum ( c o u n t e r $ ( r e p o r t ( c o u n t e r , ’ y ’ )<1+
r e p o r t ( c o u n t e r , ’ x ’ ) s i n ( r e p o r t ( c o u n t e r , ’ x ’ ) 2 0 ) ) , 1 ) / c a r d ( c o u n t e r ) ;
Sisplay report , Zstimate ;
execseed = 1+gmillisec(jnow);
Further info on how to use random numbers in GAMS can be found in [5].
x1 C x2 a (2.29)
2.2 Random Numbers in GAMS 57
Fig. 2.9 The probability density function for each uncertain parameter
x1 C 2x2 b (2.30)
4x1 C 3x2 c (2.31)
x1 0 (2.32)
x2 0 (2.33)
where a, b, and c are uncertain random parameters. The probability density function
for each parameter is given in Fig. 2.9. The question is how to describe the prob-
ability density of Z? If all uncertain parameters (a,b,c) are equal to their expected
values (10,15,25) then the objective function would be 7750. The following steps
are followed to find out the distribution of Z in case of uncertain (a,b,c):
• Set Counter = 1;
• Generate a sample of random parameters (a,b,c) using the specified probability
distribution functions
• Calculate the optimal Z and save the (a,b,c,x1 ,x2 ,Z).
The variation of Z along with the average value of Z are plotted in Fig. 2.10. The
graph shows how the average value of Z converges.
58 2 Simple Examples in GAMS
Some methods try to convert the multi-objective optimization problems into single
objective one. However, this approach is not always applicable especially in the
following cases:
• The objectives are not of the same type. For example voltage deviation and cost,
weight and volume, surface and time.
• The weight coefficients in weighted sum approach cannot be easily determined.
Additionally, If decision maker’s preference is changed then the problem should
be solved again.
• The single objective approach provides just one solution to the decision maker.
It cannot show the tradeoff between two objective functions.
• The objective function is of the same type but there are multiple decision makers
with different preferences. Each decision maker is trying to optimize its own
objective function.
The notion of optimality has been redefined in this context and instead of aiming to
find a single solution, it is tried to produce a set of acceptable compromises or trade-
offs from which the decision maker can choose one. The set of all optimal solutions
which are non-dominated by any other solution is known as Pareto-optimal set.
Suppose a minimizing problem with two objectives in conflict the Pareto optimal
fronts are plotted in Fig. 2.11.
For every two solution in each Pareto front (like A, B) none of them is better
than the others considering all objective functions. Here, f1 is better minimized in
solution A compared to B and f2 is better minimized in solution B compared to A.
2.3 Multi-Objective Optimization 59
The same concept also applies for solutions in other fronts. For every solution in
Pareto front k (for example D in the second front) there exists at least one solution
in front k 1 (here A in the first front) that dominates it (is better considering
all objective functions). Since solutions A and B belong to the first front, there is
no solution better than them in respect to all objectives. Consider the bi-objective
optimization described in (2.34):
minx f1 ; f2 (2.34)
Constraints
This means that for every solution Xi belonging to Pareto front S, at least one
solution exists as Xj which is better than Xi at least in one objective function
(named n here). In other words, there is no solution in Pareto optimal front which
is the best among all members of this set considering all objectives.
2. For every solution belonging to an upper Pareto front and the ones in the lower
fronts, (2.36) holds:
This means for every solution belonging to an upper Pareto front, there exists
at least one solution in a lower Pareto front which is not worse in any objective
function and is better in at least one objective function. NO is the number of
objective functions.
The classic approach for finding the Pareto optimal set is preference-based method
in which a relative preference vector is used to weight the objectives and change
them into a scalar value. By converting a multi-objective optimization problem into
a single objective one, only one optimum solution can be achieved which is very
sensitive to the given weights. The GAMS structure can solve only one objective
function at once. This means it is needed to solve the multi-objective problem
several times to obtain the Pareto optimal front. For this purpose, consider the bi-
objective problem described in (2.38):
s e t c o u n t e r / c1c21 / ;
scalar E;
parameter report ( counter ,) ;
v a r i a b l e of1 , of2 , x1 , x2 ;
equations
eq1 , eq2 , eq3 , eq4 ;
eq1 . . o f 1 =e =4x1 0.5 x2x2 ;
eq2 . . o f 2 =e=x1x1+5x2 ;
eq3 . . 2x1+3x2= l = 1 0 ;
eq4 . . 2x1x2=g = 0 ;
x1 . l o = 1 ;
x1 . up = 2 ;
x2 . l o = 1 ;
x2 . up = 3 ;
Model p a r e t o 1 / a l l / ;
parameter ranges () ;
S o l v e p a r e t o 1 US nLP max o f 1 ;
r a n g e s ( ’ OF1max ’ ) = o f 1 . l ;
r a n g e s ( ’ OF2min ’ ) = o f 2 . l ;
S o l v e p a r e t o 1 US nLP max o f 2 ;
r a n g e s ( ’ OF2max ’ ) = o f 2 . l ;
r a n g e s ( ’ OF1min ’ ) = o f 1 . l ;
2.3 Multi-Objective Optimization 61
E= r a n g e s ( ’ OF1min ’ ) ;
loop ( counter ,
E= ( r a n g e s ( ’ OF2max ’ )r a n g e s ( ’ OF2min ’ ) ) ( o r d ( c o u n t e r ) 1) / ( c a r d
( c o u n t e r ) 1)+ r a n g e s ( ’ OF2min ’ ) ;
o f 2 . l o =E ;
S o l v e p a r e t o 1 US nLP max o f 1 ;
r e p o r t ( c o u n t e r , ’OF1 ’ ) =OF1 . l ;
r e p o r t ( c o u n t e r , ’OF2 ’ ) =OF2 . l ;
r e p o r t ( c o u n t e r , ’E ’ ) =E ;
);
Display report ;
f2 (2.39)
The value will be varied from f2min to f2max and the f1 is maximized.
The solution for example (2.38) obtained by GCode 2.16 is shown in Fig. 2.12.
10
OFmax
2
6
OF2
2
OFmin
2
0 OFmin
1 OFmax
1
-2
2 3 4 5 6 7
OF1
2.4 Applications
Some optimization models used in power system studies are given in this section:
• LP programming: Transmission network estimation [6], short-term hydro
scheduling [7], relay coordination [8], security constrained economic
dispatch [9].
• MIP: Optimal PMU placement [10], unit commitment [11], Phase shifter place-
ment in large-scale systems [12], minimum-losses radial configuration of electri-
cal distribution networks [13].
• QCP: Topology identification in distribution network [14], optimum active and
reactive generation dispatch [15].
• NLP: Voltage stability security margin calculation [16], reactive power planning
[17], OPF [18].
• MINLP: Unit commitment with AC OPF constraints [19], flexible transmission
expansion planning with uncertainties in an electricity market [20], optimal DG
allocation [21].
• Multi-objective optimization: Transmission expansion planning [22], generation
expansion planning [23], distribution network planning [24].
References
12. F.G.M. Lima, F.D. Galiana, I. Kockar, J. Munoz, Phase shifter placement in large-scale systems
via mixed integer linear programming. IEEE Trans. Power Syst. 18(3), 1029–1034 (2003)
13. A. Borghetti, A mixed-integer linear programming approach for the computation of the
minimum-losses radial configuration of electrical distribution networks. IEEE Trans. Power
Syst. 27(3), 1264–1273 (2012)
14. Z. Tian, W. Wu, B. Zhang, A mixed integer quadratic programming model for topology
identification in distribution network. IEEE Trans. Power Syst. 31(1), 823–824 (2016)
15. H. Nicholson, M.J.H. Sterling, Optimum dispatch of active and reactive generation by
quadratic programming. IEEE Trans. Power Apparatus Syst. PAS-92(2), 644–654 (1973)
16. L.A.L. Zarate, C.A. Castro, J.L.M. Ramos, E.R. Ramos, Fast computation of voltage stability
security margins using nonlinear programming techniques. IEEE Trans. Power Syst. 21(1),
19–27 (2006)
17. L.L. Lai, J.T. Ma, Application of evolutionary programming to reactive power planning-
comparison with nonlinear programming approach. IEEE Trans. Power Syst. 12(1), 198–206
(1997)
18. J.A. Momoh, R. Adapa, M.E. El-Hawary, A review of selected optimal power flow literature
to 1993. I. nonlinear and quadratic programming approaches. IEEE Trans. Power Syst. 14(1),
96–104 (1999)
19. A. Castillo, C. Laird, C.A. Silva-Monroy, J.P. Watson, R.P. ONeill, The unit commitment
problem with ac optimal power flow constraints. IEEE Trans. Power Syst. 31(6), 4853–4866
(2016)
20. J.H. Zhao, Z.Y. Dong, P. Lindsay, K.P. Wong, Flexible transmission expansion planning with
uncertainties in an electricity market. IEEE Trans. Power Syst. 24(1), 479–488 (2009)
21. A. Kumar, W. Gao, Optimal distributed generation location using mixed integer non-linear
programming in hybrid electricity markets. IET Gener. Transm. Distrib. 4(2), 281–298 (2010)
22. P. Maghouli, S.H. Hosseini, M.O. Buygi, M. Shahidehpour, A scenario-based multi-objective
model for multi-stage transmission expansion planning. IEEE Trans. Power Syst. 26(1),
470–478 (2011)
23. S. Kannan, S. Baskar, J.D. McCalley, P. Murugan, Application of NSGA-II algorithm to
generation expansion planning. IEEE Trans. Power Syst. 24(1), 454–461 (2009)
24. V. Miranda, J.V. Ranito, L.M. Proenca. Genetic algorithms in optimal multistage distribution
network planning. IEEE Trans. Power Syst. 9(4), 1927–1933 (1994)
Chapter 3
Power Plant Dispatching
This chapter provides the instruction on how to model the economic dispatch
problem of different power plants. Different power plant technologies will be
discussed, such as thermal power, wind turbine, CHP, and hydro power plants in
GAMS.
The idea of dispatching generating units is based on some assumptions as
follows:
• The technical characteristics of the units are known.
• The on/off status of each unit is known.
• It is solved for a single snapshot of the demand.
The thermal unit technology transforms the fuel-based source of energy into
electricity. The production costs of thermal unit i are calculated as:
th th 2
Cith .Pth th th th
i / D ai .P /i C bi Pi C ci i 2 ˝th (3.1)
where ath th th
i , bi , and ci are the fuel cost coefficients of the thermal unit i. The total
fuel cost is calculated as follows:
X
TC D Cith .Pth
i / (3.2)
i2˝th
Table 3.1 The economic dispatch data for five thermal units example
ath
i bth
i
dith eth
i
i ($=MW2 ) ($=MW) cth
i ($) (kg=MW2 ) (kg=MW) fith .kg/ Pth;min
i (MW) Pth;max
i (MW)
g1 3 20 100 2 5 3 28 206
g2 4.05 18.07 98.87 3.82 4.24 6.09 90 284
g3 4.05 15.55 104.26 5.01 2.15 5.69 68.00 189.00
g4 3.99 19.21 107.21 1.10 3.99 6.20 76.00 266.00
g5 3.88 26.18 95.31 3.55 6.88 5.57 19.00 53.00
th;max=min
where Pi are the maximum/minimum power outputs of thermal unit i. The
overall thermal unit economic dispatch is formulated as follows:
X
min TC D Cith .Pth
i / (3.4a)
Pth
i i2˝th
th th 2
Cith .Pth th th th
i / D ai .Pi / C bi Pi C ci i 2 ˝th (3.4b)
Pith;min Pth
i Pith;max i 2 ˝th (3.4c)
X
Pth
i Le (3.4d)
i2˝th
The economic dispatch data for five units example is given in Table 3.1. This table
has nine columns. The first column is showing the generating unit index. The next
three columns indicate the cost coefficients for these thermal units (ath th th
i ; bi ; ci ).
The next three columns describe the emission coefficients for these thermal units
(dith ; eth th
i ; fi ). The last two columns give the minimum and maximum generating
limits of each unit if it is on.
The GAMS code for solving the economic dispatch example (3.4) is given in
GCode 3.1.
The solution obtained by Code provides information regarding the defined
variables. For example, the generating unit schedules are given in Table 3.2.
As it can be seen in Table 3.2, four attributes of variable P.gen/ are given. The
:lo and :up values are already known and are given as the input data in Table 3.1.
There are two important information regarding the variable P.gen/, namely :l and
:m. The level column shows the optimal values of variables obtained by GAMS. The
marginal value (:m) is zero (EPS or epsilon) for unit g1, g3, and g4. This is because
these generating units are not binding variables (not reached to their limits). On the
other hand, g2 has a marginal value equal to 110.005. This means that if the value
of this variable is increased by very small quantity (P.g2/) then the increase in
objective function will be approximately equal to 110:005P.g2/. This also holds
for generating unit g5. The increase of P.g5/ will approximately decrease the
objective function equal to 199:605P.g5/. This is why g2 is at its min limit and
g5 is at its max limit. The total operating costs would be OF D $1:3146 105 .
3.2 Thermal Unit Environmental Dispatch 67
GCode 3.1 Economic dispatch problem for five units, example (3.4)
s e t Gen / g1g5 / ;
s c a l a r load / 4 0 0 / ;
T a b l e d a t a ( Gen , )
a b c d e f Pmin Pmax
g1 3 20 100 2 5 3 28 206
g2 4 . 0 5 1 8 . 0 7 9 8 . 8 7 3 . 8 2 4.24 6 . 0 9 90 284
g3 4 . 0 5 1 5 . 5 5 1 0 4 . 2 6 5 . 0 1 2.15 5 . 6 9 68 189
g4 3 . 9 9 1 9 . 2 1 1 0 7 . 2 1 1 . 1 3.99 6 . 2 76 266
g5 3 . 8 8 2 6 . 1 8 9 5 . 3 1 3 . 5 5 6.88 5 . 5 7 19 53;
v a r i a b l e s P ( gen ) ,OF ;
equations
eq1 , eq2 ;
eq1 . . OF=e=sum ( gen , d a t a ( gen , ’ a ’ ) P ( gen ) P ( gen ) + d a t a ( gen , ’ b ’ ) P
( gen ) + d a t a ( gen , ’ c ’ ) ) ;
eq2 . . sum ( gen , P ( gen ) ) =g= l o a d ;
P . l o ( gen ) = d a t a ( gen , ’ Pmin ’ ) ;
P . up ( gen ) = d a t a ( gen , ’ Pmax ’ ) ;
model ECD / eq1 , eq2 / ;
s o l v e ECD u s qcp min o f ;
300
g1
P(gi) (MW) g2
200 g3
g4
g5
100
0
1 2 3 4 5 6 7 8 9 10 11
Iteration
× 105
10
OF ($/h)
0
300 400 500 600 700 800 900 1000
Load (MW)
Fig. 3.1 Load sensitivity analysis and impact on costs and generation schedules
and also their generation level. The production costs of ith thermal unit are usually
defined as:
th th 2
TEth th th th
i .Pi / D di .Pi / C ei Pi C fi
th
i 2 ˝th (3.5)
th
where dith , eth th
i , and fi are the fuel emission coefficients of the thermal unit i. TEi is
the total emission produced by thermal unit i and is expressed as (kg/h).
Different strategies have been proposed to take care of environmental issues in
dispatching the power plants, and some of them are listed below:
• Ignoring the environmental pollution and just minimizing the total fuel costs
(ED). Optimization problem described in (3.4) should be solved.
• Minimizing the total environmental pollution as the main objective function
(END). In this case, optimization problem described in (3.6) should be solved.
min TE (3.6a)
Pth
i
X
th 2
TC D ath th th th
i .Pi / C bi Pi C ci (3.6b)
i2˝th
X
2
TE D dith .Pth th th
i / C ei Pi C fi
th
(3.6c)
i2˝th
70 3 Power Plant Dispatching
The solution of (3.6) can be found in the first column of Table 3.4.
• Adding the environmental pollution is a penalty to the cost function (penalty).
For this strategy, the environmental pollution price (Ce ) should be known. In this
case, optimization problem described in (3.7) should be solved.
min OF D TC C Ce TE (3.7a)
Pth
i
X
th 2
TC D ath th th th
i .Pi / C bi Pi C ci (3.7b)
i2˝th
X
2
TE D dith .Pth th th
i / C ei Pi C fi
th
(3.7c)
i2˝th
The solution of (3.7) can be found in the second column of Table 3.4.
• Adding the environmental pollution as a constraint to the original economic
dispatch problem (Elimit). In this case, optimization problem described in (3.8)
should be solved.
min OF D TC (3.8a)
Pth
i
X
th 2
TC D ath th th th
i .Pi / C bi Pi C ci (3.8b)
i2˝th
X
2
TE D dith .Pth th th
i / C ei Pi C fi
th
(3.8c)
i2˝th
TE Elimit (3.8f)
The solution of (3.8) can be found in the third column of Table 3.4.
• Solving the dispatch problem as multi-objective problem. In this case, optimiza-
tion problem described in (3.9) should be solved.
3.2 Thermal Unit Environmental Dispatch 71
X
th 2
min TC D ath th th th
i .Pi / C bi Pi C ci (3.9a)
Pth
i i2˝th
X
2
min TE D dith .Pth th th
i / C ei Pi C fi
th
(3.9b)
Pth
i i2˝th
The ED, END, Penalty, and Limit strategies are solved using GCode 3.3. In this
code, you can find four solve statements.
• ED strategy: The first solve statement minimizes the total costs without any
concern about environmental issues.
• END strategy: The second solve statement minimizes the total environmental
pollution without any concern about economic issues.
• Penalty strategy: The third solve statement minimizes the total fuel costs +
environmental pollution costs.
• Limited Emission strategy: The fourth solve statement minimizes the total fuel
costs while environmental pollution is limited to some value.
Each solve statement obtains the optimal generating schedules in each strategy. A
parameter (report.gen; /) is defined which is updated after each solve statement.
The solution for different environmental dispatching strategies is given in
Table 3.4.
In some occasions, it is needed to solve the problem in a multi-objective way.
The multi-objective model is described in (3.9) and coded in GCode 3.4.
The Pareto optimal front in multi-objective environmental dispatch strategy for
load = 400 MW is depicted in Fig. 3.2. The operating schedules of different units in
solutions of Pareto optimal front are plotted in Fig. 3.3 for load = 400 MW.
The Pareto optimal front found in Fig. 3.2 depends on technical characteristics of
generating units in one hand and also on load value (D 400 MW). The question is
what happens if the load increases. How can we obtain the Pareto optimal front for
different values of loads? In order to obtain each Pareto optimal front, it is needed to
× 104
9.7
9.6
9.5
9.4
9.3
TE
9.2
9.1
8.9
8.8
8.7
1.3 1.32 1.34 1.36 1.38 1.4 1.42 1.44 1.46 1.48 1.5
TC ($) × 105
Fig. 3.2 Pareto optimal front in multi-objective environmental dispatch strategy for
load = 400 MW
130
g1
120 g2
g3
g4
110 g5
100
Generation level
90
80
70
60
50
40
1 2 3 4 5 6 7 8 9 10 11
Solution (from environmental friendly to economic)
Fig. 3.3 Changes in generating level of different units in Pareto optimal front for load = 400 MW
3.3 CHP Economic Dispatch 73
have a loop. The constraint method [1] is used to obtain the Pareto optimal front.
The GCode 3.5 finds the Pareto optimal fronts for different load values 400, 450,
500, and 550 MW. It uses nested loops to change the load value in upper level loop
and changes the epsilon value in lower level loop.
The Pareto optimal fronts for different load values are depicted in Fig. 3.4.
The combined heat and power (CHP) technology can generate heat and electric
power simultaneously. In CHP-related dispatch problems, we are usually faced with
different sources of energy to supply heat and power demand. These sources of
74 3 Power Plant Dispatching
GCode 3.5 Sensitivity analysis for load values in multi-objective environmental dispatch strategy
sets
Gen / g1g5 /
c o u n t e r / c1c11 /
L o a d c o u n t e r / Lc1Lc4 / ;
parameter r e p o r t ( Loadcounter ,) , rep ( Loadcounter , counter ,) ,
r e p 2 ( L o a d c o u n t e r , c o u n t e r , gen ) ;
scalars
load / 4 0 0 /
Eprice / 0 . 1 /
Elim ;
T a b l e d a t a ( Gen , )
a b c d e f Pmin Pmax
g1 3 20 100 2 5 3 28 206
g2 4 . 0 5 1 8 . 0 7 9 8 . 8 7 3 . 8 2 4.24 6 . 0 9 90 284
g3 4 . 0 5 1 5 . 5 5 1 0 4 . 2 6 5 . 0 1 2.15 5 . 6 9 68 189
g4 3 . 9 9 1 9 . 2 1 1 0 7 . 2 1 1 . 1 3.99 6 . 2 76 266
g5 3 . 8 8 2 6 . 1 8 9 5 . 3 1 3 . 5 5 6.88 5 . 5 7 19 53;
V a r i a b l e s P ( gen ) ,OF , TE , TC ;
Equations
eq1 , eq2 , eq3 ;
eq1 . . TC=e=sum ( gen , d a t a ( gen , ’ a ’ ) P ( gen ) P ( gen ) + d a t a ( gen , ’ b ’ ) P
( gen ) + d a t a ( gen , ’ c ’ ) ) ;
eq2 . . sum ( gen , P ( gen ) ) =g= l o a d ;
eq3 . . TE=e=sum ( gen , d a t a ( gen , ’ d ’ ) P ( gen ) P ( gen ) + d a t a ( gen , ’ e ’ ) P
( gen ) + d a t a ( gen , ’ f ’ ) ) ;
P . l o ( gen ) = d a t a ( gen , ’ Pmin ’ ) ;
P . up ( gen ) = d a t a ( gen , ’ Pmax ’ ) ;
Model END / eq1 , eq2 , eq3 / ;
Loop ( L o a d c o u n t e r ,
l o a d =350+ o r d ( L o a d c o u n t e r ) 50;
s o l v e END u s qcp min TC ;
r e p o r t ( L o a d c o u n t e r , ’maxTE ’ ) =TE . l ;
r e p o r t ( L o a d c o u n t e r , ’ minTC ’ ) =TC . l ;
S o l v e END u s qcp min t e ;
r e p o r t ( L o a d c o u n t e r , ’maxTC ’ ) =TC . l ;
r e p o r t ( L o a d c o u n t e r , ’ minTE ’ ) =TE . l ;
loop ( counter ,
Elim = ( r e p o r t ( L o a d c o u n t e r , ’maxTE ’ )
r e p o r t ( L o a d c o u n t e r , ’ minTE ’ ) ) ( ( o r d ( c o u n t e r ) 1) / ( c a r d ( c o u n t e r )
1) )
+ r e p o r t ( L o a d c o u n t e r , ’ minTE ’ ) ;
TE . up= Elim ;
s o l v e END u s qcp min TC ;
r e p ( L o a d c o u n t e r , c o u n t e r , ’TC ’ ) =TC . l ;
r e p ( L o a d c o u n t e r , c o u n t e r , ’TE ’ ) =TE . l ;
r e p 2 ( L o a d c o u n t e r , c o u n t e r , gen ) =P . l ( gen ) ;
);
TE . up= i n f ;
);
D i s p l a y rep , rep2 , r e p o r t ;
76 3 Power Plant Dispatching
× 105
1.9
Load =400 MW
1.8 Load =450 MW
Load =500 MW
1.7 Load =550 MW
1.6
1.5
1.4
TE
1.3
1.2
1.1
0.9
energy are usually thermal plants, CHP units, and heat only units. As described in
Sect. 3.1, the fuel cost of a thermal unit depends on its electricity generation level.
Similarly, the operating costs of CHP units depend on the level of heat and electricity
they generate. Additionally, CHP units have a feasible operating region that dictates
some limits for power and heat that they can generate. An approximate heat-power
operating region for a CHP unit is shown in Fig. 3.5 [2].
The CHP economic dispatch problem can be modeled as described in (3.10):
Qh;min
k qhk Qh;max
k k 2 ˝h (3.10f)
chp;min chp chp chp;max chp
Pj .qj / Pj Pj .qj / j 2 ˝chp (3.10g)
chp;min chp chp chp;max chp
Qj .Pj / qj Qj .Pj / j 2 ˝chp (3.10h)
X X chp
Pth
i C Pj Le (3.10i)
i2˝th j2˝chp
X X chp
qhk C qj Lh (3.10j)
k2˝h j2˝chp
The objective function defined in (3.10a) has three terms namely thermal unit
(F th ) [calculated in (3.10b)], heat only unit (F h ) [calculated in (3.10c)], and CHP
unit (F chp ) costs [calculated in (3.10d)]. The decision variables are electric power
chp
generation of thermal units (Pth i ) and CHP units Pj and also the heat generated
chp
by CHP units qj and heat only units qhk as described in (3.10a). The operating
limits of thermal units and heat only units are modeled in (3.10e) and (3.10f),
respectively as given in Table 3.5. Unlike the other technologies mentioned before,
the operating limits of CHP units are dependent on electricity and heat generation
level as described in (3.10g) and (3.10h) as described in Table 3.6. The electricity
and heat supply-demand balance are modeled in (3.10i) and (3.10j), respectively.
The electric and heat demands are assumed to be 605 MW and 540 MW,
respectively.
78 3 Power Plant Dispatching
T a b l e FR ( chp , )
Aq Ap Bq Bp Cq Cp Dq Dp
chp1 0 247 180 215 1 0 4 . 8 81 0 99
chp2 0 125 135 110 75 40 0 45;
The total operating costs are F th D 1:4068 105 ($/h), F h D 1:0418 105 ($/h),
chp
F =14,111.162 ($/h) (Table 3.7).
This section addresses the optimal operation of a hydro generating power plant. This
power plant comprises several cascaded plants along a river basin. The objective
is to minimize the total operating costs while considering different technical
constraints such as relationship between the generated power, water discharged, and
the head of the associated reservoir. The concept of cascaded hydro units is shown
in Fig. 3.6. The water balance equations that should be satisfied in each hour are as
follows:
h
2LtC1 D Lth C ItC1
h
RhtC1 StC1
h
(3.11)
80 3 Power Plant Dispatching
Xh O O
i
C RhtC1 O C StC1
h
O
h h
hO
h
Lmin Lth Lmax
h
; hO 2 up fhg (3.12)
Rht Rhmax ; Lth0 D h
Lini ; Lth24 D h
Lfin (3.13)
h
where Lth is reservoir volume, ItC1 is the water inflow, Rht is the released water,
and Sth is the spilled water at the end of period t in million m3 . Rmax is the maximum
released capacity per hour in million m3 . Lini
h h
; Lfin are the volume of the water in dam
at beginning and end of the considered horizon, respectively. This constraint means
that the volume of water in a reservoir of hydro turbine h in time t C 1 will be equal
to its value in the previous period plus the water inflow to its reservoir in time t C 1
minus its own released/spilled water and in time t C 1 plus the released/spilled water
of all reservoirs in its upstream in previous hours (with considering time delays hO ).
The concept of this cascade reservoir water balance constraint is depicted in Fig. 3.6.
The hydro power production function (HPF) (or hill chart [3]) which relates
the output power of hydro plant to the water level, inflow, and spillage is of great
importance in hydro plant scheduling. In this chapter, the method proposed in [4] has
been adopted which describes the relationship between the released water and water
head of the reservoir with the output power of the hydro power plant, as follows:
Pht D ch1 .Lth /2 C ch2 .Rht /2 C ch3 Rht Lth C ch4 Lth C ch5 Rht C ch6 (3.14)
3.4 Hydro Unit Economic Dispatch 81
Equation (3.14) states that the generated power in time t is nonlinearly related to the
water head (Lth ) and released water (Rht ) in time t simultaneously. The coefficients
ch1!6 are the characteristic factors of hydro turbine h which describe this relation.
Now we can solve a mixed hydro-thermal economic dispatch problem. Suppose we
have five thermal units which their techno-economic characteristics are described
in Table 3.8. Additionally, there are four cascaded hydro power units as shown
in Fig. 3.7 which their techno-economic characteristics are described in Table 3.9.
The loss coefficient is assumed to be 0.9 (means 10% of released/spilled water
vaporizes). The operating cost of hydro power plant is assumed to be constant
h D 14$=MW.
The hourly water inflows for each hydro power and hourly electric demand are
given in Table 3.10.
The hydro-thermal economic dispatch problem is formulated in (3.15).
82 3 Power Plant Dispatching
Table 3.10 Hourly water Time Ith1 Ith2 Ith3 Ith4 Le;t (MW)
inflows for each hydro power
and hourly electric demand t1 10 8 8.1 2.8 1275
t2 9 8 8.2 2.4 1326
t3 8 9 4 1.6 1190
t4 7 9 2 0 1105
t5 6 8 3 0 1139
t6 7 7 4 0 1360
t7 8 6 3 0 1615
t8 9 7 2 0 1717
t9 10 8 1 0 1853
t10 11 9 1 0 1836
t11 12 9 1 0 1870
t12 10 8 2 0 1955
t13 11 8 4 0 1887
t14 12 9 3 0 1751
t15 11 9 3 0 1717
t16 10 8 2 0 1802
t17 9 7 2 0 1785
t18 8 6 2 0 1904
t19 7 7 1 0 1819
t20 6 8 1 0 1785
t21 7 9 2 0 1547
t22 8 9 2 0 1462
t23 9 8 1 0 1445
t24 10 8 0 0 1360
!
X X
th 2
min OF D Pht
h C ath th th th
i .Pi;t / C bi Pi;t C ci (3.15a)
DV
t i
X O O
h
LtC1 D Lth C ItC1
h
RhtC1 StC1
h
C ŒRhtC1 O C StC1
h
O
(3.15b)
h h
hO
h
Lmin Lth h
Lmax ; hO 2 up fhg (3.15c)
Rhmin Rht Rhmax (3.15d)
3.4 Hydro Unit Economic Dispatch 83
Lth0 D Lini
h
; Lth24 D Lfin
h
(3.15e)
Pht D ch1 .Lth /2 C ch2 .Rht /2 C ch3 Rht Lth C ch4 Lth C ch5 Rht C ch6 (3.15f)
X X
Ph;t C Pth
i;t Le;t (3.15g)
h i
Pth th
i;t Pi;t1 RUi (3.15h)
Pth
i;t1 Pth
i;t RDi (3.15i)
The GCode 3.7 is developed to solve the hydro-thermal economic dispatch problem
described in (3.15). In this code, for saving the space, table demand and table inflow
are shown partially. The optimal hourly dispatch of hydro and thermal units are
given in Table 3.11.
t2 1326
t23 1445
t24 1360/;
T a b l e c h a r a c (H, )
Vmin Vmax V i n i V f i n Qmin Qmax Pmin Pmax
h1 80 150 100 120 5 15 0 500
h2 60 120 80 70 6 15 0 500
h3 100 240 170 170 10 30 0 500
h4 70 160 120 140 6 20 0 500;
V a r i a b l e s V(H, t ) ,R (H, t ) , S p i l l (H, t ) , OBJ , PH (H, t ) , c o s t T h e r m a l , p ( i ,
t);
p . up ( i , t ) = g e n d a t a ( i , ” u p p l i m ” ) ; p . l o ( i , t ) = g e n d a t a ( i , ” l o w l i m
”) ;
V . LO(H, t ) = c h a r a c (H, ’ Vmin ’ ) ; V . UP (H, t ) = c h a r a c (H, ’Vmax ’ ) ;
V . FX (H, ’ t 2 4 ’ ) = c h a r a c (H, ’ V f i n ’ ) ;
ph . l o (H, t ) = c h a r a c (H, ’ Pmin ’ ) ; ph . up (H, t ) = c h a r a c (H, ’ Pmax ’ ) ; ;
R . LO(H, t ) = c h a r a c (H, ’ Qmin ’ ) ; R . UP (H, t ) = c h a r a c (H, ’Qmax ’ ) ;
S p i l l . LO(H, t ) = 0 ;
Equations
W a t e r l e v e l , pcalc , Genconst3 , Genconst4 , c o s t T h e r m a l c a l c , balance ,
OFdef ;
c o s t T h e r m a l c a l c . . c o s t T h e r m a l =e=sum ( ( t , i ) , g e n d a t a ( i , ’ a ’ ) power
( p ( i , t ) , 2 ) + g e n d a t a ( i , ’ b ’ ) p ( i , t ) + g e n d a t a ( i , ’ c ’ ) ) ;
G e n c o n s t 3 ( i , t ) . . p ( i , t + 1 )p ( i , t ) = l = g e n d a t a ( i , ’RU ’ ) ;
G e n c o n s t 4 ( i , t ) . . p ( i , t 1)p ( i , t ) = l = g e n d a t a ( i , ’RD ’ ) ;
W a t e r l e v e l (H, t + 1 ) . . V(H, t + 1 ) =e= c h a r a c (H, ’ V i n i ’ ) $ ( o r d ( t ) = 1 ) +
V(H, t ) $ ( o r d ( t ) >1)+ i n f l o w ( t +1 ,H)R (H, t + 1 ) S p i l l (H, t + 1 ) +
0 . 9 sum ( H h a t $ u p s t r e a m (H, Hhat ) ,R ( Hhat , t d e l a y (H) ) + S p i l l ( Hhat , t
d e l a y (H) ) ) ;
p c a l c (H, t ) . . Ph (H, t ) =e= d a t a (H, ’ c1 ’ ) V(H, t ) V(H, t ) + d a t a (H, ’ c2 ’ )
R (H, t ) R (H, t )
+ d a t a (H, ’ c3 ’ ) V(H, t ) R(H, t )
+ d a t a (H, ’ c4 ’ ) V(H, t ) + d a t a (H, ’ c5 ’ ) R(H, t
) + d a t a (H, ’ c6 ’ ) ;
b a l a n c e ( t ) . . sum ( i , p ( i , t ) ) +sum (H, ph (H, t ) ) =g=demand ( t ) ;
OFdef . . OBJ=e= z e t a sum ( ( H, t ) , Ph (H, t ) ) + c o s t T h e r m a l ;
Model h y d r o / a l l / ;
S o l v e h y d r o u s n l p min OBJ ;
The thermal unit power schedules are shown in Fig. 3.8. The hydro unit power
schedules are shown in Fig. 3.9.
Different models and methodologies related to hydro power scheduling have
been addressed in the literature such as: Self-scheduling of a hydro producer in
a pool-based electricity market [3], dispatchability enhancement of variable Wind
Generation by coordination With Pumped-Storage Hydro Units [5], coordinated
wind-hydro bidding strategies in day-ahead markets [6], and self-scheduling of
hydro-thermal Genco in smart grids [7].
Table 3.11 Optimal hourly dispatch of hydro and thermal units
h1 h2 h3 h4 Thermal
Time P V R P V R P V R P V R p1 p2 p3 p4 p5
t1 128.50 150.00 15.00 112.78 120.00 15.00 60.60 234.97 13.74 285.88 160.00 20.00 100.00 207.24 240.00 60.00 80.00
t2 75.99 101.14 7.86 54.84 82.00 6.00 52.35 157.76 12.25 285.88 160.00 20.00 139.70 247.24 300.00 90.00 80.00
t3 49.59 104.14 5.00 56.64 85.00 6.00 50.55 149.76 12.00 285.88 160.00 20.00 100.00 222.90 284.44 60.00 80.00
t4 49.82 106.14 5.00 58.36 88.00 6.00 48.09 139.86 11.90 277.27 150.80 20.00 100.00 200.00 224.44 67.01 80.00
t5 49.93 107.14 5.00 59.47 90.00 6.00 35.43 100.09 11.13 268.03 141.51 20.00 100.00 240.00 209.13 97.01 80.00
t6 55.38 108.65 5.49 60.01 91.00 6.00 60.57 240.00 13.84 285.88 160.00 20.00 142.02 280.00 269.13 127.01 80.00
t7 94.17 106.49 10.16 65.31 90.15 6.85 60.60 233.25 13.71 285.88 160.00 20.00 202.02 320.00 300.00 157.01 130.00
3.4 Hydro Unit Economic Dispatch
t8 85.19 106.64 8.85 60.09 91.15 6.00 60.40 222.93 13.51 285.88 160.00 20.00 245.04 360.00 300.00 187.01 133.38
t9 87.32 107.53 9.11 62.63 92.92 6.23 59.85 211.60 13.29 285.88 160.00 20.00 285.12 400.00 300.00 217.01 155.19
t10 88.86 109.28 9.26 67.55 95.13 6.79 58.94 200.28 13.07 285.88 160.00 20.00 251.09 400.00 300.00 247.01 136.67
t11 91.06 111.80 9.48 72.11 96.76 7.37 57.73 189.40 12.86 285.88 160.00 20.00 250.08 400.00 300.00 277.01 136.12
t12 92.43 112.14 9.66 75.87 96.76 7.99 57.08 184.49 12.76 285.88 160.00 20.00 287.34 400.00 300.00 300.00 156.40
t13 98.80 112.52 10.61 82.83 95.33 9.43 56.37 179.63 12.67 285.88 160.00 20.00 229.52 400.00 300.00 300.00 133.60
t14 83.79 116.10 8.42 72.85 96.85 7.48 55.50 174.22 12.57 285.88 160.00 20.00 169.52 400.00 300.00 299.86 83.60
t15 93.21 117.50 9.60 81.81 96.78 9.07 54.66 169.44 12.47 285.88 160.00 20.00 121.44 400.00 300.00 300.00 80.00
t16 93.99 117.80 9.70 83.50 95.19 9.58 53.71 164.38 12.38 285.88 160.00 20.00 181.44 400.00 300.00 300.00 103.49
t17 90.66 117.54 9.26 82.68 92.46 9.73 52.84 160.05 12.29 285.88 160.00 20.00 182.36 400.00 300.00 300.00 90.59
t18 97.29 115.27 10.26 85.50 87.32 11.15 52.38 157.86 12.25 285.88 160.00 20.00 242.36 400.00 300.00 300.00 140.59
t19 93.39 112.49 9.79 83.90 82.78 11.53 50.84 150.95 12.12 285.88 160.00 20.00 199.31 400.00 300.00 297.20 108.49
t20 97.52 107.85 10.63 82.85 78.68 12.10 49.78 146.54 12.03 285.88 160.00 20.00 171.77 400.00 300.00 267.20 130.00
t21 50.17 109.85 5.00 72.91 78.10 9.58 49.07 143.68 11.97 285.88 160.00 20.00 111.77 360.00 300.00 237.20 80.00
t22 50.36 112.85 5.00 67.77 78.63 8.47 50.79 151.27 11.50 285.88 160.00 20.00 100.00 320.00 300.00 207.20 80.00
t23 62.56 115.73 6.13 79.29 74.75 11.88 52.22 160.81 10.73 276.84 150.35 20.00 100.00 316.90 300.00 177.20 80.00
t24 58.59 120.00 5.73 77.98 70.00 12.75 52.85 170.00 10.00 266.48 140.00 20.00 100.00 276.90 300.00 147.20 80.00
85
86 3 Power Plant Dispatching
P1
400
P2
P3
350 P4
Power of thermal units (MW)
P5
300
250
200
150
100
50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
300
250 P h1
P h2
Power of hydro unit (MW)
P h3
200
P h4
150
100
50
0
0 5 10 15 20 25
Time
Pmin
i pi;t Pmax
i (3.16b)
X X X
pww;t C Pi;t D Tieaa
t
a
C Le;t 8i; w 2 a; 8t (3.16c)
w i a
ˇ aa ˇ
t
N aa
ˇTie ˇ Tie (3.16d)
400
200
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
1
Wind ratio (t)
0.8
w1
w2
0.6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
0 pww;t w;t pw
N w (3.16e)
The wind and demand patterns in each area are shown in Fig. 3.11. The techno-
economic characteristics of thermal units and their connected area are given in
Table 3.12. The GCode 3.8 solves the multi-area economic dynamic dispatch
Example (3.16). Four sets are defined for time, area, thermal units, and wind
turbines, then it is indicated which thermal unit belongs to each area. The table wind
data describes the w;t in (3.16e). The wind capacities and their connected areas are
indicated next. Tie-line limits and thermal unit characteristics are defined next. It
3.5 Multi-Area Mix Unit Dynamic Dispatch 89
should be mentioned that some data of demand and wind tables in GCode 3.8 are
omitted to save space.
300
250
200
Inter-area power transfer (MW)
150
100
50
-50
-100
TieA1-2
-150 TieA1-3
TieA3-2
-200
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
3.6 Applications
Nomenclature
References
This chapter provides a solution for dynamic economic dispatch (DED) problem in
GAMS. DED refers to dispatch a set of units over a given operating horizon (usually
24 h). The on/off status of units is assumed to be known. Two paradigms of DED
are discussed and modeled, namely cost-based DED and price-based DED. Finally,
the linearized version of DED is provided.
The objective function of cost-based DED is minimizing the total operating costs
while satisfying the hourly demands and other technical constraints. The production
costs of g-th thermal unit is defined as:
where ag , bg , and cg are the fuel cost coefficients of the g-th unit. The total fuel cost
(TC) is calculated as follows:
X
TC D C.Pg;t / (4.2)
g;t
Pmin
g Pg;t Pmax
g (4.4)
Table 4.1 The dynamic economic dispatch data for four units example
g ag bg cg dg eg fg Pmin
g Pmax
g RUg RDg
($=MW2 ) ($=MW) ($) (kg=MW2 ) (kg=MW) .kg/ (MW) (MW) (MW) (MW)
g1 0.12 14.8 89 1.2 5 3 28 200 40 40
g2 0.17 16.57 83 2.3 4.24 6.09 20 290 30 30
g3 0.15 15.55 100 1.1 2.15 5.69 30 190 30 30
g4 0.19 16.21 70 1.1 3.99 6.2 20 260 50 50
max=min
where Pg are the maximum/minimum power outputs of g-th thermal unit. The
overall thermal unit cost-based dynamic economic dispatch is formulated as follows:
X
min TC D ag P2g;t C bg Pg;t C cg (4.5a)
Pg;t
g;t
X
EM D dg P2g;t C eg Pg;t C fg (4.5b)
g;t
Pmin
g Pg;t Pmax
g (4.5c)
Pg;t Pg;t1 RUg (4.5d)
Pg;t1 Pg;t RDg (4.5e)
X
Pg;t Lt (4.5f)
g
The economic dispatch data for four units example is given in Table 4.1. This
table has 11 columns. The first column is showing the generating unit index. The
next three columns indicate the cost coefficients for these thermal units (ag ; bg ; cg ).
The next three columns indicate the emission coefficients for these thermal units
(dg ; eg ; fg ). The next two columns give the minimum and maximum generating limits
of each unit if they are on. The last two columns indicate the ramp up/down rates of
thermal units.
The GAMS code for solving the example (4.5) is given in GCode 4.1.
t4 510
t5 515
t6 544
t7 646
t8 686
t9 741
t10 734
t11 748
t12 760
t13 754
t14 700
t15 686
t16 720
t17 714
t18 761
t19 727
t20 714
t21 618
t22 584
t23 578
t24 544/;
Variables OBJ Objective ( revenue )
costThermal Cost of thermal u n i t s
p( i , t ) Power g e n e r a t e d by t h e r m a l power
plant
EM Emission c a l c u l a t i o n ;
p . up ( i , t ) = g e n d a t a ( i , " Pmax " ) ;
p . l o ( i , t ) = g e n d a t a ( i , " Pmin " ) ;
E q u a t i o n s G e n c o n s t 3 , G e n c o n s t 4 , c o s t T h e r m a l c a l c , b a l a n c e , EMcalc ;
c o s t T h e r m a l c a l c . . c o s t T h e r m a l =e=sum ( ( t , i ) , g e n d a t a ( i , ’ a ’ ) power (
p( i , t ) ,2)
+ g e n d a t a ( i , ’ b ’ ) p ( i , t ) + g e n d a t a ( i , ’ c ’ ) ) ;
G e n c o n s t 3 ( i , t ) . . p ( i , t + 1 )p ( i , t ) = l = g e n d a t a ( i , ’RU0 ’ ) ;
G e n c o n s t 4 ( i , t ) . . p ( i , t 1)p ( i , t ) = l = g e n d a t a ( i , ’RD0 ’ ) ;
b a l a n c e ( t ) . . sum ( i , p ( i , t ) ) =g=demand ( t ) ;
EMcalc . . EM=e=sum ( ( t , i ) , g e n d a t a ( i , ’ d ’ ) power ( p ( i , t ) , 2 )
+ g e n d a t a ( i , ’ e ’ ) p ( i , t ) + g e n d a t a ( i , ’ f ’ ) ) ;
Model DEDcostbased / a l l / ;
The thermal unit power schedules obtained by GCode 4.1 are shown in Fig. 4.1.
The numerical values of dynamic economic dispatch solution for four units
example are given in Table 4.2. The total operating costs are TC D $6:4796 105 .
The total emissions are 3:5929 103 tons.
98 4 Dynamic Economic Dispatch
800
700
Demand (t)
600
500
400
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Generated power (MW)
200
150
100 P1 P2 P3 P4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 4.1 The hourly thermal unit power schedules in cost-based DED
In this section, the impact of ramp rates on optimal solution will be investigated.
For this reason, the ramp rates are gradually (in 2% steps) reduced to 60% of their
original values. The GAMS code for solving the ramp sensitivity example is given
in GCode 4.2.
GCode 4.2 The ramp rate sensitivity analysis of cost-based dynamic economic dispatch
Sets t / t1t24 / , i / p1p4 / ;
Table gendata ( i ,) g e n e r a t o r c o s t c h a r a c t e r i s t i c s and l i m i t s
a b c d e f Pmin Pmax RU0 RD0
p1 0 . 1 2 1 4 . 8 0 89 1 . 2 5 3 28 200 40 40
p2 0 . 1 7 1 6 . 5 7 83 2 . 3 4.24 6 . 0 9 20 290 30 30
p3 0 . 1 5 1 5 . 5 5 100 1 . 1 2.15 5 . 6 9 30 190 30 30
p4 0 . 1 9 1 6 . 2 1 70 1 . 1 3.99 6 . 2 20 260 50 50;
p a r a m e t e r demand ( t )
/ t1 510
t2 530
t3 516
t4 510
t5 515
t6 544
t7 646
t8 686
4.1 Cost-Based DED 99
t9 741
t10 734
t11 748
t12 760
t13 754
t14 700
t15 686
t16 720
t17 714
t18 761
t19 727
t20 714
t21 618
t22 584
t23 578
t24 544
/;
Variables OBJ Objective ( revenue )
costThermal Cost of thermal u n i t s
p( i , t ) Power g e n e r a t e d by t h e t h e r m a l
power p l a n t
EM Emission c a l c u l a t i o n ;
p . up ( i , t ) = g e n d a t a ( i , " Pmax " ) ;
p . l o ( i , t ) = g e n d a t a ( i , " Pmin " ) ;
E q u a t i o n s G e n c o n s t 3 , G e n c o n s t 4 , c o s t T h e r m a l c a l c , b a l a n c e , EMcalc ;
c o s t T h e r m a l c a l c . . c o s t T h e r m a l =e=sum ( ( t , i ) , g e n d a t a ( i , ’ a ’ ) power
( p ( i , t ) , 2 ) + g e n d a t a ( i , ’ b ’ ) p ( i , t ) + g e n d a t a ( i , ’ c ’ ) ) ;
G e n c o n s t 3 ( i , t ) . . p ( i , t + 1 )p ( i , t ) = l = g e n d a t a ( i , ’RU ’ ) ;
G e n c o n s t 4 ( i , t ) . . p ( i , t 1)p ( i , t ) = l = g e n d a t a ( i , ’RD ’ ) ;
b a l a n c e ( t ) . . sum ( i , p ( i , t ) ) =g=demand ( t ) ;
EMcalc . . EM=e=sum ( ( t , i ) , g e n d a t a ( i , ’ d ’ ) power ( p ( i , t ) , 2 ) + g e n d a t a
( i , ’ e ’ ) p ( i , t ) + g e n d a t a ( i , ’ f ’ ) ) ;
Model DEDcostbased / a l l / ;
Scalar Rscale / 1 / ;
s e t c o u n t e r / c1c21 / ;
parameter report1 ( counter ,) ;
loop ( counter ,
R s c a l e =1( o r d ( c o u n t e r ) 1) 0 . 0 2 ;
g e n d a t a ( i , ’RU ’ ) = g e n d a t a ( i , ’RU0 ’ ) R S c a l e ;
g e n d a t a ( i , ’RD ’ ) = g e n d a t a ( i , ’RD0 ’ ) R S c a l e ;
S o l v e DEDcostbased u s qcp min c o s t T h e r m a l ;
report1 ( counter , ’ Scale ’ )=Rscale ;
r e p o r t 1 ( c o u n t e r , ’TC ’ ) = c o s t T h e r m a l . l ;
r e p o r t 1 ( c o u n t e r , ’EM’ ) =EM. l ;
);
display report1 ;
e x e c u t e _ u n l o a d " DEDcostbased . gdx " r e p o r t 1
e x e c u t e ’ gdxxrw . e x e DEDcostbased . gdx p a r = r e p o r t 1 r n g = P t h e r m a l ! a1 ’
The sensitivity analysis of ramp rates on hourly thermal unit power schedules in
DED is shown in Fig. 4.2.
100 4 Dynamic Economic Dispatch
The numerical results for ramp rate sensitivity analysis in dynamic economic
dispatch of 4 units are given in Table 4.3. As it is seen in Fig. 4.2, the total costs will
increase by decreasing the ramp rates. The final total costs (40% reduction in ramp
rates) will be $649,226.53.
In this section, the decision maker needs to minimize the emissions and total
operating costs simultaneously.
X
minTC D ag P2g;t C bg Pg;t C cg (4.6a)
Pg;t
g;t
X
minEM D dg P2g;t C eg Pg;t C fg (4.6b)
Pg;t
g;t
4.1 Cost-Based DED 101
3595
3590
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
Ramp scale
× 105
6.495
Total costs ($)
6.49
6.485
6.48
Fig. 4.2 The sensitivity analysis of ramp rates on hourly thermal unit power schedules in DED
Pmin
g Pg;t Pmax
g (4.6c)
EM (4.7)
3. The value will be varied from EMmax to EMmin and then TC is minimized.
The Pareto optimal front for emission-cost minimization DED is shown in Fig. 4.3.
The numerical results for Pareto optimal solution are provided in Table 4.4. The
question is which solution of the Pareto optimal front should be chosen as the best
solution? Which one is the “most preferred” solution among those located on Pareto
optimal front of Fig. 4.3?. A fuzzy satisfying method [1] is used in this section
to find the “the best” solution. The principles of this method are as follows: for
each solution in the Pareto optimal front, Xc , a membership function is defined as
fk .Xc / . This value, which varies between 0 to 1, shows the success degree of Xc in
minimizing the objective function k. A linear membership function is used for both
objective functions, as follows:
8
<0 Otherwise
fk .Xc / D fkmax fk .Xc / (4.8)
: max min fkmin fk .Xc / fkmax
fk fk
× 106
3.55
3.5
Emission (kg)
3.45
3.4
3.35
3.3
Fig. 4.3 The Pareto optimal front for emission-cost minimization DED
t16 720
t17 714
t18 761
t19 727
t20 714
t21 618
t22 584
t23 578
t24 544/;
Variables OBJ , c o s t T h e r m a l , p ( i , t ) ,EM ;
p . up ( i , t ) = g e n d a t a ( i , " Pmax " ) ; p . l o ( i , t ) = g e n d a t a ( i , " Pmin " ) ;
E q u a t i o n s G e n c o n s t 3 , G e n c o n s t 4 , c o s t T h e r m a l c a l c , b a l a n c e , EMcalc ,
EMlim ;
c o s t T h e r m a l c a l c . . c o s t T h e r m a l =e=sum ( ( t , i ) , g e n d a t a ( i , ’ a ’ ) power
( p ( i , t ) , 2 ) + g e n d a t a ( i , ’ b ’ ) p ( i , t ) + g e n d a t a ( i , ’ c ’ ) ) ;
G e n c o n s t 3 ( i , t ) . . p ( i , t + 1 )p ( i , t ) = l = g e n d a t a ( i , ’RU0 ’ ) ;
G e n c o n s t 4 ( i , t ) . . p ( i , t 1)p ( i , t ) = l = g e n d a t a ( i , ’RD0 ’ ) ;
b a l a n c e ( t ) . . sum ( i , p ( i , t ) ) =e=demand ( t ) ;
EMcalc . . EM=e=sum ( ( t , i ) , g e n d a t a ( i , ’ d ’ ) power ( p ( i , t ) , 2 ) + g e n d a t a
( i , ’ e ’ ) p ( i , t ) + g e n d a t a ( i , ’ f ’ ) ) ;
EMlim . . EM = l = l i m ;
Model DEDcostbased / a l l / ;
parameter r e p o r t 1 ( counter ,) , rep () , r e p o r t 2 ( counter , i , t ) ;
S o l v e DEDcostbased u s qcp min c o s t T h e r m a l ;
r e p ( ’ TCmin ’ ) = c o s t T h e r m a l . l ;
r e p ( ’EMmax ’ ) =EM. l ;
S o l v e DEDcostbased u s qcp min EM;
r e p ( ’TCmax ’ ) = c o s t T h e r m a l . l ;
r e p ( ’EMmin ’ ) =EM. l ;
loop ( counter ,
l i m = r e p ( ’EMmax ’ ) + ( r e p ( ’EMmin ’ )r e p ( ’EMmax ’ ) ) ( o r d ( c o u n t e r ) 1) /
( c a r d ( c o u n t e r ) 1) ;
S o l v e DEDcostbased u s qcp min c o s t T h e r m a l ;
r e p o r t 1 ( counter , ’ Epsilon ’ )=lim ;
r e p o r t 1 ( c o u n t e r , ’TC ’ ) = c o s t T h e r m a l . l ;
r e p o r t 1 ( c o u n t e r , ’EM’ ) =EM. l ;
r e p o r t 2 ( c o u n t e r , i , t ) =P . l ( i , t ) ;
);
e x e c u t e _ u n l o a d " DEDcostbased . gdx " r e p o r t 1
e x e c u t e ’ gdxxrw . e x e DEDcostbased . gdx p a r = r e p o r t 1 r n g = r e p o r t ! a1 ’
e x e c u t e _ u n l o a d " DEDcostbased . gdx " r e p o r t 2
e x e c u t e ’ gdxxrw . e x e DEDcostbased . gdx p a r = r e p o r t 2 r n g = P t h e r m a l ! a1 ’
Considering the (4.9) and the values of Table 4.4, the best solution is c9. The
costs and emissions of this solution are $658,087.973 and 3:3459 103 tones,
respectively. The best compromised solution of Pareto optimal front for emission-
cost minimization DED is shown in Fig. 4.4.
4.1 Cost-Based DED 105
Table 4.4 The numerical results for Pareto optimal solutions (cost-based DED)
Solution TC ($) EM (kg) TC EM min.TC ; EM /
c1 3,592,886.799 647,964.460 3,592,886.799 1.000 0.000 0.000
c2 3,562,019.341 648,050.068 3,562,019.341 0.997 0.100 0.100
c3 3,531,151.883 648,328.132 3,531,151.883 0.989 0.200 0.200
c4 3,500,284.425 648,836.461 3,500,284.425 0.974 0.300 0.300
c5 3,469,416.967 649,627.557 3,469,416.967 0.951 0.400 0.400
c6 3,438,549.510 650,778.132 3,438,549.510 0.917 0.500 0.500
c7 3,407,682.052 652,408.206 3,407,682.052 0.869 0.600 0.600
c8 3,376,814.594 654,716.176 3,376,814.594 0.800 0.700 0.700
c9 3,345,947.136 658,087.973 3,345,947.136 0.701 0.800 0.701
c10 3,315,079.678 663,531.693 3,315,079.678 0.540 0.900 0.540
c11 3,284,212.220 681,788.377 3,284,212.220 0.000 1.000 0.000
220
P1
P2
200 P3
P4
Generated power (MW)
180
160
140
120
100
80
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 4.4 The best compromised solution of Pareto optimal front for emission-cost minimization
DED
In this section, the role of wind power generation in DED problem is investigated.
The integration of wind power generation in DED problem is formulated as follows:
X X
min TC D ag P2g;t C bg Pg;t C cg C VWC Pwc
t (4.10a)
DV
g;t t
106 4 Dynamic Economic Dispatch
˚
DV D Pg;t ; Pwt ; Pwc
t (4.10b)
Pmin
g Pg;t Pmax
g (4.10c)
Pg;t Pg;t1 RUg (4.10d)
Pg;t1 Pg;t RDg (4.10e)
X
Pwt C Pg;t Lt (4.10f)
g
Pwt C Pwc w
t
t (4.10g)
The GAMS code for solving the example (4.10) is given in GCode 4.4.
t a b l e g e n d a t a ( g , ) g e n e r a t o r c o s t c h a r a c t e r i s t i c s and l i m i t s
a b c d e f Pmin Pmax RU0 RD0
p1 0 . 1 2 1 4 . 8 0 89 1 . 2 5 3 28 200 40 40
p2 0 . 1 7 1 6 . 5 7 83 2 . 3 4.24 6 . 0 9 20 290 30 30
p3 0 . 1 5 1 5 . 5 5 100 1 . 1 2.15 5 . 6 9 30 190 30 30
p4 0 . 1 9 1 6 . 2 1 70 1 . 1 3.99 6 . 2 20 260 50 50;
table data ( t ,)
lambda l o a d wind
t1 3 2 . 7 1 510 4 4 . 1
t2 3 4 . 7 2 530 4 8 . 5
t3 3 2 . 7 1 516 6 5 . 7
t4 3 2 . 7 4 510 1 4 4 . 9
t5 3 2 . 9 6 515 2 0 2 . 3
t6 3 4 . 9 3 544 3 1 7 . 3
t7 44.9 646 3 6 4 . 4
t8 52 686 3 1 7 . 3
t9 5 3 . 0 3 741 271
t 1 0 4 7 . 2 6 734 3 0 6 . 9
t 1 1 4 4 . 0 7 748 4 2 4 . 1
t 1 2 3 8 . 6 3 760 398
t 1 3 3 9 . 9 1 754 4 8 7 . 6
t 1 4 3 9 . 4 5 700 5 2 1 . 9
t 1 5 4 1 . 1 4 686 5 4 1 . 3
t 1 6 3 9 . 2 3 720 560
t 1 7 5 2 . 1 2 714 4 8 6 . 8
t 1 8 4 0 . 8 5 761 3 7 2 . 6
t19 41.2 727 3 6 7 . 4
t 2 0 4 1 . 1 5 714 3 1 4 . 3
t 2 1 4 5 . 7 6 618 3 1 6 . 6
t 2 2 4 5 . 5 9 584 3 1 1 . 4
t 2 3 4 5 . 5 6 578 4 0 5 . 4
t 2 4 3 4 . 7 2 544 4 7 0 . 4 ;
Variables OBJ Objective ( revenue )
4.2 Price-Based DED 107
The total operating costs with wind integration are TC D $2:2692 105 as obtained
in GCode 4.4. The hourly schedules of thermal units in the wind-DED problem are
shown in Fig. 4.5. The hourly variation of total wind and thermal power generation
as well as the demand in wind-DED problem is depicted in Fig. 4.6.
This case is devoted to the case of price-based DED without arbitrage. This means
that the only sold commodity is energy. The problem is formulated in (4.11) as
follows:
108 4 Dynamic Economic Dispatch
160
g1
g2
140
g3
g4
120
100
(MW)
80
g,t
P
60
40
20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
800
Lt
700 P-thermal
Pw
t
600
500
(MW)
400
300
200
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 4.6 The hourly variation of total wind and thermal power generation in wind-DED problem
4.2 Price-Based DED 109
X
max OF D et Pg;t TC (4.11a)
Pg;t
g;t
X
TC D ag P2g;t C bg Pg;t C cg (4.11b)
g;t
X
EM D dg P2g;t C eg Pg;t C fg (4.11c)
g;t
Pmin
g Pg;t Pmax
g (4.11d)
Pg;t Pg;t1 RUg (4.11e)
Pg;t1 Pg;t RDg (4.11f)
X
Pg;t Lt (4.11g)
g;t
The objective function in (4.11a) models the benefits of Genco which is income
minus the total operating costs. et is the electricity price at time t in (4.11a). In this
formulation, we just calculate the total emission in (4.11c). Another difference of
price-based DED with cost-based DED is in Eq. (4.11g). As it can be observed in
this equation, the total power should be less than demand at any time. This means
that the maximum power that Genco can sell is limited to the demand at time t.
This case is devoted to the case of price-based DED without arbitrage. This means
that the only sold commodities are energy and spinning reserve. The problem is
formulated in (4.12) as follows:
X˚
max OF D et Pg;t C rt SRg;t TC (4.12a)
Pg;t
g;t
4.2 Price-Based DED 111
160
P1
P2
140 P3
P4
Generated power (MW)
120
100
80
60
40
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
X
TC D ag P2g;t C bg Pg;t C cg (4.12b)
g;t
X
EM D dg P2g;t C eg Pg;t C fg (4.12c)
g;t
Pmin
g Pg;t Pmax
g (4.12d)
Pg;t Pg;t1 RUg (4.12e)
Pg;t1 Pg;t RDg (4.12f)
0 SRg;t Pmax
g Pg;t (4.12g)
X
Pg;t Lt (4.12h)
g;t
In order to solve the PBDED problem formulated in (4.12), the energy prices (et )
and reserve prices (rt ) in (4.12a) are needed to be known. The problem is usually
solved in a day ahead time horizon. Various prediction techniques exist in literature
to forecast these numbers based on historical data [2]. The energy and reserve prices
vs. time in price-based DED are depicted in Fig. 4.8. It should be noted that the
numbers shown in Fig. 4.8 are subject to uncertainties. The GAMS code for solving
the price-based DED with arbitrage is provided in GCode 4.6.
112 4 Dynamic Economic Dispatch
55
50
Energy and reserve prices ($/MWh)
e
45 t
r
t
40
35
30
25
20
15
10
5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 4.8 The energy and reserve prices vs time in price-based DED
The energy and reserve schedules vs time in price-based DED with arbitrage are
shown in Fig. 4.9.
In this section, we are trying to generate a linear version of the cost-based DED
problem formulated in (4.5). The assumption is that the fuel cost function is still
expressed in quadratic form aP2 C bP C c. The procedure for linearization is
illustrated in Fig. 4.10.
114 4 Dynamic Economic Dispatch
250
200
150
100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Power schedules (MW)
80
P1
P2
60
P3
P4
40
20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 4.9 The energy and reserve schedules vs time in price-based DED with arbitrage
As it is shown in Fig. 4.10, the interval between Pmin ; Pmax is divided into n
h i g g
k k
equally sized intervals Pg;ini ; Pg;fin . At a specific interval k, we define a variable pkg;t
which varies between zero and the interval length Pkg as indicated in (4.13b). The
actual value of power generation i at time t is calculated in (4.13f). The slope of the
line connecting the initial and final points of the interval k is calculated in (4.13h).
X
min OF D Cg;t (4.13a)
pkg;t g;t
GCode 4.7 The code for linear cost-based DED with no arbitrage in example (4.13)
Sets t hours / t1t24 /
i thermal units / g1g4 /
k /1100/;
t a b l e g e n d a t a ( i , ) g e n e r a t o r c o s t c h a r a c t e r i s t i c s and l i m i t s
a b c d e f Pmin Pmax RU0 RD0
g1 0 . 1 2 1 4 . 8 0 89 1 . 2 5 3 28 200 40 40
g2 0 . 1 7 1 6 . 5 7 83 2 . 3 4.24 6 . 0 9 20 290 30 30
g3 0 . 1 5 1 5 . 5 5 100 1 . 1 2.15 5 . 6 9 30 190 30 30
g4 0 . 1 9 1 6 . 2 1 70 1 . 1 3.99 6 . 2 20 260 50 50;
p a r a m e t e r demand ( t )
/ t1 510
t2 530
t3 516
t4 510
t5 515
t6 544
t7 646
t8 686
t9 741
t10 734
t11 748
t12 760
t13 754
t14 700
t15 686
t16 720
t17 714
t18 761
t19 727
t20 714
t21 618
t22 584
t23 578
t24 544/;
Variables OF Objective ( revenue )
p( i , t ) Power g e n e r a t e d by t h e r m a l power
plant
Pk ( i , t , k ) ;
Parameter data (k , i ,) ;
d a t a ( k , i , ’DP ’ ) = ( g e n d a t a ( i , " Pmax " )g e n d a t a ( i , " Pmin " ) ) / c a r d ( k ) ;
d a t a ( k , i , ’ P i n i ’ ) = ( o r d ( k ) 1) d a t a ( k , i , ’DP ’ ) + g e n d a t a ( i , " Pmin " ) ;
d a t a ( k , i , ’ P f i n ’ ) = d a t a ( k , i , ’ P i n i ’ ) + d a t a ( k , i , ’DP ’ ) ;
d a t a ( k , i , ’ C i n i ’ ) = g e n d a t a ( i , " a " ) power ( d a t a ( k , i , ’ P i n i ’ ) , 2 )
+gendata ( i , " b ")data (k , i , ’ Pini ’ )+gendata ( i , " c ") ;
d a t a ( k , i , ’ C f i n ’ ) = g e n d a t a ( i , " a " ) power ( d a t a ( k , i , ’ P f i n ’ ) , 2 )
+gendata ( i , " b ")data (k , i , ’ Pfin ’ )+gendata ( i , " c ") ;
d a t a ( k , i , ’ s ’ ) = ( d a t a ( k , i , ’ C f i n ’ )d a t a ( k , i , ’ C i n i ’ ) ) / d a t a ( k , i , ’DP ’ ) ;
p . up ( i , t ) = g e n d a t a ( i , " Pmax " ) ;
p . l o ( i , t ) = g e n d a t a ( i , " Pmin " ) ;
Pk . up ( i , t , k ) = d a t a ( k , i , ’DP ’ ) ;
Pk . l o ( i , t , k ) = 0 ;
E q u a t i o n s eq1 , eq2 , eq3 , eq4 , eq5 ;
Nomenclature 117
The total cost is $647,972.4 and compared to the operating costs obtained by
GCode 4.1 which gives $647,960.1, the error is not significant. If more precision
is needed, the number of intervals (k) should be increased. This would increase the
number of variables in optimization problem and makes it more difficult to solve.
4.4 Applications
There are still some other technical constraints that should be considered in DED
problem formulation such as valve-point effect, prohibited operation zones (POZs),
and transmission losses. References [3] propose the imperialist competitive algo-
rithm (ICA) to solve such complicated problem. Stochastic Real-Time Scheduling
of Wind-Thermal Generation Units in an Electric Utility [4].
Nomenclature
Indices
k Blocks considered for piecewise linear fuel cost function.
i Thermal generating units.
t Time intervals.
Parameters
U=S0g Duration of period that unit i has been on/off at the beginning of the
operating horizon (end of t D 0) (h).
dg ; eg ; fg Emission coefficients of unit i.
et Electric energy price at time t ($/MW h).
Lt Electric demand at time t.
ag ; bg ; cg Fuel cost coefficients of unit i.
Pkg;ini=fin Initial and final values of power in block k of linearized cost of
thermal unit i (MW).
k
Cg;ini=fin Initial and final values of cost in block k of linearized cost of thermal
unit i ($/h).
118 4 Dynamic Economic Dispatch
References
This chapter provides GAMS code for solving unit commitment (UC) problem. The
developed GAMS code is linear and is categorized as a MIP model in GAMS. The
inputs are generator’s characteristics, electricity prices, and demands. The outputs
of this code are on/off status of units and their operating schedules.
Every unit commitment problem has three main cost components namely fuel
costs, start-up, and shut-down costs. The unit commitment cost calculation is
illustrated in Fig. 5.1.
The unit commitment data for ten units are inspired by Ademovic et al. [1] and
described in Table 5.1.
X
min OF D FCi;t C STCi;t C SDCi;t (5.1)
pki;t ;ui;t ;yi;t ;zi;t
i;t
X
Pi;t D Pmin
i ui;t C pki;t (5.2e)
k
k
2
Ci;ini D ai Pki;ini C bi Pki;ini C ci (5.2f)
k
2
Ci;fin D ai Pki;fin C bi Pki;fin C ci (5.2g)
k k
Ci;fin Ci;ini
ski D (5.2h)
Pki
2 X
FCi;t D ai Pmin
i C bi Pmin
i C ci ui;t C ski pki;t (5.2i)
k
The power generation of unit i at time t should be within the operating limits as given
in (5.3a). Pi;t and PN i;t state the minimum and maximum time-dependent operating
limits. These are not necessarily equal to Pmin i and Pmax
i , respectively.
The upper operating limit (PN i;t ) is described in (5.3b) and (5.3c) according to [2].
The ramp up/down constraints are modeled as follows:
In order to explain the upper operating limits described in (5.3) some assumptions
should be taken into account:
• It should be always less than capacity of unit i, this means that PN i;t Pmaxi .
• In case of unit shut-down in the next hour (t C 1): PN i;t SDi zi;tC1 . Since Pi;tC1 D
0 so Pi;t cannot be more than SDi .
• If the unit has been on in the previous hour (ui;t1 D 1) and is going to remain
on then Pi;t cannot be increased more than RUi . This means that PN i;t Pi;t1 C
RUi ui;t1 .
• If the unit has been off in the previous hour (ui;t1 D 0) and it is turned on at time
t (yi;t D 1) then Pi;t cannot be more than SUi . This means that PN i;t SUi yi;t .
The combination of all these cases is enforced by (5.3b) and (5.3c).
In order to explain the lower operating limits described in (5.3) some assumptions
should be taken into account:
• If the unit is on at time t then the generated power should be greater than Pmin
i;t ui;t .
• If the unit is on at time t1 and remains to be on at time t; tC1 then the generated
power at time t should be greater than Pi;t1 RDi ui;t .
• If the unit is on at time t 1 and turned off at time t then the generated power at
time t 1 should be Pi;t1 SDi zi;t .
The combination of all these cases is enforced by (5.3d) and (5.3e).
The on/off states of unit i at time t are described by ui;t . Additionally, start-up/shut-
down are given by yi;t ; zi;t in (5.4).
i
X
1 ui;t D 0 (5.5a)
tD1
Xi 1
kCUT
ui;t UTi yi;k ; 8k D
i C 1 : : : T UTi C 1 (5.5b)
tDk
T
X
ui;t yi;t 0; 8k D T UTi C 2 : : : T (5.5c)
tDk
˚
i D min T; UTi Ui0 ui;tD0 (5.5d)
5.1 Cost-Based Unit Commitment 123
i
X
ui;t D 0 (5.6a)
tD1
Xi 1
kCDT
1 ui;t DTi zi;k ; 8k D i C 1 : : : T DTi C 1 (5.6b)
tDk
T
X
1 ui;t zi;t 0; 8k D T DTi C 2 : : : T (5.6c)
tDk
˚
i D min T; DTi Si0 Œ1 ui;tD0 (5.6d)
The realistic start-up and shut-down costs depend on how long the unit has been
off or on, receptively. Some references have provided the detailed formulation for
modeling these cost terms. Here for simplicity, the start-up (Sdi ) and shut-down
(Sdi ) costs are modeled as constant values as (5.7).
In cost-based UC, the hourly total generation should be equal to the hourly demand:
X
Pi;t Lt (5.8)
i
The hourly demand and price values vs time are depicted in Fig. 5.2.
The GAMS code for solving the cost-based unit commitment is provided in
GCode 5.1.
GCode 5.1 Cost-based unit commitment example for ten unit system
Sets t t i m e / t 1t 2 4 / ,
i g e n e r a t o r s / g1g10 / ,
k c o s t s e g m e n t s / s g 1s g 2 0 / ,
c h a r / ch1ch2 / ;
Alias ( t , h) ;
T a b l e g e n d a t a ( i , ) g e n e r a t o r c o s t c h a r a c t e r i s t i c s and l i m i t s
a b c CostsD c o s t s t RU RD UT DT SD SU Pmin Pmax U0 U i n i S0
1400
1200
1000
800
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
300
Generated power (MW)
250
200
150
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
The total operating costs are $485,240.189. The start-up, shut-down, and fuel
costs are $442.100, $0, and $484,798.089, respectively. The power schedules of
thermal units in cost-based unit commitment are depicted in Fig. 5.3.
In order to improve the security and efficiency of the energy supply, some
additional constraints are needed to be considered in UC formulation. Some of these
constraints are discussed and formulated in this section.
126 5 Unit Commitment
One of the most important resources which is used by the system operator is called
spinning reserve (SR) [3]. It is used to cover the sudden increase in demand, rapid
reduction of renewable energy production, or unplanned generating unit outage. The
SR is supplied by online generating units which are synchronized to the system
and are able to ramp-up in order to meet the demand. The UC-reserve constrained
formulation is provided as follows:
X
min OF D FCi;t C STCi;t C SDCi;t (5.9a)
pki;t ;ui;t ;yi;t ;zi;t
i;t
X
Pi;t Lt (5.9b)
i
Subject to:
where Ri;t is the reserve provided by online unit i at time t. is the percentage
of demand which specifies the reserve requirement. It is usually expressed as a
percentage of demand at time t. The GAMS code for solving the (5.9) is described in
GCode 5.2. It should be noted that the generating unit characteristics are unchanged
but the hourly demand values specified in GCode 5.1 and Fig. 5.2 are reduced by
55%. The value is specified by the system operator and is dependent on the
system specification. Here, it is assumed to be 40% for simulation purpose. The
total operating costs without the reserve constraint is $2:1039 105 . However, if
the reserve constraint is taken into account then the operating costs would increase
to $2:1090 105 . The operating schedules of thermal units considering reserve
constraint are provided in Table 5.2.
Table 5.2 Power schedules (Pi;t ) of thermal units considering reserve constraint
Time g1 g3 g4 g5 g7 g8 g10
t1 250.0 90.4 57.0
t2 250.0 107.8 54.0
t3 94.5 250.0 80.0 30.0
t4 92.1 65.0 250.0 80.0 30.0
t5 104.0 72.2 250.0 80.0 30.0 20.0
t6 110.0 79.0 250.0 80.0 30.0 30.0 20.0
t7 123.7 95.0 250.0 80.0 30.0 30.0 20.0
t8 128.0 100.6 250.0 80.0 30.0 30.0 20.0
t9 134.0 106.8 250.0 80.0 30.0 34.0 20.0
t10 134.0 106.8 250.0 80.0 30.0 34.0 20.0
t11 133.5 105.0 250.0 80.0 30.0 30.0 20.0
t12 134.6 110.0 250.0 80.0 30.0 34.0
t13 133.7 105.0 250.0 80.0 30.0 30.0
t14 122.0 90.6 250.0 80.0 30.0 30.0
t15 128.0 97.6 250.0 80.0 30.0 30.0
t16 122.0 90.6 250.0 80.0 30.0 30.0
t17 98.0 68.2 250.0 80.0 30.0 30.0
t18 110.0 77.3 250.0 30.0 30.0
t19 104.2 52.9 250.0 30.0 30.0
t20 121.6 250.0 30.0 30.0
t21 104.9 250.0 30.0 30.0
t22 88.3 250.0 30.0 30.0
t23 101.8 250.0 30.0 30.0
t24 95.3 250.0 30.0
Table 5.3 Reserve provision (Ri;t ) by thermal units considering reserve constraint
Time g1 g3 g4 g5 g7 g8 g10
t1 270.0 189.7 63.0
t2 99.1 38.6 27.0
t3 15.5 34.6 83.8 48.0
t4 42.5 15.0 69.4 56.0 24.0
t5 28.1 22.8 71.6 56.0 24.0 20.0
t6 34.0 104.0 56.0 8.6 25.0 12.0
t7 26.4 14.0 97.2 56.0 24.0 22.0 12.0
t8 35.7 24.5 81.3 56.0 24.0 22.0 12.0
t9 34.0 23.8 94.1 56.0 24.0 18.0 12.0
t10 40.0 30.0 77.9 56.0 24.0 22.0 12.0
t11 40.6 31.8 71.1 56.0 24.0 26.0 10.0
t12 38.9 25.0 93.5 56.0 24.0 18.0
t13 40.9 35.0 69.6 56.0 24.0 26.0
t14 51.7 44.5 42.9 56.0 24.0 22.0
t15 34.0 23.0 87.3 56.0 24.0 22.0
t16 46.0 37.1 56.0 56.0 24.0 22.0
t17 42.5 104.0 30.0 24.0 22.0
t18 28.0 21.0 104.0 24.0 22.0
t19 45.8 17.1 77.9 24.0 22.0
t20 22.6 104.0 24.0 22.0
t21 56.7 63.3 24.0 22.0
t22 56.7 56.7 24.0 22.0
t23 21.7 104.0 24.0 15.0
t24 98.1 52.0
X
Pi;t Lt (5.10b)
i
Subject to:
(5.2), (5.3), (5.4), (5.5), (5.6), (5.7)
where ˝c is the set of contingencies for generating units. The GAMS code
for solving the (5.10) is described in GCode 5.3. As previously stated, the total
operating costs without the generator contingency constraint are $2:1039 105 .
However, if the generator contingency constraint (the outage of all generating units
except g4 is considered) is taken into account then the operating costs would
increase to $2:1041 105 .
130 5 Unit Commitment
Table 5.4 Power schedules (Pi;t ) by thermal units considering generator contingency constraint
Time g1 g3 g4 g5 g7 g8 g10
t1 0.0 0.0 250.0 93.4 54.0 0.0 0.0
t2 0.0 51.8 250.0 80.0 30.0 0.0 0.0
t3 0.0 74.5 250.0 80.0 30.0 0.0 20.0
t4 110.0 104.5 250.0 0.0 30.6 0.0 22.0
t5 128.0 98.2 250.0 0.0 30.0 30.0 20.0
t6 146.0 115.0 250.0 0.0 30.0 38.0 20.0
t7 152.0 130.0 250.0 0.0 34.5 40.2 22.0
t8 158.0 130.1 250.0 0.0 34.5 42.0 24.0
t9 162.8 135.0 250.0 0.0 39.0 42.0 26.0
t10 162.8 135.0 250.0 0.0 39.0 42.0 26.0
t11 158.0 135.0 250.0 0.0 39.0 42.0 24.5
t12 158.0 130.1 250.0 0.0 34.5 42.0 24.0
t13 152.0 130.0 250.0 0.0 34.5 40.2 22.0
t14 146.0 118.6 250.0 0.0 30.0 38.0 20.0
t15 146.1 125.0 250.0 0.0 34.5 38.0 22.0
t16 146.0 118.6 250.0 0.0 30.0 38.0 20.0
t17 139.0 113.3 250.0 0.0 0.0 34.0 20.0
t18 137.3 110.0 250.0 0.0 0.0 0.0 0.0
t19 122.1 95.0 250.0 0.0 0.0 0.0 0.0
t20 106.6 75.0 250.0 0.0 0.0 0.0 0.0
t21 98.0 66.9 250.0 0.0 0.0 0.0 0.0
t22 92.0 56.3 250.0 0.0 0.0 0.0 0.0
t23 96.8 65.0 250.0 0.0 0.0 0.0 0.0
t24 125.3 0.0 250.0 0.0 0.0 0.0 0.0
132 5 Unit Commitment
Table 5.5 Reserve provision (Ri;t ) by thermal units considering generator contingency constraint
Time g1 g3 g4 g5 g7 g8 g10
t1 0.0 0.0 270.0 186.7 66.0 0.0 0.0
t2 0.0 28.3 0.0 69.4 48.0 0.0 0.0
t3 0.0 7.3 1.8 30.0 22.8 0.0 20.0
t4 0.0 0.0 76.6 0.0 23.5 0.0 10.0
t5 22.0 0.0 64.5 0.0 24.6 25.0 14.0
t6 0.0 4.0 104.0 0.0 24.0 14.0 0.0
t7 0.0 8.7 104.0 0.0 19.5 19.9 0.0
t8 0.0 0.0 103.9 0.0 24.0 20.2 10.0
t9 0.0 15.0 96.3 0.0 19.5 22.0 10.0
t10 0.0 15.0 89.8 0.0 24.0 22.0 12.0
t11 0.0 0.0 98.5 0.0 24.0 22.0 13.6
t12 0.0 0.0 95.1 0.0 28.5 22.0 12.5
t13 0.0 0.2 104.0 0.0 24.0 23.9 0.0
t14 0.0 3.9 104.0 0.0 0.0 24.2 14.0
t15 0.0 21.1 73.5 0.0 19.5 22.0 10.0
t16 0.0 0.0 90.0 0.0 20.0 22.0 14.0
t17 0.0 14.0 104.0 0.0 0.0 11.0 10.0
t18 6.0 33.3 104.0 0.0 0.0 0.0 0.0
t19 0.0 18.1 104.0 0.0 0.0 0.0 0.0
t20 0.0 31.6 75.0 0.0 0.0 0.0 0.0
t21 0.0 31.1 66.9 0.0 0.0 0.0 0.0
t22 0.0 0.0 92.0 0.0 0.0 0.0 0.0
t23 0.0 5.0 91.8 0.0 0.0 0.0 0.0
t24 0.0 95.0 30.3 0.0 0.0 0.0 0.0
problems. In this modern context, the demand values are no longer strict and can
be dispatched. The UC problem incorporating a simple demand response model is
presented as follows:
X
min OF D FCi;t C STCi;t C SDCi;t (5.11a)
pki;t ;ui;t ;yi;t ;zi;t
i;t
X
Pi;t Dt (5.11b)
i
Subject to:
(5.2), (5.3), (5.4), (5.5), (5.6), (5.7)
5.2 Cost-Based UC with Additional Constraints 133
Equation (5.11c) states the demand variation ranges. &min=max determine the min/-
max flexibility of demand response. Equation (5.11d) states that the total energy of
the consumer does not change over the operating horizon. The &min=max are assumed
to be 10%.
The GAMS code for solving the (5.11) is described in GCode 5.4. As previously
stated, the total operating costs without the generator contingency constraint are
$2:1039 105 . However, if the demand response flexibility is available then the
operating costs would decrease to $2:0965 105 . The power schedules (Pi;t ) by
thermal units considering demand response constraint are given in Table 5.6.
600
Electric demand (MW)
550
500
450
400
350
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 5.4 The demand pattern change in cost-based unit commitment with demand response
flexibility
650 0%
3%
6%
600 9%
Electric demand (MW)
12%
15%
18%
550
500
450
400
350
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 5.5 The sensitivity analysis of demand pattern changes in CBUC with various demand
response flexibilities
136 5 Unit Commitment
× 105
2.104
2.102
2.1
Total costs ($)
2.098
2.096
2.094
2.092
0 2 4 6 8 10 12 14 16 18 20
Demand flexibility (%)
Subject to:
(5.2), (5.3), (5.4), (5.5), (5.6), (5.7)
The GAMS code for solving the (5.12) is described in GCode 5.5.
GCode 5.5 Price-based unit commitment Example for ten unit system
Sets t / t 1t 2 4 / , i / g1g10 / , k / s g 1s g 2 0 / , c h a r / ch1ch2 / ;
Alias ( t , h)
T a b l e G d a t a ( i , ) g e n e r a t o r c o s t c h a r a c t e r i s t i c s and l i m i t s
a b c CostsD c o s t s t RU RD UT DT SD SU Pmin Pmax U0 U i n i S0
Removed f o r s a v i n g s p a c e
Parameter data ( k , i ,) ;
d a t a ( k , i , ’DP ’ ) = ( G d a t a ( i , " Pmax " )G d a t a ( i , " Pmin " ) ) / c a r d ( k ) ;
d a t a ( k , i , ’ P i n i ’ ) = ( o r d ( k ) 1)d a t a ( k , i , ’DP ’ ) + G d a t a ( i , " Pmin " ) ;
d a t a ( k , i , ’ P f i n ’ ) = d a t a ( k , i , ’ P i n i ’ ) + d a t a ( k , i , ’DP ’ ) ;
d a t a ( k , i , ’ C i n i ’ ) = G d a t a ( i , " a " )power ( d a t a ( k , i , ’ P i n i ’ ) , 2 )
5.3 Price-Based Unit Commitment 137
350
P1 P2 P3 P4 P5 P6 P7 P8 P9 P 10
300
Generated power (MW)
250
200
150
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
The start-up, shut-down, and fuel costs are $499.000, $163.800, and
$372,277.510, respectively. The net benefit of Genco is $58,186.325. The power
schedules of thermal units in cost-based unit commitment are depicted in Fig. 5.7.
5.4 Applications
The unit commitment analysis has a vast range of applications, and some of them
are described as follows:
5.4.1 Cost-Based UC
In practical applications, the thermal units might have some limitations in fuels.
This means that the unit cannot generate more than some certain amount of energy.
In other words, it might not be technically possible to keep the unit on for all time
steps for the operating period. The fuel constrained UC is formulated in 4,335,178.
Another important constraint in UC is environmental emission which is modeled
in [4].
Another aspect of UC is considering the uncertainties associated with renewable
energy resources (like wind turbines). Generally speaking, there are several methods
for dealing with uncertainties in power system studies, such as
• Stochastic methods: two-stage scenario-based [5], two-point estimate [6, 12]
• Fuzzy methods [7]
• Robust optimization [8, 9]
• Information gap decision theory [10, 11]
The different uncertainty parameters and modeling methods are shown in
Fig. 5.8 [12].
References 139
5.4.2 Price-Based UC
References
This chapter provides a solution for optimal power flow OPF problem in GAMS.
Different OPF models are investigated, such as single and multi-period DC-AC
optimal power flow.
There are some necessary conditions that make the DC power flow acceptable as an
approximate solution for AC power flow such as:
x
• The ratio of rijij should be large enough that rij can be neglected.
• The voltage magnitudes are approximately 1 pu.
The DC power flow concept for a two-bus network is shown in Fig. 6.1. The basic
variables in DC power flow are voltage angles ıi . The angle of the slack bus is
assumed to be zero as the reference for the rest of network.
The technical and economic characteristics of generating units shown in
Table 6.1 are given as follows:
The demand at bus 2 is L2 D 400 MW, line reactance is X12 D 0:2 pu, and line
flow limit is Pmax
12 D 1:50 pu (per unit on 100 MVA base). The optimization problem
which should be solved is formulated in (6.1).
X
min OF D ag .Pg /2 C bg Pg C cg (6.1a)
Pg ;ıi
g1 ;g2
ı1 ı 2
Pij D (6.1b)
X12
Pg1 D P12 (6.1c)
Pg2 C P12 D L2 (6.1d)
GCode 6.1 The OPF GAMS code for two-bus network, Example (6.1)
Sets
Gen / g1g2 /
bus / 1 2 / ;
Scalars
L2 /400/
X12 / 0 . 2 /
Sbase / 1 0 0 /
P12_max / 1 . 5 / ;
T a b l e d a t a ( Gen , )
a b c Pmin Pmax
G1 3 20 100 28 206
G2 4 . 0 5 1 8 . 0 7 9 8 . 8 7 90 284;
V a r i a b l e s P ( gen ) ,OF , d e l t a ( b u s ) , P12 ;
Equations
eq1 , eq2 , eq3 , eq4 ;
Pmax max
12 P12 P12 (6.1e)
ı1 D 0 Slack (6.1f)
The GAMS code for solving the (6.1) is provided in GCode 6.1.
The operating costs would be $306.108, P12 D 150 MW and ı2 D 0:3 (rad).
The general power flow concept is shown in Fig. 6.2. As it can be seen in Fig. 6.2,
every bus might host some generation and demand. Each bus might be connected
6.1 Single Period Optimal DC Power Flow 143
Table 6.1 The techno-economic data of thermal units in two-bus OPF example
g ag ($=MW2 ) bg ($=MW) cg ($) Pmin
g (MW) Pmax
g (MW)
g1 0.12 14.8 89 28 200
g2 0.17 16.57 83 20 290
ıi ı j
Pij D ij 2 ˝` (6.2b)
xij
X X
Pg Li D Pij W i i 2 ˝B (6.2c)
g2˝Gi j2˝`i
Pmax
ij Pij Pmax
ij ij 2 ˝` (6.2d)
Pmin
g Pg Pmax
g (6.2e)
144 6 Multi-Period Optimal Power Flow
Fig. 6.3 Three bus network example (a) data and (b) power flow solution
The three-bus network data is shown in Fig. 6.3. This example is taken from [2]
(Example 4B, p. 110).
The GAMS code for solving this problem is given as GCode 6.2: The developed
code for solving the OPF problem in three-bus network (Fig. 6.3) is explained here.
It is general and can be used for any network with any size.
• Three sets are defined: bus (all network buses), slack(bus) which shows slack
buses with reference angle values, Gen (set of generating units)
• A scalar value named Sbase is defined for per unit calculations
• The set node is defined as the similar set to set bus
• The table GenData defines the technical and economic characteristics of gener-
ating units
• The set GBconect defines the connection point of each generating unit
• The table BusData specifies the demand values in each bus
• The set conex specifies how each bus is connected to the other network buses
• The table branch defines the branch characteristics
• Four variables are used for this formulation namely: OF (objective function),
Pij (active power flow between bus and node), Pg(generating schedule of each
generating unit), and delta (voltage angle at each bus)
• Three equations are defined: const1 (active flow calculation between each pair of
connected buses), const2 (nodal active power balance in each bus), and const3
(objective function calculation)
• The definition of the model loadflow (specifies for GAMS that which constraints
should be taken into account)
• Variables’ limits specification
6.1 Single Period Optimal DC Power Flow 145
• Solve statement
• Generating report from the solved model
• The marginal value of const2.m provides the LMP at each bus. This is used for
congestion cost calculation.
GCode 6.2 The DC-OPF GAMS code for three-bus network, Example (Sect. 6.1.1)
Sets
bus / 1 3 /
s l a c k ( bus ) / 3 /
Gen / g1g3 / ;
scalars
Sbase / 1 0 0 / ;
a l i a s ( bus , node ) ;
T a b l e GenData ( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
b pmin pmax
g1 10 0 65
g2 11 0 100;
s e t GBconect ( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t
t o each bus
/1 . g1
3 . g2 / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
Pd
2 100;
s e t conex Bus c o n n e c t i v i t y m a t r i x
/
1 . 2
2 . 3
1 . 3/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
T a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
x Limit
1 . 2 0.2 100
2 . 3 0.25 100
1 . 3 0.4 100 ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node , bus , ’ x ’
);
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node
, bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ c o n e x ( bus , node ) = 1 / b r a n c h ( bus , node , ’ x ’ ) ;
Variables
OF
P i j ( bus , node )
Pg ( Gen )
d e l t a ( bus ) ;
Equations const1 , const2 , const3 ;
c o n s t 1 ( bus , node ) $ c o n e x ( bus , node ) . . P i j ( bus , node ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( b u s )
d e l t a ( node ) ) ;
146 6 Multi-Period Optimal Power Flow
The total operating costs will be 1035 $/h and the LMP for all buses are equal to
11 $/h. This means that if the demand value at any bus increases for 1 MW then
the operating cost will increase by 11 $/h. Since the generating unit 1 is generating
power at its maximum limit (because it is cheaper) the additional demand should be
supplied by generating unit 2 with operating cost equal to 11 $/MW h. The detailed
three-bus optimal power flow solution with (Pmax
ij D 100 MW) is given in Table 6.2.
Question: What would happen if the flow limit of the branch connecting bus 1 to
bus 2 is reduced to 50 MW.
Answer: The answer is straightforward. The operating cost might increase but
how much? We can easily decrease the flow limit in the GCode 6.2 (table Branch).
The new operating cost would be 1056.250 $/h. The LMP values are different for
each bus in this case. The LMP values are 1 D 10 $/MW h, 2 D 11:625 $/MW h,
3 D 11 $/MW h. The power flow solution is shown in Fig. 6.4. The LMP value
in bus 1 is 1 D 10 $/MW h because if the load increases in this node it will be
supplied by generator 1 (which the operating costs are 10 $/MW h). The LMP value
in bus 3 is 3 D 11 $/MW h because any increase in load in this node should be
supplied by generator 2 (which the operating costs are 11 $/MW h). Generator 1
Table 6.2 The three-bus Bus (i) Pg (MW) ıi (rad) Li (MW) i ($/MW h)
optimal power flow solution
(Pmax D 100 MW) 1 65 0.02 0 11
ij
2 0 0.10 100 11
3 35 0.00 0 11
6.1 Single Period Optimal DC Power Flow 147
cannot send more power by line 1 2 since it is congested and the direction of
the power flow in branch 3 1 is from bus 3 to bus 1. Finally, The LMP value in
bus 2 is 3 D 11:625 $/MW h because some of this demand will be supplied by
generating unit 1 and some part will be supplied by unit 2. If the demand should
pay the LMP value for every MW h then the total payment by the demand would be
100 MW 11:625 $/MW h = 1162.5 $/h. On the other hand, the generating units are
also paid based on the LMP value of the connection point. The total payments to the
generating units would be 43:7510C56:2511 D 1056:25 $/h. As it can be seen,
there is a difference between what demand pays and what generating units receive.
This surplus money is equal to 1162:5 1056:25 D 106:25 $/h. This is also called
the congestion cost. Another technique for calculating the congestion costs (Ccg ) is
using the following formula [3]:
X
Ccg D Pji .i j / (6.3)
ij
Table 6.3 The three-bus Bus (i) Pg (MW) ıi (rad) Li (MW) i ($/MW h)
optimal power flow solution
(Pmax 1 43.75 0.025 0 10
12 D 50 MW)
2 0 0.125 100 11.625
3 56.25 0 0 11
The five-bus network data is shown in Fig. 6.5. This example is taken from [4].
The GAMS code developed for solving OPF in five-bus network is provided in
GCode 6.3.
GCode 6.3 The OPF GAMS code for five-bus network, Example (Sect. 6.1.2)
S e t s b u s / 1 5 / , s l a c k ( b u s ) / 1 / , Gen / g1g5 / ;
S c a l a r s S b a s e / 1 0 0 / ; a l i a s ( bus , node ) ;
T a b l e GenData ( Gen , )
b pmin pmax
g1 14 0 40
g2 15 0 170
g3 30 0 520
g4 40 0 200
g5 20 0 600 ;
s e t GBconect ( bus , Gen ) c o n n e c t i v i t y i n d e x o f g e n e r a t i n g u n i t
/1 . g1
1 . g2
3 . g3
4 . g4
5 . g5 / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
Pd
6.1 Single Period Optimal DC Power Flow 149
2 300
3 300
4 400;
s e t conex Bus c o n n e c t i v i t y m a t r i x
/1 . 2
2 . 3
3 . 4
4 . 1
4 . 5
5 . 1/;
c o n e x ( bus , node ) $ c o n e x ( node , b u s ) = 1 ;
T a b l e b r a n c h ( bus , node , )
x Limit
1 . 2 0.0281 400
1 . 4 0.0304 400
1 . 5 0.0064 400
2 . 3 0.0108 400
3 . 4 0.0297 400
4 . 5 0.0297 240 ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node , bus , ’ x ’
);
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node
, bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ c o n e x ( bus , node ) = 1 / b r a n c h ( bus , node , ’ x ’ ) ;
V a r i a b l e s OF , P i j ( bus , node ) , Pg ( Gen ) , d e l t a ( b u s ) ;
Equations const1 , const2 , const3 ;
c o n s t 1 ( bus , node ) $ c o n e x ( bus , node ) . . P i j ( bus , node ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( b u s ) d e l t a ( node ) ) ;
c o n s t 2 ( b u s ) . . +sum ( Gen$GBconect ( bus , Gen ) , Pg ( Gen ) )BusData ( bus , ’
pd ’ ) / S b a s e =e=
+sum ( n o d e $ c o n e x ( node , b u s ) , P i j ( bus ,
node ) ) ;
const3 . . OF=g=sum ( Gen , Pg ( Gen ) GenData ( Gen , ’ b ’ ) S b a s e ) ;
Model l o a d f l o w / const1 , const2 , const3 / ;
Pg . l o ( Gen ) =GenData ( Gen , ’ Pmin ’ ) / S b a s e ;
Pg . up ( Gen ) =GenData ( Gen , ’ Pmax ’ ) / S b a s e ;
d e l t a . up ( b u s ) = p i ;
d e l t a . l o ( b u s )=p i ;
d e l t a . fx ( s l a c k ) =0;
P i j . up ( bus , node ) $ ( ( c o n e x ( bus , node ) ) ) = b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
P i j . l o ( bus , node ) $ ( ( c o n e x ( bus , node ) ) ) =
b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
s o l v e l o a d f l o w m i n i m i z i n g OF u s i n g l p ;
p a r a m e t e r r e p o r t ( bus , ) , C o n g e s t i o n c o s t ;
r e p o r t ( bus , ’ Gen (MW) ’ ) = sum ( Gen$GBconect ( bus , Gen ) , Pg . l ( Gen ) ) s b a s e
;
r e p o r t ( bus , ’ Angle ’ ) = d e l t a . l ( b u s ) ;
r e p o r t ( bus , ’ l o a d (MW) ’ ) = BusData ( bus , ’ pd ’ ) ;
r e p o r t ( bus , ’LMP( $ /MWh) ’ ) = c o n s t 2 .m( b u s ) / s b a s e ;
C o n g e s t i o n c o s t = sum ( ( bus , node ) ,
P i j . l ( bus , node ) ( c o n s t 2 .m( b u s ) + c o n s t 2 .m( node ) ) ) / 2 ;
Display report , Pij . l , Congestioncost ;
150 6 Multi-Period Optimal Power Flow
Table 6.4 The optimal Bus (i) Pg (MW) ıi (rad) Li (MW) i ($/MW h)
power flow solution in
five-bus network 1 210.000 0.000 0 16.977
2 0.000 0.070 300 26.384
3 323.495 0.065 300 30.000
4 0.000 0.057 400 39.943
5 466.505 0.014 0 10.000
The minimum operating cost is 17,479.897 $/h. The network is highly congested,
and the LMP values are different in various buses. The five-bus network flows and
directions are depicted in Fig. 6.6. The detailed five-bus optimal power flow solution
is given in Table 6.4.
The IEEE RTS 24-bus network is shown in Fig. 6.7. It is a transmission network
with the voltage levels of 138 kV, 230 kV, and Sbase = 100 MVA. The branch data
for IEEE RTS 24-bus network is given in Table 6.5 [5]. The from bus, to bus,
reactance (X), resistance (r), total line charging susceptance (b), and MVA rating
(MVA) are specified in this table. The parallel lines in MATPOWER are merged,
and the resultants are given in Table 6.5. The generation data for IEEE RTS 24-bus
network is given in Table 6.6. The data of generating units in this network is inspired
by Conejo et al. [6] and Bouffard et al. [7] with some modifications. The slack bus
is bus 13 in this network.
6.1 Single Period Optimal DC Power Flow 151
In this case, it is assumed that the network is intact and all branches and generating
units are working in normal condition. The minimum operating cost is $29,574.275
obtained by using the GCode 6.4.
GCode 6.4 The OPF GAMS code for IEEE Reliability test 24-bus network, Example (Sect. 6.1.3)
s e t s b u s / 1 2 4 / , s l a c k ( b u s ) / 1 3 / , Gen / g1g12 / ; s c a l a r S b a s e
/ 1 0 0 / ; a l i a s ( bus , node ) ;
T a b l e GenData ( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
Pmax Pmin b CostsD c o s t s t RU RD SU SD UT DT
u i n i U0 So
g1 400 100 5.47 0 0 47 47 105 108 1 1
1 5 0 ;
s e t GBconect ( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t
t o each bus
/18 . g1 / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW/ MVar
Pd Qd
1 108 2 2 ;
T a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
r x b limit
1 . 2 0.0026 0.0139 0.4611 175;
p a r a m e t e r c o n e x ( bus , node ) ;
c o n e x ( bus , node ) $ b r a n c h ( bus , node , ’ l i m i t ’ ) = 1 ;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node , bus , ’ x ’
);
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node
, bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ c o n e x ( bus , node ) = 1 / b r a n c h ( bus , node , ’ x ’ ) ;
V a r i a b l e s OF , P i j ( bus , node ) , Pg ( Gen ) , d e l t a ( b u s ) ;
Equations const1 , const2 , const3 ;
c o n s t 1 ( bus , node ) $ ( c o n e x ( bus , node ) ) . .
P i j ( bus , node ) =e= b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( b u s ) d e l t a ( node ) ) ;
c o n s t 2 ( b u s ) . . +sum ( Gen$GBconect ( bus , Gen ) , Pg ( Gen ) )BusData ( bus , ’
pd ’ ) / S b a s e =e=
+sum ( n o d e $ c o n e x ( node , b u s ) , P i j ( bus , node ) ) ;
const3 . . OF=g=sum ( Gen , Pg ( Gen ) GenData ( Gen , ’ b ’ ) S b a s e ) ;
Model l o a d f l o w / const1 , const2 , const3 / ;
Pg . l o ( Gen ) =GenData ( Gen , ’ Pmin ’ ) / S b a s e ; Pg . up ( Gen ) =GenData ( Gen ,
’ Pmax ’ ) / S b a s e ;
d e l t a . up ( b u s ) = p i / 2 ; d e l t a . l o ( b u s )=p i / 2 ; d e l t a . f x ( s l a c k ) = 0 ;
P i j . up ( bus , node ) $ ( ( c o n e x ( bus , node ) ) ) =1 b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
P i j . l o ( bus , node ) $ ( ( c o n e x ( bus , node ) ) ) =1 b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
S o l v e l o a d f l o w m i n i m i z i n g OF u s i n g l p ;
154 6 Multi-Period Optimal Power Flow
Table 6.7 Base case solution Bus Pg (MW) ıi (rad) Load (MW) i ($/MW h)
of IEEE RTS 24-bus network
(branch flow limits are 1 152 0.150 108 20.7
unchanged) 2 152 0.151 97 20.7
3 0.113 180 20.7
4 0.185 74 20.7
5 0.191 71 20.7
6 0.230 136 20.7
7 257.15 0.105 125 20.7
8 0.186 171 20.7
9 0.136 175 20.7
10 0.172 195 20.7
11 0.044 20.7
12 0.031 20.7
13 206.85 0.000 265 20.7
14 0.027 194 20.7
15 167 0.182 317 20.7
16 155 0.168 100 20.7
17 0.251 20.7
18 400 0.276 333 20.7
19 0.146 181 20.7
20 0.164 128 20.7
21 400 0.291 20.7
22 300 0.399 20.7
23 660 0.187 20.7
24 0.069 20.7
The base case solution of IEEE RTS 24-bus network without changing the branch
flow limits is described in Table 6.7. As it can be observed in Table 6.7, the LMP
values are all the same and equal to 20.7 $/MW h. This is because there is no
congestion in this network for the given loading values. The congestion cost would
be zero in this case.
Now the branch flow limits are reduced by 30%. The problem is solved again, and
the angle values are found as given in Table 6.8. The minimum operating cost is
$29,747.745 obtained by using the GCode 6.4. The congestion cost is $4597.217 in
this case. The solution of IEEE RTS 24-bus network (branch flow limits are reduced
by 30%) is given in Table 6.8. Reducing the branch flow limit will not only increase
the operating cost but also makes the LMP values different across the network.
6.1 Single Period Optimal DC Power Flow 155
Table 6.8 Solution of IEEE Bus Pg (MW) ıi (rad) Load (MW) i ($/MW h)
RTS 24-bus network (branch
flow limits are reduced by 1 152.00 0.162 108 20.66
30%) 2 152.00 0.163 97 20.71
3 0.129 180 19.11
4 0.197 74 20.85
5 0.203 71 20.98
6 0.241 136 21.17
7 247.50 0.130 125 20.70
8 0.205 171 21.14
9 0.147 175 20.96
10 0.183 195 21.32
11 0.053 22.69
12 0.038 20.55
13 251.24 0.000 265 20.93
14 0.012 194 25.78
15 132.26 0.158 317 16.00
16 155.00 0.149 100 15.68
17 0.230 15.79
18 400.00 0.255 333 15.85
19 0.131 181 16.86
20 0.152 128 17.87
21 400.00 0.269 15.89
22 300.00 0.378 15.85
23 660.00 0.177 18.42
24 0.049 17.19
In this case, some branch contingencies are examined. In order to simulate the
branch outage, the following equation should be satisfied.
ıi ıj
Pij Mij (6.4)
xij
ıi ıj
Pij Mij (6.5)
xij
where ij is a binary parameter which shows the status of the branch connecting bus
i to bus j. In the developed GAMS code, if the branch limit is set to 0 it is considered
as an outaged branch. This is because const1 which models the flow calculation in
line ij is calculated for every branch which has conex.bus; node/ > 0. Now some
different contingencies are evaluated as follows:
156 6 Multi-Period Optimal Power Flow
• Contingency 1: branch `2019 ; `1223 are out. Congestion costs are $4905.000
and OF = $29,888.196. The congested lines are `1323 . The LMP values are not
the same in different buses.
• Contingency 2: branch `1416 ; `1619 are out. Congestion costs are $6224.250
and OF = $32,199.855. The congested lines are `243 ; `87 . The LMP values are
not the same in different buses.
• Contingency 3: branch `15 ; `42 are out. Congestion costs are $0 and
OF = $29,574.275. No line would be congested and therefore the LMP values
are the same in all buses.
The OPF solutions for these three contingency cases are provided in Table 6.9.
Table 6.9 Solution of IEEE RTS 24-bus network (branch outage contingencies)
Contingency 1 Contingency 2 Contingency 3
Pg
Bus (MW) ıi (rad) i ($/MW h) Pg (MW) ıi (rad) i ($/MW h) Pg (MW) ıi (rad) i ($/MW h)
1 152 0.218 20.70 152 0.106 20.93 152 0.050 20.70
2 152 0.219 20.70 152 0.112 20.93 152 0.054 20.70
3 0.193 20.70 0.055 20.93 0.088 20.70
4 0.252 20.70 0.156 20.93 0.215 20.70
5 0.257 20.70 -0.173 20.93 0.239 20.70
6 0.294 20.70 0.227 20.93 0.210 20.70
7 289.15 0.123 20.70 300 0.038 20.70 257.15 0.108 20.70
8 0.224 20.70 0.145 20.93 0.189 20.70
9 0.202 20.70 0.116 20.93 0.138 20.70
10 0.235 20.70 0.181 20.93 0.176 20.70
11 0.094 20.70 0.122 20.93 0.044 20.70
12 0.116 20.70 0.037 20.93 0.032 20.70
13 206.85 20.70 436 20.93 206.85 20.70
14 0.053 20.70 0.203 20.93 0.029 20.70
15 167 0.077 20.70 66.25 0.598 5.47 167 0.189 20.70
16 155 0.060 20.70 54.25 0.631 5.47 155 0.173 20.70
17 0.144 20.70 0.691 5.47 0.257 20.70
18 400 0.171 20.70 400 0.706 5.47 400 0.283 20.70
19 0.019 20.70 0.073 20.93 0.150 20.70
20 0.419 10.89 0.109 20.93 0.167 20.70
21 400 0.185 20.70 329.5 0.711 5.47 400 0.298 20.70
22 300 0.293 20.70 300 0.827 5.47 300 0.405 20.70
23 628 0.433 10.89 660 0.142 20.93 660 0.190 20.70
24 0.026 20.70 0.390 5.47 0.083 20.70
6.1 Single Period Optimal DC Power Flow 157
In this case, some generating units are out of service. This can be because of
unplanned outage or maintenance purpose. Now some different contingencies are
evaluated as follows:
• Contingency 1: The generating unit g9 (connected to bus 7) is out. Solving the
problem shows that no line is congested but removing the g9 will cause an
increase in total operating costs which becomes OF = $29,633.420.
• Contingency 2: The generating unit g5 (connected to bus 15) is out. Solving the
problem shows that line `87 is congested but removing the g5 will cause an
increase in total operating costs which becomes OF = $30,328.570. The LMP
values are different on different buses, and the congestion costs are $40.250.
• Contingency 3: The generating unit g8 (connected to bus 23) is out. Solving the
problem shows that line `87 is congested but removing the g8 will cause an
increase in total operating costs which becomes OF = $33,078.420. The LMP
values are different on different buses, and the congestion costs are $40.250.
• Contingency 4: The generating unit g10 (connected to bus 13) is out. The problem
becomes infeasible, and GAMS cannot find any solution for it. This is because
no solution is found which satisfies the technical constraints. Some load shedding
action should take place.
The OPF solutions for first three contingency cases are given in Table 6.10. In order
to analyze the contingency case 4, the load shedding is modeled using a virtual
generating unit connected to bus i as shown in Fig. 6.8. The production cost of this
specific unit is set to a high value. It is usually called the value of the loss of load.
The production level of this generating unit is equal to the load shedding that should
happen in bus i. The maximum power of this unit is equal to the load connected
to the bus i (0 LSi Li ). The DC-OPF problem considering the load shedding
concept is formulated in (6.6).
X X
OF D ag .Pg /2 C bg Pg C cg C VOLL LSi (6.6a)
g2˝G i
ıi ı j
Pij D ij 2 ˝` (6.6b)
xij
X X
Pg C LSi Li D Pij W i i 2 ˝B (6.6c)
g2˝Gi j2˝`i
Pmax
ij Pij Pmax
ij ij 2 ˝` (6.6d)
Pmin
g Pg Pmax
g (6.6e)
0 LSi Li (6.6f)
158 6 Multi-Period Optimal Power Flow
Table 6.10 Solution of IEEE RTS 24-bus network (generator outage contingencies)
Contingency 1 Contingency 2 Contingency 3
Pg Pg Pg
Bus (MW) ıi (rad) i ($/MW h) (MW) ıi (rad) i ($/MW h) (MW) ıi (rad) i ($/MW h)
1 152 0.246 20.93 152 0.171 20.93 152 0.186 20.93
2 152 0.248 20.93 152 0.172 20.93 152 0.187 20.93
3 0.195 20.93 0.156 20.93 0.165 20.93
4 0.283 20.93 0.204 20.93 0.219 20.93
5 0.291 20.93 0.208 20.93 0.224 20.93
6 0.331 20.93 0.244 20.93 0.261 20.93
7 0.576 20.93 300 0.058 20.7 300 0.075 20.7
8 0.499 20.93 0.165 20.93 0.182 20.93
9 0.235 20.93 0.153 20.93 0.169 20.93
10 0.275 20.93 0.184 20.93 0.202 20.93
11 0.097 20.93 0.065 20.93 0.076 20.93
12 0.082 20.93 0.044 20.93 0.071 20.93
13 464 0.000 20.93 319 0.000 20.93 514 0.000 20.93
14 0.024 20.93 0.020 20.93 0.034 20.93
15 167 0.129 20.93 12 0.095 20.93 167 0.098 20.93
16 155 0.118 20.93 155 0.099 20.93 155 0.081 20.93
17 0.200 20.93 0.175 20.93 0.165 20.93
18 400 0.226 20.93 400 0.198 20.93 400 0.191 20.93
19 0.103 20.93 0.092 20.93 0.038 20.93
20 0.126 20.93 0.122 20.93 0.038 20.93
21 400 0.240 20.93 400 0.210 20.93 400 0.206 20.93
22 300 0.348 20.93 300 0.320 20.93 300 0.314 20.93
23 660 0.152 20.93 660 0.152 20.93 310 0.051 20.93
24 0.006 20.93 0.001 20.93 0.003 20.93
The GAMS code for modeling and calculating the load shedding values is given
in GCode 6.5:
GCode 6.5 The OPF GAMS code for IEEE Reliability test 24-bus network with load shedding
modeling
Sets
bus /124/
s l a c k ( bus ) / 1 3 /
Gen / g1g12 /
scalars
Sbase / 1 0 0 /
VOLL / 1 0 0 0 0 / ;
a l i a s ( bus , node ) ;
t a b l e GenData ( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
Pmax Pmin b
REMOVED FOR SAVING SPACE
;
s e t GBconect ( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t
t o each bus
/
REMOVED FOR SAVING SPACE
/ ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
Pd Qd
REMOVED FOR SAVING SPACE
;
The OPF solution for contingency case 4 is given in Table 6.11. The simulation
results show that the demand in bus 18 should be reduced by 116 MW as given in
Table 6.11. It should be noted that the LMP values are not meaningful in this case.
The LMP values are calculated and shown in Table 6.12.
In order to calculate the LMP in a network with load shedding, the calculated
amount of load shedding should be curtailed from the demand in the specific bus
(here bus 18) and the problem should be resolved.
Nomenclature
Table 6.11 Solution of IEEE Bus Pg (MW) ıi (rad) Li (MW) LSHi (MW)
RTS 24-bus network
(generator g10 outage with 1 152 0.095 108
load shedding modeling) 2 152 0.097 97
3 0.042 180
4 0.132 74
5 0.140 71
6 0.181 136
7 300 0.006 125
8 0.101 171
9 0.084 175
10 0.124 195
11 0.004
12 0.001
13 0.000 265
14 0.093 194
15 215 0.285 317
16 155 0.259 100
17 0.360
18 400 0.396 333 116
19 0.220 181
20 0.222 128
21 400 0.405
22 300 0.511
23 660 0.237
24 0.160
Parameters
Li Electric power demand in bus i
ag ; bg ; cg Fuel cost coefficients of thermal unit g.
max=min
Pg Maximum/minimum limits of power generation of thermal unit g.
Pmax
ij Maximum power flow limits of branch connecting bus i to j.
xij Reactance of branch connecting bus i to j.
rij Resistance of branch connecting bus i to j.
Variables
Pij Active power flow of branch connecting bus i to j.
Pg Active power generated by thermal unit g(MW).
i Locational marginal price in bus i ($/MW h).
LSi Load shedding in bus i (MW).
OF Total operating costs ($/h).
ıi Voltage angle in bus i (rad).
162 6 Multi-Period Optimal Power Flow
The load flow model considering wind power and load shedding is shown in Fig. 6.9.
The multi-period wind DC-OPF is formulated as follows:
X X
OF D ag .Pg;t /2 C bg Pg;t C cg C VOLL LSi;t C VWC Pwc
i;t (6.7a)
g;t i;t
X X
Pg;t C LSi;t C Pwi;t Li;t D Pij;t W i;t (6.7b)
g2˝Gi j2˝`i
ıi;t ıj;t
Pij;t D (6.7c)
xij
Pmax
ij Pij;t Pmax
ij (6.7d)
Pmin
g Pg;t Pmax
g (6.7e)
6.2 Multi-Period Optimal Wind-DC OPF 163
Fig. 6.9 Load flow model considering wind power and load shedding
The objective function in (6.7a) consists of operating costs of thermal units, load
shedding costs, and wind curtailment costs. The nodal power balance is formulated
in (6.7b). This equation is also providing the LMP value in bus i at time t (i;t ). The
active flow in branch connecting bus i to bus j is calculated in (6.7c). The branch flow
limits of every branch is formulated in (6.7d). The operating limits of the thermal
generating unit are modeled in (6.7e). The ramp rates of thermal units are described
in (6.7f) and (6.7g). The load shedding of bus i is limited to the existing demand at
time t as stated in (6.7h). The wind power curtailment is formulated in (6.7i). At any
bus i hosting wind turbine, the amount of wind power generation depends on wind
power availability and wind power capacity as described in (6.7j). It should bear in
mind that the demand and wind power availability change vs time. These variations
are reflected in Li;t and wt , respectively. The wind power connection points to the
network are indicated in Fig. 6.10.
The wind-demand variation pattern vs time is shown in Fig. 6.11. The optimal
thermal unit power generation schedules of multi-period wind DC-OPF is given in
Table 6.13.
164 6 Multi-Period Optimal Power Flow
1 Wind
Demand
0.8
Wind-demand pattern
0.6
0.4
0.2
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
g4 2.0 0.4 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.4 0.4 0.3 0.3 0.3 0.3 0.4 0.6 0.7 0.7 0.7 0.6 0.4 0.3 0.3
g5 15.0 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.6 0.5 0.5 0.5 0.5 0.5 0.5 0.8 1.0 1.0 1.2 1.0 0.8 0.5 0.5
g6 16.0 0.8 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.8 1.0 1.2 1.4 1.2 1.0 0.9 1.1 1.3 1.6 1.6 1.4 1.2 1.0 0.8 0.5
g7 23.0 1.4 1.2 1.1 1.1 1.1 1.1 1.1 1.2 1.4 1.6 1.8 2.0 2.2 2.1 2.3 2.5 2.7 2.9 3.1 2.9 2.7 2.5 2.3 2.1
g8 23.0 1.7 1.4 1.4 1.4 1.4 1.4 1.4 1.4 1.7 2.0 2.2 2.5 2.3 2.1 2.3 2.6 2.9 3.2 3.3 3.0 2.7 2.4 2.1 1.9
g9 7.0 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 1.2 1.7 1.2 1.1 0.9 0.8 0.8 0.8
g10 13.0 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.1 2.3 2.5 2.3 2.1 2.1 2.1 2.1 2.1
g11 15.0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.2 0.3 0.2 0.1 0.1 0.1 0.1 0.1
g12 22.0 3.0 3.0 3.0 2.9 3.0 3.0 2.7 2.7 3.0 3.0 3.0 3.0 3.0 3.0 2.7 2.3 2.7 3.0 3.0 3.0 3.0 3.0 2.7 3.0
165
166 6 Multi-Period Optimal Power Flow
GCode 6.6 Multi-period DC-OPF for modified IEEE RTS 24-bus system
S e t s b u s / 1 2 4 / , s l a c k ( b u s ) / 1 3 / , Gen / g1g12 / , t / t 1 t 2 4 / ;
S c a l a r s Sbase / 1 0 0 / ,VOLL / 1 0 0 0 0 / ,VWC / 5 0 / ; a l i a s ( bus , node ) ;
t a b l e GD( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
Pmax Pmin b CostsD c o s t s t RU RD SU SD UT DT
u i n i U0 So
Removed f o r s a v i n g s p a c e
S e t GB( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t t o
each bus
/ Removed f o r s a v i n g s p a c e / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
O m i t t e d f o r s a v i n g s p a c e ;
t a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
O m i t t e d f o r s a v i n g s p a c e ;
T a b l e WD( t , )
w d
t1 0.0786666666666667 0.684511335492475
t2 0.0866666666666667 0.644122690036197
t3 0.117333333333333 0.61306915602972
t4 0.258666666666667 0.599733282530006
t5 0.361333333333333 0.588874071251667
t10 0.548 0.787007048961707
t20 0.561333333333333 0.936368832158506
t21 0.565333333333333 0.887597637645266
t22 0.556 0.809297008954087
t23 0.724 0.74585635359116
t24 0.84 0.733473042484283;
P a r a m e t e r Wcap ( b u s )
/8 200
19 150
21 1 0 0 / ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node , bus , ’ x ’
);
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node
, bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = 1 / b r a n c h ( bus ,
node , ’ x ’ ) ;
b r a n c h ( bus , node , ’ z ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = s q r t ( power ( b r a n c h
( bus , node , ’ x ’ ) , 2 ) + power ( b r a n c h ( bus , node , ’ r ’ ) , 2 ) ) ;
b r a n c h ( node , bus , ’ z ’ ) = b r a n c h ( bus , node , ’ z ’ ) ;
p a r a m e t e r c o n e x ( bus , node ) ;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ l i m i t ’ ) and b r a n c h ( node , bus , ’
l i m i t ’ ) ) =1;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
Variables
OF , P i j ( bus , node , t ) , Pg ( Gen , t ) , d e l t a ( bus , t ) , l s h ( bus , t ) ,Pw ( bus , t ) , pc
( bus , t ) ;
Equations
const1 , const2 , const3 , const4 , const5 , const6 ;
c o n s t 1 ( bus , node , t ) $ ( c o n e x ( bus , node ) ) . . P i j ( bus , node , t ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( bus , t ) d e l t a ( node , t ) ) ;
c o n s t 2 ( bus , t ) . . l s h ( bus , t ) $BusData ( bus , ’ pd ’ )
+Pw ( bus , t ) $Wcap ( b u s ) +sum ( Gen$GB ( bus , Gen ) , Pg ( Gen , t ) )
6.2 Multi-Period Optimal Wind-DC OPF 167
The wind power generations at efferent buses vs time are shown in Fig. 6.12.
200
180 8
19
160 21
Wind power generation (MW)
140
120
100
80
60
40
20
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
The wind power curtailment is occurring in bus 19 at time t17 equal to 38.76
and also in bus 21 at time t16 equal to 15.32 MW and also at time t17 equal to
86.93 MW. The total operating cost (including the wind curtailment cost) would
be $4:3229 105 .
Nomenclature
The AC power flow considering wind generation and load shedding is shown
in Fig. 6.13.
The optimal power flow equations are described in (6.8) as follows:
X g g
X
OF D ag .Pi;t /2 C bg Pi;t C cg C VOLL PLS wc
i;t C VWC Pi;t (6.8a)
i;t i;t
g
X p
Pi;t C PLS w L
i;t C Pi;t Pi;t D Pij;t W i;t (6.8b)
j2˝`i
g
X q
Qi;t C QLS w L
i;t C Qi;t Qi;t D Qij;t W i;t (6.8c)
j2˝`i
Fig. 6.13 AC power flow considering wind generation and load shedding
170 6 Multi-Period Optimal Power Flow
g g
Pi;t Pi;t1 RUg (6.8k)
g g
Pi;t1 Pi;t RDg (6.8l)
0 PLS L
i;t Pi;t (6.8m)
0 QLS L
i;t Qi;t (6.8n)
Pwc w w
i;t D wt
i Pi;t (6.8o)
0 Pwi;t wt
wi (6.8p)
The GAMS code developed for solving the minimum cost OPF is given in
GCode 6.7. The optimal active/reactive power generation of thermal units in MP-
AC OPF are given in Figs. 6.14 and 6.15, respectively.
400
Active power generation (MVAr)
350
300
250 1
2
200 7
13
150 15
16
18
100
21
22
50 23
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
200
1 2 7 13 15 16 18 21 22 23
Reactive power generation (MVAr)
150
100
50
-50
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
GCode 6.7 Multi-period AC OPF for modified IEEE RTS 24 bus system
Nomenclature
Parameters
wi;t Availability of wind turbine connected to bus i at time t
wi Capacity of wind turbine connected to bus i
PLi;t Active power component of demand in bus i at time t
Pwi;t Active power generation by wind turbine connected to bus i at time t
Qwi;t Reactive power generation by wind turbine connected to bus i at time t
ag ; bg ; cg Fuel cost coefficients of thermal unit g.
g;max=min
Pi Maximum/minimum limits of power generation of thermal unit g
connected to bus i.
Pmax
ij Maximum power flow limits of branch connecting bus i to j.
xij Reactance of branch connecting bus i to j.
rij Resistance of branch connecting bus i to j.
VOLL Value of loss of load ($/MW h)
References 173
References
This chapter provides a solution for operation and planning aspects of energy
storage systems (ESS) problem in GAMS. The ESS integration has been analyzed
in operation and planning horizon. The inputs are generator’s characteristics,
electricity prices, demands, and network topology. The outputs of this code are
operating schedules of ESS as well as the investment decisions.
7.1 Introduction
The energy storage system (ESS) is an attractive option to increase the flexibility
of energy system operation and planning. These units can absorb energy in
case of low electricity price or excessive generation and return it back in high
price/low generation periods. Different technologies and objective functions have
been reported in the literature.
Some of the ESS technologies are as follows:
• Superconducting magnetic energy storage system (SMES) [1]
• Compressed Air Energy Storage (CAES) [2]
• Super-capacitor Energy Storage [3]
• Pumped Hydro Storage [4]
• Battery energy storage [5]
• Flywheel Energy Storage System [6]
• Power to gas storage method [7]
Some of the objective functions in ESS studies are listed as follows:
• Compensate grid voltage fluctuations [1]
• Overcome the Destabilizing Effect of Instantaneous Constant Power Loads in
DC Microgrids [3]
• Prevention of Transient Under-Frequency Load Shedding [8]
The total operating costs without using ESS are TC D $6:4796 105 as obtained in
GCode 4.1. The DED problem integrated with ESS is formulated in (7.1).
X
min TC D ag P2g;t C bg Pg;t C cg (7.1a)
Pg;t ;SOCt ;Pdt ;Pct g;t
Pmin
g Pg;t Pmax
g (7.1b)
Pg;t Pg;t1 RUg (7.1c)
Pg;t1 Pg;t RDg (7.1d)
SOCt D SOCt1 C Pct c Pdt =d t (7.1e)
Pcmin Pct Pcmax (7.1f)
Pdmin Pdt Pdmax (7.1g)
SOCmin SOCt SOCmax (7.1h)
X
Pg;t C Pdt Lt Pct (7.1i)
g
The simulation parameters for this problem are given in Table 7.1. The economic
dispatch data for four units example is given in Table 7.2. This table has 11 columns.
Table 7.2 The dynamic economic dispatch data for four thermal units example
Unit ag ($=MW2 ) bg ($=MW) cg ($) dg (kg=MW2 ) eg (kg=MW) fg .kg/ Pmin
g (MW) Pmax
g (MW) RUg (MW) RDg (MW)
g1 0.12 14.8 89 1.2 5 3 28 200 40 40
g2 0.17 16.57 83 2.3 4.24 6.09 20 290 30 30
g3 0.15 15.55 100 1.1 2.15 5.69 30 190 30 30
g4 0.19 16.21 70 1.1 3.99 6.2 20 260 50 50
177
178 7 Energy Storage Systems
The first column is showing the generating unit index. The next three columns
indicate the cost coefficients for these thermal units (ag ; bg ; cg ). The next three
columns indicate the emission coefficients for these thermal units (dg ; eg ; fg ). The
next two columns give the minimum and maximum generating limits of each unit if
they ton. The last two columns indicate the ramp up/down rates of thermal units.
The GAMS code for solving the example (7.1) is given in Code 7.1.
GCode 7.1 The cost-based dynamic economic dispatch integrated with ESS (7.1)
Set t hours / t1t24 /
Set g thermal units / p1p4 / ;
Model DEDESScostbased / a l l / ;
The total operating costs with using ESS are TC D $6:4553 105 as obtained in
GCode 7.1. The optimal solution for ESS integrated dynamic economic dispatch is
given in Table 7.3. The hourly dispatch of ESS in DED problem is shown in Fig. 7.1.
The hourly schedules of thermal units in DED-ESS problem are shown in Fig. 7.2.
800
Power/energy
600
Total power by thermal units
400 Demand
SOC t
200
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Charge/discharge (MW)
60 P ct
P dt
40
20
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
210
200
190
180
170
(MW)
160
g,t
150
P
140
g1
130 g2
g3
120
g4
110
100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Time (h)
The role of ESS in efficient utilization of wind energy is investigated in this section.
The ESS-wind-DED is formulated as follows:
X X
min TC D ag P2g;t C bg Pg;t C cg C VWC Pwc t (7.2a)
DV
g;t t
˚
DV D Pg;t ; SOCt ; Pdt ; Pct ; Pwt ; Pwc
t (7.2b)
Pmin
g Pg;t Pmax
g (7.2c)
Pg;t Pg;t1 RUg (7.2d)
Pg;t1 Pg;t RDg (7.2e)
SOCt D SOCt1 C Pct c Pdt =d t (7.2f)
Pcmin Pct Pcmax (7.2g)
Pdmin Pdt Pdmax (7.2h)
SOCmin SOCt SOCmax (7.2i)
X
Pwt C Pg;t C Pdt Lt Pct (7.2j)
g
Pwt C Pwc w
t
t (7.2k)
t 1 3 3 9 . 9 1 754 4 8 7 . 6
t 1 4 3 9 . 4 5 700 5 2 1 . 9
t 1 5 4 1 . 1 4 686 5 4 1 . 3
t 1 6 3 9 . 2 3 720 560
t 1 7 5 2 . 1 2 714 4 8 6 . 8
t 1 8 4 0 . 8 5 761 3 7 2 . 6
t19 41.2 727 3 6 7 . 4
t 2 0 4 1 . 1 5 714 3 1 4 . 3
t 2 1 4 5 . 7 6 618 3 1 6 . 6
t 2 2 4 5 . 5 9 584 3 1 1 . 4
t 2 3 4 5 . 5 6 578 4 0 5 . 4
t 2 4 3 4 . 7 2 544 4 7 0 . 4 ;
variables cost Cost of thermal u n i t s
p(g , t ) Power g e n e r a t e d by t h e r m a l power
plant
SOC( t ) , Pd ( t ) , Pc ( t ) ,Pw ( t ) ,PWC( t ) ;
p . up ( g , t ) = g e n d a t a ( g , ” Pmax ” ) ; p . l o ( g , t ) = g e n d a t a ( g , ” Pmin ” ) ;
s c a l a r SOC0 / 1 0 0 / , SOCmax / 3 0 0 / , e t a c / 0 . 9 5 / , e t a d / 0 . 9 / , VWC
/50/;
SOC . up ( t ) =SOCmax ; SOC . l o ( t ) =0.2SOCmax ;
SOC . f x ( ’ t 2 4 ’ ) =SOC0 ; Pc . up ( t ) =0.2SOCmax ;
Pc . l o ( t ) = 0 ; Pd . up ( t ) =0.2SOCmax ; Pd . l o ( t ) = 0 ;
Pw . up ( t ) = d a t a ( t , ’ wind ’ ) ; Pw . l o ( t ) = 0 ;
Pwc . up ( t ) = d a t a ( t , ’ wind ’ ) ; Pwc . l o ( t ) = 0 ;
E q u a t i o n s G e n c o n s t 3 , G e n c o n s t 4 , c o s t T h e r m a l c a l c , constESS , b a l a n c e ,
wind ;
c o s t T h e r m a l c a l c . . c o s t =e=sum ( t ,VWCpwc ( t ) )
+sum ( ( t , g ) , g e n d a t a ( g , ’ a ’ ) power ( p ( g , t ) , 2 ) + g e n d a t a ( g , ’ b ’ )
p (g , t ) +gendata (g , ’c ’ ) ) ;
G e n c o n s t 3 ( g , t ) . . p ( g , t + 1 )p ( g , t ) = l = g e n d a t a ( g , ’RU0 ’ ) ;
G e n c o n s t 4 ( g , t ) . . p ( g , t 1)p ( g , t ) = l = g e n d a t a ( g , ’RD0 ’ ) ;
c o n s t E S S ( t ) . . SOC( t ) =e=SOC0$ ( o r d ( t ) = 1 ) + SOC( t 1)$ ( o r d ( t ) >1)+Pc ( t )
e t a c Pd ( t ) / e t a d ;
b a l a n c e ( t ) . . Pw ( t ) + sum ( g , p ( g , t ) ) +Pd ( t ) =g= d a t a ( t , ’ l o a d ’ ) +Pc ( t ) ;
wind ( t ) . . Pw ( t ) +PWC( t ) =e= d a t a ( t , ’ wind ’ ) ;
Model DEDESSwind / a l l / ;
S o l v e DEDESSwind u s qcp min c o s t ;
parameter rep ( t ,) ;
r e p ( t , ’ P t h ’ ) =sum ( g , p . l ( g , t ) ) ;
r e p ( t , ’SOC ’ ) =SOC . l ( t ) ;
r e p ( t , ’ Pd ’ ) =Pd . l ( t ) ;
r e p ( t , ’ Pc ’ ) =Pc . l ( t ) ;
r e p ( t , ’ Load ’ ) = d a t a ( t , ’ l o a d ’ ) ;
e x e c u t e u n l o a d ”DEDESSwind . gdx ” P . l
e x e c u t e ’ gdxxrw . e x e DEDESSwind . gdx v a r =P r n g = P t h e r m a l ! a1 ’
e x e c u t e u n l o a d ”DEDESSwind . gdx ” r e p
e x e c u t e ’ gdxxrw . e x e DEDESSwind . gdx p a r = r e P r n g = r e p ! a1 ’
7.2 ESS Operation 183
w
Demand Total power by thermal units SOC t Pt
800
600
(MW)
400
200
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
60 P dt
P ct
(MW)
40
20
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
160
g1
140 g2
g3
g4
120
P g,t (MW)
100
80
60
40
20
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
The total operating costs using ESS are TC D $2:2336 105 as obtained
in GCode 7.2. The hourly dispatch of ESS in wind-DED problem is depicted in
Fig. 7.3. The hourly schedules of thermal units in wind-DED-ESS problem are
shown in Fig. 7.4.
184 7 Energy Storage Systems
ıi;t ıj;t
Pij;t D (7.3c)
Xij
Pmax
ij Pij;t Pmax
ij (7.3d)
Pmin
g Pg;t Pmax
g (7.3e)
Pg;t Pg;t1 RUg (7.3f)
Pg;t1 Pg;t RDg (7.3g)
0 LSi;t Li;t (7.3h)
Pwc w w
i;t D wi;t
i Pi;t (7.3i)
0 Pwi;t wt
wi (7.3j)
SOCi;t D SOCi;t1 C Pci;t c Pdi;t =d t (7.3k)
Pci;min Pci;t Pci;max (7.3l)
Pdi;min Pdi;t Pdi;max (7.3m)
SOCi;min SOCi;t SOCi;max (7.3n)
The model is implemented on IEEE RTS 24-bus network with ESS integration
which is shown in Fig. 7.5.
It is a transmission network with the voltage levels of 138 kV, 230 kV, and
Sbase = 100 MVA. The branch data for IEEE RTS 24-bus network is given in
Table 7.4 [14]. The from bus, to bus, reactance (X), resistance (r), total line charging
susceptance (b), and MVA rating (MVA) are specified in this table. The parallel
lines in MATPOWER are merged, and the resultants are given in Table 7.4. The
generation data for IEEE RTS 24-bus network is given in Table 7.5. The data of
generating units in this network is inspired by Conejo et al. [15] and Bouffard et al.
[16] with some modifications. The slack bus is bus 13 in this network.
It is assumed that the network is intact and all branches and generating units are
working in normal condition. The SOC of ESS connected to bus 19 and 21 are 200
7.2 ESS Operation 185
and 100 MW h, respectively. The rest of ESS data is the same as Table 7.1. The
minimum operating cost is $4:1839 105 obtained by using the GCode 7.3.
GCode 7.3 The ESS-DCOPF GAMS code for IEEE Reliability test 24-bus network
S e t s b u s / 1 2 4 / , s l a c k ( b u s ) / 1 3 / , Gen / g1g12 / , t / t 1 t 2 4 / ;
s c a l a r s Sbase / 1 0 0 / ,VOLL / 1 0 0 0 0 / ,VOLW / 5 0 / ; a l i a s ( bus , node ) ;
T a b l e GD( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
Pmax Pmin b CostsD c o s t s t RU RD SU SD UT DT
u i n i U0 So
The same a s b e f o r e
S e t GB( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t t o
each bus
/ The same a s b e f o r e / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
The same a s b e f o r e ;
t a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
The same a s b e f o r e ;
T a b l e WD( t , )
w d
The same a s b e f o r e ;
p a r a m e t e r Wcap ( b u s )
/8 200
19 150
21 1 0 0 / ;
p a r a m e t e r SOCMax ( b u s )
/ 1 9 200
21 1 0 0 / ;
s c a l a r e t a c / 0 . 9 5 / , e t a d / 0 . 9 / , VWC / 5 0 / ;
p a r a m e t e r SOC0 ( b u s ) ;
186
SOC0 ( b u s ) =0.2SOCMax ( b u s ) / s b a s e ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node ,
bus , ’ x ’ ) ;
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h
( node , bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = 1 / b r a n c h ( bus ,
node , ’ x ’ ) ;
b r a n c h ( bus , node , ’ z ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) =
s q r t ( power ( b r a n c h ( bus , node , ’ x ’ ) , 2 ) + power ( b r a n c h ( bus , node ,
’ r ’ ) ,2) ) ;
b r a n c h ( node , bus , ’ z ’ ) = b r a n c h ( bus , node , ’ z ’ ) ;
p a r a m e t e r c o n e x ( bus , node ) ;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ l i m i t ’ ) and b r a n c h ( node , bus , ’
l i m i t ’ ) ) =1;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
V a r i a b l e s OF , P i j ( bus , node , t ) , Pg ( Gen , t ) , d e l t a ( bus , t ) , l s h ( bus , t ) ,Pw
( bus , t ) , pwc ( bus , t ) ,
SOC( bus , t ) , Pd ( bus , t ) , Pc ( bus , t ) ;
E q u a t i o n s const1 , const2 , const3 , const4 , const5 , const6 , constESS ;
c o n s t 1 ( bus , node , t ) $ ( c o n e x ( bus , node ) ) . . P i j ( bus , node , t ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( bus , t ) d e l t a ( node , t ) ) ;
c o n s t 2 ( bus , t ) . . l s h ( bus , t ) $BusData ( bus , ’ pd ’ ) +Pw ( bus , t ) $Wcap ( b u s )
+sum ( Gen$GB ( bus , Gen ) , Pg ( Gen , t ) )
+(Pc ( bus , t ) +Pd ( bus , t ) )$SOCMAX( b u s )WD( t , ’ d ’ ) BusData ( bus , ’ pd ’ ) /
S b a s e =e=
+sum ( n o d e $ c o n e x ( node , b u s ) , P i j ( bus , node , t ) ) ;
const3 . . OF=g=sum ( ( bus , Gen , t ) $GB ( bus , Gen ) , Pg ( Gen , t ) GD( Gen , ’ b
’ ) S b a s e )
+sum ( ( bus , t ) ,VOLL l s h ( bus , t ) S b a s e $ B u s D a t a ( bus , ’ pd ’ )
+VOLWPwc ( bus , t ) sbase$Wcap ( b u s ) ) ;
c o n s t 4 ( gen , t ) . . pg ( gen , t + 1 )pg ( gen , t ) = l =GD( gen , ’RU ’ ) / S b a s e ;
c o n s t 5 ( gen , t ) . . pg ( gen , t 1)pg ( gen , t ) = l =GD( gen , ’RD ’ ) / S b a s e ;
c o n s t 6 ( bus , t ) $Wcap ( b u s ) . . pwc ( bus , t ) =e=WD( t , ’w ’ ) Wcap ( b u s ) / Sbase
pw ( bus , t ) ;
c o n s t E S S ( bus , t ) $SOCMax ( b u s ) . . SOC( bus , t ) =e=SOC0 ( b u s ) $ ( o r d ( t ) = 1 ) +
SOC( bus , t 1)$ ( o r d ( t ) >1)+Pc ( bus , t ) e t a c Pd ( bus , t ) / e t a d ;
Model l o a d f l o w / all /;
Pg . l o ( Gen , t ) =GD( Gen , ’ Pmin ’ ) / S b a s e ; Pg . up ( Gen , t ) =GD( Gen , ’ Pmax ’ ) /
Sbase ;
d e l t a . up ( bus , t ) = p i / 2 ; d e l t a . l o ( bus , t )=p i / 2 ; d e l t a . f x ( s l a c k , t ) = 0 ;
P i j . up ( bus , node , t ) $ ( ( c o n e x ( bus , node ) ) ) = b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
P i j . l o ( bus , node , t ) $ ( ( c o n e x ( bus , node ) ) )=b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
l s h . up ( bus , t ) =WD( t , ’ d ’ ) BusData ( bus , ’ pd ’ ) / S b a s e ; l s h . l o ( bus , t ) = 0 ;
Pw . up ( bus , t ) =WD( t , ’w ’ ) Wcap ( b u s ) / S b a s e ; Pw . l o ( bus , t ) = 0 ;
Pwc . up ( bus , t ) =WD( t , ’w ’ ) Wcap ( b u s ) / S b a s e ; Pwc . l o ( bus , t ) = 0 ;
SOC . up ( bus , t ) =SOCmax ( b u s ) / s b a s e ; SOC . l o ( bus , t ) =0.2SOCmax ( b u s ) /
sbase ;
SOC . f x ( bus , ’ t 2 4 ’ ) =SOC0 ( b u s ) ;
Pc . up ( bus , t ) =0.2SOCmax ( b u s ) / s b a s e ; Pc . l o ( bus , t ) = 0 ;
Pd . up ( bus , t ) =0.2SOCmax ( b u s ) / s b a s e ; Pd . l o ( bus , t ) = 0 ;
S o l v e l o a d f l o w m i n i m i z i n g OF u s i n g l p ;
7.2 ESS Operation 189
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
120
Discharge (MWh)
100
Charge (MW)
ESS at bus 21
80 SOC (MWh)
60
40
20
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
400
g 12
350
g 11
g 10
300
g9
250 g8
(MW)
g7
200
g,t
g6
P
g5
150
g4
g3
100
g2
50 g1
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 7.7 The hourly dispatch of thermal generating units in DC-OPF problem
The AC-OPF model is implemented on IEEE RTS 24-bus network with ESS
integration which is shown in Fig. 7.5. The wind capacities and ESS characteristics
are the same as Sect. 7.2.3. The minimum operating cost is $4:3018 105 obtained
by using the GCode 7.4.
GCode 7.4 The ESS-ACOPF GAMS code for IEEE Reliability test 24-bus network
S e t s b u s / 1 2 4 / , s l a c k ( b u s ) / 1 3 / , Gen / g1g12 / , t / t 1 t 2 4 / ;
S c a l a r s Sbase / 1 0 0 / ,VOLL / 1 0 0 0 0 / ,VOLW / 5 0 / ; a l i a s ( bus , node ) ;
T a b l e GD( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
s e t GB( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t t o
each bus ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
T a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
r x b limit ;
T a b l e WD( t , )
P a r a m e t e r Wcap ( b u s ) Wind c a p a c i t i e s a t e a c h b u s
p a r a m e t e r SOCMax ( b u s )
/ 19 200
21 100 / ; S c a l a r e t a c / 0 . 9 5 / , e t a d / 0 . 9 / , VWC / 5 0 / ;
P a r a m e t e r SOC0 ( b u s ) ; SOC0 ( b u s ) =0.2SOCMax ( b u s ) / s b a s e ;
b r a n c h ( bus , node , ’ z ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = s q r t ( power ( b r a n c h
( bus , node , ’ x ’ ) , 2 ) + power ( b r a n c h ( bus , node , ’ r ’ ) , 2 ) ) ;
b r a n c h ( node , bus , ’ t h e t a ’ ) $ b r a n c h ( node , bus , ’ l i m i t ’ ) =
a r c t a n ( b r a n c h ( node , bus , ’ x ’ ) / b r a n c h ( node , bus , ’ r ’ ) ) ; P a r a m e t e r
c o n e x ( bus , node ) ;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ l i m i t ’ ) and b r a n c h ( node , bus , ’
l i m i t ’ ) ) =1;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
V a r i a b l e s OF , Q i j ( bus , node , t ) , P i j ( bus , node , t ) , Pg ( Gen , t ) , Qg ( Gen , t ) ,
d e l t a ( bus , t )
,V( bus , t ) , l s h ( bus , t ) ,Pw ( bus , t ) , pwc ( bus , t ) ,SOC( bus , t ) , Pd ( bus , t ) , Pc
( bus , t ) ;
E q u a t i o n s const2 , const2B , const3 , const4 , const5 , const6 , const7 ,
const8 , constESS ;
c o n s t 1 ( bus , node , t ) $ c o n e x ( bus , node ) . . P i j ( bus , node , t ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( bus , t ) d e l t a ( node , t ) ) ;
c o n s t 2 ( bus , t ) . . l s h ( bus , t ) $BusData ( bus , ’ pd ’ ) +Pw ( bus , t ) $Wcap ( b u s ) +
sum ( Gen$GB ( bus , Gen ) ,
Pg ( Gen , t ) ) +(Pc ( bus , t ) +Pd ( bus , t ) )$SOCMAX( b u s )WD( t , ’ d ’ ) BusData
( bus , ’ pd ’ ) / S b a s e =e =+sum ( n o d e $ c o n e x ( node , b u s ) , P i j ( bus , node , t ) ) ;
c o n s t 2 B ( bus , t ) . . sum ( Gen$GB ( bus , Gen ) , Qg ( Gen , t ) )WD( t , ’ d ’ ) BusData
( bus , ’Qd ’ ) / S b a s e =e =+sum ( n o d e $ c o n e x ( node , b u s ) , Q i j ( bus , node , t ) ) ;
c o n s t 3 . . OF=g=sum ( ( bus , Gen , t ) $GB ( bus , Gen ) , Pg ( Gen , t ) GD( Gen , ’ b ’ )
S b a s e ) +sum ( ( bus , t ) ,
VOLL l s h ( bus , t ) S b a s e $ B u s D a t a ( bus , ’ pd ’ ) +VOLWPwc ( bus , t )
sbase$Wcap ( b u s ) ) ;
c o n s t 4 ( gen , t ) . . pg ( gen , t + 1 )pg ( gen , t ) = l =GD( gen , ’RU ’ ) / S b a s e ;
c o n s t 5 ( gen , t ) . . pg ( gen , t 1)pg ( gen , t ) = l =GD( gen , ’RD ’ ) / S b a s e ;
c o n s t 6 ( bus , t ) $Wcap ( b u s ) . . pwc ( bus , t ) =e=WD( t , ’w ’ ) Wcap ( b u s ) / Sbase
pw ( bus , t ) ;
c o n s t E S S ( bus , t ) $SOCMax ( b u s ) . . SOC( bus , t ) =e=SOC0 ( b u s ) $ ( o r d ( t ) = 1 )
+SOC( bus , t 1)$ ( o r d ( t ) >1)+Pc ( bus , t ) e t a c Pd (
bus , t ) / e t a d ;
192 7 Energy Storage Systems
The hourly dispatch of ESS in AC-OPF problem is shown in Fig. 7.8 and the
hourly dispatch of thermal generating units in AC-OPF problem is depicted in
Fig. 7.9.
The hourly active power losses in AC-OPF problem are shown in Fig. 7.10. The
hourly min/average/max value of voltage magnitudes (pu) is depicted in Fig. 7.11.
7.2 ESS Operation 193
300
Discharge (MW)
ESS at bus 19 Charge (MW)
200 SOC (MWh)
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
150
Discharge (MW)
Charge (MW)
ESS at bus 21
SOC (MWh)
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
400
350 g 12
g 11
300 g 10
g9
250 g8
P g,t (MW)
g7
200 g6
g5
150 g4
g3
100 g2
g1
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 7.9 The hourly dispatch of thermal generating units in AC-OPF problem
194 7 Energy Storage Systems
60
55
Active power losses (MWh)
50
45
40
35
30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
1.06
V max
V avg
1.04 V min
1.02
Voltage (pu)
0.98
0.96
0.94
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
ıi;t ıj;t
Pij;t D (7.5c)
Xij
Pmax
ij Pij;t Pmax
ij (7.5d)
Pmin
g Pg;t Pmax
g (7.5e)
Pg;t Pg;t1 RUg (7.5f)
Pg;t1 Pg;t RDg (7.5g)
0 LSi;t Li;t (7.5h)
Pwc w w
i;t D wi;t
i Pi;t (7.5i)
0 Pwi;t wt
wi (7.5j)
SOCi;t D SOCi;t1 C Pci;t c Pdi;t =d t (7.5k)
Pci;min Pci;t Pci;max (7.5l)
Pdi;min Pdi;t Pdi;max (7.5m)
SOCi;min NiESS SOCi;t SOCi;max NiESS (7.5n)
X
NiESS Nmax
ESS
(7.5o)
i
Equation (7.5n) enforces the state of charge exist only in those buses that NiESS
has nonzero value. The total number of ESS units is limited by (7.5o). The model
is implemented on IEEE RTS 24-bus network with the wind power generation as
shown in Fig. 7.5. The purpose is to find the optimal allocation ESS to minimize
the total operating costs. It should be noted that this formulation is only considering
24 h. For planning purposes, longer planning horizon should be taken into account,
196 7 Energy Storage Systems
and load growth and investment costs should also be considered. The ESS allocation
is solved using the GCode 7.5 and the total operating cost is obtained as $4:1753
105 . The optimal locations and capacities of ESS are shown in Fig. 7.12.
GCode 7.5 The ESS allocation using DC-OPF GAMS code for IEEE Reliability test 24-bus
network
S e t s b u s / 1 2 4 / , s l a c k ( b u s ) / 1 3 / , Gen / g1g12 / , t / t 1 t 2 4 / ;
S c a l a r s Nmax , S b a s e / 1 0 0 / ,VOLL / 1 0 0 0 0 / ,VWC / 5 0 / ; a l i a s ( bus ,
node ) ;
T a b l e GD( Gen , ) G e n e r a t i n g u n i t s c h a r a c t e r i s t i c s
Removed f o r s a v i n g s p a c e , t h e same a s p r e v i o u s d a t a
s e t GB( bus , Gen ) c o n n e c t i v i t y i n d e x o f e a c h g e n e r a t i n g u n i t t o
each bus
/ Removed f o r s a v i n g s p a c e , t h e same a s p r e v i o u s d a t a / ;
T a b l e BusData ( bus , ) Demands o f e a c h b u s i n MW
Removed f o r s a v i n g s p a c e , t h e same a s p r e v i o u s d a t a
t a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
r x b limit
Removed f o r s a v i n g s p a c e , t h e same a s p r e v i o u s d a t a ;
T a b l e WD( t , )
Removed f o r s a v i n g s p a c e , t h e same a s p r e v i o u s d a t a ;
p a r a m e t e r Wcap ( b u s )
/8 200
19 150
21 1 0 0 / ;
p a r a m e t e r SOCMax ( b u s ) ; s c a l a r e t a c / 0 . 9 5 / , e t a d / 0 . 9 / , VWC
/50/;
p a r a m e t e r SOC0 ( b u s ) ;
b r a n c h ( bus , node , ’ x ’ ) $ ( b r a n c h ( bus , node , ’ x ’ ) = 0 ) = b r a n c h ( node , bus , ’ x ’
);
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node
, bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = 1 / b r a n c h ( bus ,
node , ’ x ’ ) ;
b r a n c h ( bus , node , ’ z ’ ) $ b r a n c h ( bus , node , ’ L i m i t ’ ) = s q r t ( power ( b r a n c h
( bus , node , ’ x ’ ) , 2 )
+ power ( b r a n c h ( bus , node , ’ r ’ ) , 2 ) ) ;
b r a n c h ( node , bus , ’ z ’ ) = b r a n c h ( bus , node , ’ z ’ ) ;
P a r a m e t e r c o n e x ( bus , node ) ;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ l i m i t ’ ) and b r a n c h ( node , bus , ’
l i m i t ’ ) ) =1;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
V a r i a b l e s OF , P i j ( bus , node , t ) , Pg ( Gen , t ) , d e l t a ( bus , t ) , l s h ( bus , t ) ,Pw
( bus , t ) ,
pwc ( bus , t ) ,SOC( bus , t ) , Pd ( bus , t ) , Pc ( bus , t ) ;
I n t e g e r v a r i a b l e NESS ( b u s ) ;
E q u a t i o n s c o n s t 1 , c o n s t 2 , c o n s t 3 , c o n s t 4 , c o n s t 5 , c o n s t 6 , constESS ,
constESS2 , constESS3 , constESS4 , constESS5 , c o n s t E S S 6 ;
c o n s t 1 ( bus , node , t ) $ ( c o n e x ( bus , node ) ) . . P i j ( bus , node , t ) =e=
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( bus , t ) d e l t a ( node , t ) ) ;
c o n s t 2 ( bus , t ) . . l s h ( bus , t ) $BusData ( bus , ’ pd ’ ) +Pw ( bus , t ) $Wcap ( b u s )
7.3 ESS Allocation 197
+sum ( Gen$GB ( bus , Gen ) , Pg ( Gen , t ) ) +(Pc ( bus , t ) +Pd ( bus , t ) )$SOCMAX( b u s
)
WD( t , ’ d ’ ) BusData ( bus , ’ pd ’ ) / S b a s e =e =+sum ( n o d e $ c o n e x ( node , b u s ) ,
P i j ( bus , node , t ) ) ;
c o n s t 3 . . OF=g=sum ( ( bus , Gen , t ) $GB ( bus , Gen ) , Pg ( Gen , t ) GD( Gen , ’ b ’ )
S b a s e ) +sum ( ( bus , t ) ,
VOLL l s h ( bus , t ) S b a s e $ B u s D a t a ( bus , ’ pd ’ ) +VWCPwc ( bus , t )
sbase$Wcap ( b u s ) ) ;
c o n s t 4 ( gen , t ) . . pg ( gen , t + 1 )pg ( gen , t ) = l =GD( gen , ’RU ’ ) / S b a s e ;
c o n s t 5 ( gen , t ) . . pg ( gen , t 1)pg ( gen , t ) = l =GD( gen , ’RD ’ ) / S b a s e ;
c o n s t 6 ( bus , t ) $Wcap ( b u s ) . . pwc ( bus , t ) =e=WD( t , ’w ’ ) Wcap ( b u s ) / Sbase
pw ( bus , t ) ;
c o n s t E S S ( bus , t ) . . SOC( bus , t ) =e = ( 0 . 2 NESS ( b u s ) SOCMax ( b u s ) / s b a s e
) $ ( ord ( t ) =1)+
SOC( bus , t 1)$ ( o r d ( t ) >1)+Pc ( bus , t ) e t a c Pd ( bus , t ) / e t a d ;
c o n s t E S S 2 ( bus , t ) . . SOC( bus , t ) = l =NESS ( b u s ) SOCmax ( b u s ) / s b a s e ;
c o n s t E S S 3 ( bus , t ) . . Pc ( bus , t ) = l =0.2NESS ( b u s ) SOCmax ( b u s ) / s b a s e ;
c o n s t E S S 4 ( bus , t ) . . Pd ( bus , t ) = l =0.2NESS ( b u s ) SOCmax ( b u s ) / s b a s e ;
constESS5 . . sum ( bus , NESS ( b u s ) ) = l =Nmax ;
c o n s t E S S 6 ( b u s ) . . SOC( bus , ’ t 2 4 ’ ) =e =0.2NESS ( b u s ) SOCmax ( b u s ) /
sbase ;
Model l o a d f l o w / all /;
Pg . l o ( Gen , t ) =GD( Gen , ’ Pmin ’ ) / S b a s e ; Pg . up ( Gen , t ) =GD( Gen , ’ Pmax ’ ) /
Sbase ;
d e l t a . up ( bus , t ) = p i / 2 ; d e l t a . l o ( bus , t )=p i / 2 ; d e l t a . f x ( s l a c k , t ) = 0 ;
P i j . up ( bus , node , t ) $ ( ( c o n e x ( bus , node ) ) ) = b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
P i j . l o ( bus , node , t ) $ ( ( c o n e x ( bus , node ) ) )=b r a n c h ( bus , node , ’ L i m i t ’ ) /
Sbase ;
l s h . up ( bus , t ) = WD( t , ’ d ’ ) BusData ( bus , ’ pd ’ ) / S b a s e ; l s h . l o ( bus , t ) =
0;
Pw . up ( bus , t ) =WD( t , ’w ’ ) Wcap ( b u s ) / S b a s e ; Pw . l o ( bus , t ) = 0 ;
Pwc . up ( bus , t ) =WD( t , ’w ’ ) Wcap ( b u s ) / S b a s e ; Pwc . l o ( bus , t ) = 0 ;
SOC . l o ( bus , t ) = 0 ; Pc . l o ( bus , t ) = 0 ; Pd . l o ( bus , t ) = 0 ;
NESS . up ( b u s ) = 5 ; SOCMax ( b u s ) = 2 0 ; SOC0 ( b u s ) =0.2SOCMax ( b u s ) / s b a s e ;
Nmax = 1 5 ;
S o l v e l o a d f l o w m i n i m i z i n g OF u s i n g mip ;
The hourly dispatch of storage unit in optimal ESS allocation problem is shown in
Fig. 7.13. The hourly dispatch of thermal generating units in ESS allocation problem
is depicted in Fig. 7.14.
198 7 Energy Storage Systems
Fig. 7.12 The optimal allocation of ESS units in IEEE RTS network
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
ESS at bus 5
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
ESS at bus 13
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 7.13 The hourly dispatch of storage unit in optimal ESS allocation problem
Nomenclature
Indices
400
350 g 12
g 11
300 g 10
g9
250 g8
P g,t (MW)
g7
g6
200
g5
g4
150
g3
g2
100
g1
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 7.14 The hourly dispatch of thermal generating units in ESS allocation problem
Parameters
et Electric energy price at time t ($/MW h).
Lt Electric demand at time t.
ag ; bg ; cg Fuel cost coefficients of unit i.
max=min
Pg Maximum/minimum limits of power generation of thermal unit i.
RUg =RDg Ramp-up/down limit of generation unit i (MW/h).
VWC Value of wind curtailment
wt Wind availability at time t
Variables
ESS
Ui;t Binary variable indicating the charge/discharge mode of ESS connected to
bus i at time t
Pwt Wind generation at time t
Pwc
t Wind curtailment at time t
Cg;t Fuel cost of thermal unit i at time t ($).
Pg;t Power generated by thermal unit i at time t (MW).
TC Total operating costs ($).
7.4 Applications
Various applications of ESS in power system operation and planning studies have
been investigated in the literature. Some of these aspects are listed here as follows:
• Electrical Energy Storage and Real-Time Thermal Ratings to Defer Network
Reinforcement [17]
200 7 Energy Storage Systems
• Energy storage and its use with intermittent renewable energy [18]
• Sizing of Energy Storage for microgrids [19]
• Primary Frequency Control using ESS [20]
• OPF in microgrids with ESS [21]
• ESS sizing for grid-connected photovoltaic systems [22]
• Coupling pumped hydro energy storage with UC [23]
• Transmission congestion relief privately owned large-scale ESS [24]
• Phase balancing using ESS in power grids under uncertainty [11]
• Price maker ESS in nodal energy markets [25]
• Value of ESS in dynamic economic dispatch game [26]
• Impact of strategic behavior and ownership of ESS on provision of flexibility
[27]
• Reliability improvement using ESS [28]
References
14. R.D. Zimmerman, C.E. Murillo-Sanchez, R.J. Thomas, Matpower: steady-state operations,
planning, and analysis tools for power systems research and education. IEEE Trans. Power
Syst. 26(1), 12–19 (2011)
15. A.J. Conejo, M. Carrión, J.M. Morales, Decision Making Under Uncertainty in Electricity
Markets, vol. 1 (Springer, New York, 2010)
16. F. Bouffard, F.D. Galiana, A.J. Conejo, Market-clearing with stochastic security-part II: case
studies. IEEE Trans. Power Syst. 20(4), 1827–1835 (2005)
17. D.M. Greenwood, N.S. Wade, P.C. Taylor, P. Papadopoulos, N. Heyward, A probabilistic
method combining electrical energy storage and real-time thermal ratings to defer network
reinforcement. IEEE Trans. Sustain. Energy 8(1), 374–384 (2017)
18. J.P. Barton, D.G. Infield, Energy storage and its use with intermittent renewable energy. IEEE
Trans. Energy Convers. 19(2), 441–448 (2004)
19. S.X. Chen, H.B. Gooi, M.Q. Wang, Sizing of energy storage for microgrids. IEEE Trans. Smart
Grid 3(1), 142–151 (2012)
20. A. Oudalov, D. Chartouni, C. Ohler, Optimizing a battery energy storage system for primary
frequency control. IEEE Trans. Power Syst. 22(3), 1259–1266 (2007)
21. Y. Levron, J.M. Guerrero, Y. Beck, Optimal power flow in microgrids with energy storage.
IEEE Trans. Power Syst. 28(3), 3226–3234 (2013)
22. Y. Ru, J. Kleissl, S. Martinez, Storage size determination for grid-connected photovoltaic
systems. IEEE Trans. Sustain. Energy 4(1), 68–81 (2013)
23. K. Bruninx, Y. Dvorkin, E. Delarue, H. Pandi, W. Dhaeseleer, D.S. Kirschen, Coupling pumped
hydro energy storage with unit commitment. IEEE Trans. Sustain. Energy 7(2), 786–796
(2016)
24. H. Khani, M.R. Dadash Zadeh, A.H. Hajimiragha, Transmission congestion relief using
privately owned large-scale energy storage systems in a competitive electricity market. IEEE
Trans. Power Syst. 31(2), 1449–1458 (2016)
25. H. Mohsenian-Rad, Coordinated price-maker operation of large energy storage units in nodal
energy markets. IEEE Trans. Power Syst. 31(1), 786–797 (2016)
26. W. Tang, R. Jain, Dynamic economic dispatch game: the value of storage. IEEE Trans. Smart
Grid 7(5), 2350–2358 (2016)
27. K. Hartwig, I. Kockar, Impact of strategic behavior and ownership of energy storage on
provision of flexibility. IEEE Trans. Sustain. Energy 7(2), 744–754 (2016)
28. A. Vieira Pombo, J. Murta-Pina, V. Ferno Pires, Multiobjective formulation of the integration
of storage systems within distribution networks for improving reliability. Electr. Power Syst.
Res. 148, 87–96 (2017)
Chapter 8
Power System Observability
This chapter provides a solution for increasing the power system observability by
allocation of Phasor Measurement Units (PMU) problem in GAMS. The PMU is
able to measure the voltage phasor at the connection bus and also it measures the
current phasor of any branch connected to the bus hosting the PMU. Different cases
are analyzed and the problem is tested on some standard IEEE cases.
The PMU devices are able to provide the system operator a set of synchronized
phasor measurements in the system in order to make it observable. In this case,
it is needed to make every existing bus observable no matter if it has any
generation/demand or not. Additionally, the contingencies are not considered. In
order to explain the observability concept, Fig. 8.1 provides an example. If a PMU
is installed on bus i then bus i and all adjacent buses are observable. It means that the
voltage phasors of these buses are known. The system is called observable if every
bus of the network is observable.
The PMU placement concept is simply explained as follows: If a bus or at least
one of its adjacent buses is equipped with PMU then this bus is observable. One
trivial solution for PMU placement problem is installing PMU at all buses. This
solution makes all buses observable but obviously the costs would be very high and
sometimes practical aspects do not allow this to happen. In other words, it is tried
to find the minimum number of buses to have PMU devices in order to make the
whole system observable. This PMU placement problem is formulated as follows:
X
min OF D i (8.1a)
i
i2˝B
X
i C j ˛i 8i 2 ˝B (8.1b)
j2˝ij`
˛i D 1 (8.1c)
where i; j are bus index, i is a binary variable indicating if it has PMU (1) or not (0),
˝B is the set of all network buses, ˛i is a binary parameter (observability) which is
set to 1 to make the whole network observable, and ˝i is the set of all buses adjacent
(connected) to bus i.
The GAMS code for solving the optimal PMU allocation in IEEE 14-bus network
without considering the zero bus injection is provided in GCode 8.1.
GCode 8.1 PMU allocation for IEEE 14 network without considering zero injection nodes
S e t s bus /114/;
A l i a s ( bus , node ) ;
T a b l e BusData ( bus , ) b u s s c h a r a c t e r i s t i c s
Pd gen
1 0 1
2 21.7 1
3 94.2 1
4 47.8
5 7.6
6 11.2 1
8 0 1
9 29.5
10 9
11 3.5
12 6.1
13 13.5
14 14.9 ;
s e t conex Bus c o n n e c t i v i t y m a t r i x
8.1 Min No. PMU Placement 205
/1 . 2
1 . 5
2 . 3
2 . 4
2 . 5
3 . 4
4 . 5
4 . 7
4 . 9
5 . 6
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
V a r i a b l e s OF ;
B i n a r y v a r i a b l e PMU( b u s ) ;
Equations
const1 ,
const2 ;
S o l v e p l a c e m e n t m i n i m i z i n g OF u s i n g mip ;
The optimal PMU allocation for IEEE 14-bus without considering the zero
injection buses is obtained using GCode 8.1 and is shown in Fig. 8.2. The simulation
results show that four PMU devices are required to make the IEEE 14-bus network
fully observable. The optimal PMU allocation for IEEE 57-bus without considering
the zero injection buses is shown in Fig. 8.3. The simulation results show that 14
PMU devices are needed to make the IEEE 57-bus network fully observable.
The optimal PMU allocation for IEEE 118-bus without considering the zero
injection buses is shown in Fig. 8.4. The simulation results show that 32 PMU
devices are required to make the IEEE 118-bus network fully observable.
Fig. 8.2 Optimal PMU allocation for IEEE 14-bus without considering the zero injection buses
Fig. 8.3 Optimal PMU allocation for IEEE 57-bus without considering the zero injection buses
8.2 Min Cost PMU placement 207
Fig. 8.4 Optimal PMU allocation for IEEE 118-bus without considering the zero injection buses
The cost of PMU device is basically dependent on the number of channels used for
measurement. In [1], it is stated that if the cost of each PMU is C and the number of
used channels is n at bus i then the total PMU cost would be wi D .1 C 0:1 n/C
in the mentioned bus. n is the number of branches connected to bus i.
X
min OF D wi i (8.2a)
i
i2˝B
X
i C j ˛i 8i 2 ˝B (8.2b)
j2˝ij`
˛i D 1 (8.2c)
where i; j are bus index, i is a binary variable indicating if it has PMU (1) or not
(0), ˝B is the set of all network buses, and ˛i is a binary parameter (observability)
which is set to 1 to make the whole network observable.
The GAMS code for solving the optimal allocation of PMU devices with
minimum cost without considering the ZIB is described in GCode 8.2.
208 8 Power System Observability
GCode 8.2 Min cost PMU allocation for IEEE 14 network without considering zero injection
nodes
S e t s bus / 1 1 4 / ;
a l i a s ( bus , node ) ;
Set conex Bus c o n n e c t i v i t y m a t r i x
/1 . 2
1 . 5
2 . 3
2 . 4
2 . 5
3 . 4
4 . 5
4 . 7
4 . 9
5 . 6
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
p a r a m e t e r s c o s t ( bus ) ;
c o s t ( b u s ) =1+0.1sum ( n o d e $ c o n e x ( bus , node ) , 1 ) ;
Variables
OF_c ;
binary variable
PMU( b u s ) ;
Equations
const0 ,
const2 ;
const0 . . OF_c=e=sum ( bus , c o s t ( b u s ) PMU( b u s ) ) ;
c o n s t 2 ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus , node ) ,
PMU( node ) ) =g = 1 ;
Option o p t c r =0;
The minimum cost PMU allocation problem is solved and the solutions are given
in Table 8.1.
Some buses in the network do not contain demand or generation which are called
Zero Injection Buses (ZIB). These buses can be specially treated in terms of
observability as explained in Fig. 8.5. This figure shows zero injection bus j and its
adjacent buses. The observability of each bus is guaranteed with the observability
of n 1 of them [2]. In this way, the network buses ˝B will be divided into two
categories as follows:
• Zero injection buses ˝z or adjacent to zero injection buses ˝za
• The rest of the buses (normal buses) ˝n
X
min OF D i (8.3a)
i
i2˝B
210 8 Power System Observability
Fig. 8.6 Optimal PMU allocation for IEEE 14-bus with considering the zero injection buses
X
i C j ˛i 8i 2 ˝n (8.3b)
j2˝ij`
* +
X X
a C j j˝za j 1 8i 2 ˝za (8.3c)
` `
a2˝ia j2˝aj
˛i D 1 (8.3d)
where i; j are bus index, i is a binary variable indicating if it has PMU (1) or not
(0), ˝B is the set of all network buses, and ˛i is a binary parameter (observability)
which is set to 1 to make the whole network observable.
The zero injection buses for the networks under study are specified in Table 8.2.
The GAMS code for solving the optimal PMU allocation in IEEE 14-bus network
without considering the zero bus injection is provided in GCode 8.1 The optimal
PMU allocation for IEEE 14 and 57 bus systems with considering the zero injection
buses are given in Figs. 8.6 and 8.7, respectively. The optimal PMU allocation for
IEEE 118-bus with considering the zero injection buses is shown in Fig. 8.8. The
8.3 Min No. PMU Placement Considering ZIB 211
Fig. 8.7 Optimal PMU allocation for IEEE 57-bus with considering the zero injection buses
simulation results show that 29 PMU devices are required to make the IEEE 118-
bus network fully observable.
GCode 8.3 PMU allocation for IEEE 14 network considering zero injection nodes
14 14.9 ;
s e t conex Bus c o n n e c t i v i t y m a t r i x
/1 . 2
1 . 5
2 . 3
2 . 4
2 . 5
3 . 4
4 . 5
4 . 7
4 . 9
5 . 6
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
p a r a m e t e r s A( bus , node ) ,B( bus , node ) , Z ( b u s ) , n o r m a l ( b u s ) ,
abnormal ( bus ) ;
Z ( b u s ) $ ( BusData ( bus , ’ Pd ’ ) =0 and BusData ( bus , ’ gen ’ ) = 0 ) =
yes ;
A( bus , node ) $ ( Z ( b u s ) and c o n e x ( bus , node ) ) = y e s ;
n o r m a l ( b u s ) $ ( Z ( b u s ) =0 and sum ( n o d e $ c o n e x ( bus , node ) ,
Z ( node ) ) = 0 ) = y e s ;
B( bus , node ) $ (A( bus , node ) ) = y e s ;
B ( bus , node ) $ ( Z ( node ) and o r d ( b u s ) = o r d ( node ) ) = y e s ;
a b n o r m a l ( b u s ) $ ( n o r m a l ( b u s ) = 0 ) = y e s ; V a r i a b l e s OF ; b i n a r y
v a r i a b l e PMU( b u s ) ;
E q u a t i o n s c o n s t 1 , eq1 , eq2 ;
const1 . . OF=g=sum ( bus ,PMU( b u s ) ) ;
eq1 ( b u s ) $ n o r m a l ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus ,
node ) ,PMU( node ) ) =g = 1 ;
eq2 ( b u s ) $ a b n o r m a l ( b u s ) . . sum ( s h i n $ c o n e x ( bus , s h i n ) ,
PMU( s h i n ) +sum ( n o d e $ c o n e x ( s h i n , node ) ,PMU( node ) ) ) =g=sum
( node , B ( bus , node ) ) 1;
Model p l a c e m e n t W i t h z e r o i n j e c t i o n / c o n s t 1 , eq1 , eq2 / ;
S o l v e p l a c e m e n t W i t h z e r o i n j e c t i o n m i n i m i z i n g OF u s i n g
mip ;
8.4 Min No. PMU Placement for Maximizing the Observability 213
Fig. 8.8 Optimal PMU allocation for IEEE 118-bus with considering the zero injection buses
Another question that can be asked is how to maximize the system observability
using a limited number of PMU devices. How should these units be allocated in a
given system? In order to answer this question, a binary variable ˛i is defined which
states bus i is observable (1) or not (0). The optimization problem to be solved is as
follows:
X
max OF D ˛i (8.4a)
i ;˛i
i2˝B
X
i NPMU (8.4b)
i2˝B
X
i C j ˛i 8i 2 ˝B (8.4c)
j2˝ij`
1 ˛i (8.4d)
where i; j are bus index, i is a binary variable indicating if it has PMU (1) or not
(0), ˝B is the set of all network buses, ˛i is an integer variable (observability) which
its minimum value is set to 1 to make the whole network observable, and NPMU is
the number of available PMU devices.
214 8 Power System Observability
The GAMS code for solving the optimal PMU allocation in IEEE 14-bus network
for maximizing the system observability is provided in GCode 8.4. The optimal
solution is described in Table 8.3.
GCode 8.4 PMU allocation for IEEE 14 network for maximizing the system observability
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
p a r a m e t e r s A( bus , node ) ,B( bus , node ) , Z ( b u s ) , n o r m a l ( b u s ) ,
abnormal ( bus ) ;
Z ( b u s ) $ ( BusData ( bus , ’ Pd ’ ) =0 and BusData ( bus , ’ gen ’ ) = 0 ) =
yes ;
A( bus , node ) $ ( Z ( b u s ) and c o n e x ( bus , node ) ) = y e s ;
n o r m a l ( b u s ) $ ( Z ( b u s ) =0 and sum ( n o d e $ c o n e x ( bus , node ) ,
Z ( node ) ) = 0 ) = y e s ;
a b n o r m a l ( b u s ) $ ( n o r m a l ( b u s ) = 0 ) = y e s ; B( bus , node ) $ (A( bus ,
node ) ) = y e s ;
B ( bus , node ) $ ( Z ( node ) and o r d ( b u s ) = o r d ( node ) ) = y e s ;
V a r i a b l e s OF , OBI ; B i n a r y v a r i a b l e s PMU( b u s ) , a l p h a ( b u s )
; S c a l a r NPMU / 1 0 / ;
E q u a t i o n s eq3 , eq4 , eq5 ;
eq3 . . sum ( bus , pmu ( b u s ) ) = l =NPMU; eq4 . . OBI=e=sum
( node , a l p h a ( node ) ) ;
eq5 ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus , node ) ,PMU( node )
) =g= a l p h a ( b u s ) ;
O p t i o n o p t c r = 0 ; Model p l a c e m e n t 3 / eq3 , eq4 , eq5 / ;
S o l v e p l a c e m e n t 3 m a x i m i z i n g OBI u s i n g mip ;
s e t c o u n t e r / c1c4 / ; p a r a m e t e r r e p o r t ( bus , c o u n t e r ) ,
OBIrep ( c o u n t e r ) ;
l o o p ( c o u n t e r , NPMU= o r d ( c o u n t e r ) ; S o l v e p l a c e m e n t 3
m a x i m i z i n g OBI u s i n g mip ;
r e p o r t ( bus , c o u n t e r ) =pmu . l ( b u s ) ; OBIrep ( c o u n t e r ) =OBI . l ;
);
The total observable buses vs NPMU in IEEE 57-bus network is shown in Fig. 8.9.
The total observable buses vs NPMU in IEEE 118-bus network is shown in Fig. 8.10.
216 8 Power System Observability
60
Total number of observable buses
50
40
30
20
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
NPMU
120
Total number of observable buses
100
80
60
40
20
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
N
PMU
In order to make the system observability resilient against the loss of single PMU
device, each bus should be observed at least by two PMU devices. The PMU
allocation resilient against single PMU outage is formulated as follows:
X
min OF D i (8.5a)
i
i2˝B
X
i C j 2˛i 8i 2 ˝B (8.5b)
j2˝ij`
˛i D 1 (8.5c)
˛i is a binary parameter which shows the observability of each bus and is set to 1 to
make the whole network observable. The GAMS code for PMU allocation of IEEE
14 network resilient against single PMU outage is provided in GCode 8.5.
GCode 8.5 PMU allocation for IEEE 14 network resilient against single PMU outage
Sets
bus / 1 1 4 / ;
a l i a s ( bus , node ) ;
a l i a s ( bus , s h i n ) ;
s e t conex Bus c o n n e c t i v i t y m a t r i x
/1 . 2
1 . 5
2 . 3
2 . 4
2 . 5
3 . 4
4 . 5
4 . 7
4 . 9
5 . 6
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
218 8 Power System Observability
binary variable
PMU( b u s ) ;
Equations
const1 ,
const2A ;
const1 . . OF=e=sum ( bus ,PMU( b u s ) ) ;
c o n s t 2 A ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus , node ) ,PMU
( node ) ) =g = 2 ;
Option o p t c r =0;
S o l v e p l a c e m e n t 4 m i n i m i z i n g OF u s i n g mip ;
D i s p l a y pmu . l ;
The optimal PMU allocation for IEEE 14-bus resilient against single PMU outage
is shown in Fig. 8.11. As it can be seen in this figure, 9 PMU devices are needed
to make the system fully observable even in the case of single PMU outage. The
optimal PMU allocation for IEEE 57-bus resilient against single PMU outage is
shown in Fig. 8.12. As it can be seen in this figure, 33 PMU devices are needed to
make the system fully observable even in the case of single PMU outage.
The optimal PMU allocation for IEEE 118-bus resilient against single PMU
outage is shown in Fig. 8.13. As it can be seen in this figure, 68 PMU devices are
needed to make the system fully observable even in the case of single PMU outage.
In this section, PMU units are allocated in the network in order to keep the system
observable even in case of single line outage. For this purpose, each bus should
have a PMU or should be monitored with at least two other PMU devices. This is
formulated as follows:
X
min OF D i (8.6a)
i ;˛i
i2˝B
i C ˛i 1 8i 2 ˝B (8.6b)
Fig. 8.11 Optimal PMU allocation for IEEE 14-bus resilient against single PMU outage
Fig. 8.12 Optimal PMU allocation for IEEE 57-bus resilient against single PMU outage
220 8 Power System Observability
Fig. 8.13 Optimal PMU allocation for IEEE 118-bus resilient against single PMU outage
X
j 2 ˛i 8i 2 ˝B (8.6c)
j2˝ij`
˛i ; i 2 f0; 1g (8.6d)
The GAMS code for solving the PMU allocation considering single line outage is
developed in GCode 8.6. ˛i is a binary variable which indicates if bus i is monitored
using the PMU installed in the adjacent buses. The optimal solution is given in
Table 8.4.
GCode 8.6 PMU allocation for IEEE 14 network resilient against single line outage
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
V a r i a b l e s OF ; B i n a r y v a r i a b l e PMU( b u s ) , a l p h a ( b u s ) ;
s c a l a r NPMU / 1 0 / ; E q u a t i o n s c o n s t 1 , c o n s t 2 C , c o n s t 2 D ;
const1 . . OF=e=sum ( bus ,PMU( b u s ) ) ;
c o n s t 2 C ( b u s ) . . PMU( b u s ) + a l p h a ( b u s ) =g = 1 ;
c o n s t 2 D ( b u s ) . . sum ( n o d e $ c o n e x ( bus , node ) ,PMU( node ) ) =g
=2 a l p h a ( b u s ) ;
Option o p t c r =0;
Model p l a c e m e n t 6 / const1 , const2C , const2D / ;
S o l v e p l a c e m e n t 6 m i n i m i z i n g OF u s i n g mip ;
D i s p l a y pmu . l ;
The optimal number of PMU units for making the system fully observable is
obtained so far in previous sections. The next step is the implementation of these
plans by the system operator. The ideal situation is installing all PMU units in
the obtained network buses. However, simultaneous installation of theses devices
222 8 Power System Observability
is not possible due to some practical difficulties such as unavailability of crews and
difficulties in simultaneous maintenance outage of lines for PMU installations. In
this section, it is assumed that the optimal number and locations of PMU units
are already obtained. The system operator can only install a limited number of
PMU devices at a given period of time. The question is that which buses should
be equipped with PMU at each phase. This problem is called Multistage PMU
placement. The decision maker should maximize the number of observable buses
of the systems at each phase. The number of observable buses will increase in each
phase and after the final phase, the whole system will be observable. In order to
solve the problem, the following steps should be taken:
1. The optimal number of PMU units are found using the techniques discussed so
far. It might be considering ZIP or contingencies or costs. Save this number Npmu
and the locations of PMU devices.
2. How many installation stages and how many PMU units ( p ) are going to be
installed in each stage?
3. The following optimization problem is solved for stage p.
X
max OBI D ˛i (8.7a)
i ;˛i
i2˝B
X
TPMU D i p (8.7b)
i2˝B
X
i C j ˛i 8i 2 ˝B (8.7c)
j2˝ij`
i ; ˛i 2 f0; 1g (8.7d)
Sets
bus / 1 1 4 / ;
a l i a s ( bus , node ) ;
s e t conex Bus c o n n e c t i v i t y m a t r i x
/1 . 2
1 . 5
2 . 3
2 . 4
2 . 5
3 . 4
4 . 5
4 . 7
8.6 Multistage PMU Placement 223
4 . 9
5 . 6
6 . 11
6 . 12
6 . 13
7 . 8
7 . 9
9 . 10
9 . 14
10 . 11
12 . 13
13 . 14/;
c o n e x ( bus , node ) $ ( c o n e x ( node , b u s ) ) = 1 ;
Variables
OF , OBI ;
B i n a r y v a r i a b l e PMU( b u s ) , a l p h a ( b u s ) , b e t a ( b u s ) ;
Equations const1 , const2 , const3 , const2E , const3A ;
const1 . . OF=e=sum ( bus ,PMU( b u s ) ) ;
c o n s t 2 ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus , node ) ,PMU
( node ) ) =g = 1 ;
c o n s t 2 E ( b u s ) . . PMU( b u s ) +sum ( n o d e $ c o n e x ( bus , node ) ,PMU
( node ) ) =g= b e t a ( b u s ) ;
const3 . . OBI=e=sum ( bus , b e t a ( b u s ) ) ;
const3A . . OF=e=sum ( bus , PMU( b u s ) ) ;
Option o p t c r =0;
Model p l a c e m e n t / const1 , const2 / ;
Model p l a c e m e n t 8 / const2E , const3 , const3A / ;
S e t cp / cp1 cp3 / ; A l i a s ( cp , cpp ) ;
P a r a m e t e r p h a s e _ r e p ( cp , ) , phase_pmu ( cp , b u s ) ; P a r a m e t e r
p h a s e ( cp )
/ cp1 2
cp2 1
cp3 1 / ;
S o l v e p l a c e m e n t m i n i m i z i n g OF u s i n g mip ;
d i s p l a y pmu . l ; Pmu . f x ( b u s ) $ ( Pmu . l ( b u s ) = 0 ) = 0 ;
b e t a . up ( b u s ) = 1 ; b e t a . l o ( b u s ) = 0 ;
l o o p ( cp ,
OF . up=sum ( cpp$ ( o r d ( cpp ) <= o r d ( cp ) ) , p h a s e ( cpp ) ) ;
s o l v e p l a c e m e n t 8 m a x i m i z i n g OBI u s i n g mip ;
p h a s e _ r e p ( cp , ’OBS ’ ) =OBI . l ;
p h a s e _ r e p ( cp , ’Tpmu ’ ) =sum ( bus , Pmu . l ( b u s ) ) ;
phase_pmu ( cp , b u s ) =pmu . l ( b u s ) ;
Pmu . f x ( b u s ) $ (PMU. l ( b u s ) ) = 1 ; ) ;
224 8 Power System Observability
Fig. 8.14 Multistage optimal PMU allocation for different case studies
The solution for multistage optimal PMU allocation for different case studies is
shown in Fig. 8.14.
The optimal allocation of PMU devices in multistage PMU allocation is shown in
Table 8.5. It is assumed that the total number of PMU (TPMU) for full observability
of the system is known in advance. Three installation phases are considered and the
possible number of installable PMU devices ( p ) is also known.
8.7 Applications
Different objective functions as well as methods have been proposed in the literature
to improve the power system observability as follows:
• MIP formulation for optimal PMU placement [3]
• Multi-stage MIP-based PMU allocation [2]
• Optimal PMU Placement considering measurement Loss and branch outage [4]
• Weighted least squares algorithm for optimal PMU placement [5]
• Redundancy and observability analysis of conventional measurement and
PMU [6]
• Semi-definite Programming for optimal PMU placement considering fixed
channel capacity [7]
References 225
• Optimal PMU placement for full network observability using tabu search
algorithm [8]
• Multi-objective optimal PMU placement using a non-dominated sorting differ-
ential evolution algorithm [9]
• Iterated Local Search for optimal PMU allocation [10]
References
1. V. Basetti, A.K. Chandel, Optimal PMU placement for power system observability using
Taguchi binary bat algorithm. Measurement 95, 8–20 (2017)
2. D. Dua, S. Dambhare, R.K. Gajbhiye, S.A. Soman, Optimal multistage scheduling of PMU
placement: an ILP approach. IEEE Trans. Power Delivery 23(4), 1812–1820 (2008)
3. B. Gou, Generalized integer linear programming formulation for optimal PMU placement.
IEEE Trans. Power Syst. 23(3), 1099–1104 (2008)
4. C. Rakpenthai, S. Premrudeepreechacharn, S. Uatrongjit, N.R. Watson, An optimal PMU
placement method against measurement loss and branch outage. IEEE Trans. Power Delivery
22(1), 101–107 (2007)
5. N.M. Manousakis, G.N. Korres, A weighted least squares algorithm for optimal PMU
placement. IEEE Trans. Power Syst. 28(3), 3499–3500 (2013)
6. J.B.A. London, S.A.R. Piereti, R.A.S. Benedito, N.G. Bretas, Redundancy and observability
analysis of conventional and PMU measurements. IEEE Trans. Power Syst. 24(3), 1629–1630
(2009)
7. N.M. Manousakis, G.N. Korres, Optimal PMU placement for numerical observability
considering fixed channel capacity; a semidefinite programming approach. IEEE Trans. Power
Syst. 31(4), 3328–3329 (2016)
8. J. Peng, Y. Sun, H.F. Wang, Optimal PMU placement for full network observability using Tabu
search algorithm. Int. J. Electr. Power Energy Syst. 28(4), 223–231 (2006)
9. C. Peng, H. Sun, J. Guo, Multi-objective optimal PMU placement using a non-dominated
sorting differential evolution algorithm. Int. J. Electr. Power Energy Syst. 32(8), 886–892
(2010)
10. M. Hurtgen, J.-C. Maun, Optimal PMU placement using iterated local search. Int. J. Electr.
Power Energy Syst. 32(8), 857–860 (2010)
Chapter 9
Topics in Transmission Operation and Planning
This chapter provides a solution for some transmission network operation and
planning studies in GAMS. The transmission investment regarding building new
lines and power flow controllers (phase shifter), sensitivity factors, and transmission
switching have been discussed in this chapter. The GAMS code for solving each
optimization problem is developed and discussed.
Pmax k k max k
ij ˛ij Pij Pij ˛ij ij 2 ˝` (9.1g)
Pmin
g Pg Pmax
g (9.1h)
1
Bij D (9.1j)
xij
k 2 f1; 2; 3; 4g (9.1l)
9.1 Transmission Network Planning 229
The objective function in (9.1a) consists of operational costs (OPC) and invest-
ment costs (INVC). The operational costs are calculated in (9.1b) while the
investment costs are calculated in (9.1c). (9.1d), and (9.1e) model, the power flow
on branch connecting bus i to bus j. In (9.1d) and (9.1e) there is a parameter M. It is
also called big M in the literature [13]. This parameter is selected as follows:
The power balance between the generated power, load shedding, demand, and
line flows is ensured by (9.1f). The line flow limits are modeled in (9.1g) and the
impacts of line investment decision ˛ijk are formulated. The generation operating
limits are given in (9.1h). The initial status of each line is described in (9.1i).
The six-bus Garver transmission network [14] is shown in Fig. 9.1.
Transmission expansion planning data are given in Table 9.1. The existing and
potential right of ways in addition to the reactances and flow limits are provided
there. The investment costs (Cij ) are given in million $. The VOLL is assumed to
be 1000 $/MW h. There are three generating units with different operating costs as
shown in Fig. 9.1. Although the generator number 3 is the cheapest unit, however,
it is not connected to the grid. The candidate right of ways are the existing ones
(indicated by solid lines and the dashed ones as indicated in Fig. 9.1). The GAMS
code for solving the DC power flow-based TEP is provided in GCode 9.1.
230 9 Topics in Transmission Operation and Planning
Table 9.1 Transmission From (i) To (j) xij fNij Cij 0ij
expansion planning data for
Garver six-bus transmission 1 2 0.40 100 40 1
network 1 4 0.60 80 60 1
1 5 0.20 100 20 1
2 3 0.20 100 20 1
2 4 0.40 100 40 1
2 6 0.30 100 30 0
3 5 0.20 100 20 1
4 6 0.30 100 30 0
E q u a t i o n s const1A , c o n s t 1 B , c o n s t 1 C , const1D , c o n s t 1 E , c o n s t 2 , c o n s t 3 ;
c o n s t 1 A ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k )
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( b u s )d e l t a ( node ) ) = l = M(1 a l p h a ( bus , node , k ) ) ;
c o n s t 1 B ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k )
b r a n c h ( bus , node , ’ b i j ’ ) ( d e l t a ( b u s )d e l t a ( node ) ) =g=M(1 a l p h a ( bus , node , k ) ) ;
c o n s t 1 C ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k ) = l =
a l p h a ( bus , node , k )b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
c o n s t 1 D ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k ) =g=
a l p h a ( bus , node , k )b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
c o n s t 1 E ( bus , node , k ) $ c o n e x ( node , b u s ) . . a l p h a ( bus , node , k ) =e= a l p h a ( node , bus , k ) ;
c o n s t 2 ( b u s ) . . LS ( b u s ) +sum ( Gen$GBconect ( bus , Gen ) , Pg ( Gen ) )BusData ( bus , ’ pd ’ ) / S b a s e
=e =+sum ( ( k , node ) $ c o n e x ( node , b u s ) , P i j ( bus , node , k ) ) ;
const3 . . OF=g =28760(sum ( Gen , Pg ( Gen )GenData ( Gen , ’ b ’ )S b a s e )
+1000 s b a s esum ( bus , LS ( b u s ) ) )
+1 e6sum ( ( bus , node , k ) $ c o n e x ( node , b u s ) , 0 . 5 b r a n c h ( bus , node , ’ c o s t ’ )a l p h a ( bus , node , k )
$ ( o r d ( k ) >1 o r b r a n c h ( node , bus , ’ s t a t ’ ) = 0 ) ) ;
Model l o a d f l o w / a l l / ; o p t i o n o p t c r =0;
LS . up ( b u s ) = BusData ( bus , ’ pd ’ ) / S b a s e ; LS . l o ( b u s ) = 0 ;
Pg . l o ( Gen ) =GenData ( Gen , ’ Pmin ’ ) / S b a s e ;
Pg . up ( Gen ) =GenData ( Gen , ’ Pmax ’ ) / S b a s e ;
d e l t a . up ( b u s ) = p i / 3 ; d e l t a . l o ( b u s )=p i / 3 ; d e l t a . f x ( s l a c k ) = 0 ;
P i j . up ( bus , node , k ) $ ( ( c o n e x ( bus , node ) ) ) =1 b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
P i j . l o ( bus , node , k ) $ ( ( c o n e x ( bus , node ) ) )=1b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
S o l v e l o a d f l o w min OF u s MIP ;
The optimal TEP solution for 2 years planning period (T D 2 8760 h) is shown in
Fig. 9.2. The total operating cost is M$227.142, and the investment costs are M$110.
The total costs would be M$337.140.
The optimal solutions dictate that the branch connecting bus 1 to bus 5 should be
reinforced with one additional line. Bus 6 to bus 2 should be connected using three
lines.
Fig. 9.2 Optimal TEP solution for 2 years planning period (T D 2 8760 h)
Fig. 9.3 Optimal TEP solution for 10 years planning period (T D 10 8760 h)
9.1 Transmission Network Planning 233
• The model is a single period. The load duration curve (LDC) or a discrete LDC
with some demand levels and their associated duration should be considered.
• The contingencies should be taken into account. This will ensure the system
operator to keep the light on even some network/generation assets fail. The
failure of transmission lines or generating units might cause overloading of the
remaining lines and operation of over-current relays and cause cascaded failures.
It might even lead to black out.
• The AC power flow constraints should be checked to make sure no voltage
constraint or line limit is violated.
• The voltage stability issue should also be checked.
• The model is trying to minimize the total operating cost plus the investment costs.
In deregulated environment, the transmission asset owner and the transmission
system operator are two independent entities. This makes the problem more
complicated since these two entities would have different objective functions.
The asset owner is trying to maximize its benefit and make money by making
investments. On the other hand, the system operator is trying to maximize the
social welfare. The multi-objective techniques [8] or complementarity models
[15] provide the suitable answer to this challenge.
• The demand grows should be considered.
• The formulated transmission planning model is a static model. This means that
the decision is made in order to make the system capable of answering for the
needs of next N years. The dynamic of investment or timing of investment and
time value of money is neglected.
• The uncertainties of the electricity market, renewable energies, demand, and
regulatory frameworks should be considered to make the model robust against
future scenarios.
• The VOLL is assumed to be the same for all demands at different buses.
However, the importance level of all demands is not the same. This can reduce
the investment requirements for TEP.
9.1.2 TEP with New Lines and Power Flow Controller Option
This section investigates the impact of power flow controller as a planning option.
The phase shifter is used as the power flow controller device. The role of the phase
shifter is depicted in Fig. 9.4. The relation between the power flow, voltage angles
difference across the branchij , and the line susceptance is given in (9.2).
ıi ıj C ij
Pij D D Bij .ıi ıj C ij / (9.2a)
xij
ijmax ij Cijmax (9.2b)
ij D ji (9.2c)
234 9 Topics in Transmission Operation and Planning
Although the voltage phase shift is a discrete variable in reality but it is modeled as
a continuous variable for simplicity in (9.2).
Pmax k k max k
ij ˛ij Pij Pij ˛ij ij 2 ˝` (9.3j)
Pmin
g Pg Pmax
g (9.3k)
if 0ij D 1 then ˛ijkD1 D 1 (9.3l)
1
Bij D (9.3m)
xij
˛ijk ; Iijk 2 f0; 1g (9.3n)
k 2 f1; 2; 3; 4g (9.3o)
9.1 Transmission Network Planning 235
Fig. 9.5 The optimal decisions regarding the location of phase shifter and new transmission lines
2 years plan (T D 2 8760)
The phase shifter impact is shown in (9.3d) and (9.3e). The investment decision
regarding the phase shifter is reflected in (9.3f). The phase shifter can be installed
on lines that initially exist or built lines as shown in (9.3h). The investment cost for
each phase shifter is assumed to be ij = M$0.6. The optimal decisions regarding the
location of phase shifter and new transmission lines 2 years plan (T D 2 8760)
are given in Fig. 9.5. The total operating cost is M$224.256 and the investment costs
are M$110.6. The total costs would be M$334.856.
3 40
4 160
5 240;
t a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
X LIMIT C o s t s t a t
;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ x ’ ) ) = y e s ; c o n e x ( bus , node ) $ c o n e x ( node , b u s ) = y e s ;
b r a n c h ( bus , node , ’ x ’ ) $ b r a n c h ( node , bus , ’ x ’ ) = b r a n c h ( node , bus , ’ x ’ ) ;
b r a n c h ( bus , node , ’ c o s t ’ ) $ b r a n c h ( node , bus , ’ c o s t ’ ) = b r a n c h ( node , bus , ’ c o s t ’ ) ;
b r a n c h ( bus , node , ’ s t a t ’ ) $ b r a n c h ( node , bus , ’ s t a t ’ ) = b r a n c h ( node , bus , ’ s t a t ’ ) ;
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node , bus , ’ L i m i t ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ c o n e x ( bus , node ) = 1 / b r a n c h ( bus , node , ’ x ’ ) ;
M=smax ( ( bus , node ) $ c o n e x ( bus , node ) , b r a n c h ( bus , node , ’ b i j ’ ) 3.142) ;
V a r i a b l e s OF , P i j ( bus , node , k ) , Pg ( Gen ) , d e l t a ( b u s ) , LS ( b u s ) , P S H i j ( bus , node , k ) ;
b i n a r y v a r i a b l e a l p h a ( bus , node , k ) , I ( bus , node , k ) ; a l p h a . l ( bus , node , k ) = 1 ;
a l p h a . f x ( bus , node , k ) $ ( c o n e x ( bus , node ) and o r d ( k ) =1 and b r a n c h ( node , bus , ’ s t a t ’ ) )
=1;
E q u a t i o n s const1A , c o n s t 1 B , c o n s t 1 C , const1D , c o n s t 1 E , c o n s t 2 , c o n s t 3 ,
const4 , const5 , const6 , const7 ;
c o n s t 1 A ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k )b r a n c h ( bus , node , ’ b i j ’ ) (
d e l t a ( b u s )d e l t a ( node ) + P S H i j ( bus , node , k ) ) = l =M(1 a l p h a ( bus , node , k ) )
;
c o n s t 1 B ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k )b r a n c h ( bus , node , ’ b i j ’ ) (
d e l t a ( b u s )d e l t a ( node ) + P S H i j ( bus , node , k ) ) =g=M(1 a l p h a ( bus , node , k ) )
;
c o n s t 1 C ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k ) = l =
a l p h a ( bus , node , k )b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
c o n s t 1 D ( bus , node , k ) $ c o n e x ( node , b u s ) . . P i j ( bus , node , k ) =g=
a l p h a ( bus , node , k )b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
c o n s t 1 E ( bus , node , k ) $ c o n e x ( node , b u s ) . . a l p h a ( bus , node , k ) =e= a l p h a ( node , bus , k ) ;
c o n s t 2 ( b u s ) . . LS ( b u s ) +sum ( Gen$GBconect ( bus , Gen ) , Pg ( Gen ) )
BusData ( bus , ’ pd ’ ) / S b a s e =e =+sum ( ( k , node ) $ c o n e x ( node , b u s ) , P i j ( bus , node , k ) ) ;
c o n s t 3 . . OF=g=T(sum ( Gen , Pg ( Gen )GenData ( Gen , ’ b ’ )S b a s e ) +100000sum ( bus , LS ( b u s ) ) )
+1 e6sum ( ( bus , node , k ) $ c o n e x ( node , b u s ) , 0 . 5 b r a n c h ( bus , node , ’ c o s t ’ )
a l p h a ( bus , node , k ) $ ( o r d ( k ) >1 o r b r a n c h ( node , bus , ’ s t a t ’ ) = 0 ) ) +6 e5 0.5sum ( ( bus , node , k )
$ c o n e x ( node , b u s ) , I ( bus , node , k ) ) ;
c o n s t 4 ( bus , node , k ) $ c o n e x ( node , b u s ) . . P S H i j ( bus , node , k ) + P S H i j ( node , bus , k ) =e = 0 ;
c o n s t 5 ( bus , node , k ) $ c o n e x ( node , b u s ) . . P S H i j ( bus , node , k ) = l = I ( bus , node , k )p i / 8 ;
c o n s t 6 ( bus , node , k ) $ c o n e x ( node , b u s ) . . P S H i j ( bus , node , k ) =g=I ( bus , node , k )p i / 8 ;
c o n s t 7 ( bus , node , k ) $ c o n e x ( node , b u s ) . . I ( bus , node , k ) = l = a l p h a ( bus , node , k ) ;
Model l o a d f l o w / a l l / ; LS . up ( b u s ) = BusData ( bus , ’ pd ’ ) / S b a s e ; LS . l o ( b u s ) = 0 ;
Pg . l o ( Gen ) =GenData ( Gen , ’ Pmin ’ ) / S b a s e ; Pg . up ( Gen ) =GenData ( Gen , ’ Pmax ’ ) / S b a s e ;
d e l t a . up ( b u s ) = p i / 3 ; d e l t a . l o ( b u s )=p i / 3 ; d e l t a . f x ( s l a c k ) = 0 ;
P i j . up ( bus , node , k ) $ ( ( c o n e x ( bus , node ) ) ) =1 b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
P i j . l o ( bus , node , k ) $ ( ( c o n e x ( bus , node ) ) )=1b r a n c h ( bus , node , ’ L i m i t ’ ) / S b a s e ;
P S H i j . up ( bus , node , k ) = p i / 8 ; P S H i j . l o ( bus , node , k )=p i / 8 ; o p t i o n o p t c r = 0 ;
S o l v e l o a d f l o w min OF u s MIP ;
The optimal decisions regarding the location of phase shifter and new transmis-
sion lines 10 years plan (T D 10 8760) are given in Fig. 9.6. The total operating
cost is M$805.920 and the investment costs are M$200.600. The total costs would
be M$1006.520.
9.1 Transmission Network Planning 237
Fig. 9.6 The optimal decisions regarding the location of phase shifter and new transmission lines
10 years plan (T D 10 8760)
Nomenclature
Parameters
M Big number
T Duration of planning period (h)
Li Electric power demand in bus i at time t
bg Fuel cost coefficient of thermal unit g
0ij Initial status of branch connecting bus i to j
Cij Investment cost for branch connecting bus i to j
ij Investment cost of phase shifter in line ij
max = min
Pg Maximum/minimum limits of power generation of thermal unit g
238 9 Topics in Transmission Operation and Planning
Pmax
ij Maximum power flow limits of branch connecting bus i to j
ijmax Maximum phase shift in line connecting bus i to bus j
xij Reactance of branch connecting bus i to j
Bij Susceptance of branch connecting bus i to j
VOLL Value of loss of load ($/MW h)
Variables
Pkij Active power flow of branch k connecting bus i to j (MW)
Pg Active power generated by thermal unit g (MW)
˛ijk Binary variable to model the investment decision regarding the line k at the
right of way ij
Iijk Binary variable to model the investment decision regarding the phase
shifter in line k at the right of way ij
i Locational marginal price in bus i ($/MW h)
LSi Load shedding in bus i (MW)
ij Phase shift in line connecting bus i to bus j
OPC Total operating costs ($)
OF Total costs ($)
INVC Total investment costs ($)
ıi Voltage angle of bus i (rad)
In this section two important factors are analyzed and calculated namely:
• Generation Shift Factor (GSF)
• Line Outage Distribution Factor (LODF)
g ı1 ı 2 ı1 ı 3
P1 L1 D C (9.4a)
x12 x13
9.2 Sensitivity Factors in Transmission Networks 239
g ı2 ı 1 ı2 ı 3
P2 L2 D C (9.4b)
x21 x23
g ı3 ı 2 ı3 ı 1
P3 L3 D C (9.4c)
x32 x31
g ı1 ı 2 ı1 ı3
P1 L1 D C (9.5a)
0:1 0:2
g ı2 ı 1 ı2 ı3
P2 L2 D C (9.5b)
0:1 0:25
g ı3 ı 2 ı3 ı1
P3 L3 D C (9.5c)
0:25 0:2
0 1 0 1 0 1
P1 15 10 5 ı1
g
@ A @
(9.4) can be written as : P2 D 10 14 4 D ı2 A where Pi D Pi Li .
@ A
P3 5 4 9 ı3
0 1
15 10 5
Suppose B D @ 10 14 4 A then we can have the relation between the bus
5 4 9
angles and the net injections as a linear matrix form.
P D Bı (9.6)
240 9 Topics in Transmission Operation and Planning
In normal DC power flow, the P vector is known and the decision maker’s goal is to
find the ı vector. The problem is that matrix B is singular and does not have a matrix
inverse.
The good news is that the bus angle at slack bus is known to be zero. If the slack
bus is bus 1 then we can have the following matrix form:
P2 14 4 ı2
D (9.7)
P3 4 9 ı3
ı2 14 4 P2 0:0818 0:0364 P2
D D (9.8)
ı3 4 9 P3 0:0364 0:1273 P3
where Bred is the B matrix after eliminating the row and column of slack bus.
If the network has n buses then Bred would be a square .n 1/ .n 1/
matrix. For the rest of this chapter, whenever X appears in any equation it is
representing Xred .
Now we are about to investigate the impact of change in power injection in bus
n on the line flow between bus i and bus j. The flow on line connecting bus i to bus
j is calculated as follows:
ıi ı j
fij D (9.11)
xij
Now we assume that any change in injected power at bus m will be compensated by
the slack bus. In order to calculate the flow change in line i j we need to use the
following equation:
ıi ıj
fij D (9.12)
xij
The value of xij remains constant but the voltage angles would change if P is
happening at bus m (and P at slack bus). Referring to (9.9) we would have
ı D XP (9.13)
9.2 Sensitivity Factors in Transmission Networks 241
0 1 0 1 0 1
ı2 X22 X2;n1 X2n 0
B ı3 C B X32 X3;n1 X3n C B 0 C
B C B C B C
B :: C B :: : : :: :: C B ::C
B : C B : : : : C B :C
B C B C B C
B ı C B Xm2 Xm;n1 C B C
B m C B Xmn C B Pm C
B : C B :: : : :: C C B C
B :: C B : :
::
: : C B ::: C
B C B B C
B C B C B C
B ıi C DB Xi2 Xi;n1 Xin C B 0 C
B : C B :: : : :: CC B C
B : C B :: B :: C
B : C B : : : : C B : C
B C B C B C
B ıj C B Xj2 Xj;n1 Xjn C B 0 C
B C B C B C
B :: C B :: :: :: :: C B :: C
B : C B : : : C
: C B C
B C B B : C
@ ın1 A @ Xn1;2 Xn1;n1 Xn1;n A @ 0 A
ın n11
Xn;2 Xn;n1 Xn;n n1n1 0 n11
(9.14)
The (9.17) states that the sensitivity of the flow in line ij of power change in bus m
is obtained as follows:
fij Xim Xjm
aijm D D (9.18)
Pm xij
Using the (9.18) is useful in calculating the line flows in post-contingency period.
post pre
fij D fij C aijm Pm (9.19)
If the post-contingency line flow at line ij after the failure of a generating unit at
bus m (producing Pgm MW) is to be calculated then the following equation can be
used:
post pre
fij D fij C aijm .Pgm / (9.20)
If the post-contingency line flow at line ij after the disconnection of load at bus
m is to be calculated then the following equation can be used:
post pre
fij D fij C aijm .Lm / (9.21)
242 9 Topics in Transmission Operation and Planning
Now let’s calculate the Generation Shift Factors (aijm ) for the network shown
in Fig. 9.7.
The GCode 9.3 described the GAMS code for calculating the generation shift
factors.
S e t s b u s / 1 3 / , s l a c k ( b u s ) / 1 / , Gen / g1g3 / , n o n s l a c k ( b u s ) / 2 3 / ;
s c a l a r s Sbase / 1 0 0 / ;
a l i a s ( bus , node , s h i n , k n o t ) ; a l i a s ( n o n s l a c k , n o n s l a c k j ) ;
T a b l e b r a n c h ( bus , node , ) Network t e c h n i c a l c h a r a c t e r i s t i c s
X LIMIT s t a t
1 . 2 0 . 1 100 1
1 . 3 0 . 2 80 1
2 . 3 0 . 2 5 100 1;
s e t c o n e x ( bus , node ) Bus c o n n e c t i v i t y m a t r i x l ;
c o n e x ( bus , node ) $ ( b r a n c h ( bus , node , ’ x ’ ) ) = y e s ;
c o n e x ( bus , node ) $ c o n e x ( node , b u s ) = y e s ;
b r a n c h ( bus , node , ’ x ’ ) $ b r a n c h ( node , bus , ’ x ’ ) = b r a n c h ( node , bus , ’ x ’ ) ;
b r a n c h ( bus , node , ’ s t a t ’ ) $ b r a n c h ( node , bus , ’ s t a t ’ ) = b r a n c h ( node , bus , ’ s t a t ’ ) ;
b r a n c h ( bus , node , ’ L i m i t ’ ) $ ( b r a n c h ( bus , node , ’ L i m i t ’ ) = 0 ) = b r a n c h ( node , bus , ’
Limit ’ ) ;
b r a n c h ( bus , node , ’ b i j ’ ) $ c o n e x ( bus , node ) = 1 / b r a n c h ( bus , node , ’ x ’ ) ;
P a r a m e t e r B m a t r i x ( bus , node ) , Binv ( bus , node ) , Flow ( bus , node ) ; A l i a s ( bus ,
knot ) ;
B m a t r i x ( bus , node ) $ ( c o n e x ( node , b u s ) )=b r a n c h ( bus , node , ’ b i j ’ ) ;
B m a t r i x ( bus , b u s ) =sum ( k n o t $ c o n e x ( k n o t , b u s ) , B m a t r i x ( bus , k n o t ) ) ;
p a r a m e t e r B r e d u c e d ( n o n s l a c k , n o n s l a c k j ) ,GSHF ( bus , node , k n o t ) ;
Breduced ( nonslack , n o n s l a c k j ) =Bmatrix ( nonslack , n o n s l a c k j ) ;
parameter inva ( nonslack , nonslackj ) ’ i n v e r s e of a ’ ;
e x e c u t e _ u n l o a d ’ a . gdx ’ , n o n s l a c k , B r e d u c e d ;
e x e c u t e ’ = i n v e r t . e x e a . gdx n o n s l a c k B r e d u c e d b . gdx i n v a ’ ;
e x e c u t e _ l o a d ’ b . gdx ’ , i n v a ;
Binv ( n o n s l a c k , n o n s l a c k j ) = i n v a ( n o n s l a c k , n o n s l a c k j ) ;
GSHF ( bus , node , k n o t ) $ c o n e x ( bus , node ) =
b r a n c h ( bus , node , ’ b i j ’ ) ( Binv ( bus , k n o t )Binv ( node , k n o t ) ) ;
D i s p l a y B m a t r i x , Binv , GSHF ;
The GCode 9.3 has no solve statement or variable. This is because no optimiza-
tion is going to be done. First of all, the B matrix is calculated in GCode 9.3 as
follows:
Parameter Bmatrix(bus,node);
Alias(bus,knot);
Bmatrix(bus,node)$conex(node,bus)=-branch(bus,node,’bij’);
Bmatrix(bus,bus)=sum(knot$conex(knot,bus),-Bmatrix(bus,knot));
9.2 Sensitivity Factors in Transmission Networks 243
—- 68 PARAMETER Bmatrix
1 2 3
1 15.000 -10.000 -5.000
2 -10.000 14.000 -4.000
3 -5.000 -4.000 9.000
Now we need to eliminate the row and column containing the slack bus. In order
to do this, another parameter called Breduced is defined but over the non-slack bus
set. This set is defined over all buses except the slack buses.
Parameter Breduced(nonslack,nonslackj);
Breduced(nonslack,nonslackj)=Bmatrix(nonslack,nonslackj);
Parameter inva(nonslack,nonslackj) ’inverse of a’;
execute_unload ’a.gdx’, nonslack, Breduced;
execute ’=invert.exe a.gdx nonslack Breduced b.gdx inva’;
execute_load ’b.gdx’, inva;
—- 68 PARAMETER Binv
2 3
2 0:082 0:036
3 0:036 0:127
Now all needed data for calculating the aijm is available. The generation shift
factors are calculated as follows:
Binv(nonslack,nonslackj)=inva(nonslack,nonslackj);
GSHF(bus,node,knot)$conex(bus,node)=branch(bus,node,’bij’)*(Binv
(bus,knot)-Binv(node,knot));
Using the GCode 9.3, the generation shift factors are calculated as Table 9.2.
The generation shift factors (GSHF) have the following interesting features as
follows:
244 9 Topics in Transmission Operation and Planning
• The procedure for calculating the GSHF does not involve any optimization
• The values of GSHF can be calculated in advance and be used in real-time
applications.
• The values of GSHF do not depend on the loading condition of the network.
These coefficients only depend on the network topology. If the network topology
is changed (due to transmission outage or switching), GSHF should be recalcu-
lated.
• The technique we used for calculating the GSHF is assuming that the changes
at any bus are quickly compensated by the slack bus. In case the changes are
compensated by multiple generating units then the calculation procedure would
be slightly different [16].
• The GSHF are also useful for understanding how to reduce the line loading. For
example, suppose we need to reduce the flow at line 3 1. As we can see that
bus 3 has the largest GSHF equal to 0.636. It means that if we can reduce the
generation at bus 3, then a negative value will be added to the initial flow of line
3 1. If the initial flow from bus 3 to bus 1 is positive, then it would reduce.
Now let’s check the values obtained in Table 9.2. For this purpose, the base power
flow is solved and is shown in Fig. 9.8. The values of line flow, as well as the voltage
angles, are specified in this figure. Suppose it is desired to increase the flow on the
0
line connecting the bus 3 to bus 2. The power flow on this line is f32 D 2:7 MW.
32 32
Using the Table 9.2 states that a2 D 0:182 and a3 D 0:364. Let’s investigate the
impact of changes in power injections in different buses on transmission lines.
The demand in bus 2 is increased by 10 MW and the new line flows are depicted in
Fig. 9.9. As it can be seen in this figure, the new line flow of line 3 2 is 4.5 MW.
This is obtained using a GAMS code. Let’s calculate the new line flow using the
Table 9.2. The new line flow is calculated as follows:
post pre
f32 D f32 C a32
2 .P2 / D 0:027 0:182 .0:1/ D 0:0452 pu (9.22)
post pre
f12 D f12 C a12
2 .P2 / D 0:177 0:818 .0:1/ D 0:0952 pu (9.23)
Fig. 9.9 The DC power flow solution for three-bus network after increasing the demand at bus 2
for 10 MW.
post pre
f31 D f31 C a31
2 .P2 / D 0:123 C 0:182 .0:1/ D 0:1048 pu (9.24)
It should be noted that the flow values as well as the change in power injection at
bus 2 are expressed in pu. P2 is representing the change in bus injection at bus
2 which is 10 MW or 0.1 pu. It can be observed that the results confirm what is
obtained by solving the DC power flow as shown in Fig. 9.9.
246 9 Topics in Transmission Operation and Planning
Fig. 9.10 The DC power flow solution for three-bus network after increasing the generation at bus
3 for 10 MW.
g
9.2.1.2 Generation Increase in P3 by 10 MW
The generation in bus 3 is increased by 10 MW and the new line flows are depicted
in Fig. 9.10 which are obtained using a GAMS code. Let’s calculate the new line
flow using the GSHF in Table 9.2. The new line flow is calculated as follows:
post pre
f32 D f32 C a32
3 .P3 / D 0:027 C 0:364 .0:1/ D 0:0634 pu (9.25)
post pre
f12 D f12 C a12
3 .P3 / D 0:177 C 0:364 .0:1/ D 0:2134 pu (9.26)
post pre
f31 D f31 C a31
3 .P3 / D 0:123 C 0:636 .0:1/ D 0:1866 pu (9.27)
The impact of line outages on power flow of other lines is investigated in this section.
Consider the line connecting the bus n and m as shown in Fig. 9.11. In Fig. 9.11a,
the intact network is shown. We need to find out the impact of the line outage of the
branch connecting bus n to bus m on the rest of the network. Suppose the flow of this
0
line is initially equal to fnm . The power from the rest of the network injected to bus n
is equal to power absorption from bus m to the rest of network when no contingency
has happened. We need to find a way to make these flows equal to zero. It is done
using a very smart trick [17]. If we add two injections to the network: CPn at bus
n and another one equal to Pn at bus m the flow on the line nm would change as
shown in Fig. 9.11b. The question is what is the new flow on this line? The change
of flow on line nm can be easily calculated using the following equation:
9.2 Sensitivity Factors in Transmission Networks 247
Fig. 9.11 Line outage modeling using virtual injections. (a) Intact network. (b) Post-contingency
network
ın ım Xnn Pn C Xnm .Pn / .Xmn Pn C Xmm .Pn //
fnm D D
xnm xnm
(9.28)
post
If the virtual injection to the grid Pn is carefully chosen then fnm D Pn . This
makes the flow from the rest of the network to bus n and m equal to zero (line
outage).
post 0
Pn D fnm D fnm C fnm (9.31)
ıi ıj Xin Pn C Xim .Pn / .Xjn Pn C Xjm .Pn //
fij D D (9.33)
xij xij
Xin Xim Xjn C Xjm
fij D Pn (9.34)
xij
fij Xin Xim Xjn C Xjm
LODFij;nm D D (9.35)
0
fnm xij .1 Xnn CXxmm
nm
2Xnm
/
The GCode 9.4 is developed to calculate the Line outage distribution factors for the
network shown in Fig. 9.7.
Sets
bus / 1 3 / ,
s l a c k ( bus ) / 1 / ,
Gen / g1g3 / ,
n o n s l a c k ( bus ) / 2 3 / ;
Scalars Sbase / 1 0 0 / ;
A l i a s ( bus , node , s h i n , k n o t ) ;
Alias ( nonslack , nonslackj ) ;
P a r a m e t e r i n v a ( n o n s l a c k , n o n s l a c k j ) ’ i n v e r s e o f a ’ , D f a c t o r ( bus , node , k n o t ,
shin ) ,
9.3 Transmission Network Switching 249
c o n t i n g e n c y ( bus , node , k n o t , s h i n ) ;
e x e c u t e _ u n l o a d ’ a . gdx ’ , n o n s l a c k , B r e d u c e d ;
e x e c u t e ’ = i n v e r t . e x e a . gdx n o n s l a c k B r e d u c e d b . gdx i n v a ’ ;
e x e c u t e _ l o a d ’ b . gdx ’ , i n v a ;
Binv ( n o n s l a c k , n o n s l a c k j ) = i n v a ( n o n s l a c k , n o n s l a c k j ) ;
GSHF ( bus , node , k n o t ) $ c o n e x ( bus , node ) =
b r a n c h ( bus , node , ’ b i j ’ ) ( Binv ( bus , k n o t )Binv ( node , k n o t ) ) ;
D i s p l a y B m a t r i x , Binv , GSHF , d f a c t o r ;
The idea of optimal transmission switching (OTS) has been broadly investigated in
the literature [18]. Opening a set of transmission lines would change the network
topology and the line flow patterns. This can be used to relieve the line congestion
in the system and reduce the operating costs. Some research works which used the
transmission switching as a flexibility tool are listed as follows:
21 15 0.03 0.03 0.07 0.02 0.02 0.02 0.02 0.02 0.02 0.01 0.00 0.00 0.01 0.15 0.03 0.31 0.45 0.02 0.01 0.57 0.47 0.01 0.12
21 18 0.02 0.02 0.06 0.02 0.02 0.01 0.01 0.01 0.02 0.01 0.00 0.00 0.01 0.13 0.02 0.27 0.46 0.02 0.01 0.37 0.12 0.01 0.11
22 17 0.00 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.02 0.00 0.04 0.01 0.00 0.00 0.06 0.41 0.00 0.02
22 21 0.00 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.02 0.00 0.04 0.01 0.00 0.00 0.06 0.59 0.00 0.02
23 12 0.04 0.04 0.02 0.05 0.05 0.06 0.06 0.06 0.05 0.07 0.01 0.16 0.08 0.13 0.14 0.14 0.14 0.20 0.25 0.14 0.14 0.28 0.09
23 13 0.17 0.17 0.22 0.17 0.16 0.16 0.16 0.16 0.16 0.15 0.13 0.16 0.23 0.31 0.31 0.31 0.31 0.38 0.44 0.31 0.31 0.47 0.27
23 20 0.13 0.13 0.23 0.12 0.11 0.10 0.10 0.10 0.11 0.09 0.14 0.00 0.31 0.44 0.46 0.45 0.45 0.58 0.69 0.44 0.45 0.25 0.36
24 3 0.15 0.15 0.37 0.13 0.11 0.08 0.08 0.08 0.11 0.06 0.01 0.03 0.07 0.18 0.14 0.15 0.16 0.10 0.07 0.17 0.16 0.06 0.35
24 15 0.15 0.15 0.37 0.13 0.11 0.08 0.08 0.08 0.11 0.06 0.01 0.03 0.07 0.18 0.14 0.15 0.16 0.10 0.07 0.17 0.16 0.06 0.65
253
254 9 Topics in Transmission Operation and Planning
Pmax max
ij
ij Pij Pij
ij ij 2 ˝` (9.36e)
Pmin
g Pg Pmax
g (9.36f)
X
.1
ij / Nsw ij 2 ˝` (9.36g)
ij
1
Bij D (9.36h)
xij
ij 2 f0; 1g (9.36i)
where
ij is the on/off state of the branch connecting bus i to bus j, and Nsw is the
number of allowed switching actions in the network.
The operating and congestion cost vs number of switched lines in IEEE 118-bus
network (Fig. 9.13) are depicted in Fig. 9.14. The GAMS code for solving the (9.36)
is provided in GCode 9.5.
9.3 Transmission Network Switching 255
× 104
Operating cost ($) 9
8.9
8.8
8.7
0 1 2 3 4 5 6 7 8 9 10
N
sw
× 104
4
Congestion cost ($)
0
0 1 2 3 4 5 6 7 8 9 10
N
sw
Fig. 9.14 The operating and congestion cost vs number of switched lines in IEEE 118-bus network
GCode 9.5 The OTS GAMS code for IEEE 118-bus network
S e t s b u s / 1 1 1 8 / , s l a c k ( b u s ) / 1 3 / , c o n e x ( bus , node ) ,
GenNo / Gen1Gen54 / , c o u n t e r / c0c10 / ;
Scalars Sbase / 1 0 0 / ;
A l i a s ( bus , t o t a l b u s , node ) ;
Increasing the demand in a given area or bus (or equivalently losing the
generation) might cause congestion and increasing the total operating costs. The
OTS can be used to enhance the grid utilization and reduce the line congestions.
A simple analysis is conducted as follows:
• The demand at bus i is increased for 20 MW.
• The DC OPF is solved without considering the transmission switching option
(LP model).
• The DC OPF along with transmission switching option is solved (MIP model).
258 9 Topics in Transmission Operation and Planning
× 10 4
9.3
No switching LP model
9.2 With switching MIP model
Operating costs ($)
9.1
8.9
8.8
1 10 20 30 40 50 60 70 80 90 100 110 120
Bus
Fig. 9.15 The operating cost vs the connection point of new demand (20 MW) in with/without
transmission switching cases
60 60
Without switching
With switching
Nsw= 2
40 Nsw= 1 40
i
λi
λ
20 20
Nsw= 3 60
40
λi
i
Nsw= 4
λ
40
20 20
40 Nsw= 5 40 Nsw= 6
i
λi
λ
20 20
40 Nsw= 7 40 Nsw= 8
λi
i
λ
20 20
40 Nsw= 9 40 Nsw= 10
λi
i
λ
20 20
Bus Bus
Fig. 9.16 The LMP values (i ) in ($/MW h) at different buses in with/without transmission
switching cases
The comparison of the total operating costs between the with/without transmission
switching cases are shown in Fig. 9.15. The impact of connecting a new demand to
different buses would cause different changes in total operating costs. In all cases,
using the transmission switching flexibility can reduce the operating costs as shown
in Fig. 9.15.
Using the transmission switching might change the LMP values at different
buses. The LMP values (i ) in $/MW h at different buses in with/without trans-
mission switching cases. As it is shown in Fig. 9.16, when no switching is allowed
(Nsw D 0) then the LMP values of switching and not switching cases are the same.
By increasing the number of switchable lines, the LMP values get closer to each
other. The generation and branch data of IEEE 118 bus are given in Tables 9.7 and
9.8, respectively.
The developed GAMS code for OTS can be improved to consider the following
issues:
Table 9.7 Generation data for 118-bus network
Bus Unit (g) bg ($/MW h) Pmin
g (MW) Pmax
g (MW) Bus Unit (g) bg ($/MW h) Pmin
g (MW) Pmax
g (MW)
1 Gen1 26.2 5.0 30.0 65.0 Gen28 8.3 100.0 420.0
4 Gen2 26.2 5.0 30.0 66.0 Gen29 12.9 80.0 300.0
6 Gen3 26.2 5.0 30.0 69.0 Gen30 15.5 30.0 80.0
8 Gen4 12.9 150.0 300.0 70.0 Gen31 26.2 10.0 30.0
10 Gen5 12.9 100.0 300.0 72.0 Gen32 26.2 5.0 30.0
9.3 Transmission Network Switching
8.5 0.03 5.00 26 . 30 0.09 5.00 48 . 49 0.05 1.75 65 . 66 0.04 5.00 85 . 86 0.12 5.00 103 . 104 0.16 1.75
9 . 10 0.03 5.00 17 . 31 0.16 1.75 49 . 50 0.08 1.75 66 . 67 0.10 1.75 86 . 87 0.21 5.00 103 . 105 0.16 1.75
4 . 11 0.07 1.75 29 . 31 0.03 1.75 49 . 51 0.14 1.75 65 . 68 0.02 5.00 85 . 88 0.10 1.75 100 . 106 0.23 1.75
5 . 11 0.07 1.75 23 . 32 0.12 1.40 51 . 52 0.06 1.75 47 . 69 0.28 1.75 85 . 89 0.17 1.75 104 . 105 0.04 1.75
11 . 12 0.02 1.75 31 . 32 0.10 1.75 52 . 53 0.16 1.75 49 . 69 0.32 1.75 88 . 89 0.07 5.00 105 . 106 0.05 1.75
2 . 12 0.06 1.75 27 . 32 0.08 1.75 53 . 54 0.12 1.75 68 . 69 0.04 5.00 89 . 90 0.09 10.00 105 . 107 0.18 1.75
3 . 12 0.16 1.75 15 . 33 0.12 1.75 49 . 54 0.15 3.50 69 . 70 0.13 5.00 90 . 91 0.08 1.75 105 . 108 0.07 1.75
7 . 12 0.03 1.75 19 . 34 0.25 1.75 54 . 55 0.07 1.75 24 . 70 0.41 1.75 89 . 92 0.08 10.00 106 . 107 0.18 1.75
11 . 13 0.07 1.75 35 . 36 0.01 1.75 54 . 56 0.01 1.75 70 . 71 0.04 1.75 91 . 92 0.13 1.75 108 . 109 0.03 1.75
12 . 14 0.07 1.75 35 . 37 0.05 1.75 55 . 56 0.02 1.75 24 . 72 0.20 1.75 92 . 93 0.08 1.75 103 . 110 0.18 1.75
13 . 15 0.24 1.75 33 . 37 0.14 1.75 56 . 57 0.10 1.75 71 . 72 0.18 1.75 92 . 94 0.16 1.75 109 . 110 0.08 1.75
14 . 15 0.20 1.75 34 . 36 0.03 1.75 50 . 57 0.13 1.75 71 . 73 0.05 1.75 93 . 94 0.07 1.75 110 . 111 0.08 1.75
12 . 16 0.08 1.75 34 . 37 0.01 5.00 56 . 58 0.10 1.75 70 . 74 0.13 1.75 94 . 95 0.04 1.75 110 . 112 0.06 1.75
15 . 17 0.04 5.00 38 . 37 0.04 5.00 51 . 58 0.07 1.75 70 . 75 0.14 1.75 80 . 96 0.18 1.75 17 . 113 0.03 1.75
16 . 17 0.18 1.75 37 . 39 0.11 1.75 54 . 59 0.23 1.75 69 . 75 0.12 5.00 82 . 96 0.05 1.75 32 . 113 0.20 5.00
(continued)
261
262
• The model should be multi-period. The OTS should consider the variation pattern
of demand and then determine the optimal switching actions.
• The uncertainty of demand and renewable power generation should be taken into
account.
• The current formulation does not ensure the network connectivity. It only
tries to satisfy the nodal demand-supply constraint. The resultant system (after
switching) might contain some islands.
• The computation burden of the model should be improved to make it applicable
for large scale transmission networks.
• The AC power flow constraints should be used for getting closer to reality.
• The unit commitment constraints can be added to the formulation to consider the
on/off states of the units as the decision variables.
• Changing the transmission network topology might change the short circuit level
on each bus. This should be taken into account for protection issues.
• The current model only considers the intact condition of the network. The
contingencies should also be considered.
• The OTS flexibility can be combined with demand response and power flow
controller devices.
• The bus splitting can be regarded as a switching action.
References
11. P. Maghouli, S.H. Hosseini, M.O. Buygi, M. Shahidehpour, A multi-objective framework for
transmission expansion planning in deregulated environments. IEEE Trans. Power Syst. 24(2),
1051–1061 (2009)
12. H. Yu, C.Y. Chung, K.P. Wong, J.H. Zhang, A chance constrained transmission network
expansion planning method with consideration of load and wind farm uncertainties. IEEE
Trans. Power Syst. 24(3), 1568–1576 (2009)
13. M.R. Bussieck, A. Pruessner, Mixed-integer nonlinear programming. SIAG/OPT Newsl.
Views News 14(1), 19–22 (2003)
14. R. Romero, A. Monticelli, A. Garcia, S. Haffner, Test systems and mathematical models for
transmission network expansion planning. IEE Proc. Gener. Transm. Distrib. 149(1), 27–36
(2002)
15. L. Baringo, A.J. Conejo, Transmission and wind power investment. IEEE Trans. Power Syst.
27(2), 885–893 (2012)
16. A.J. Wood, B.F. Wollenberg, Power Generation Operation and Control, 2nd edn. (Wiley, New
York, 1996)
17. A.J. Wood, B.F. Wollenberg, Power Generation, Operation, and Control (Wiley, New York,
2012)
18. E.B. Fisher, R.P. O’Neill, M.C. Ferris, Optimal transmission switching. IEEE Trans. Power
Syst. 23(3), 1346–1355 (2008)
19. K.W. Hedman, R.P. O’Neill, E.B. Fisher, S.S. Oren, Optimal transmission switching with
contingency analysis. IEEE Trans. Power Syst. 24(3), 1577–1586 (2009)
20. K.W. Hedman, M.C. Ferris, R.P. O’Neill, E.B. Fisher, S.S. Oren, Co-optimization of generation
unit commitment and transmission switching with n-1 reliability. IEEE Trans. Power Syst.
25(2), 1052–1063 (2010)
21. T. Ding, C. Zhao, Robust optimal transmission switching with the consideration of corrective
actions for n-k contingencies. IET Gener. Transm. Distrib. 10(13), 3288–3295 (2016)
22. Z. Yang, H. Zhong, Q. Xia, C. Kang, Optimal transmission switching with short-circuit current
limitation constraints. IEEE Trans. Power Syst. 31(2), 1278–1288 (2016)
23. P. Henneaux, D.S. Kirschen, Probabilistic security analysis of optimal transmission switching.
IEEE Trans. Power Syst. 31(1), 508–517 (2016)
24. F. Qiu, J. Wang, Chance-constrained transmission switching with guaranteed wind power
utilization. IEEE Trans. Power Syst. 30(3), 1270–1278 (2015)
25. M. Soroush, J.D. Fuller, Accuracies of optimal transmission switching heuristics based on
dcopf and acopf. IEEE Trans. Power Syst. 29(2), 924–932 (2014)
Chapter 10
Energy System Integration
This chapter provides a solution for energy system integration (ESI) problem
in GAMS. The ESI analysis refers to a class of studies which investigate the
potential in different energy sectors (water, gas, and electricity) for moving toward
a more environmentally friendly and efficient energy supply. The main idea is how
to harvest the flexibilities in each energy carrier in a larger framework. In this
chapter, the coordination between water desalination systems and power system,
gas network-power network, and finally the concept of energy hub is investigated.
Pmin max
g Ug;t Pg;t Pg Ug;t (10.1f)
Pmin max
c Uc;t Pc;t Pc Uc;t (10.1g)
Wcmin Uc;t Wc;t Wcmax Uc;t (10.1h)
Wwmin Uw;t Ww;t Wwmax Uw;t (10.1i)
Pc;t
Rmin
c Rmax
c (10.1j)
Wc;t
X X
Pg;t C Pc;t D PLt (10.1k)
g c
X X
Ww;t C Wc;t D WLt (10.1l)
w c
The simulation data are taken from [1] with slight modifications (Tables 10.1, 10.2,
and 10.3).
10.1 Water-Power Nexus 267
+ g e n d a t a ( i , ’ c ’ )Up ( i , t ) ) ;
b a l a n c e P ( t ) . . sum ( i , p ( i , t ) ) +sum ( c , Pc ( c , t ) ) =e=PWdata ( t , ’ Pd ’ ) ;
balanceW ( t ) . . sum (w, Water (w, t ) ) +sum ( c , Wc( c , t ) ) =e=PWdata ( t , ’ w a t e r ’ ) ;
c o s t C o p r o d c a l c . . CC=e=sum ( ( c , t ) , C o p r o d u c t ( c , ’ A11 ’ )power ( Pc ( c , t ) , 2 )
+2 C o p r o d u c t ( c , ’ A12 ’ )Pc ( c , t )Wc( c , t ) + C o p r o d u c t ( c , ’ A22 ’ )power (Wc( c , t ) , 2 )
+ C o p r o d u c t ( c , ’B1 ’ )Pc ( c , t ) + C o p r o d u c t ( c , ’ B2 ’ )Wc( c , t ) + C o p r o d u c t ( c , ’C ’ )Uc ( c , t ) ) ;
c o s t w a t e r c a l c . . W a t e r C o s t =e=sum ( ( t , w) , w a t e r d a t a (w, ’ a ’ )power ( Water (w, t ) , 2 )
+ w a t e r d a t a (w, ’ b ’ )Water (w, t ) + w a t e r d a t a (w, ’ c ’ )Uw(w, t ) ) ;
O b j e c t i v e . . OF=e=TC+CC+ W a t e r C o s t ;
r a t i o 1 ( c , t ) . . Pc ( c , t ) = l =Wc( c , t )C o p r o d u c t ( c , ’Rmax ’ ) ;
r a t i o 2 ( c , t ) . . Pc ( c , t ) =g=Wc( c , t )C o p r o d u c t ( c , ’ Rmin ’ ) ;
eq1 (w, t ) . . Water (w, t ) = l =Uw(w, t )w a t e r d a t a (w, ’Wmax ’ ) ;
eq2 (w, t ) . . Water (w, t ) =g=Uw(w, t )w a t e r d a t a (w, ’Wmin ’ ) ;
eq3 ( c , t ) . . wc ( c , t ) = l = Uc ( c , t )C o p r o d u c t ( c , ’Wmax ’ ) ;
eq4 ( c , t ) . . wc ( c , t ) =g= Uc ( c , t )C o p r o d u c t ( c , ’Wmin ’ ) ;
eq5 ( c , t ) . . Pc ( c , t ) = l = Uc ( c , t )C o p r o d u c t ( c , ’ Pmax ’ ) ;
eq6 ( c , t ) . . Pc ( c , t ) =g= Uc ( c , t )C o p r o d u c t ( c , ’ Pmin ’ ) ;
eq7 ( i , t ) . . p ( i , t ) = l =Up ( i , t )g e n d a t a ( i , " Pmax " ) ;
eq8 ( i , t ) . . p ( i , t ) =g=Up ( i , t )g e n d a t a ( i , " Pmin " ) ;
Model DEDcostbased / a l l / ; S o l v e DEDcostbased u s MInlp min OF ;
Fig. 10.2 Hourly water output of different plants in water-energy nexus problem
10.2 Gas-Power Nexus 269
Fig. 10.3 Hourly power output of different plants in water-energy nexus problem
The interaction of gas network and electricity network is modeled in this section.
The electrical network is IEEE RTS 24-bus network which is shown in Fig. 10.4.
It is a transmission network with the voltage levels of 138 kV, 230 kV and
Sbase = 100 MVA. The branch data for IEEE RTS 24-bus network is given in
Table 10.4 [2]. The from bus, to bus, reactance (X), resistance (r), total line charging
susceptance (b), and MVA rating (MVA) are specified in this table. The parallel
lines in MATPOWER are merged and the resultants are given in Table 10.4. The
generation data for IEEE RTS 24-bus network is given in Table 10.5. The data of
generating units in this network is inspired by Conejo et al. [3] and Bouffard et al.
[4] with some modifications. The slack bus is bus 13 in this network. The wind
turbines and the capacities are also shown in Fig. 10.4.
270 10 Energy System Integration
The gas network is also shown in Fig. 10.4 which its data is taken from [5]. The
technical and economical characteristics of gas nodes are given in Table 10.6. The
technical characteristics of gas network are also provided in Table 10.7 [5]. The gas
network equations are described in (10.2).
X
GC D cn Sgn;t (10.2a)
n;t
X X
fn;m;t D fm;n;t C Sgn;t
g;t Sdn Sen;t (10.2b)
m m
q
fm;n;t D Cm;n Pr2m;t Pr2n;t Passive arcs (10.2c)
q
fm;n;t Cmn Pr2m;t Pr2n;t Active arcs (10.2d)
Sgmin
n Sgn;t Sgmax
n (10.2e)
Prmin
n Prn;t Prmax
n (10.2f)
10.2 Gas-Power Nexus
ıi;t ıj;t
Pij;t D (10.3c)
Xij
Pmax
ij Pij;t Pmax
ij (10.3d)
Pmin
g Pg;t Pmax
g (10.3e)
Pg;t Pg;t1 RUg (10.3f)
Pg;t1 Pg;t RDg (10.3g)
0 LSi;t Li;t (10.3h)
10.2 Gas-Power Nexus 273
Pwc w w
i;t D wt
i Pi;t (10.3i)
0 Pwi;t wt
wi (10.3j)
The overall optimization problem, constraints, and the decision variables are as
follows:
minOF D EC C GC (10.4)
DV
ıi;t ; Pg;t ; Pc;t ; Wc;t ; Ww;t
DV D
Sgn;t ; fn;m;t ; Prn;t
.10.2 and .10.3/
The hourly variation pattern of wind generation, electric and gas demand is
shown in Fig. 10.5.
274 10 Energy System Integration
Fig. 10.5 Hourly variation pattern of wind generation, electric and gas demand (pu)
The integrated electricity-gas problem is solved using the GCode 10.2. The
total electricity cost EC is $3:9760 105 . The total gas extraction costs are
GC = $5:1755 105 and the total costs are $9:1515 105 . The hourly variation
pattern of wind generation, electric and gas demand is shown in Fig. 10.5.
Fig. 10.6 Hourly variation pattern of gas generation from gas sources
Hourly variation pattern of gas generation from gas sources are shown in
Fig. 10.6.
The hourly variation pattern of electricity power generation is shown in Fig. 10.7.
276 10 Energy System Integration
400
g1
350
g2
g3
300
g4
g5
250
Pg,t (MW)
g6
200 g7
g8
150 g9
g 10
100 g 11
g 12
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
The interaction of gas network and electricity sector has been investigated in
several works. The impacts of the gas network on security constrained UC is
analyzed in [6]. A unified gas and power flow analysis in natural gas and electricity
coupled networks can be found in [7]. A robust scheduling model for wind-
integrated energy systems with the considerations of both gas pipeline and power
transmission contingencies is developed in [8]. The reliability of gas networks and
their impacts on the reliability of electricity network is modeled in [9]. The impact
of large penetration of wind generation on the UK gas network is analyzed in [10].
One of the recent efficient methods of electricity storage is storing the electricity as
gas. This method is also called power to gas or P2G technique [11].
The concept of Energy Hub was introduced in [12]. Energy hub may be considered
as a virtual box that can convert a set of input energy carriers into a set of energy
demands. This box contains several technologies that can store, transfer, or convert
different forms of energies to each other. A general example of Energy hub is
shown in Fig. 10.8. Different aspects of energy hubs are investigated in the literature
such as economic dispatch of energy hubs [13], demand response and energy hub
[14], energy hub concept applied on car manufacturing plants [15], and wind power
uncertainty modeling in energy hubs [16, 17].
The technologies shown in Fig. 10.8 are explained as follows:
• Combined heat and power (CHP): receives the natural gas (Gt ) and converts it
into heat (Ht ) and electricity (Et ) The CHP economic dispatch problem can be
modeled in (10.5) [18]:
Ht D chp
ge Gt (10.5a)
10.3 Energy Hub Concept 277
chp
Et D gh Gt (10.5b)
• Electric heat pump (EHP): It is fed by electricity and generates heat demand
(Ht ) or cool demand (Ct ) based on the operating mode. The operation of EHP is
mathematically formulated as follows:
Ct C Ht D Et COP (10.6a)
Htmin Ith Ht Htmax Ith (10.6b)
Ctmin Itc Ct Ctmax Itc (10.6c)
Itc C Ith 1 (10.6d)
Itc ; Ith 2 f0; 1g
The EHP can be in heat or cool generation mode. COP is the coefficient of
performance for EHP.
• Chiller boiler (CB): It receives heat and transforms it into cool demand The
chiller boiler operation is mathematically formulated as follows:
Ct D hc Ht (10.7)
278 10 Energy System Integration
The hc is the efficiency of heat to cooling conversion for chiller boiler.
• Electricity storage system (ESS): It can store (electricity) and then discharge
electricity The ESS operation is mathematically formulated as follows:
• Furnace (F): receives the natural gas and generates the heat demand
Ht D gh Gt (10.10)
Three different energy hub configurations will be analyzed to investigate the level
of achievable operational flexibility.
10.3.1 Data
The energy hubs which are analyzed in this chapter would have three types of energy
demands namely electric, heat, and cooling demand. Different hourly demand and
electricity price data for three energy hub configurations are given in Table 10.8.
• The charging and discharging efficiencies (ch=dch ) of ESS are assumed to be 0.9.
The ESS capacity is SOCmax D 600 MW h and SOCmin D 120 MW h. The initial
stored energy in ESS is 120 MW h. The minimum charging and discharging
ch=dch
limits are Emin D 0 and the maximum charging and discharging limits are
ch=dch
Emax D 120 MW.
• The transformer efficiency is ee D 0:98.
• The CHP efficiencies for gas to electricity is ge D 0:35 and for gas to heat is
gh D 0:45. The CHP capacity is 250 MW.
10.3 Energy Hub Concept 279
Table 10.8 Different hourly Time Dht (MW) Det (MW) Dct (MW) et $/MW h
demand and electricity price
data for energy hub t1 21.41 52.10 11.51 36.67
configurations t2 23.21 66.70 13.68 40.41
t3 26.09 72.20 16.01 38.48
t4 26.72 78.37 21.42 38.00
t5 25.59 120.20 21.97 40.24
t6 26.45 83.48 30.80 38.55
t7 39.54 110.40 38.94 52.26
t8 47.28 124.29 46.78 67.34
t9 52.12 143.61 50.97 70.47
t10 49.13 149.28 48.86 66.20
t11 69.26 154.19 34.77 73.30
t12 61.97 147.30 32.68 60.82
t13 68.04 200.71 27.77 63.15
t14 68.56 174.37 32.02 70.77
t15 56.40 176.54 33.22 63.09
t16 41.32 136.11 34.13 52.53
t17 37.43 108.71 40.78 57.00
t18 25.44 96.90 43.56 49.15
t19 25.66 89.08 51.48 47.47
t20 21.94 82.49 43.15 49.46
t21 22.44 76.93 36.49 53.07
t22 24.63 66.85 27.68 51.60
t23 22.72 47.17 19.14 50.53
t24 22.59 64.67 11.04 36.38
ehp ehp
• For EHP, CMax D HMax D 500 MW; The COP is assumed to be 2.5.
f
• The furnace efficiency gh is 0.9. The furnace capacity is 600 MW.
• The chiller boiler has a capacity equal to 500 MW and the efficiency is hc D 0:95
• The natural gas price is assumed to be constant for different hours and it is equal
g
to t D 12$/MW h
10.3.2 Configuration I
Fig. 10.9 The energy hub configuration I, considering transformer, furnace, and chiller boiler
f
gh Gt D H1;t C H2;t (10.11c)
The GAMS code for solving the hub configuration I described in (10.11) is given in
GCode 10.3.
The developed model in GCode 10.3 is linear and can be solved using any lp
solver. The problem is solved and the total operating costs are $1:1327 105 . The
hourly purchased electricity and natural gas in energy hub configuration I are shown
in Fig. 10.10.
The output of furnace system will be divided into two streams. The first
one will supply the chiller and the second one will directly supply the heat
demand. The hourly output of furnace unit in energy hub configuration-I is shown
in Fig. 10.11.
10.3 Energy Hub Concept 281
10.3.3 Configuration II
This configuration contains transformer, furnace, chiller boiler, CHP, and ESS as
shown in Fig. 10.12.
282 10 Energy System Integration
300
Power (MW) Et
200
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
150
Gt
Power (MW)
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.10 The hourly purchased electricity and natural gas in energy hub configuration I
80
H1,t
H2,t
70
60
Power (MW)
50
40
30
20
10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.11 The hourly output of furnace unit in energy hub configuration I
10.3 Energy Hub Concept 283
Fig. 10.12 The energy hub configuration II, considering transformer, furnace, chiller boiler, CHP,
and electric energy storage
X g
min OF D et Et C t Gt (10.12a)
t
The GAMS code for solving the hub configuration II described in (10.12) is given
in GCode 10.4.
t a b l e data ( t ,)
Dh De Dc lambda
t1 21.4 52.1 11.5 36.7
t2 23.2 66.7 13.7 40.4
t3 2 6 . 1 7 2 . 2 16 38.5
t4 2 6 . 7 7 8 . 4 2 1 . 4 38
t5 2 5 . 6 1 2 0 . 2 22 40.2
t6 26.4 83.5 30.8 38.6
t7 39.5 110.4 38.9 52.3
t8 47.3 124.3 46.8 67.3
t9 5 2 . 1 1 4 3 . 6 51 70.5
t10 49.1 149.3 48.9 66.2
t11 69.3 154.2 34.8 73.3
t 1 2 62 147.3 32.7 60.8
t 1 3 68 200.7 27.8 63.2
t 1 4 6 8 . 6 1 7 4 . 4 32 70.8
t15 56.4 176.5 33.2 63.1
t16 41.3 136.1 34.1 52.5
t 1 7 3 7 . 4 1 0 8 . 7 4 0 . 8 57
t18 25.4 96.9 43.6 49.2
t19 25.7 89.1 51.5 47.5
t20 21.9 82.5 43.1 49.5
t21 22.4 76.9 36.5 53.1
t22 24.6 66.8 27.7 51.6
t23 22.7 47.2 19.1 50.5
t 2 4 2 2 . 6 6 4 . 7 11 36.4
Variable cost ;
Positive variables
E ( t ) , E1 ( t ) , E2 ( t ) ,G( t ) , G1 ( t ) , G2 ( t ) , H1 ( t ) , H2 ( t )
SOC( t ) , Ec ( t ) , Ed ( t ) ;
Binary v a r i a b l e s Idch ( t ) , Ich ( t ) ;
s c a l a r SOC0 / 2 0 / , SOCmax / 6 0 0 / , e t a _ c / 0 . 9 / , e t a _ d / 0 . 9 / , e t a _ e e / 0 . 9 8 / , e t a _ g e / 0 . 4 5 / ,
e t a _ g h / 0 . 3 5 / , e t a _ h c / 0 . 9 5 / , Chpmax / 2 5 0 / , CBmax / 5 0 0 / , Fmax / 6 0 0 / , e t a _ g h f / 0 . 9 / ;
SOC0= 0.2SOCmax ;
SOC . up ( t ) =SOCmax ; SOC . l o ( t ) =0.2SOCmax ; SOC . f x ( ’ t 2 4 ’ ) =SOC0 ;
Ec . up ( t ) =0.2SOCmax ; Ec . l o ( t ) = 0 ;
Ed . up ( t ) =0.2SOCmax ; Ed . l o ( t ) = 0 ;
G1 . up ( t ) =Chpmax ;
G2 . up ( t ) =Fmax ;
H2 . up ( t ) =CBmax ;
E q u a t i o n s eq1 , eq2 , eq3 , eq4 , eq5 , eq6 , eq7 , eq8 , eq9 , eq10 , eq11 , eq12 ;
eq1 .. c o s t =e=sum ( t , d a t a ( t , ’ lambda ’ )E ( t ) +12G( t ) ) ;
eq2 ( t ) .. e t a _ e eE2 ( t ) +Ed ( t ) + e t a _ g eG1 ( t ) =e= d a t a ( t , ’E ’ ) ;
eq3 ( t ) .. E ( t ) =e=E1 ( t ) +E2 ( t ) ;
eq4 ( t ) .. E1 ( t ) =e=Ec ( t ) ;
eq5 ( t ) .. SOC( t ) =e=SOC0$ ( o r d ( t ) = 1 ) + SOC( t 1)$ ( o r d ( t ) >1)+Ec ( t )e t a _ cEd ( t ) / e t a _ d
;
eq6 ( t ) .. Ed ( t ) = l =0.2SOCmaxI d c h ( t ) ;
eq7 ( t ) .. Ec ( t ) = l =0.2SOCmaxI c h ( t ) ;
eq8 ( t ) .. Idch ( t ) + Ich ( t ) = l =1;
10.3 Energy Hub Concept 285
The developed model in GCode 10.4 is linear and can be solved using any lp
solver. The problem is solved, and the total operating costs are $0:85504 105 .
The hourly purchased electricity and its division between transformer and ESS in
energy hub configuration-II are shown in Fig. 10.13. The output of furnace system
will be divided into two streams. The first one will supply the chiller and the second
one will supply the heat demand. The hourly output of furnace unit in energy hub
configuration II is shown in Fig. 10.14. The hourly state of charge, charging, and
discharging of ESS in energy hub configuration II is shown in Fig. 10.15.
This configuration contains transformer, furnace, chiller boiler, CHP, and ESS as
shown in Fig. 10.16.
200
Et
Power (MW)
150
E 1,t
E 2,t
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
300
Gt
Power (MW)
200 G1,t
G2,t
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.13 The hourly purchased electricity and its division between transformer and ESS in
energy hub configuration II
286 10 Energy System Integration
60
H1,t
H2,t
50
40
Power (MW)
30
20
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.14 The hourly output of furnace unit in energy hub configuration II
600 SOC
t
500 Edch
t
Power (MW)
400 Ech
t
300
200
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.15 The hourly state of charge (MW h), charging, and discharging of ESS (MW) in energy
hub configuration II
X g
min OF D et Et C t Gt (10.13a)
t
Fig. 10.16 The energy hub configuration III, considering transformer, furnace, chiller boiler, CHP,
electric energy storage, and EHP
The developed model in GCode 10.5 is linear and can be solved using any lp
solver.
eq7 ( t ) .. Ec ( t ) = l =0.2SOCmaxI c h ( t ) ;
eq8 ( t ) .. Idch ( t ) + Ich ( t ) = l =1;
eq9 ( t ) .. G( t ) =e=G1 ( t ) +G2 ( t ) ;
eq10 ( t ) .. e t a _ g hG1 ( t ) +H1 ( t ) +H_ehp ( t ) =e=1 d a t a ( t , ’ h ’ ) ;
eq11 ( t ) .. e t a _ g h fG2 ( t ) =e=H1 ( t ) +H2 ( t ) ;
eq12 ( t ) .. e t a _ h cH2 ( t ) +C_ehp ( t ) =e= d a t a ( t , ’ c ’ ) ;
eq13 ( t ) .. C_ehp ( t ) +H_ehp ( t ) =e=E3 ( t )cop ;
eq14 ( t ) .. H_ehp ( t ) = l =H_ehpMax I h ( t ) ;
eq15 ( t ) .. C_ehp ( t ) = l =C_ehpMax I c ( t ) ;
eq16 ( t ) .. Ic ( t ) +Ih ( t ) = l =1;
Model Hub / a l l / ;
S o l v e hub u s mip min c o s t ;
200
Et
Power (MW)
150
E 1,t
E 2,t
100
50
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
300
Gt
Power (MW)
200 G1,t
G2,t
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.17 The hourly purchased electricity and its division between transformer and ESS in
energy hub configuration III
The problem is solved and the total operating costs are $0:84430 105 . The
hourly purchased electricity and its division between transformer and ESS in energy
hub configuration-III are shown in Figs. 10.17, 10.18. The output of furnace system
will be divided into two streams. The first one will supply the chiller and the second
one will supply the heat demand. The hourly output of furnace unit in energy hub
configuration II is shown in Fig. 10.14. The hourly state of charge, charging, and
discharging of ESS in energy hub configuration III is shown in Fig. 10.19. The
hourly output of EHP in energy hub configuration III is shown in Fig. 10.20.
290 10 Energy System Integration
60
H1,t
H2,t
50
40
Power (MW)
30
20
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.18 The hourly output of furnace unit in energy hub configuration III
600 SOCt
500 Edch
t
Power (MW)
400 Ech
t
300
200
100
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.19 The hourly state of charge (MW h), charging, and discharging of ESS (MW) in energy
hub configuration III
References 291
55
50 HEHP
t
CEHP
t
45
40
35
Power (MW)
30
25
20
15
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Time (h)
Fig. 10.20 The hourly output of EHP in energy hub configuration III
References
1. A. Santhosh, A.M. Farid, K. Youcef-Toumi, Real-time economic dispatch for the supply side
of the energy-water nexus. Appl. Energy 122, 42–52 (2014)
2. R.D. Zimmerman, C.E. Murillo-Sanchez, R.J. Thomas, Matpower: steady-state operations,
planning, and analysis tools for power systems research and education. IEEE Trans. Power
Syst. 26(1), 12–19 (2011)
3. A.J. Conejo, M. Carrión, J.M. Morales, Decision Making Under Uncertainty in Electricity
Markets, vol. 1 (Springer, Berlin, 2010)
4. F. Bouffard, F.D. Galiana, A.J. Conejo, Market-clearing with stochastic security-part II: case
studies. IEEE Trans. Power Syst. 20(4), 1827–1835 (2005)
5. D. De Wolf, Y. Smeers, The gas transmission problem solved by an extension of the simplex
algorithm. Manag. Sci. 46(11), 1454–1465 (2000)
6. T. Li, M. Eremia, M. Shahidehpour, Interdependency of natural gas network and power system
security. IEEE Trans. Power Syst. 23(4), 1817–1824 (2008)
7. A. Martinez-Mares, C.R. Fuerte-Esquivel, A unified gas and power flow analysis in natural gas
and electricity coupled networks. IEEE Trans. Power Syst. 27(4), 2156–2166 (2012)
8. L. Bai, F. Li, T. Jiang, H. Jia, Robust scheduling for wind integrated energy systems considering
gas pipeline and power transmission n-1 contingencies. IEEE Trans. Power Syst. 32(2), 1582–
1584 (2017)
9. J. Munoz, N. Jimenez-Redondo, J. Perez-Ruiz, J. Barquin, Natural gas network modeling for
power systems reliability studies. in 2003 IEEE Bologna Power Tech Conference Proceedings,
vol. 4, June 2003, p. 8
10. M. Qadrdan, M. Chaudry, J. Wu, N. Jenkins, J. Ekanayake, Impact of a large penetration of
wind generation on the GB gas network. Energy Policy 38(10), 5684–5695 (2010)
292 10 Energy System Integration
11. H.S. de Boer, L. Grond, H. Moll, R. Benders, The application of power-to-gas, pumped hydro
storage and compressed air energy storage in an electricity system at different wind power
penetration levels. Energy 72, 360–370 (2014)
12. M. Geidl, G. Koeppel, P. Favre-Perrod, B. Klöckl, G. Andersson, K. Fröhlich, The energy hub–
a powerful concept for future energy systems. in Third Annual Carnegie Mellon Conference
on the Electricity Industry, Pittsburgh (2007), pp. 13–14
13. S.D. Beigvand, H. Abdi, M. La Scala, A general model for energy hub economic dispatch.
Appl. Energy 190, 1090–1111 (2017)
14. M. Batić, N. Tomašević, G. Beccuti, T. Demiray, S. Vraneš, Combined energy hub optimisation
and demand side management for buildings. Energy Build. 127, 229–241 (2016)
15. K. Kampouropoulos, F. Andrade, Energy hub optimization applied on car manufacturing
plants. in ANDESCON, 2016 IEEE (IEEE, Piscataway, 2016), pp. 1–4
16. A. Soroudi, B. Mohammadi-Ivatloo, A. Rabiee, Energy hub management with intermittent
wind power. in Large Scale Renewable Power Generation (Springer, Singapore, 2014),
pp. 413–438
17. A. Dolatabadi, B. Mohammadi-Ivatloo, M. Abapour, S. Tohidi, Optimal stochas-
tic design of wind integrated energy hub. IEEE Trans. Ind. Inf. 99, 1–1 (2017).
doi:10.1109/TII.2017.2664101
18. M. Geidl, Integrated modeling and optimization of multi-carrier energy systems. PhD thesis,
TU Graz, 2007
Index
D
Debugging, 19–24, 43 H
DED. See dynamic economic dispatch (DED) Heat, 73, 76, 77, 92, 276–278, 280, 285, 289
Demand flexibility, 131–136 Heat demand, 77, 277, 278, 280, 285, 289
Discharging, 3, 278, 285, 286, 289, 290 Heuristic optimization, 5
Display, 8, 11, 21–23, 26, 36 Hydro Unit, 79–86
R
M Ramp rate, 98–101, 120–122, 163
Marginal, 14, 35–37, 43, 45, 48, 49, 66, 67, Random numbers, 53–57
145, 161, 168, 173, 238 Reserve, 3, 91, 110–114, 126–129, 131, 132
Mixed integer non-linear programming Resistance, 150, 161, 168, 172, 184, 269
(MINLP), 11, 27, 49–52, 62 Robust optimization, 3, 4, 138, 139, 227
Mixed integer programming (MIP), 11, 27, 28,
38–44, 62, 119, 224, 227, 254, 257
Multi-area economic dispatch, 86, 87, 90, 91 S
Multistage PMU placement, 221–224 Sensitivity analysis, 17, 28, 67–69, 75, 98–101,
135
Single line outage, 218–221
N Solve statement, 8, 10, 20, 21, 23, 45, 55, 71,
Natural gas, 276, 278–280, 282 145, 242
Non-linear programming (NLP), 11, 23, Spinning reserve, 110, 114, 118, 126
44–52, 62 State of charge, 195, 278, 285, 286, 289, 290
Stochastic, 91, 117, 138, 139
Susceptance, 150, 173, 184, 233, 238, 269
O
Observability, 2, 28, 203–225
Operating costs, 3, 28, 76, 79, 81, 87, 95, 97, T
100, 107, 109, 117, 125, 126, 129, 133, Thermal unit, 65–73, 76, 77, 81, 83–88, 95–99,
136, 142, 146, 150, 153, 154, 157, 161, 101, 107, 108, 121, 125, 126, 128, 129,
163, 168, 176, 179, 183, 185, 191, 195, 131–134, 138, 139, 143, 161, 163, 165,
196, 199, 229, 231, 233, 235, 236, 249, 170, 172, 173, 177–180, 183, 199, 237,
257, 258, 280, 285, 289 238, 266
OPF. See Optimal power flow (OPF) Transmission expansion planning (TEP), 1, 3,
Optimal AC power flow, 28, 169–173 6, 62, 227–238
Index 295
U Weighted sum, 58
Uncertainty, 2, 3, 138, 139, 176, 200, 227, 263, Wind curtailment, 118, 163, 168, 176, 199
276 Wind turbine, 28, 65, 88, 138, 163, 168, 172,
173, 269
W
Water, 79–82, 265–268 Z
Water-power Nexus, 265–269 Zero injection bus, 205–207, 209–211, 213