SlideShare a Scribd company logo
Final project
ECE 505-Applied Optimization for Engineers
Qiaoyu Zhang,A20331991
Weixiong Wang,A20332258
Background:
In the power market, both generators and loads will bid price, and different
generators and loads might bid for different price. According to the price that they bid,
we need to decide how many electricity can generator produce and how many loads
can be supply in order to maximize the societal surplus. In the meantime, we should
consider the limits in real power system. These limits include: limit of transmission
line, limit of generator and limit of load.
Statement of Objectives:
The optimization problem going to solve is about power market. As other kinds of
market, seller will bid a price for selling its produce. At the same time buyer will bid a
price that they can accept for buying the produce. Only when both the seller and buyer
agree the price, the deal can be done. And this price is called market clearing price. If
seller and buyer can’t reach the agreement, the seller have to keep his produces.
Design Procedure:
Now suppose that there is a three buses system including bus 1, bus 2 and bus 3.
Three buses are connected with each other with three transmission lines. Assume that
line1 (l1) is between bus 1 and bus 2. Line2 (l2) is connecting bus 2 and bus 3 and
line 3(l3) is between bus 3 and bus 1. Each of them has a maximize power flow limit
l1max, l2max and l3max. If power exceeds these limit, power system will become
unstable.
Figure 1
 As showed in figure 1. There are two generator in this power system G1 and G2.
G1 is located at bus 1, and G2 is located at bus 2. The power generated by G1 is
called P1, and the power generated by G2 is called P2. What’s more, G1 and G2
has lower and upper limit because of the properties of generator. Generators can’t
generator too small power and can’t generate power that exceed its limit. For G1,
the limit is P1min and P1max and for G2, the limit is P2min and P2max.
 Also, there are two load in the power system: L1 and L2. L1 is located at bus 3
and L2 is located at bus 2. In the realization, not all the load need to be supplied.
Some of the load can cut off for saving money. On the other hand, most of the
load have to be supplied. Then the lower limit of L1 is L1min and the upper limit
is L1max. The same as L2, we have L2min and L2max
Bus1 Bus2 Bus3
Generator G1 G2
Load L2 L1
 When the power market is open, both generators and loads will bid prices.
Assume that G1 bid for price C1, G2 bid for price C2. And L1 bid for price B1,
and L2 bid for price B2. After biding price, we need to decide how much power
should be produce base on the objective function. In this case, we want to
maximize the societal surplus.
𝑠𝑜𝑐𝑖𝑒𝑡𝑎𝑙 𝑠𝑢𝑟𝑝𝑙𝑢𝑠 = (𝐿1 𝐵1 + 𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2)
 What’s more, according to Kirchhoff’s Current Law (KCL), the total injection
should be equal to the total withdrawal. First, I assume that the power flow from
bus1 to bus 2 is f12, the power flow from bus2 to bus3 is f23, and the power flow
from bus3 to bus1 is f31. And then, we can get:
𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12
𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2
𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31
Formulation:
As the definition of linear programming, the standard format is:
min
𝑥∈𝑅 𝑛
{𝑐 𝑇
𝑥|𝐴𝑥 = 𝑏, 𝐶𝑥 ≤ 𝑑}
We separate the situation into two different cases.
Case1:
In this case, we consider that every load is important, none of these load can be cut
off. It probably means that all the load is residential load or important industry load.
In this case, only generator can bid for the price.
(i)Variables:
First, we need to decide the variables for this problem. There are three kinds of
variables in this question: power of generators, loads and power flow. In this case, as
the load can’t be cut off, we can consider the load to be constant value. Therefore, the
variable should be:
𝑥 =
[
𝑃1
𝑃2
𝑓12
𝑓23
𝑓31]
(ii). Objective function:
The objective of this problem is to maximize the societal surplus: (𝐿1 𝐵1 + 𝐿2 𝐵2) −
(𝑃1 𝐶1 + 𝑃2 𝐶2).
As the loads are constant in this case, maximizing the societal surplus equation should
become minimizing (𝑃1 𝐶1 + 𝑃2 𝐶2). And then, we can get the objective function:
𝑓(𝑥) = [𝐶1 𝐶2 0 0 0]
[
𝑃1
𝑃2
𝑓12
𝑓23
𝑓31]
(iii). Equality constraints:
The Equality constraints for this problem is the KCL equation for every bus:
𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12
𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2
𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31
[
1 0 −1 0 1
0
0
1 1 −1 0
0 0 1 −1
]
[
𝑃1
𝑃2
𝑓12
𝑓23
𝑓31]
= [
0
𝐿2
𝐿1
]
Therefore, we can get:
𝐴 = [
1 0 −1 0 1
0
0
1 1 −1 0
0 0 1 −1
]
𝑏 = [
0
𝐿2
𝐿1
]
(iv). Inequality constraints:
As the loads are constant in this case, we only have generator and power flow limit.
And these limits are:
𝑃1𝑚𝑖𝑛 ≤ 𝑃1 ≤ 𝑃1𝑚𝑎𝑥
𝑃2𝑚𝑖𝑛 ≤ 𝑃2 ≤ 𝑃2𝑚𝑎𝑥
|𝑓12| ≤ 𝑙1𝑚𝑎𝑥
|𝑓23| ≤ 𝑙2𝑚𝑎𝑥
|𝑓31| ≤ 𝑙3𝑚𝑎𝑥
According this, we can get:
𝑃1 ≤ 𝑃1𝑚𝑎𝑥
𝑃2 ≤ 𝑃2𝑚𝑎𝑥
−𝑃1 ≤ −𝑃1𝑚𝑖𝑛
−𝑃2 ≤ −𝑃2𝑚𝑖𝑛
𝑓12 ≤ 𝑙1𝑚𝑎𝑥
𝑓23 ≤ 𝑙2𝑚𝑎𝑥
𝑓31 ≤ 𝑙3𝑚𝑎𝑥
−𝑓12 ≤ 𝑙1𝑚𝑎𝑥
−𝑓23 ≤ 𝑙2𝑚𝑎𝑥
−𝑓31 ≤ 𝑙3𝑚𝑎𝑥
Therefore, in the format of 𝐶𝑥 ≤ 𝑑, we can get:
C=
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
-1 0 0 0 0
0 -1 0 0 0
0 0 -1 0 0
0 0 0 -1 0
0 0 0 0 -1
And
𝑑 =
[
𝑃1𝑚𝑎𝑥
𝑃2𝑚𝑎𝑥
𝑙1𝑚𝑎𝑥
𝑙2𝑚𝑎𝑥
𝑙3𝑚𝑎𝑥
−𝑃1𝑚𝑖𝑛
−𝑃2𝑚𝑖𝑛
𝑙1𝑚𝑎𝑥
𝑙2𝑚𝑎𝑥
𝑙3𝑚𝑎𝑥 ]
Case 2:
In this case, some of the load can be cut off. It means that both loads and generator
can bid for price, and loads can determine not to accept the electricity for the purpose
of saving money. In this case, some load might be less important than others and they
can using electricity at other time when the electricity price is lower. Also, people can
use computer program to bid the price automatically and let computer to decide
whether to use electricity or not. This is a new trend of power system called smart
grid.
(i)Variables:
We need to consider load as variables too, as load can change and not be decided yet.
Therefore the variables for this case is:
𝑥 =
[
𝑃1
𝑃2
𝐿1
𝐿2
𝑓12
𝑓23
𝑓31]
(ii). Objective function:
The objective of this problem is to maximize the societal surplus: (𝐿1 𝐵1 + 𝐿2 𝐵2) −
(𝑃1 𝐶1 + 𝑃2 𝐶2).
As the loads in this case is not a constant but a variables in this case, we should
consider loads to be included in the objective function. And maximizing the (𝐿1 𝐵1 +
𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2) means minimizing (𝑃1 𝐶1 + 𝑃2 𝐶2) − (𝐿1 𝐵1 + 𝐿2 𝐵2). We can
get the objective function:
𝑓(𝑥) = [𝐶1 𝐶2 −𝐵1 −𝐵2 0 0 0]
[
𝑃1
𝑃2
𝐿1
𝐿2
𝑓12
𝑓23
𝑓31]
(iii). Equality constraints:
According to the KCL, the equation of equality constraints should be same as before:
𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12
𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2
𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31
However, the loads in this case are no longer constants. Therefore, we need to adjust
the equation when writing in the standard format.
[
1 0 0 0 −1 0 1
0 1 0 −1 1 −1 0
0 0 −1 0 0 1 −1
]
[
𝑃1
𝑃2
𝐿1
𝐿2
𝑓12
𝑓23
𝑓31]
= 0
In this case,
𝐴 = [
1 0 0 0 −1 0 1
0 1 0 −1 1 −1 0
0 0 −1 0 0 1 −1
]
𝑏 = 0
(iv). Inequality constraints:
As loads are not constant in this case, we need to consider the limit of loads too.
Thought some of the loads can be cut off to save money, not all the loads can be cut
off. There are still large amount of loads need to have power supply all the time. Also,
not all the residential user of industry are willing to join the market. Therefore, the
loads should only change between the lower limit Lmin and upper limit Lmax.
Then we can get the inequality constraints:
𝑃1𝑚𝑖𝑛 ≤ 𝑃1 ≤ 𝑃1𝑚𝑎𝑥
𝑃2𝑚𝑖𝑛 ≤ 𝑃2 ≤ 𝑃2𝑚𝑎𝑥
𝐿1𝑚𝑖𝑛 ≤ 𝐿1 ≤ 𝐿1𝑚𝑎𝑥
𝐿2𝑚𝑖𝑛 ≤ 𝐿2 ≤ 𝐿2𝑚𝑎𝑥
|𝑓12| ≤ 𝑙1𝑚𝑎𝑥
|𝑓23| ≤ 𝑙2𝑚𝑎𝑥
|𝑓31| ≤ 𝑙3𝑚𝑎𝑥
According this, we can get:
𝑃1 ≤ 𝑃1𝑚𝑎𝑥
𝑃2 ≤ 𝑃2𝑚𝑎𝑥
−𝑃1 ≤ −𝑃1𝑚𝑖𝑛
−𝑃2 ≤ −𝑃2𝑚𝑖𝑛
𝐿1 ≤ 𝐿1𝑚𝑎𝑥
𝐿2 ≤ 𝐿2𝑚𝑎𝑥
−𝐿1 ≤ −𝐿1𝑚𝑖𝑛
−𝐿2 ≤ −𝐿2𝑚𝑖𝑛
𝑓12 ≤ 𝑙1𝑚𝑎𝑥
𝑓23 ≤ 𝑙2𝑚𝑎𝑥
𝑓31 ≤ 𝑙3𝑚𝑎𝑥
−𝑓12 ≤ 𝑙1𝑚𝑎𝑥
−𝑓23 ≤ 𝑙2𝑚𝑎𝑥
−𝑓31 ≤ 𝑙3𝑚𝑎𝑥
Therefore, in the format of 𝐶𝑥 ≤ 𝑑, we can get:
C=
1 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0
0 0 0 0 0 0 1
-1 0 0 0 0 0 0
0 -1 0 0 0 0 0
0 0 -1 0 0 0 0
0 0 0 -1 0 0 0
0 0 0 0 -1 0 0
0 0 0 0 0 -1 0
0 0 0 0 0 0 -1
And
𝑑 =
[
𝑃1𝑚𝑎𝑥
𝑃2𝑚𝑎𝑥
𝐿1𝑚𝑎𝑥
𝐿2𝑚𝑎𝑥
𝑙1𝑚𝑎𝑥
𝑙2𝑚𝑎𝑥
𝑙3𝑚𝑎𝑥
−𝑃1𝑚𝑖𝑛
−𝑃2𝑚𝑖𝑛
−𝐿1𝑚𝑖𝑛
−𝐿2𝑚𝑖𝑛
𝑙1𝑚𝑎𝑥
𝑙2𝑚𝑎𝑥
𝑙3𝑚𝑎𝑥 ]
Design Results:
Case 1
For case1, I set up a small instant:
The bidding price of generator is:
MWhC
MWhC
/$14
/$10
2
1


The limits of power generated by generators are:
MWPMW
MWPMW
10040
20030
2
1


The loads need to be supplied are:
𝐿1 = 150𝑀𝑊
𝐿2 = 60𝑀𝑊
The power flow limits are:
MWf
MWf
MWf
140
150
40
31
23
12



Then we can get:

















31
23
12
2
1
]0001410[)(
f
f
f
P
P
xf
And




































































140
150
40
40-
30-
140
150
40
100
200
3
2
1
2
1
3
2
1
2
1
max
max
max
min
min
max
max
max
max
max
l
l
l
P
P
l
l
l
P
P
d
Substitute c, A, b, C and d matrix into the linprog function in matlab. We can get:
Optimization terminated.
X =
170.0000
40.0000
34.6446
14.6446
-135.3554
FVAL =
2.2600e+03
EXITFLAG =
1
OUTPUT =
iterations: 5
algorithm: 'interior-point'
cgiterations: 0
message: 'Optimization terminated.'
constrviolation: 2.6409e-10
firstorderopt: 4.0029e-07This result means:
MWf
MWf
MWf
MWP
MWP
3554.135
6446.14
6446.34
0000.40
0000.170
31
23
12
2
1





Form this result, G1 is the power provider,we can see that G1 generate power much
more than lower limit. The reason is the biding price C1 of G1 is lower than the price
C2 for G2. We want the G1 generate as much power as possible. And f31 is negative
value so the the power flow should from bus1 to bus3.
The minimum of generator cost is 2260$/h. In order to compare with case 2, I set the
price of loads the same as case 2:
𝐵1 = 9$/𝑀𝑊ℎ
𝐵2 = 17$/𝑀𝑊ℎ
Then we can get the maximum 𝑠𝑜𝑐𝑖𝑒𝑡𝑎𝑙 𝑠𝑢𝑟𝑝𝑙𝑢𝑠 = (9 × 150 + 17 × 60) − 2260 =
110$/ℎ
Case 2
For case2, I set up a small instant:
The bidding price of generator is:
𝐶1 = 10$/𝑀𝑊ℎ
𝐶2 = 14$/𝑀𝑊ℎ
The bidding price of loads are:
𝐵1 = 9$/𝑀𝑊ℎ
𝐵2 = 17$/𝑀𝑊ℎ
The limits of power generated by generators are:
30𝑀𝑊 ≤ 𝑃1 ≤ 200𝑀𝑊
40𝑀𝑊 ≤ 𝑃2 ≤ 100𝑀𝑊
The limits of load are:
130𝑀𝑊 ≤ 𝐿1 ≤ 150𝑀𝑊
40𝑀𝑊 ≤ 𝐿2 ≤ 60𝑀𝑊
The power flow limits are:
|𝑓12| ≤ 40𝑀𝑊
|𝑓23| ≤ 150𝑀𝑊
|𝑓31| ≤ 140 𝑀𝑊
Then we can get:
𝑓(𝑥) = [10 14 −9 −17 0 0 0]
[
𝑃1
𝑃2
𝐿1
𝐿2
𝑓12
𝑓23
𝑓31]
And
𝑑 =
[
200
100
150
60
40
150
140
−30
−40
−130
−40
40
150
140 ]
Substitute c, A, b, C and d matrix into the linprog function in matlab. We can get:
Optimization terminated.
X =
150.0000
40.0000
130.0000
60.0000
27.7910
7.7910
-122.2090
FVAL =
-130.0000
EXITFLAG =
1
OUTPUT =
iterations: 6
algorithm: 'interior-point'
cgiterations: 0
message: [1x24 char]
constrviolation: 8.6686e-12
firstorderopt: 1.1841e-08
This result means:
𝑃1 = 150.0000MW
𝑃2 = 40.0000MW
𝐿1 = 130.0000MW
𝐿2 = 60.0000MW
𝑓12 = 27.7910MW
𝑓23 = 7.7910MW
𝑓31 = −122.2090MW
Form this result, we can see that G1 generate power much more than lower limit. The
reason is the biding price C1 of G1 is lower than the price C2 for G2. We want the G1
generate as much power as possible. However, we can see that the lower limit of P2
force G1 to operate under 200MW. As G2 is bidding for a higher price, it can only
operate at it lower limit. And we can see that L2 is bidding for high price, so all of its
load can be supplied. For L1, it operate at the lower limit because it is bidding for a
lower price. We can see that all the variable is within the limit, and the limit of P2 and
L2 is activate.
The maximum of societal surplus is 140$/h.
Conclusion:
Form these two cases, we can see that the results are different. The reason is we can
cut of some low price load to reduce the total power demand. In this way we can
reduce the usage of generator to save more money. Therefore the societal surplus in
case 2 have 20$/h more than case1. Form this two case, we can see that changing the
limit and variables can change the result of optimization problem.
Appendix
Matalb code for case 1:
A = [1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
-1 0 0 0 0
0 -1 0 0 0
0 0 -1 0 0
0 0 0 -1 0
0 0 0 0 -1];
b = [200 100 40 150 140 -30 -40 40 150 140];
Aeq = [1 0 -1 0 1
0 1 1 -1 0
0 0 0 1 -1];
beq = [0 60 150];
f = [10
14
0
0
0];
[X,FVAL,EXITFLAG,OUTPUT] = linprog(f,A,b,Aeq,beq)
Matlab code for case 2:
f=[10;14;-9;-17;0;0;0];
Aeq=[1 0 0 0 -1 0 1;
0 1 0 -1 1 -1 0;
0 0 -1 0 0 1 -1];
beq=[0,0,0];
A=[1 0 0 0 0 0 0;
0 1 0 0 0 0 0;
0 0 1 0 0 0 0;
0 0 0 1 0 0 0;
0 0 0 0 1 0 0;
0 0 0 0 0 1 0;
0 0 0 0 0 0 1;
-1 0 0 0 0 0 0;
0 -1 0 0 0 0 0;
0 0 -1 0 0 0 0;
0 0 0 -1 0 0 0;
0 0 0 0 -1 0 0;
0 0 0 0 0 -1 0;
0 0 0 0 0 0 -1];
b=[200;100;150;60;40;150;140;-30;-40;-130;-40;40;150;140];
[X,FVAL,EXITFLAG,OUTPUT] =linprog(f,A,b,Aeq,beq)

More Related Content

Similar to ECE 505 Final project

ECE4762011_Lect16.ppt
ECE4762011_Lect16.pptECE4762011_Lect16.ppt
ECE4762011_Lect16.ppt
MuhammadAniqueAslam1
 
Economic Dispatch
Economic DispatchEconomic Dispatch
Economic Dispatch
Power System Operation
 
ECE476_2016_Lect17.pptx
ECE476_2016_Lect17.pptxECE476_2016_Lect17.pptx
ECE476_2016_Lect17.pptx
FeehaAreej
 
Operation and Control of Inductive Wireless Power Transfer
Operation and Control of Inductive Wireless Power Transfer Operation and Control of Inductive Wireless Power Transfer
Operation and Control of Inductive Wireless Power Transfer
Indian Institute of Technology Guwahati
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
Forward2025
 
Computer Application in Power system: Chapter six - optimization and security
Computer Application in Power system: Chapter six - optimization and securityComputer Application in Power system: Chapter six - optimization and security
Computer Application in Power system: Chapter six - optimization and security
Adama Science and Technology University
 
UNIT-4-PPT.ppt
UNIT-4-PPT.pptUNIT-4-PPT.ppt
UNIT-4-PPT.ppt
Karthik Kathan
 
Mr. Bakar Presentation for group discussion.docx
Mr. Bakar Presentation for group discussion.docxMr. Bakar Presentation for group discussion.docx
Mr. Bakar Presentation for group discussion.docx
CyberMohdSalahShoty
 
RS dc-dc converter 2004
RS dc-dc converter 2004RS dc-dc converter 2004
RS dc-dc converter 2004
Utsav Yagnik
 
Control of Wind Energy Conversion System and Power Quality Improvement in the...
Control of Wind Energy Conversion System and Power Quality Improvement in the...Control of Wind Energy Conversion System and Power Quality Improvement in the...
Control of Wind Energy Conversion System and Power Quality Improvement in the...
ijeei-iaes
 
On the dynamic behavior of the current in the condenser of a boost converter ...
On the dynamic behavior of the current in the condenser of a boost converter ...On the dynamic behavior of the current in the condenser of a boost converter ...
On the dynamic behavior of the current in the condenser of a boost converter ...
TELKOMNIKA JOURNAL
 
Effect of the Production on economics.pptx
Effect of the Production on economics.pptxEffect of the Production on economics.pptx
Effect of the Production on economics.pptx
utsashkumar10116
 
Unit 5.pptx
Unit 5.pptxUnit 5.pptx
Unit 5.pptx
Sapna130727
 
economic load dispatch and unit commitment power_system_operation.pdf
economic load dispatch and unit commitment power_system_operation.pdfeconomic load dispatch and unit commitment power_system_operation.pdf
economic load dispatch and unit commitment power_system_operation.pdf
ArnabChakraborty499766
 
Module2-Automatic-Generation-control.ppt
Module2-Automatic-Generation-control.pptModule2-Automatic-Generation-control.ppt
Module2-Automatic-Generation-control.ppt
kvvbapiraju2
 
ALL DAY EFFICIENCY
ALL DAY EFFICIENCYALL DAY EFFICIENCY
ALL DAY EFFICIENCY
Maria Romina Angustia
 
ECE4762011_Lect10.ppt
ECE4762011_Lect10.pptECE4762011_Lect10.ppt
ECE4762011_Lect10.ppt
ThomasNikola
 
ECE4762011_Lect10.ppt
ECE4762011_Lect10.pptECE4762011_Lect10.ppt
ECE4762011_Lect10.ppt
babu717541
 
Mini Projet Repport.pdf
Mini Projet Repport.pdfMini Projet Repport.pdf
Mini Projet Repport.pdf
MouadELJazouli1
 
Microelectromechanical Assignment Help
Microelectromechanical Assignment HelpMicroelectromechanical Assignment Help
Microelectromechanical Assignment Help
Mechanical Engineering Assignment Help
 

Similar to ECE 505 Final project (20)

ECE4762011_Lect16.ppt
ECE4762011_Lect16.pptECE4762011_Lect16.ppt
ECE4762011_Lect16.ppt
 
Economic Dispatch
Economic DispatchEconomic Dispatch
Economic Dispatch
 
ECE476_2016_Lect17.pptx
ECE476_2016_Lect17.pptxECE476_2016_Lect17.pptx
ECE476_2016_Lect17.pptx
 
Operation and Control of Inductive Wireless Power Transfer
Operation and Control of Inductive Wireless Power Transfer Operation and Control of Inductive Wireless Power Transfer
Operation and Control of Inductive Wireless Power Transfer
 
Lecture 10
Lecture 10Lecture 10
Lecture 10
 
Computer Application in Power system: Chapter six - optimization and security
Computer Application in Power system: Chapter six - optimization and securityComputer Application in Power system: Chapter six - optimization and security
Computer Application in Power system: Chapter six - optimization and security
 
UNIT-4-PPT.ppt
UNIT-4-PPT.pptUNIT-4-PPT.ppt
UNIT-4-PPT.ppt
 
Mr. Bakar Presentation for group discussion.docx
Mr. Bakar Presentation for group discussion.docxMr. Bakar Presentation for group discussion.docx
Mr. Bakar Presentation for group discussion.docx
 
RS dc-dc converter 2004
RS dc-dc converter 2004RS dc-dc converter 2004
RS dc-dc converter 2004
 
Control of Wind Energy Conversion System and Power Quality Improvement in the...
Control of Wind Energy Conversion System and Power Quality Improvement in the...Control of Wind Energy Conversion System and Power Quality Improvement in the...
Control of Wind Energy Conversion System and Power Quality Improvement in the...
 
On the dynamic behavior of the current in the condenser of a boost converter ...
On the dynamic behavior of the current in the condenser of a boost converter ...On the dynamic behavior of the current in the condenser of a boost converter ...
On the dynamic behavior of the current in the condenser of a boost converter ...
 
Effect of the Production on economics.pptx
Effect of the Production on economics.pptxEffect of the Production on economics.pptx
Effect of the Production on economics.pptx
 
Unit 5.pptx
Unit 5.pptxUnit 5.pptx
Unit 5.pptx
 
economic load dispatch and unit commitment power_system_operation.pdf
economic load dispatch and unit commitment power_system_operation.pdfeconomic load dispatch and unit commitment power_system_operation.pdf
economic load dispatch and unit commitment power_system_operation.pdf
 
Module2-Automatic-Generation-control.ppt
Module2-Automatic-Generation-control.pptModule2-Automatic-Generation-control.ppt
Module2-Automatic-Generation-control.ppt
 
ALL DAY EFFICIENCY
ALL DAY EFFICIENCYALL DAY EFFICIENCY
ALL DAY EFFICIENCY
 
ECE4762011_Lect10.ppt
ECE4762011_Lect10.pptECE4762011_Lect10.ppt
ECE4762011_Lect10.ppt
 
ECE4762011_Lect10.ppt
ECE4762011_Lect10.pptECE4762011_Lect10.ppt
ECE4762011_Lect10.ppt
 
Mini Projet Repport.pdf
Mini Projet Repport.pdfMini Projet Repport.pdf
Mini Projet Repport.pdf
 
Microelectromechanical Assignment Help
Microelectromechanical Assignment HelpMicroelectromechanical Assignment Help
Microelectromechanical Assignment Help
 

ECE 505 Final project

  • 1. Final project ECE 505-Applied Optimization for Engineers Qiaoyu Zhang,A20331991 Weixiong Wang,A20332258 Background: In the power market, both generators and loads will bid price, and different generators and loads might bid for different price. According to the price that they bid, we need to decide how many electricity can generator produce and how many loads can be supply in order to maximize the societal surplus. In the meantime, we should consider the limits in real power system. These limits include: limit of transmission line, limit of generator and limit of load. Statement of Objectives: The optimization problem going to solve is about power market. As other kinds of market, seller will bid a price for selling its produce. At the same time buyer will bid a price that they can accept for buying the produce. Only when both the seller and buyer agree the price, the deal can be done. And this price is called market clearing price. If seller and buyer can’t reach the agreement, the seller have to keep his produces. Design Procedure: Now suppose that there is a three buses system including bus 1, bus 2 and bus 3. Three buses are connected with each other with three transmission lines. Assume that line1 (l1) is between bus 1 and bus 2. Line2 (l2) is connecting bus 2 and bus 3 and line 3(l3) is between bus 3 and bus 1. Each of them has a maximize power flow limit l1max, l2max and l3max. If power exceeds these limit, power system will become unstable. Figure 1
  • 2.  As showed in figure 1. There are two generator in this power system G1 and G2. G1 is located at bus 1, and G2 is located at bus 2. The power generated by G1 is called P1, and the power generated by G2 is called P2. What’s more, G1 and G2 has lower and upper limit because of the properties of generator. Generators can’t generator too small power and can’t generate power that exceed its limit. For G1, the limit is P1min and P1max and for G2, the limit is P2min and P2max.  Also, there are two load in the power system: L1 and L2. L1 is located at bus 3 and L2 is located at bus 2. In the realization, not all the load need to be supplied. Some of the load can cut off for saving money. On the other hand, most of the load have to be supplied. Then the lower limit of L1 is L1min and the upper limit is L1max. The same as L2, we have L2min and L2max Bus1 Bus2 Bus3 Generator G1 G2 Load L2 L1  When the power market is open, both generators and loads will bid prices. Assume that G1 bid for price C1, G2 bid for price C2. And L1 bid for price B1, and L2 bid for price B2. After biding price, we need to decide how much power should be produce base on the objective function. In this case, we want to maximize the societal surplus. 𝑠𝑜𝑐𝑖𝑒𝑡𝑎𝑙 𝑠𝑢𝑟𝑝𝑙𝑢𝑠 = (𝐿1 𝐵1 + 𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2)  What’s more, according to Kirchhoff’s Current Law (KCL), the total injection should be equal to the total withdrawal. First, I assume that the power flow from bus1 to bus 2 is f12, the power flow from bus2 to bus3 is f23, and the power flow from bus3 to bus1 is f31. And then, we can get: 𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12 𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2 𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31 Formulation: As the definition of linear programming, the standard format is: min 𝑥∈𝑅 𝑛 {𝑐 𝑇 𝑥|𝐴𝑥 = 𝑏, 𝐶𝑥 ≤ 𝑑} We separate the situation into two different cases. Case1: In this case, we consider that every load is important, none of these load can be cut off. It probably means that all the load is residential load or important industry load. In this case, only generator can bid for the price. (i)Variables: First, we need to decide the variables for this problem. There are three kinds of variables in this question: power of generators, loads and power flow. In this case, as the load can’t be cut off, we can consider the load to be constant value. Therefore, the variable should be:
  • 3. 𝑥 = [ 𝑃1 𝑃2 𝑓12 𝑓23 𝑓31] (ii). Objective function: The objective of this problem is to maximize the societal surplus: (𝐿1 𝐵1 + 𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2). As the loads are constant in this case, maximizing the societal surplus equation should become minimizing (𝑃1 𝐶1 + 𝑃2 𝐶2). And then, we can get the objective function: 𝑓(𝑥) = [𝐶1 𝐶2 0 0 0] [ 𝑃1 𝑃2 𝑓12 𝑓23 𝑓31] (iii). Equality constraints: The Equality constraints for this problem is the KCL equation for every bus: 𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12 𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2 𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31 [ 1 0 −1 0 1 0 0 1 1 −1 0 0 0 1 −1 ] [ 𝑃1 𝑃2 𝑓12 𝑓23 𝑓31] = [ 0 𝐿2 𝐿1 ] Therefore, we can get: 𝐴 = [ 1 0 −1 0 1 0 0 1 1 −1 0 0 0 1 −1 ] 𝑏 = [ 0 𝐿2 𝐿1 ] (iv). Inequality constraints: As the loads are constant in this case, we only have generator and power flow limit. And these limits are: 𝑃1𝑚𝑖𝑛 ≤ 𝑃1 ≤ 𝑃1𝑚𝑎𝑥 𝑃2𝑚𝑖𝑛 ≤ 𝑃2 ≤ 𝑃2𝑚𝑎𝑥 |𝑓12| ≤ 𝑙1𝑚𝑎𝑥 |𝑓23| ≤ 𝑙2𝑚𝑎𝑥 |𝑓31| ≤ 𝑙3𝑚𝑎𝑥 According this, we can get: 𝑃1 ≤ 𝑃1𝑚𝑎𝑥 𝑃2 ≤ 𝑃2𝑚𝑎𝑥 −𝑃1 ≤ −𝑃1𝑚𝑖𝑛
  • 4. −𝑃2 ≤ −𝑃2𝑚𝑖𝑛 𝑓12 ≤ 𝑙1𝑚𝑎𝑥 𝑓23 ≤ 𝑙2𝑚𝑎𝑥 𝑓31 ≤ 𝑙3𝑚𝑎𝑥 −𝑓12 ≤ 𝑙1𝑚𝑎𝑥 −𝑓23 ≤ 𝑙2𝑚𝑎𝑥 −𝑓31 ≤ 𝑙3𝑚𝑎𝑥 Therefore, in the format of 𝐶𝑥 ≤ 𝑑, we can get: C= 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 -1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 -1 And 𝑑 = [ 𝑃1𝑚𝑎𝑥 𝑃2𝑚𝑎𝑥 𝑙1𝑚𝑎𝑥 𝑙2𝑚𝑎𝑥 𝑙3𝑚𝑎𝑥 −𝑃1𝑚𝑖𝑛 −𝑃2𝑚𝑖𝑛 𝑙1𝑚𝑎𝑥 𝑙2𝑚𝑎𝑥 𝑙3𝑚𝑎𝑥 ] Case 2: In this case, some of the load can be cut off. It means that both loads and generator can bid for price, and loads can determine not to accept the electricity for the purpose of saving money. In this case, some load might be less important than others and they can using electricity at other time when the electricity price is lower. Also, people can use computer program to bid the price automatically and let computer to decide whether to use electricity or not. This is a new trend of power system called smart grid. (i)Variables: We need to consider load as variables too, as load can change and not be decided yet. Therefore the variables for this case is:
  • 5. 𝑥 = [ 𝑃1 𝑃2 𝐿1 𝐿2 𝑓12 𝑓23 𝑓31] (ii). Objective function: The objective of this problem is to maximize the societal surplus: (𝐿1 𝐵1 + 𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2). As the loads in this case is not a constant but a variables in this case, we should consider loads to be included in the objective function. And maximizing the (𝐿1 𝐵1 + 𝐿2 𝐵2) − (𝑃1 𝐶1 + 𝑃2 𝐶2) means minimizing (𝑃1 𝐶1 + 𝑃2 𝐶2) − (𝐿1 𝐵1 + 𝐿2 𝐵2). We can get the objective function: 𝑓(𝑥) = [𝐶1 𝐶2 −𝐵1 −𝐵2 0 0 0] [ 𝑃1 𝑃2 𝐿1 𝐿2 𝑓12 𝑓23 𝑓31] (iii). Equality constraints: According to the KCL, the equation of equality constraints should be same as before: 𝑏𝑢𝑠1: 𝑃1 + 𝑓31 = 𝑓12 𝑏𝑢𝑠2: 𝑃2 + 𝑓12 = 𝑓23 + 𝐿2 𝑏𝑢𝑠3: 𝑓23 = 𝐿1 + 𝑓31 However, the loads in this case are no longer constants. Therefore, we need to adjust the equation when writing in the standard format. [ 1 0 0 0 −1 0 1 0 1 0 −1 1 −1 0 0 0 −1 0 0 1 −1 ] [ 𝑃1 𝑃2 𝐿1 𝐿2 𝑓12 𝑓23 𝑓31] = 0 In this case, 𝐴 = [ 1 0 0 0 −1 0 1 0 1 0 −1 1 −1 0 0 0 −1 0 0 1 −1 ] 𝑏 = 0 (iv). Inequality constraints: As loads are not constant in this case, we need to consider the limit of loads too. Thought some of the loads can be cut off to save money, not all the loads can be cut off. There are still large amount of loads need to have power supply all the time. Also,
  • 6. not all the residential user of industry are willing to join the market. Therefore, the loads should only change between the lower limit Lmin and upper limit Lmax. Then we can get the inequality constraints: 𝑃1𝑚𝑖𝑛 ≤ 𝑃1 ≤ 𝑃1𝑚𝑎𝑥 𝑃2𝑚𝑖𝑛 ≤ 𝑃2 ≤ 𝑃2𝑚𝑎𝑥 𝐿1𝑚𝑖𝑛 ≤ 𝐿1 ≤ 𝐿1𝑚𝑎𝑥 𝐿2𝑚𝑖𝑛 ≤ 𝐿2 ≤ 𝐿2𝑚𝑎𝑥 |𝑓12| ≤ 𝑙1𝑚𝑎𝑥 |𝑓23| ≤ 𝑙2𝑚𝑎𝑥 |𝑓31| ≤ 𝑙3𝑚𝑎𝑥 According this, we can get: 𝑃1 ≤ 𝑃1𝑚𝑎𝑥 𝑃2 ≤ 𝑃2𝑚𝑎𝑥 −𝑃1 ≤ −𝑃1𝑚𝑖𝑛 −𝑃2 ≤ −𝑃2𝑚𝑖𝑛 𝐿1 ≤ 𝐿1𝑚𝑎𝑥 𝐿2 ≤ 𝐿2𝑚𝑎𝑥 −𝐿1 ≤ −𝐿1𝑚𝑖𝑛 −𝐿2 ≤ −𝐿2𝑚𝑖𝑛 𝑓12 ≤ 𝑙1𝑚𝑎𝑥 𝑓23 ≤ 𝑙2𝑚𝑎𝑥 𝑓31 ≤ 𝑙3𝑚𝑎𝑥 −𝑓12 ≤ 𝑙1𝑚𝑎𝑥 −𝑓23 ≤ 𝑙2𝑚𝑎𝑥 −𝑓31 ≤ 𝑙3𝑚𝑎𝑥 Therefore, in the format of 𝐶𝑥 ≤ 𝑑, we can get: C= 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 -1 And
  • 7. 𝑑 = [ 𝑃1𝑚𝑎𝑥 𝑃2𝑚𝑎𝑥 𝐿1𝑚𝑎𝑥 𝐿2𝑚𝑎𝑥 𝑙1𝑚𝑎𝑥 𝑙2𝑚𝑎𝑥 𝑙3𝑚𝑎𝑥 −𝑃1𝑚𝑖𝑛 −𝑃2𝑚𝑖𝑛 −𝐿1𝑚𝑖𝑛 −𝐿2𝑚𝑖𝑛 𝑙1𝑚𝑎𝑥 𝑙2𝑚𝑎𝑥 𝑙3𝑚𝑎𝑥 ] Design Results: Case 1 For case1, I set up a small instant: The bidding price of generator is: MWhC MWhC /$14 /$10 2 1   The limits of power generated by generators are: MWPMW MWPMW 10040 20030 2 1   The loads need to be supplied are: 𝐿1 = 150𝑀𝑊 𝐿2 = 60𝑀𝑊 The power flow limits are: MWf MWf MWf 140 150 40 31 23 12    Then we can get:                  31 23 12 2 1 ]0001410[)( f f f P P xf And
  • 8.                                                                     140 150 40 40- 30- 140 150 40 100 200 3 2 1 2 1 3 2 1 2 1 max max max min min max max max max max l l l P P l l l P P d Substitute c, A, b, C and d matrix into the linprog function in matlab. We can get: Optimization terminated. X = 170.0000 40.0000 34.6446 14.6446 -135.3554 FVAL = 2.2600e+03 EXITFLAG = 1 OUTPUT = iterations: 5 algorithm: 'interior-point' cgiterations: 0 message: 'Optimization terminated.' constrviolation: 2.6409e-10 firstorderopt: 4.0029e-07This result means:
  • 9. MWf MWf MWf MWP MWP 3554.135 6446.14 6446.34 0000.40 0000.170 31 23 12 2 1      Form this result, G1 is the power provider,we can see that G1 generate power much more than lower limit. The reason is the biding price C1 of G1 is lower than the price C2 for G2. We want the G1 generate as much power as possible. And f31 is negative value so the the power flow should from bus1 to bus3. The minimum of generator cost is 2260$/h. In order to compare with case 2, I set the price of loads the same as case 2: 𝐵1 = 9$/𝑀𝑊ℎ 𝐵2 = 17$/𝑀𝑊ℎ Then we can get the maximum 𝑠𝑜𝑐𝑖𝑒𝑡𝑎𝑙 𝑠𝑢𝑟𝑝𝑙𝑢𝑠 = (9 × 150 + 17 × 60) − 2260 = 110$/ℎ Case 2 For case2, I set up a small instant: The bidding price of generator is: 𝐶1 = 10$/𝑀𝑊ℎ 𝐶2 = 14$/𝑀𝑊ℎ The bidding price of loads are: 𝐵1 = 9$/𝑀𝑊ℎ 𝐵2 = 17$/𝑀𝑊ℎ The limits of power generated by generators are: 30𝑀𝑊 ≤ 𝑃1 ≤ 200𝑀𝑊 40𝑀𝑊 ≤ 𝑃2 ≤ 100𝑀𝑊 The limits of load are: 130𝑀𝑊 ≤ 𝐿1 ≤ 150𝑀𝑊 40𝑀𝑊 ≤ 𝐿2 ≤ 60𝑀𝑊 The power flow limits are: |𝑓12| ≤ 40𝑀𝑊 |𝑓23| ≤ 150𝑀𝑊 |𝑓31| ≤ 140 𝑀𝑊 Then we can get: 𝑓(𝑥) = [10 14 −9 −17 0 0 0] [ 𝑃1 𝑃2 𝐿1 𝐿2 𝑓12 𝑓23 𝑓31] And
  • 10. 𝑑 = [ 200 100 150 60 40 150 140 −30 −40 −130 −40 40 150 140 ] Substitute c, A, b, C and d matrix into the linprog function in matlab. We can get: Optimization terminated. X = 150.0000 40.0000 130.0000 60.0000 27.7910 7.7910 -122.2090 FVAL = -130.0000 EXITFLAG = 1 OUTPUT = iterations: 6 algorithm: 'interior-point' cgiterations: 0 message: [1x24 char] constrviolation: 8.6686e-12 firstorderopt: 1.1841e-08
  • 11. This result means: 𝑃1 = 150.0000MW 𝑃2 = 40.0000MW 𝐿1 = 130.0000MW 𝐿2 = 60.0000MW 𝑓12 = 27.7910MW 𝑓23 = 7.7910MW 𝑓31 = −122.2090MW Form this result, we can see that G1 generate power much more than lower limit. The reason is the biding price C1 of G1 is lower than the price C2 for G2. We want the G1 generate as much power as possible. However, we can see that the lower limit of P2 force G1 to operate under 200MW. As G2 is bidding for a higher price, it can only operate at it lower limit. And we can see that L2 is bidding for high price, so all of its load can be supplied. For L1, it operate at the lower limit because it is bidding for a lower price. We can see that all the variable is within the limit, and the limit of P2 and L2 is activate. The maximum of societal surplus is 140$/h. Conclusion: Form these two cases, we can see that the results are different. The reason is we can cut of some low price load to reduce the total power demand. In this way we can reduce the usage of generator to save more money. Therefore the societal surplus in case 2 have 20$/h more than case1. Form this two case, we can see that changing the limit and variables can change the result of optimization problem. Appendix Matalb code for case 1: A = [1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 -1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 -1 0 0 0 0 0 -1]; b = [200 100 40 150 140 -30 -40 40 150 140]; Aeq = [1 0 -1 0 1 0 1 1 -1 0 0 0 0 1 -1]; beq = [0 60 150];
  • 12. f = [10 14 0 0 0]; [X,FVAL,EXITFLAG,OUTPUT] = linprog(f,A,b,Aeq,beq) Matlab code for case 2: f=[10;14;-9;-17;0;0;0]; Aeq=[1 0 0 0 -1 0 1; 0 1 0 -1 1 -1 0; 0 0 -1 0 0 1 -1]; beq=[0,0,0]; A=[1 0 0 0 0 0 0; 0 1 0 0 0 0 0; 0 0 1 0 0 0 0; 0 0 0 1 0 0 0; 0 0 0 0 1 0 0; 0 0 0 0 0 1 0; 0 0 0 0 0 0 1; -1 0 0 0 0 0 0; 0 -1 0 0 0 0 0; 0 0 -1 0 0 0 0; 0 0 0 -1 0 0 0; 0 0 0 0 -1 0 0; 0 0 0 0 0 -1 0; 0 0 0 0 0 0 -1]; b=[200;100;150;60;40;150;140;-30;-40;-130;-40;40;150;140]; [X,FVAL,EXITFLAG,OUTPUT] =linprog(f,A,b,Aeq,beq)