0% found this document useful (0 votes)
21 views4 pages

Economic Dispatch in MATLAB Code

This document provides an overview and examples of using MATLAB code to perform economic dispatch of power generation systems. It describes how to model the cost functions and constraints of multiple generators to calculate the optimal dispatch schedule that minimizes total generation costs while meeting a given load. Examples are provided to demonstrate solving economic dispatch problems with and without generator limits, and with and without transmission losses. The results provide the optimal dispatch schedule and total generation costs.

Uploaded by

Steve
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Economic Dispatch in MATLAB Code

This document provides an overview and examples of using MATLAB code to perform economic dispatch of power generation systems. It describes how to model the cost functions and constraints of multiple generators to calculate the optimal dispatch schedule that minimizes total generation costs while meeting a given load. Examples are provided to demonstrate solving economic dispatch problems with and without generator limits, and with and without transmission losses. The results provide the optimal dispatch schedule and total generation costs.

Uploaded by

Steve
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMPUTATIONAL METHODS IN POWER

ENGINEERING. COURSE CODE:TECE 3891


ECONOMIC DISPATCH - TUTORIAL
DR. DICKSON K. CHEMBE, Email: dchembe@[Link]
April 8, 2022

1 Economic Dispatch without loses


The fuel-cost functions for three thermal plants in $/h are given by

Ci = 500 + 5.3P1 + 0.004P12


C2 = 400 + 5.5P2 + 0.006P22
C3 = 200 + 5.8P3 + 0.009P32

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

2 General guidelines on Dispatch program


A general program called dispatch is developed for the optimal dispatch problem. The program
returns the system A, the optimal dispatch generation vector F, and the total [Link] reserved
variables are required by the dispatch program:

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 [Link] 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.

cost = [500 5.3 0.004


400 5 . 5 0 . 0 0 6
200 5 . 8 0 . 0 0 9 ] ;
mwlimits =[200 450
150 350
100 2 2 5 ] ;
Pdt = 9 7 5 ;
dispatch
gencost

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 Including generator limits and losses


The dispatch program can be used to find the optimal dispatch of generation. The program is
designed for the loss coefficients to be expressed in per unit. The loss coefficients are arranged in
a matrix form with the variable name B. The base MVA must be specified by the variable name
basemva. If base mva is not specified, it is set to 100 MVA. We use the following commands
cost = [200 7.0 0.008
180 6 . 3 0 . 0 0 9
140 6 . 8 0 . 0 0 7 ]
mwlimits =[10 85
10 80
10 7 0 ] ;
Pdt = 1 5 0 ;
B = [0.0218 0 0
0 0.0228 0
0 0 0.0179];
basemva = 1 0 0 ;
dispatch
gencost

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

Common questions

Powered by AI

Switching from a loss-neglecting model to one that includes line losses can significantly impact operational economics by increasing the total generation cost. Accounting for losses requires additional generation, as more power must be produced than what is consumed to offset the energy lost in transmission. This adjustment can increase the fuel and operational costs for power systems. Understanding and incorporating these losses helps operators make more informed decisions for economic dispatch, ensuring that the power generated truly meets the demand. It drives up costs but results in a more accurate and reliable power supply model that factors in transmission inefficiencies .

The incremental cost of delivered power, or system lambda, represents the marginal cost of supplying an additional megawatt-hour (MWh) of electricity. It helps in determining the optimal distribution of power generation among different plants to meet a given total load at the lowest possible cost. It is calculated by balancing the power supply with demand while minimizing the fuel costs as per the cost functions of the thermal plants. In the context of the provided document, system lambda is updated iteratively in MATLAB using the coordination equation and the gradient method until the change in power generation, DelP, is minimized to achieve optimal dispatch .

The gradient method helps determine the optimal set of generation outputs by minimizing the cost function iteratively. In the MATLAB program, the gradient method calculates the necessary adjustments to the power outputs until the total generated power matches the demanded load, with minimal difference (DelP). The method involves computing the gradient of the cost function, which guides the direction and magnitude of adjustment for the power generation levels in each iteration. The changes are expressed as Delambda, which is used to update the λ value (system lambda), and this process continues until convergence is achieved, indicating optimal dispatch .

Power dispatch calculations that integrate both generator limits and line losses involve a complex balance to achieve true optimality. The control algorithm must account for physical constraints within which generators operate (min/max output), alongside adjustments for actual power distribution affected by line losses. Incorporating a matrix of loss coefficients quantifies losses, altering the effective power deliverable to meet demand. Adjusting generation to maintain balance involves iterating potential solutions, ensuring all constraints are satisfied without breaching generator capabilities; this balance requires sophisticated calculation techniques to reconcile these variables, providing a nuanced and accurate demand supply model .

Generator limits define the minimum and maximum generation capacities of each generator and must be accounted for to ensure operational feasibility. When included in the economic dispatch process, these limits prevent generators from producing power beyond their operational capabilities. This necessitates adjustments in the dispatch calculations and may require reallocation of power generations among other available units that can still contribute within their limits. The MATLAB dispatch program can handle such constraints by specifying these limits using the 'mwlimits' matrix, which defines the permissible range for each generator. This ensures that the optimal dispatch respects the physical limitations of each generation unit .

Convergence in the dispatched power outputs is ensured by iteratively adjusting system lambda (λ) and subsequently the power outputs until the error in the total power, DelP, falls below a predefined threshold—here set to 0.001. The program continues iterations while the absolute value of DelP remains greater than this convergence criterion. Critical parameters include DelP; the gradient of the cost function, which impacts Delambda; and system lambda, which determines generation output through the coordination equation. These values drive the reallocation process to fine-tune power distribution among plants, ensuring the dispatched power meets the load exactly with minimized cost .

Line losses, which occur as power flows through transmission lines, increase the total cost of electricity generation because they necessitate generating more power than the actual demand to compensate for the energy lost. In economic dispatch calculations, line losses can be accounted for by incorporating loss coefficients, represented as matrices (such as B-matrices), into the dispatch programming. These coefficients model the power loss as a function of the generation output levels. By including losses, the dispatch decisions adjust the generation outputs to minimize the total cost, considering both fuel expenses and the losses incurred during transmission. This leads to higher overall generation but aligns with true demand, ensuring the actual power delivered meets the requirements .

Incorporating generator power limits restricts the feasible solution space, effectively reducing the variety of possible generation combinations compared to unconstrained scenarios. In cases without power limits, the dispatch calculations focus solely on minimizing costs without regard to the physical capabilities of the generators. However, with limits included, the solutions must respect these constraints, often resulting in less flexibility in adjusting outputs. This can lead to higher total costs if optimal cost conditions overlap with limit borders, necessitating power adjustments across different generators that can still be optimized within their limits .

The MATLAB program involves several procedural steps to solve the economic dispatch problem. Initially, the program requires user input for an estimated value of system lambda (λ). Then, using the coordination equation, it calculates the generators' power outputs based on the cost function coefficients provided. The residual or difference between calculated and required total load (DelP) is computed. The total gradient is then calculated to determine the necessary change in lambda (Delambda), which progressively refines the outputs to match the demanded load. The steps iterate, updating lambda and generator outputs, until DelP meets a convergence criterion (absolute value below 0.001), achieving an optimal distribution without considering losses .

To achieve optimal dispatch, the tutorial utilizes an iterative adjustment method based on economic principles. Initially, lambda (λ) is estimated and systematically refined. The power generation outputs for each plant are calculated using the coordination equation: P = (λ − beta) / (2 * gamma). Subsequently, the discrepancy between actual and required power, DelP, is calculated. Adjustments are guided by a calculated gradient, which informs how much lambda should change (Delambda = DelP / J). These adjustments correct the power outputs iteratively. The process continues until the convergence criterion is met, indicating that the generation output aligns optimally with the load demand, minimizing total cost without losses .

You might also like