EEB 551 Lab 2
EEB 551 Lab 2
2022/2023(1)
Find the optimal solution of problem (2.16) under the following hypotheses:
where T is the number of intervals in the study period; N is the set of commit-
ted units; Pit is the generation of unit i during the t-th time interval; Ci (Pit )
is the cost of producing Pit from unit i. This optimization is subject to the
following constraints:
Load generation balance:
X
Pit = Dt + Losst , (t = 1, 2, · · · , T ) (2.18)
i∈N
where D is the demand and Losst is the system transmission loss. Their sum
t
where U Ri and DRi are the maximum ramp up/down rates for unit i and
∆t is the duration of the time intervals into which the study period is divided.
Maximum capacity:
34 2 Applications in Economic Dispatch
0 6 Sit 6 U Ri · ∆t (i ∈ N, t = 1, 2, · · · , T ) (2.22)
where SRt is the system spinning reserve requirement for time interval t.
Line flow limits:
where F`t is the active power flow through transmission line `; F`max is the
upper limit on the active power flow along line `; and L is the number of lines
in the network.
The unit cost curves are often given as piece-wise linear functions. A linear
function, i.e., Ci (Pit )= No Load Cost of Unit i + αi Pit , where αi is a constant
parameter, is used for the sake of clarity in this section.
Now the problem is able to be formulated into a linear programming prob-
lem: PT P t
M inimize i∈N αi Pi
t=1 (2.25)
Subject to (2.18) − (2.24)
Example 2.6. Solve Problem (2.25) for a system with 4 units by neglect-
ing transmission losses, line flow limits and spinning reserve conditions (i.e.
Losst = 0 and Sit = 0 for all t and neglect(2.22)-(2.24)) and using the following
data:
minx f T x
Ax 6 b
Aeq x = beq
lb 6 x 6 ub
Therefore it suffices to rewrite all the data in the problem into the above
matrix form.
Let x1 = P11 , x2 = P21 , x3 = P31 , x4 = P12 , x5 = P22 , x6 = P32 , x7 = P13 , x8 =
P2 , x9 = P33 , then the cost function can be written as F = f T x where
3
f T = (α1 , α2 , α3 , α4 , α1 , α2 , α3 , α4 , α1 , α2 , α3 , α4 )
= (20, 35, 34, 13, 20, 35, 34, 13, 20, 35, 34, 13).
P4
The equality constraint i=1 Pit = Dt , t = 1, 2, 3, can be rewritten as Aeq x =
beq with
111100000000
Aeq = 0 0 0 0 1 1 1 1 0 0 0 0,
000000001111
beq = (1000, 1030, 900)T .
The inequality constraints −DRi = −U Ri 6 Pit+1 − Pit 6 U Ri , t = 1, 2, i =
1, 2, 3, 4, can be rewritten as
or equivalently Ax 6 b, where
36 2 Applications in Economic Dispatch
1 0 0 0 −1 0 0 0 0 0 0 0
−1 0 0 0 1 0 0 0 0 0 0 0
0 1 0 0 0 −1 0 0 0 0 0 0
0 −1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 −1 0 0 0 0 0
0 0 −1 0 0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 −1 0 0 0 0
0 0 0 −1 0 0 0 1 0 0 0 0
A=
0
,
0 0 0 1 0 0 0 −1 0 0 0
0 0 0 0 −1 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0 0 −1 0 0
0 0 0 0 0 −1 0 0 0 1 0 0
0 0 0 0 0 0 1 0 0 0 −1 0
0 0 0 0 0 0 −1 0 0 0 1 0
0 0 0 0 0 0 0 1 0 0 0 −1
0 0 0 0 0 0 0 −1 0 0 0 1
b = (60, 60, 40, 40, 40, 40, 76, 76, 60, 60, 40, 40, 40, 40, 76, 76)T .
The lower bound vector lb is
(100, 80, 80, 30, 100, 80, 80, 30, 100, 80, 80, 30)T ,
(400, 350, 350, 130, 400, 350, 350, 130, 400, 350, 350, 130).
Now substitute the above matrices and vectors in the function ‘linprog’,
the problem is solved with the minimum cost of 75710, and the corresponding
Pit ’s are
Exercise 2.7. Neglect the restriction (2.24) and solve the problem (2.25) for
the case of N = {1, 2, 3}, T = 3, α1 = 8, α2 = 7.8, α3 = 7.6, Loss1 = 5,
Loss2 = 5.2, Loss3 = 5.4, ∆t = 1, DR1 = U R1 = 5, DR2 = U R2 =
10,Pimax = 90, Pimin = 0, SR1 = 5, and SR2 = SR3 = 10, D1 = 175,
D2 = 180, D3 = 185, where i = 1, 2, 3.
2. Lab Work
Dynamic Economic Dispatch (DED) problems are considered which involve three types of
constraints—equality, dynamic and inequality constraints. There are roughly three main types of
constraints in the dynamic dispatch problem: the load demand balance in terms of equality
constraints, ramp rates in terms of dynamic constraints and generation capacity in terms of
inequality constraints. It is worthy to point out that the load demand balance, in a vertically
integrated utility environment, is an obligation, thus a hard constraint; while in other cases, such as
competitive markets, it is a soft constraint since the demand may not be necessarily met. The ramp
rate and generation capacity limitations are equipment constraints, thus hard ones. Some other
constraints such as spinning reserve, security constraints, etc., can be taken into consideration in
exactly the same fashion in both formulations of the dynamic dispatch problem but they all boil down
mathematically to the aforementioned three types of constraints. General constraints and objectives
including non-smooth and/or non-convex functions will be left to future research.
To this end, some notations are introduced. Let 𝑁 be a fixed positive integer, 𝑇 a sampling period 𝑁𝑇
the dispatch period. The dynamic dispatch problem can be considered over time intervals, or
dispatch interval, [𝑖𝑇, (𝑖 + 𝑁)𝑇) for any 𝑖 ≥ 0. Here the time from 0 𝑡𝑜 ∞ is divided into small
intervals [0, 𝑇), [𝑇, 2𝑇), [2𝑇, 3𝑇), …, [𝑖𝑇, 𝑗𝑇), denotes the union of
[𝑖𝑇, (𝑖 + 1)𝑇), [(𝑖 + 1)𝑇, (𝑖_2)𝑇), … , [(𝑗 − 1)𝑇, 𝑗𝑇). An example is a sampling period of an hour and a
dispatch interval of 24ℎ.
For the sake of simplicity, it is assumed throughout this work that [𝐼, 𝑗) denotes the time interval
[𝑖𝑇, 𝑗𝑇). When 𝑇 = 1ℎ, then interval [𝐼, 𝑗) denotes the 𝑖 − 𝑡ℎ hour, (𝑖 + 1) − 𝑡ℎ hour, …, and the
(𝑗 − 1) − 𝑡ℎ hour.
Assume that 𝑛 is the number of committed units, 𝑃𝑖𝑘 is the average power generated by unit 𝑖 during
𝑘 − 𝑡ℎ time interval [𝑘 − 1, 𝑘), 𝐶𝑖 (𝑃𝑖𝑘 ) and 𝑅𝑖 (𝑃𝑖𝑘 ) are the generation and ramping costs respectively
for unit 𝑖 to produce 𝑃𝑖𝑘 ; 𝐷𝑘 is the demand at time 𝑘 (i.e., the 𝑘 − 𝑡ℎ time interval); the variable 𝑢𝑖𝑘 is
the ramp rate of the unit 𝑖 at time 𝑘 and is also called control variable in this work; 𝑈𝑅𝑖 , and 𝐷𝑅𝑖 , are
the maximum ramp up/down rates for unit 𝑖; 𝑃𝑖𝑚𝑖𝑛 and 𝑃𝑖𝑚𝑎𝑥 are the minimum and maximum
capacity of unit 𝑖 respectively; the notation (𝑃𝑖𝑘 : 1≤ 𝑖 ≤ 𝑛, 𝑙 ≤ 𝑘 ≤ 𝑙 + 𝑗) denotes the vector
𝑙+𝑗
(𝑃1𝑙 , 𝑃2𝑙 , … , 𝑃𝑛𝑙 , 𝑃1𝑙+1 , 𝑃2𝑙+1 , … , 𝑃𝑛𝑙+1 , … , 𝑃1 , 𝑃2,…, 𝑃𝑛 ), and 𝐶(𝑃𝑖𝑘 : 1 ≤ 𝑖 ≤ 𝑛, 𝑙 ≤ 𝑘 ≤ 𝑙 + 𝑗) denotes the
𝑙+1 𝑙+1
𝑘
0 𝑖𝑓 𝑗 > 𝑘
∑ 𝑥𝑖 = {𝑥 + 𝑥 + ⋯ + 𝑥
𝑗 𝑗+1 𝑘 𝑖𝑓 𝑗 ≤ 𝑘
𝑖=𝑗
Given 𝑛, 𝑁, 𝐷𝑅𝑖 , 𝑈𝑅𝑖 , 𝑃𝑖𝑚𝑖𝑛 , 𝑃𝑖𝑚𝑎𝑥 , 1 ≤ 𝑖 ≤ 𝑛, and 𝐷, solve the following minimization problem:
min 𝐶(𝑃𝑖𝑘 : 1 ≤ 𝑖 ≤ 𝑛, 1 ≤ 𝑘 ≤ 𝑁)
𝑁 𝑛
subject to;
𝑛
∑ 𝑃𝑖𝑘 = 𝐷𝑘
𝑖=1
𝑗+1 𝑗
−𝐷𝑅𝑖 . 𝑇 ≤ 𝑃𝑖 − 𝑃𝑖 ≤ 𝑈𝑅𝑖 . 𝑇
𝑚𝑖𝑛
𝑃𝑖 ≤ 𝑃𝑖 ≤ 𝑃𝑖𝑚𝑎𝑥 ,
𝑘
(1 ≤ 𝑖 ≤ 𝑛, 1 ≤ 𝑗 ≤ 𝑁 − 1, 1 ≤ 𝑘 ≤ 𝑁)
Note that the variables in the above DED problem are;
{𝑃𝑖𝑘 : 1 ≤ 𝑖 ≤ 𝑛, 1 ≤ 𝑘 ≤ 𝑁}
Data
This is an application of DED to the following six unit generators. This standard example is derived
from Gaing (2004). The data is listed in Tables 1 & 2. The dispatch interval is and the sampling period
are 1 day and 1 hour, respectively. The generation cost and ramping cost curves are given as
quadratic functions 𝐶𝑖 (𝑃𝑖 ) + 𝑅𝑖 (𝑃𝑖 ) = 𝑎𝑖 + 𝑏𝑖 𝑃𝑖 + 𝑐𝑖 𝑃𝑖2 . The initial generations 𝑃𝑖0 have chosen such
that ∑10 0 0
𝑖=1 𝑃𝑖 < 𝐷 .
Requirement:
Develop a matlab code using ‘fmincon ‘to solve the DED problem. Find the values of and draw the
following;
-The demand and the optimal six generators output power.
References:
Gaing, Z. L. (2004, June). Constrained dynamic economic dispatch solution using particle swarm
optimization. In IEEE Power Engineering Society General Meeting, 2004. (pp. 153-158). IEEE.