Control Engineering
Control Engineering
where Pi , P2 , and P3 are in MW. The total load, PD , is 800 MW. Neglecting line losses and generator
limits, find the optimal dispatch and the total cost in $/h by iterative technique using the gradient
method USING MATLAB.
This program can be named Dispatch.m. Below is the program Solution - Matlab Code
a lp h a = [ 5 0 0 ; 4 0 0 ; 2 0 0 ] ;
beta = [ 5 . 3 ; 5 . 5 ; 5 . 8 ] ; gamma= [ . 0 0 4 ; . 0 0 6 ; . 0 0 9 ] ;
PD=800;
DelP = 1 0 ; % E r r o r i n DelP i s s e t t o a high v a l u e
lambda = input ( ’ Enter e s t i m a t e d v a l u e o f Lambda = ’ ) ;
fprintf ( ’ ’ )
disp ( [ ’ Lambda Pl P2 P3 DP ’ . . .
’ grad Delambda ’ ] )
i t e r = 0; % I t e r a t i o n counter
while abs ( DelP ) >= 0 . 0 0 1 % Test f o r c o n v e r g e n c e
i t e r = i t e r +1; %No . o f i t e r a t i o n s
P = ( lambda − beta ) . / ( 2 ∗gamma) ; % C o o r d i n a t i o n e q u a t i o n
DelP =PD − sum(P ) ; % R e s i d u a l
J = sum( ones ( length (gamma) , 1 ) . / ( 2 ∗gamma) ) ; % Gradient sum
Delambda = DelP/J ; % Change i n v a r i a b l e
disp ( [ lambda , P( 1 ) , P( 2 ) , P( 3 ) , DelP , J , Delambda ] )
lambda = lambda + Delambda ; % S u c c e s s i v e s o l u t i o n
1
end
t o t a l c o s t = sum( alpha + beta . ∗P + gamma. ∗P . ˆ 2 )
cost = [500 5.3 0.004
400 5 . 5 0 . 0 0 6
200 5 . 8 0 . 0 0 9 ] ;
Pdt = 800
gencost
%%
%E c o n o m i c d i s p a t c h
1.1 results
Enter estimated value of Lambda = 6
When the program is run, the result is:
Lambda Pl P2 P3 DP grad Delambda
6.0000 87.500 41.6667 11.1111 659.7222 263.8889 2.500
8.5000 400.000 250.0000 150.0000 0.0000 263.8889 0.000
totalcost = 6682.5
Pdt This reserved name must be used to specify the total load in MW. If Pdt is not specified the
user is prompted to input the total load. If dispatch is used following any of the power flow
programs, the total load is automatically passed by the power flow program.
cost This reserved name must be used to specify the cost function coefficients. The coefficients
are arranged in the MATLAB matrix format. Each row contains the coefficients of the cost
function in ascending powers of P.
mwlimits This name is reserved for the generator’s real power limits and are discussed in Section
7.5. in the book Hadi Saadat - Power system Analysis 2010. This entry is specified in matrix
form with the first column representing the minimum value and the second column representing
the maximum value. If mwlimits is not specified, the program obtains the optimal dispatch
of generation with no limits.
B BO BOO These names are reserved for the loss formula coefficient matrices and are discussed in
Section 7.6.of Hadi Saadat - Power system Analysis 2010. If these variables are not specified,
optimal dispatch of generation is obtained neglecting losses
The total generation cost of a thermal power system can be obtained with the aid of the gencost
command. This program can be used following any of the power flow programs or the dispatch
program, provided cost function matrix is defined.
2
3 Including generator limits as in example 2 ED in slides
The following commands can be used to obtain the optimal dispatch of generation including gener-
ator limits.
3.1 results
The result is Incremental cost of delivered power(system lambda) = 9.4$/MWh Optimal Dispatch
of Generation:
450
325
200
Total generation cost = 8236.25 $/h
4.1 result
The result is Incremental cost of delivered power(system lambda) = 7.678935$/MWh Optimal Dis-
patch of Generation:
3
35.0907
64.1317
52.4767
Total system loss = 1.6991 MW
Total generation cost = 1592.65 $/h