economic dispatch and hydro-scheduling using linear ... project report... · cost ($/hr) p 1 2 p 3...
TRANSCRIPT
Economic Dispatch and Hydro-Schedulingusing Linear Programming
Shantanu S ChavanNavaneethakrishnan Raman
Tamil Kadir Rajavel
May 2, 2011
Abstract
Linear programming (LP) is one of the preferred methods for optimizing power systemproblems. The size and complexity of such multi-variable, multi-constraint problems call forthe use of LP solvers. In this project, we use MATLAB R©’s optimization toolbox to solveeconomic dispatch (ED) and hydro-scheduling problems. This project report also discussesthe algorithm we developed for working out the optimal solution for the problem. We alsoreview some of the commercially available LP solvers.
Contents
List of Figures 2
1 Introduction 41.1 Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Economic Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Hydro-Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Solution to Economic Dispatch problem 62.1 Piecewise linear approximation of cost functions . . . . . . . . . . . . . . . . 62.2 Economic dispatch without loss . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.1 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.2.2 Equality constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.2.3 Inequality constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Economic dispatch with loss . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3.1 Modification in linear programming based on Lagrange multiplier method 82.3.2 Objective function and equality constraints . . . . . . . . . . . . . . . 9
2.4 MATLAB R© code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Solution to Hydro-Scheduling problem 143.1 Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.2 Objective function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.3 Equality constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.4 Inequality Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.5 MATLAB R© code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 Commercially available Linear Programming Solvers 204.1 Linear programming in GAMS . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1.1 CPLEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5 Conclusions 215.1 Economic dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.2 Hydro-scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1
A Program Outputs 22A.1 Economic dispatch problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
A.1.1 Output 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23A.1.2 Output 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24A.1.3 Output 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
A.2 Hydro-scheduling problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26A.2.1 Output 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26A.2.2 Output 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2
List of Figures
2.1 Cost Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2 Linearized Cost Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3
Chapter 1
Introduction
In this project, we demonstrate how linear programming can be used for solving economic dis-patch and hydro-scheduling problems, with the help of optimization toolbox in MATLAB R©.MATLAB R© code for a representative problem is provided in each section. More variationswere solved, whose outputs are available in Appendix A.
1.1 Linear Programming
Linear Programming has always been an efficient tool in solving optimization problems.Linear programming problem defines an objective function, which has to be minimized ormaximized, satisfying a set of linear constraints. The constraints can be equalities or in-equalities. The commonly used techniques for solving linear programming problems aresimplex algorithm developed by George Dantzig and the interior point method. The linearprogramming problem in its standard form can be formulated as
min or max f = cTx (1.1)
subject to
Ax ≤ b; x ≥ 0 (1.2)
where c is the vector containing coefficients of objective function.A and b are the problem parameters representing the constraint functions.
The optimization toolbox in MATLAB R© makes use of linear programming functionLINPROG, capable of performing large scale, medium scale or simplex algorithm.
4
1.2 Economic Dispatch
Economic dispatch is the method of determining the most efficient (cheapest) way of powersystem operation to supply the load on the system. The main objective of economic dispatchis to minimize total operational cost, satisfying all the constraints involved.
The definition of economic dispatch provided in EPAct section 1234 is:
“The operation of generation facilities to produce energy at the lowest cost toreliably serve consumers, recognizing any operational limits of generation andtransmission facilities.”
There are various methods to solve for economic dispatch of generating units, which arelisted below:
(i) Largrange multiplier method
(ii) Dynamic programming
(iii) Linear programming
In general, the cost function of each generator is a quadratic function of the form
Ci(Pi) = αi + βiPi + γiP2i
The total cost is
C(P ) =n∑
i=1
Ci(Pi)
The objective is to minimize the total cost C(P ) satisfying a set of constraints.
1.3 Hydro-Scheduling
Hydro-scheduling is a random, non-linear problem, dealing with minimization of operatingcosts. Similar to economic dispatch problem, hydro-scheduling can be solved using
(i) Largrange multiplier method
(ii) Dynamic programming
(iii) Linear programming
There are two types of hydro-scheduling problem
(i) Short range hydro-scheduling (1 day - 1 week)
(ii) Long range hydro-scheduling (1 week - 1 or several years)
In this project, we are dealing with short-term hydro-scheduling. The primary objectiveof hydro-scheduling is to minimize the total operating cost C(P ) of thermal units overthe scheduling period, meeting various constraints on hydro-electric generation, thermalgeneration, reservoir levels, etc.
5
Chapter 2
Solution to Economic Dispatchproblem
In this section, we will explain a method of solving economic dispatch problem utilizing linearprogramming. As per the conditions for linear programming, the objective function needsto be linear in form. However, in practical problems, it is not the case and we encounterobjective function (cost function of the thermal plants in our case) which is quadratic.This doesn’t satisfy the requirements of a linear program. We can bypass this problem byemploying piecewise linear approximation of the cost function.
2.1 Piecewise linear approximation of cost functions
More often we come across objective functions (cost functions) which are non linear in nature.For the purpose of minimizing it by linear programming we can utilize the piecewise linearapproximation of the function curve. Let us take a cost function shown in Fig. 2.1
Power(MW)
Cost($/Hr)
Figure 2.1: Cost Curve
6
This non linear cost curve can be approximated by using a series of segments representingthe slope of the curve at various points. This is presented in Fig. 2.2
Power(MW)
Cost($/Hr)
P1 P2 P3 P4
C1
C2
C3
C4
s3
Figure 2.2: Linearized Cost Curve
s1, s2, s3 represent the slopes of the segments given by
si =Ci+1 − Ci
Pi+1 − Pi
for i=1,2,3.
Therefore, cost curve is approximated by the use of slope segments and can be improvedfurther by increasing the number of slope segments.
Finally, the cost function is given by
C(P ) = C(Pmin) +3∑
j=1
siPj
2.2 Economic dispatch without loss
2.2.1 Objective function
For the case mentioned in Section 2.1, the objective function for the linear program is noth-ing but the sum of piecewise approximated cost functions. However, the first term C(Pmin)is a constant value, and thus does not effect the decision variables in linear programming.So, it does not picture in the linear program formulation. But, while calculating cheapestcost, we should include it back.
Finally, the objective function in general is given as
F =Ns∑i=1
Ng∑j=1
sijPij
7
Ns: No. of slope segmentsNg: No. of generators
For example, for two generators(Ng = 2) and three slope segments (Ns = 3), we have
F = s11P11 + s21P21 + s31P31 + s12P12 + s22P22 + s32P32
2.2.2 Equality constraints
In general, the load balance equation is given as
PLoad −Ng∑i=1
Pi = 0
Since the decision variables in LP are incremental values of power, we cannot include Pmin
for each generator. Therefore, we subtract the minimum generation from the total load pluslosses incurred. The equality constraint is hence given as
P11 + P21 + P31 + P12 + P22 + P32 = PLoad − (P1,min + P2,min)
2.2.3 Inequality constraints
In this project, we will use LB and UB of decision variables instead of the inequality con-straints, where LB would be 0 for all variables and UB would be equal to the step size forcalculating slopes, si.
2.3 Economic dispatch with loss
2.3.1 Modification in linear programming based on Lagrange mul-tiplier method
The load balance equation in general is given by
PLoad + PLoss −Ng∑i=1
Pi = 0
When we solve economic dispatch by Lagrange multiplier method, we come across a termcalled penalty factor defined as
pf = 1− ∂Ploss
∂Pi
We include the penalty factor term into the Lagrange multiplier method to account for thelosses. In this project, we will employ the same methodology for including the losses intothe calculation via linear programming.
8
2.3.2 Objective function and equality constraints
We have already linearized the cost curves in the previous sections. To incorporate the lossesincurred, we will include the penalty factor term corresponding to the loss function into theslope equation. For example, the slope values will change from s1 to (pf ∗ s1).
The objective function will therefore be
F =Ns∑i=1
Ng∑j=1
pfjsijPij
Ns: No. of slope segmentsNg: No. of generators
For example, for two generators(Ng = 2) and three slope segments (Ns = 3), we have
F = pf1(s11P11 + s21P21 + s31P31) + pf2(s12P12 + s22P22 + s32P32)
The equality constraint is hence given as
P11 + P21 + P31 + P12 + P22 + P32 = PLoad + PLoss − (P1,min + P2,min)
2.4 MATLAB R© code
% ECONOMIC DISPATCH USING LINEAR PROGRAMMING% TO MINIMIZE THE PRODUCTION COST OF THERMAL UNITS% H1(P1)= 800 + 7.2∗ P1 + P1ˆ2/450 MBtu/HR 250 < P1 < 600 MW% COST OF FUEL FOR PLANT 1= $1 .5/MBtu% H2(P2)= 950 + 7∗ P2 + P2ˆ2/600 MBtu/HR 300 < P2 < 875 MW% COST OF FUEL FOR PLANT 2= $1 .8/MBtu% H3(P3)= 350 + 8∗ P3 + P3ˆ2/400 MBtu/HR 150 < P3 < 400 MW% COST OF FUEL FOR PLANT 3= $1 .6/MBtu% dp l o s s /dp1=0.002% dp l o s s /dp2= −0.005% dp l o s s /dp3=0.01% LOAD= 1200 MW% POWER LOSS= 3% OF LOAD= 36 MW
clc ; clear a l l ;
%PRINT INPUT/OUTPUT CHARACTERISTICSfpr intf ( ’%+5s %+30s %+10s %+10s %+20s %+25s \n ’ , ’ Unit ’ , . . .
’ Heat Rate Function (MBtu/HR) ’ , ’Pmin ’ , ’Pmax ’ , ’ Fuel Cost ( $/MBtu) ’ , . . .
9
’ Incrementa l Loss ( $/MWh) ’ ) ;fpr intf ( ’%+5s %+30s %+10s %+10s %+20s %+25s \n ’ , ’ 1 ’ , . . .
’ 800 + 7.2∗ P1 + P1ˆ2/450 ’ , ’ 250 ’ , ’ 600 ’ , ’ 1 . 5 ’ , ’ 0 .002 ’ ) ;fpr intf ( ’%+5s %+30s %+10s %+10s %+20s %+25s \n ’ , ’ 2 ’ , . . .
’ 950 + 7.0∗ P2 + P2ˆ2/600 ’ , ’ 300 ’ , ’ 875 ’ , ’ 1 . 8 ’ , ’ −0.005 ’ ) ;fpr intf ( ’%+5s %+30s %+10s %+10s %+20s %+25s \n\n ’ , ’ 3 ’ , . . .
’ 350 + 8.0∗ P3 + P3ˆ2/400 ’ , ’ 150 ’ , ’ 400 ’ , ’ 1 . 6 ’ , ’ 0 .01 ’ ) ;fpr intf ( ’%+20s %+10s \n ’ , ’ Load : ’ , ’ 1200 MW’ ) ;fpr intf ( ’%+20s %+10s \n \n ’ , ’ Power Loss : ’ , ’3% o f Load ’ ) ;
format shortGstep =5;
p 1 f i n a l = [ ] ;p 2 f i n a l = [ ] ;p 3 f i n a l = [ ] ;t o t a l = [ ] ;
% PROBLEM DATAp1min=250;p1max=600; % GENERATOR LIMITS 250 < P1 < 600 MWp2min=300;p2max=875; % 300 < P2 < 875 MWp3min=150;p3max=400; % 150 < P3 < 400 MWdp los s dp =[0.002 −0.005 0 . 0 1 ] ; % INCREMENTAL COSTS OF THE THREE GENERATORSload=1200; % LOAD= 1200 MWp l o s s= 0 .03∗1200 ; % POWER LOSS= 3% OF THE LOAD= 36 MWr =[1.5 1 .8 1 . 6 ] ; % COST OF FUEL: PLANT 1=$1 .5/MBtu
% PLANT 2=$1 .8/MBtu% PLANT 3=$1 .6/MBtu
h1 =[7.2 1/450 8 0 0 ] ; % I/O CHARACTERISTICS OF GENERATOR 1 MBtu/HRh2=[7 1/600 9 5 0 ] ; % I/O CHARACTERISTICS OF GENERATOR 2 MBtu/HRh3=[8 1/400 3 5 0 ] ; % I/O CHARACTERISTICS OF GENERATOR 3 MBtu/HR
p1=p1min : s tep : p1max ;c1=r ( 1 ) . ∗ ( ( h1 ( 1 ) . ∗ p1 )+((p1 . ˆ 2 ) . ∗ h1 (2))+ h1 ( 3 ) ) ; % COST FUNCTION 1p2=p2min : s tep : p2max ;c2=r ( 2 ) . ∗ ( ( h2 ( 1 ) . ∗ p2 )+((p2 . ˆ 2 ) . ∗ h2 (2))+ h2 ( 3 ) ) ; % COST FUNCTION 2p3=p3min : s tep : p3max ;c3=r ( 3 ) . ∗ ( ( h3 ( 1 ) . ∗ p3 )+((p3 . ˆ 2 ) . ∗ h3 (2))+ h3 ( 3 ) ) ; % COST FUNCTION 3
pgenmin=min( p1)+min( p2)+min( p3 ) ;
% LOOPS FOR FINDING THE SLOPES OF THE GENERATORS I/O CHARACTERISTICS
10
% LINEARIZING THE QUADRATIC FUNCTION FOR LINEAR PROGRAMMINGfor i =1: length ( c1)−1
s1 ( i )=( c1 ( i +1)−c1 ( i ) ) / ( p1 ( i +1)−p1 ( i ) ) ;endfor i =1: length ( c2)−1
s2 ( i )=( c2 ( i +1)−c2 ( i ) ) / ( p2 ( i +1)−p2 ( i ) ) ;endfor i =1: length ( c3)−1
s3 ( i )=( c3 ( i +1)−c3 ( i ) ) / ( p3 ( i +1)−p3 ( i ) ) ;end
% CALCULATION WITHOUT LOSSESc=[s1 , s2 , s3 ] ; % OBJECTIVE FUNCTION
% MINIMISE F1(P1)+F2(P2)+F3(P3)
% SUBJECT TO FOLLOWING CONSTRAINTS
% INEQUALITY CONSTRAINTSA= [ ] ;b = [ ] ;
% EQUALITY CONSTRAINTSAeq=zeros ( length ( c ) ) ;Aeq ( 1 , : ) = 1 ;Beq=zeros ( length ( c ) , 1 ) ;Beq(1)= load−pgenmin ;
% LIMITS (UPPER AND LOWER BOUNDS)LB=zeros ( length ( c ) , 1 ) ;UB=zeros ( length ( c ) , 1 ) ;UB( : ,1 )= step ;
% LINEAR PROGRAMMING TO FIND THE OPTIMUM SOLUTION% VECTOR x WILL GIVE GENARATION VALUES (3 GENAREATORS)% GENERATION VALUES THAT WILL MINIMISE PRODUCTION COST FOR LOAD=1200 MWx = l i n p r o g ( c ,A, b , Aeq , Beq ,LB,UB) ;
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 1 WITHOUT LOSSESsum1=min( p1 ) ;for i =1: length ( s1 )
sum1=sum1+x ( i ) ;end
11
p 1 f i n a l (1)=sum1 ;
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 2 WITHOUT LOSSESsum2=min( p2 ) ;for i=length ( s1 ) : ( length ( s1)+length ( s2 ) )
sum2=sum2+x ( i ) ;endp 2 f i n a l (1)=sum2 ;
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 3 WITHOUT LOSSESsum3=min( p3 ) ;for i =(length ( s1)+length ( s2 ) ) : length ( x )
sum3=sum3+x ( i ) ;endp 3 f i n a l (1)=sum3 ;
% TOTAL GENERATIONt o t a l (1)= p 1 f i n a l (1)+ p 2 f i n a l (1)+ p 3 f i n a l ( 1 ) ;P2=p 2 f i n a l ( 1 ) ; P1=p 1 f i n a l ( 1 ) ; P3=p 3 f i n a l ( 1 ) ;
% TOTAL PRODUCTION COSTcos t1 =(r ( 1 )∗ ( ( h1 (1)∗P1)+((P1ˆ2)∗h1 (2))+ h1 (3)) )+( r ( 2 )∗ ( ( h2 (1)∗P2 ) + . . .
( ( P2ˆ2)∗h2 (2))+ h2 (3)) )+( r ( 3 )∗ ( ( h3 (1)∗P3)+((P3ˆ2)∗h3 (2))+ h3 ( 3 ) ) ) ;c o s t w i t h o u t l o s s e s=cos t1 ;
% CALCULATION WITH LOSSES= 36 MW(3% OF THE LOAD)c =[(1/(1− dplos s dp ( 1 ) ) )∗ s1 ,(1/(1− dp los s dp ( 2 ) ) )∗ s2 , . . .
(1/(1− dp los s dp ( 3 ) ) )∗ s3 ] ; % PENALTY FACTOR INTRODUCTION% TO THE OBJECTIVE FUNCTION
% EQUALITY CONSTRAINTS CHANGED DUE TO THE LOSSESBeq(1)= load−pgenmin+p l o s s ;
% LINEAR PROGRAMMING TO FIND THE OPTIMUM SOLUTIONx = l i n p r o g ( c ,A, b , Aeq , Beq ,LB,UB) ;
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 1 WITH LOSSESsum1=min( p1 ) ;for i =1: length ( s1 )
sum1=sum1+x ( i ) ;endp 1 f i n a l (2)=sum1 ;
12
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 2 WITH LOSSESsum2=min( p2 ) ;for i=length ( s1 )+1:( length ( s1)+length ( s2 ) )
sum2=sum2+x ( i ) ;endp 2 f i n a l (2)=sum2 ;
% LOOP FOR FINDING THE ANSWER TO THE GENERATION 3 WITH LOSSESsum3=min( p3 ) ;for i =(length ( s1)+length ( s2 )+1): length ( x )
sum3=sum3+x ( i ) ;endp 3 f i n a l (2)=sum3 ;
% TOTAL GENERATIONt o t a l (2)= p 1 f i n a l (2)+ p 2 f i n a l (2)+ p 3 f i n a l ( 2 ) ;P2=p 2 f i n a l ( 2 ) ; P1=p 1 f i n a l ( 2 ) ; P3=p 3 f i n a l ( 2 ) ;
% TOTAL PRODUCTION COSTcos t2 =(r ( 1 )∗ ( ( h1 (1)∗P1)+((P1ˆ2)∗h1 (2))+ h1 (3)) )+( r ( 2 )∗ ( ( h2 (1)∗P2 ) + . . .
( ( P2ˆ2)∗h2 (2))+ h2 (3)) )+( r ( 3 )∗ ( ( h3 (1)∗P3)+((P3ˆ2)∗h3 (2))+ h3 ( 3 ) ) ) ;c o s t w i t h l o s s e s=cos t2 ;
%PRINT OUTPUTfpr intf ( ’\n \n %+30s %+9s %+9s %+13s %+18s %+9s \n ’ , ’GEN 1 ’ , . . .
’GEN 2 ’ , ’GEN 3 ’ , ’TOTAL LOAD’ , ’TOTAL GENERATION’ , ’COST ’ ) ;fpr intf ( ’ %+20s %9.2 f %9.2 f %9.2 f %13.2 f %18.2 f %9.2 f \n ’ , . . .
’WITHOUT LOSSES ’ , p 1 f i n a l ( 1 ) , p 2 f i n a l ( 1 ) , p 3 f i n a l ( 1 ) , load , t o t a l ( 1 ) , . . .c o s t w i t h o u t l o s s e s ) ;
fpr intf ( ’ %+20s %9.2 f %9.2 f %9.2 f %13.2 f %18.2 f %9.2 f \n ’ , . . .’WITH LOSSES ’ , p 1 f i n a l ( 2 ) , p 2 f i n a l ( 2 ) , p 3 f i n a l ( 2 ) , load , t o t a l ( 2 ) , . . .c o s t w i t h l o s s e s ) ;
13
Chapter 3
Solution to Hydro-Scheduling problem
In this section, we will discuss the methodology for solving short term hydro schedulingproblem. Short term hydro scheduling deals with hour by hour scheduling of all generators(hydro, steam etc.) with the goal of minimizing the overall production cost during the par-ticular time period. We are considering a case of two generators, one hydro and other as asteam generator.
Suppose we have two sources of generation as mentioned above supplying a given load.Now, at given time if the generation capacity of hydro plant is more than the load itself,it can supply the entire load on its own. But, when compared to a case when the load tobe supplied is more than the capability of the hydro-plant, it cannot supply the load andhas to depend on the other source of generation for providing the remaining load. Ideally,we would like to run the hydro plant as much as possible to reduce the production cost ofsteam plant. This leads us to the so called ‘Hydro scheduling problem.’ There are variousmethods available to get around this problem and one of them is via linear programming.
3.1 Problem Formulation
Since we are dealing with hour to hour scheduling problem, invariably we will have numberof load periods each with several number of hours. These load periods play an importantrole in formulating the problem. For example, in this report we will solve a problem withtwo load periods of 12 hours each supplying different loads. Our aim is to supply these loadsin the given period with the set of hydro and steam plant and with minimum productioncost for the steam plant.
Cost characteristics of the steam plant are non linear as before. On the other hand, theflow characteristics for the hydro plant are linear. In a hydro scheduling problem, startingand ending conditions such as reservoir water level along with water inflows are given. Thereare certain constraints on the hydro and steam plants which have to be met while solvingfor the minimum solution. e.g. minimum and maximum generation levels.
14
3.2 Objective function
As seen in the earlier chapter, we would use the same method of piecewise linear approxima-tion for linearizing the quadratic cost curves to incorporate them in the linear program. Theobjective of the hydro scheduling problem is to minimize the production cost of the steamplant. Hence the objective function is nothing but,
F =Ns∑i=1
N∑j=1
si(j)Pi(j)
Ns: No. of slope segmentsN : No. of load periods
The number of load periods for the given system along with the step size used for slopecalculation will determine the length of the vector containing the coefficients of objectivefunction.
3.3 Equality constraints
As discussed earlier, load balance equation is
Pload(j)− Ps(j)− Ph(j) = 0
For our project, we will get
Ns∑i=1
Ps,i(j) + Ph(j) = Pload(j)− Ps,min(j)
where j = 1, 2, 3, ...N
Again, note that as discussed in the previous chapter, we have to subtract the value ofthe Ps,min from the total load.
Additional equality constraints representing the hydro plant variables are also involved.Although, the starting and ending reservoir limits and hydraulic inflow are known, the in-termediate reservoir levels that decide the hydro plant generation for minimal amount ofsteam plant operation are not known and are very important in terms finding the answer.j number of equations relating the starting, intermediate and ending reservoir levels alongwith inflow and water discharge during the period form these constraints. They are given as
Vj−1 + rj − qj = Vj
where, Vj is reservoir volume at period jrj is net inflow to the reservoir during period jqj is water discharge during period j
15
3.4 Inequality Constraints
We will again use LB and UB in linear program, where LB would be 0 for all variablesand UB would be equal to the step size for slope calculation. Here we will have someadditional variables as compared to the economic dispatch solution. That includes hydroplant generation and intermediate reservoir level. This also leads to zero padding in theobjective function vector corresponding to the additional variables coming into picture.
3.5 MATLAB R© code
% HYDRO SCHEDULING USING LINEAR PROGRAMMING% TO MINIMISE PRODUCTION COST OF COAL POWER PLANT% H(Ps)= 4∗ Ps + 0.001∗ Psˆ2 MBtu/HR 50 < Ps < 500 MW% COST OF COAL= 1.2 $/MBtu% q (Ph)= 50 + 4.9∗ Ph ACRE−FT/HR 0 < Ph < 500 MW% RESERVOIR CAPACITY= 30000 ACRE−FT, INFLOW= 1250 ACRE−FT/HR% RESERVOIR VOLUME AT START= 15000 ACRE−FT% RESERVOIR VOLUME AT END= 15000 ACRE−FT% LOAD (BOTH PERIODS ARE 12 HRS LONG)% PERIODS MW% 1 425% 2 700clc ; clear a l l ;format shortGstep =1;
%PRINT INPUT/OUTPUT CHARACTERISTICSfpr intf ( ’%s \n ’ , ’STEAM PLANT: ’ ) ;fpr intf ( ’%+32s %−30s %+15s\n ’ , ’ Heat Rate Function : ’ , . . .
’ 4∗ Ps + 0.001∗ Psˆ2 MBtu/HR’ , ’ 50 < Ps < 500 MW’ ) ;fpr intf ( ’%+32s %+5s \n \n ’ , ’ Cost o f Coal : ’ , ’ 1 . 2 $/MBtu ’ ) ;fpr intf ( ’%s \n ’ , ’HYDRO PLANT: ’ ) ;fpr intf ( ’%+32s %−30s %+15s\n ’ , ’ Flow C h a r a c t e r i s t i c s : ’ , . . .
’ 50 + 4.9∗ Ph ACRE−FT/HR’ , ’ 0 < Ph < 500 MW’ ) ;fpr intf ( ’%+32s %+5s \n ’ , ’ Rese rvo i r Capacity : ’ , ’ 30000 ACRE−FT ’ ) ;fpr intf ( ’%+32s %+5s \n ’ , ’ In f l ow : ’ , ’ 1250 ACRE−FT/HR’ ) ;fpr intf ( ’%+32s %+5s \n ’ , ’ Rese rvo i r Volume at Sta r t : ’ , ’ 15000 ACRE−FT ’ ) ;fpr intf ( ’%+32s %+5s \n \n ’ , ’ Rese rvo i r Volume at End : ’ , ’ 15000 ACRE−FT ’ ) ;fpr intf ( ’%+32s %+10s \n ’ , ’ Per iod (12 HRS Each ) ’ , ’ Load (MW) ’ ) ;fpr intf ( ’%+32s %+10s \n ’ , ’ 1 ’ , ’ 425 ’ ) ;fpr intf ( ’%+32s %+10s \n \n ’ , ’ 2 ’ , ’ 700 ’ ) ;
16
% PROBLEM DATAr =1.2 ; % COST OF FUEL= $1 .2/MBtup=12; % NO. OF HRS IN SINGLE LOAD PERIODload=[425 7 0 0 ] ; % PERIODWISE LOADps =50: s tep : 5 0 0 ; % COAL POWER PLANT GENERATION LIMITS
% 50 TO 500 MWph=0: s tep : 5 0 0 ; % HYDRO POWER PLANT GENERATION LIMITS
% 0 TO 500 MWq=[50 4 . 9 ] ; % I/O CHARACTERISTICS OF HYDRO−PLANT
% q (1) + q (2)∗ ph (ACRE−FT/HR)v =0:7500 :30000 ; % RESREVOIR VOLUME LIMITS
% 0 TO 30000 ACRE−FTv s t a r t =15000; % START VOLUME= 15000 ACRE−FTv end =15000; % END VOLUME= 15000 ACRE−FTin =1250∗p ; % WATER INFLOW= 1250 ACRE−FT/HRhs =[4 0 . 0 0 1 ] ;c s =[ r∗hs (1 ) r∗hs ( 2 ) ] ; % I/O CHARACTERISTICS OF COAL POWER PLANT
% cs (1)∗ ps + cs (2)∗ ps ˆ2 ($/HR)f s =(cs (1)∗p ) . ∗ ps+(cs (2)∗p ) . ∗ ( ps . ˆ 2 ) ;% I/O CHARACTERISTICS FOR 12−HR PERIOD
% LOOP FOR FINDING THE SLOPES OF THE COAL POWER PLANT I/O CHARACTERISTICS% LINEARIZING THE QUADRATIC FUNCTION FOR LINEAR PROGRAMMINGfor i =1: length ( f s )−1
s ( i )=(( f s ( i +1)− f s ( i ) ) / ( ps ( i +1)−ps ( i ) ) ) ;end
c=[s , s , 0 , 0 , 0 ] ; % OBJECTIVE FUNCTION% MINIMISE Fs (Ps(1))+Fs (Ps (2) )
% SUBJECT TO FOLLOWING CONSTRAINTS
% INEQUALITY CONSTRAINTSA= [ ] ;b = [ ] ;
% EQUALITY CONSTRAINTSAeq=zeros ( length ( c ) ) ;Aeq ( 1 , ( 1 : ( length ( s ) ) ) )=1 ;Aeq (2 , length ( s )+1:( length ( s )∗2))=1;Aeq (1 , length ( c )−2)=1;Aeq (2 , length ( c )−1)=1;Aeq (3 , length ( c)−2)=q (2)∗p ;
17
Aeq (3 , length ( c ))=1;Aeq (4 , length ( c)−1)=−q (2)∗p ;Aeq (4 , length ( c ))=1;Beq=[ load(1)−min( ps ) ; load(2)−min( ps ) ; v s t a r t+in−q (1)∗p ; q (1)∗p ] ;Beq ( 5 : length ( c ) ,1)=0;
% LIMITS (UPPER AND LOWER BOUNDS)LB=zeros ( length ( c ) , 1 ) ;UB=zeros ( length ( c ) , 1 ) ;UB( ( 1 : length ( c )−3) ,1)= step ;UB( ( length ( c )−2: length ( c )−1) ,1)=max(ph ) ;UB( length ( c ) ,1)=max( v ) ;
% LINEAR PROGRAMMING TO FIND THE OPTIMUM SOLUTION% VECTOR x WILL GIVE COAL POWER PLANT GENARATION VALUES , HYDRO PLANT% GENERATION VALUES THAT WILL MINIMISE THE PRODUCTION COST ALONG WITH% VOLUME OF RESERVOIR AFTER THE END OF PERIOD 1x=l i n p r o g ( c ,A, b , Aeq , Beq ,LB,UB) ;
% LOOP FOR FINDING THE ANSWER FOR COAL POWER PLANT GENERATION (PERIOD 1)sum1=min( ps ) ;for i =1: length ( s )sum1=sum1+x ( i ) ;
endp s f i n a l p e r i o d 1=sum1 ;
% LOOP FOR FINDING THE ANSWER FOR COAL POWER PLANT GENERATION (PERIOD 2)sum2=min( ps ) ;for i=length ( s )+1:2∗ length ( s )
sum2=sum2+x ( i ) ;endp s f i n a l p e r i o d 2=sum2 ;
p h f i n a l p e r i o d 1=x ( length ( c )−2); % HYDRO PLANT GENERATION (PERIOD 1)p h f i n a l p e r i o d 2=x ( length ( c )−1); % HYDRO PLANT GENERATION (PERIOD 2)
% TOTAL GENERATION (PERIOD 1)Tota l p e r i od 1=p s f i n a l p e r i o d 1+p h f i n a l p e r i o d 1 ;
% TOTAL GENERATION (PERIOD 2)Tota l p e r i od 2=p s f i n a l p e r i o d 2+p h f i n a l p e r i o d 2 ;
18
% PRODUCTION COST (PERIOD 1)c o s t p e r i o d 1 =(cs (1)∗p)∗ p s f i n a l p e r i o d 1 +(( cs (2)∗p ) ∗ . . .
( p s f i n a l p e r i o d 1 ˆ 2 ) ) ;
% PRODUCTION COST (PERIOD 2)c o s t p e r i o d 2 =(cs (1)∗p)∗ p s f i n a l p e r i o d 2 +(( cs (2)∗p ) ∗ . . . .
( p s f i n a l p e r i o d 2 ˆ 2 ) ) ;
To ta l c o s t=c o s t p e r i o d 1+c o s t p e r i o d 2 ; % TOTAL PRODUCTION COST
%PRINT OUTPUTfpr intf ( ’ %+50s %+9s \n ’ , ’PERIOD 1 ’ , ’PERIOD 2 ’ ) ;fpr intf ( ’ %+40s %9.2 f %9.2 f \n ’ , ’HYDRO PLANT GENERATION’ . . .
, p h f i n a l p e r i o d 1 , p h f i n a l p e r i o d 2 ) ;fpr intf ( ’ %+40s %9.2 f %9.2 f \n ’ , ’COAL PLANT GENERATION’ . . .
, p s f i n a l p e r i o d 1 , p s f i n a l p e r i o d 2 ) ;fpr intf ( ’ %+40s %9.2 f %9.2 f \n ’ , ’TOTAL GENERATION’ . . .
, Tota l pe r i od 1 , To ta l p e r i od 2 ) ;fpr intf ( ’ %+40s %9.2 f %9.2 f \n\n ’ , ’PRODUCTION COST’ . . .
, c o s t p e r i o d 1 , c o s t p e r i o d 2 ) ;fpr intf ( ’ %+40s %9.2 f \n ’ , ’TOTAL COST’ , To ta l c o s t ) ;fpr intf ( ’ %+40s %9.2 f %s \n ’ , ’INTERMEDIATE RESERVOIR VOLUME’ , x ( length ( c ) ) , ’ACRE FT. ’ ) ;
19
Chapter 4
Commercially available LinearProgramming Solvers
There are many multi-variable, multi-constraint optimization problems in power systemsthat can be solved using linear programming. Although, many programming languages canbe used to solve these complex problems, commercial solvers hold the upper hand in termsof efficiency and stability. There are several commercial solvers available in MATLAB R© andGeneral Algebraic Modeling System (GAMS). In this section, we will review some of thecommercial solvers which come under GAMS.
As discussed earlier, deterministic solutions to linear programming problem can be foundusing simplex method or interior point method. GAMS uses variations of these algorithms.
4.1 Linear programming in GAMS
GAMS is designed for formulating and optimizing large and complex problems. It alsosupports quadratic and non-linear programming. CPLEX, COIN, MOSEK, etc. are someof the examples of commercial GAMS solvers.
4.1.1 CPLEX
CPLEX Optimization Studio is one of the widely used commercial LP solvers, developedby IBM ILOG. As discussed earlier, it uses variations of simplex method or interior pointmethod, namely primal and dual simplex method and primal-dual logarithmic barrier al-gorithm. CPLEX can also solve several extensions to LP, such as network flow problem,quadratic programming problem, mixed integer programming problem. CPLEX is unique inhaving additional algorithms in solving sparse problems and problems where there are morevariables than equations.
20
Chapter 5
Conclusions
5.1 Economic dispatch
Two variations of economic dispatch problems were solved. First being the lossless case andother is the case where you have losses incurred. The limitation of solving the latter in LPis that it does not have any in-built facility to incorporate the loss component. This can beovercome by incorporating the penalty factor component in LP formulation. The results ofMATLAB R© programs are attached in Appendix A for reference.
5.2 Hydro-scheduling
The solution of hydro-scheduling problem using linear programming, shown in Appendix A,depends on the water discharge, reservoir levels and net water inflow. The limitation of LPin solving hydro-scheduling problem arises due to flow equation. Assuming that the flowequation is a linear function of hydro-plant generation, we have following two cases:
• Linear function with a constant term:The constant term restricts the LP from reaching the upper bound, which may resultin the optimal solution. Hence, we may not get the cheapest solution for the problem,which can be found using other methods like dynamic programming.
• Linear function without constant term:The absence of constant term enables LP to find the cheapest solution, which may bea better result than the one obtained from dynamic programming. Dynamic program-ming might run into dimensionality issues if we are to obtain accurate results.
21
Appendix A
Program Outputs
22
A.1
Eco
nom
icdis
patc
hpro
ble
m
This
sect
ion
conta
ins
com
pute
rou
tputs
ofth
ree
econ
omic
dis
pat
chpro
ble
ms
solv
edin
MA
TL
AB
R ©.
The
outp
ut
conta
ins
pro
ble
mdat
aan
dfinal
answ
er.
A.1
.1O
utp
ut
1
Un
itH
eat
Ra
teF
un
cti
on
(MB
tu/H
R)
Pm
inP
max
Fu
el
Co
st($
/M
Btu
)In
cre
me
nta
lL
oss
($
/MW
h)1
80
0+
7.2∗
P1
+P
1ˆ
2/
45
02
50
60
01
.50
.00
22
95
0+
7.0∗
P2
+P
2ˆ
2/
60
03
00
87
51
.8−
0.0
05
33
50
+8
.0∗
P3
+P
3ˆ
2/
40
01
50
40
01
.60
.01
Load
:1
20
0M
WP
ow
erL
oss
:3%
of
Load
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
GE
N1
GE
N2
GE
N3
TO
TA
LLO
AD
TO
TA
LG
EN
ER
AT
ION
CO
STW
ITH
OU
TL
OSSE
S5
95
.00
36
0.0
02
45
.00
12
00
.00
12
00
.00
19
37
6.9
8W
ITH
LO
SSE
S6
00
.00
39
5.0
02
41
.00
12
00
.00
12
36
.00
19
91
2.2
0
23
A.1
.2O
utp
ut
2
Un
itC
ost
Fu
ncti
on
($
/HR
)P
min
Pm
ax1
20
00
+2
0∗
P1
+0
.05
0∗P
1ˆ
22
50
60
02
12
50
+1
0∗
P2
+0
.02
5∗P
2ˆ
23
00
80
0
Load
:9
00
MW
Pow
erL
oss
:0
.00
04∗P
1ˆ
2
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
No
.o
fit
er
at
ion
s(W
ith
Lo
ss)
:2
GE
N1
GE
N2
TO
TA
LLO
AD
TO
TA
LG
EN
ER
AT
ION
CO
STW
ITH
OU
TL
OSSE
S2
50
.00
65
0.0
09
00
.00
90
0.0
02
72
07
.50
WIT
HL
OSSE
S2
50
.00
67
5.0
09
00
.00
92
5.0
02
95
15
.63
24
A.1
.3O
utp
ut
3
Un
itC
ost
Fu
ncti
on
($
/HR
)P
min
Pm
ax1
50
0+
0.0
01∗P
1ˆ
25
08
50
22
00
+0
.00
4∗P
2ˆ
25
01
22
0
Load
:8
00
MW
Pow
erL
oss
:0
.00
01∗P
1ˆ
2
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
Op
tim
iza
tio
nte
rmin
ate
d.
No
.o
fit
er
at
ion
s(W
ith
Lo
ss)
:3
GE
N1
GE
N2
TO
TA
LLO
AD
TO
TA
LG
EN
ER
AT
ION
CO
STW
ITH
OU
TL
OSSE
S6
40
.00
16
0.0
08
00
.00
80
0.0
01
21
2.0
0W
ITH
LO
SSE
S6
52
.63
19
0.0
08
00
.00
84
2.6
31
27
0.3
2
25
A.2
Hydro
-sch
eduling
pro
ble
m
A.2
.1O
utp
ut
1
STE
AM
PLA
NT
:H
eat
Ra
teF
un
cti
on
:4∗
Ps
+0
.00
1∗
Psˆ
2M
Btu
/HR
50<
Ps<
50
0M
WC
ost
of
Co
al:
1.2
$/M
Btu
HY
DR
OP
LA
NT
:F
low
Ch
ara
cte
ris
tic
s:
50
+4
.9∗
Ph
AC
RE−
FT
/HR
0<
Ph<
50
0M
WR
ese
rv
oir
Ca
pa
cit
y:
30
00
0A
CR
E−F
TIn
flo
w:
12
50
AC
RE−
FT
/HR
Re
se
rv
oir
Volu
me
at
Sta
rt
:1
50
00
AC
RE−
FT
Re
se
rv
oir
Volu
me
at
En
d:
15
00
0A
CR
E−F
T
Peri
od
(12
HR
SE
ach
)L
oad
(MW
)1
42
52
70
0
Op
tim
iza
tio
nte
rmin
ate
d.
PE
RIO
D1
PE
RIO
D2
HY
DR
OP
LA
NT
GE
NE
RA
TIO
N1
07
.29
38
2.5
1C
OA
LP
LA
NT
GE
NE
RA
TIO
N3
17
.71
31
7.4
9T
OT
AL
GE
NE
RA
TIO
N4
25
.00
70
0.0
0P
RO
DU
CT
ION
CO
ST1
97
53
.68
19
73
9.1
6
TO
TA
LC
OST
39
49
2.8
4IN
TE
RM
ED
IAT
ER
ESE
RV
OIR
VO
LUM
E2
30
91
.40
AC
RE
FT
.
26
A.2
.2O
utp
ut
2
STE
AM
PLA
NT
:H
eat
Ra
teF
un
cti
on
:4∗
Ps
+0
.00
1∗
Psˆ
2M
Btu
/HR
50<
Ps<
50
0M
WC
ost
of
Co
al:
1.2
$/M
Btu
HY
DR
OP
LA
NT
:F
low
Ch
ara
cte
ris
tic
s:
4.9∗
Ph
AC
RE−
FT
/HR
0<
Ph<
50
0M
WR
ese
rv
oir
Ca
pa
cit
y:
30
00
0A
CR
E−F
TIn
flo
w:
12
50
AC
RE−
FT
/HR
Re
se
rv
oir
Volu
me
at
Sta
rt
:1
50
00
AC
RE−
FT
Re
se
rv
oir
Volu
me
at
En
d:
15
00
0A
CR
E−F
T
Peri
od
(12
HR
SE
ach
)L
oad
(MW
)1
42
52
70
0
Op
tim
iza
tio
nte
rmin
ate
d.
PE
RIO
D1
PE
RIO
D2
HY
DR
OP
LA
NT
GE
NE
RA
TIO
N1
17
.50
39
2.7
1C
OA
LP
LA
NT
GE
NE
RA
TIO
N3
07
.50
30
7.2
9T
OT
AL
GE
NE
RA
TIO
N4
25
.00
70
0.0
0P
RO
DU
CT
ION
CO
ST1
90
73
.70
19
05
9.9
6
TO
TA
LC
OST
38
13
3.6
6IN
TE
RM
ED
IAT
ER
ESE
RV
OIR
VO
LUM
E2
30
91
.08
AC
RE
FT
.
27
Bibliography
[1] A. J. Wood and B. F. Wollenberg, Power Generation Operation and Control. John Wiley& Sons, Inc., New York, NY, 2nd Edition, 1996.
[2] Molly E. Ison, Frederick Wurtz, Commercial Linear Programming Solvers and TheirApplications to Power System Optimization. Power and Energy Society General Meeting -Conversion and Delivery of Electrical Energy in the 21st Century, 2008 IEEE, Pittsburgh,PA, pp. 1 - 7, July 2008.
[3] “General Algebraic Modeling System.”, Wikipedia. Available:http://en.wikipedia.org/wiki/General_Algebraic_Modeling_System
[4] “Economic Dispatch: Concepts, Practices and Issues.”, Presentation to the Joint Boardfor the Study of Economic Dispatch. FERC Staff Palm Springs, California. November 13,2005
[5] Stephen Boyd, Lieven Vandenberghe, Convex Optimization. Cam-bridge University Press, New York, pp. 146 - 148, 2009. Available:http://www.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf
[6] “Optimization Toolbox.”, The MathWorks Inc. Available:http://www.mathworks.com/access/helpdesk/help/toolbox/optim/
28