0% found this document useful (0 votes)
13 views

04 - Assignment_week4 SET3060_Answers

The assignment involves individual and group tasks focused on economic dispatch and non-linear programming using MATLAB. Individual tasks require deriving expressions for marginal cost, revenue, and profit for an electricity producer, while group tasks involve solving an economic dispatch problem numerically in MATLAB and analyzing the sensitivity of solutions. The assignment emphasizes the importance of Lagrange and KKT multipliers in optimization problems with inequality constraints and concludes with optimal results for social welfare and incremental utility.

Uploaded by

ivan canales
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)
13 views

04 - Assignment_week4 SET3060_Answers

The assignment involves individual and group tasks focused on economic dispatch and non-linear programming using MATLAB. Individual tasks require deriving expressions for marginal cost, revenue, and profit for an electricity producer, while group tasks involve solving an economic dispatch problem numerically in MATLAB and analyzing the sensitivity of solutions. The assignment emphasizes the importance of Lagrange and KKT multipliers in optimization problems with inequality constraints and concludes with optimal results for social welfare and incremental utility.

Uploaded by

ivan canales
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
You are on page 1/ 7

Assignment 3: Economic Dispatch and Non-Linear Programming

This assignment is structured in two blocks: individual tasks and group tasks.

The individual tasks are made of simple preliminary exercises that should be done individually before the
instruction session. These are necessary for completing the group tasks.
The group tasks involve the use of MATLAB and a complete optimization problem, which will be solved
during the instructions.

Individual tasks

1. (10 min)

An electricity producer estimates that its variable cost in €/hr for producing electricity in terms of
power produced in MW is given by the following expression:

C(PG) = 25 PG2 + 2000PG

Where C is the total cost and PG is the quantity produced in that hour.

(a) Derive an expression for the marginal cost of production.

𝑑𝐶(𝑃𝐺 ) €
𝑑𝑃𝐺
= 25 ∗ 2 ∗ 𝑃𝐺 + 2000 = 50𝑃𝐺 + 2000 [𝑀𝑊ℎ]

b) Derive an expression for the revenue and the profit when the power is sold at marginal cost.

Ans. Revenue would be the selling price (in this case marginal cost) times the power sold.


𝑅𝑒𝑣𝑒𝑛𝑢𝑒 = (50𝑃𝐺 + 2000) ∗ 𝑃𝐺 𝑠𝑜𝑙𝑑 [ ]

𝑃𝑟𝑜𝑓𝑖𝑡 = 𝑅𝑒𝑣𝑒𝑛𝑢𝑒 − 𝐶𝑜𝑠𝑡 = (50𝑃𝐺 2𝑠𝑜𝑙𝑑 + 2000𝑃𝐺 𝑠𝑜𝑙𝑑 ) − (25𝑃𝐺 2𝑠𝑜𝑙𝑑 + 2000𝑃𝐺 𝑠𝑜𝑙𝑑 )


= 25𝑃𝐺 2𝑠𝑜𝑙𝑑 [ ]

The market price is in this case equal to the marginal cost : 50𝑃𝐺 + 2000
c) Suppose that our electricity producer is a marginal producer. Present in the graph below its
marginal cost, revenue and profit.

Ans. To answer this question, it is important to realize that the total cost and marginal cost have
different dimensions, they cannot be drawn in the same graph. Revenue and profit have the same
dimensions as total cost.
If the marginal cost is known (50PG + 2000), then the total cost is equal to the integral of the
marginal cost (the result should be the same as the total cost mentioned above):
𝑃𝐺 𝑠𝑜𝑙𝑑
𝐶(𝑃𝐺𝑠𝑜𝑙𝑑 ) = ∫ (50𝑃𝐺 + 2000) 𝑑𝑃𝐺
0
= 25𝑃𝐺 2𝑠𝑜𝑙𝑑 + 2000𝑃𝐺 𝑠𝑜𝑙𝑑
Group tasks

1. (30 min)
(This question should be answered with MATLAB)

In week 2 you solved analytically the economic dispatch problem with a quadratic unit cost
functions characterized by the parameters provided as follows:

The specific system demand levels were 40, 250, 300, and resp. 600MW.

(a) Solve this problem numerically in Matlab and compare with the solutions obtained in week 2.
Use function “fmincon” from Matlab for non-linear optimization with constraints.

e.g. for 300:


PGmin=[0 0];
PGmax=[400 300];
A= [];
b= [];
PG0= [0 0];
Aeq= [1 1];
beq= [300]; % This is where the system demand level of 300 is
used. Use 40, 250 and 600 for other cases

obj= @(PG) 100+20*PG(1)+0.5*0.05*PG(1)^2+


200+25*PG(2)+0.5*0.1*PG(2)^2;
[x,fval,exitflag,output,lambda,grad,hessian] =
fmincon(obj,PG0,A,b,Aeq,beq,PGmin,PGmax);

x = 233.3333 66.6667

lambda.eqlin
>> ans = -31.6667

(b) Reflect on the sensitivity of the solution by looking on the Lagrange multipliers.

Both units operate at identical incremental costs. The common incremental cost also
coincides with the system marginal cost, that is, the sensitivity of the total cost with
respect to the system demand. In this case the incremental cost (-Lagrange multiplier) is
31,67.
c) Do the power plants operate at identical marginal cost in all situations?

The power plants operate at identical marginal cost (incremental cost) for the case when
𝑃𝐺𝑚𝑖𝑛 < 𝑃𝐺 𝑖 < 𝑃𝐺𝑚𝑎𝑥

For the case when demand is 40 MW and 600 MW, the power plants do not operate at
identical marginal cost because
𝑃𝐺𝑖 = 𝑃𝐺𝑚𝑖𝑛 𝑎𝑛𝑑 𝑃𝐺 𝑖 = 𝑃𝐺𝑚𝑎𝑥

Consider now the ED as above but with elastic demand characterized as follows:

Superscript and subscript “D” in the table above indicates “demand.”

d) Should this Economic Dispatch Problem with elastic demand be solved, when chosen for
an analytical solution, by only Lagrange multipliers or by Lagrange and KKT multipliers?
Explain your answer.

The Economic Dispatch Problem with elastic demand contains inequality constraints; an
optimization problem with inequality constraints cannot be solved analytically just by using
Lagrange multipliers. For problems with inequality constraints Kuhn-Tucker conditions
should be satisfied.

e) What are the optimal results? Answer this question after the problem is numerically solved
in Matlab.
The optimization variables: PG1, PG2, PD1, PD2

PG = [ PG1, PG2 ]: vector with generation levels Unit 1, resp. Unit 2


PD = [ PD1, PD2 ]: vector with individual demands of Load 1, resp. Load 2

The objective function (the social welfare to be maximized):


𝑚=2 𝑛=2

𝑆𝑊(𝑃𝐺 , 𝑃𝐷 ) = ∑ 𝑈𝑗 (𝑃𝐷𝑗 ) − ∑ 𝐶𝑖 (𝑃𝐺 𝑖 )


𝑗=1 𝑖=1

SW (PG1, PG2 , PD1, PD2 ) = (55 − 0,2 * PD1 ) * PD1 + (50 − 0,1* PD2 ) * PD2 −
(100 + 20 * PG1 + 0,5 * 0,05PG1 * PG1 ) − (200 + 25 * PG2 + 0,5 * 0,10 * PG2 * PG2 )

Constraints:

1. ∑𝑚=2 𝑛=2
𝑗=1 𝑃𝐷 𝑗 = ∑𝑖=1 𝑃𝐺 𝑖 ; 𝑇ℎ𝑒 𝑠𝑦𝑠𝑡𝑒𝑚 𝑑𝑒𝑚𝑎𝑛𝑑 𝑠ℎ𝑜𝑢𝑙𝑑 𝑒𝑞𝑢𝑎𝑙 𝑠𝑦𝑠𝑡𝑒𝑚 𝑝𝑟𝑜𝑑𝑢𝑐𝑡𝑖𝑜𝑛

2. 𝑃𝐺𝑚𝑖𝑛 ≤ 𝑃𝐺 𝑖 ≤ 𝑃𝐺𝑚𝑎𝑥 ; 𝐺𝑒𝑛𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑙𝑖𝑚𝑖𝑡𝑠 𝑓𝑜𝑟 𝑖 = 1, 2

3. 𝑃𝐷𝑚𝑖𝑛 ≤ 𝑃𝐷 𝑗 ≤ 𝑃𝐷𝑚𝑎𝑥 ; 𝐷𝑒𝑚𝑎𝑛𝑑 𝑙𝑖𝑚𝑖𝑡𝑠 𝑓𝑜𝑟 𝑗 = 1, 2


The solution is:

Max social welfare = 2504,1667


PD1 = 68,333
PD2 = 111,667
PG1 = 153,333
PG2 = 26,667

MATLAB implementation
To solve this problem in Matlab choose e.g
x(1)= PD1; x(2)= PD2; x(3)= PG1, x(4)= PG2

obj= @(x) (55-0.2*x(1))*x(1)+(50-0.1*x(2))*x(2)-...


(100+20*x(3)+0.5*0.05*x(3)^2)-(200+25*x(4)+0.5*0.1*x(4)^2);

Here lower and upper bound constraints should be included; therefore we will
use x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub)

If you are not sure about the syntax you can always use documentation (doc) in Matlab by
typing in the Command Window: >> doc fmincon

Consider that MATLAB can only minimize an objective function, therefore we min (-SW):

f) What is the social welfare for the optimal situation?

The social welfare for the optimal solution is 2504,17.

(g) What can you say about the incremental utility? What does the incremental utility say?

The incremental utility (or benefit function / marginal utility) is equal to:

dU j (PDj )
IU j (PDj ) =
dPDj
It is equal to minus Lagrange multiplier, so = 27,67

It should be stressed that all generating units must operate at identical incremental costs
(marginal costs) and that all demands operate at identical marginal utilities. Moreover, single
marginal cost must be equal to single incremental utility.

>> lambda.eqlin
ans = 27.6667

You might also like