Upload
-
View
228
Download
0
Embed Size (px)
Citation preview
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 100
1 1 β1 00 0 1 β1
]
[ π1
π2
π12
π23
π31]
= [0πΏ2
πΏ1
]
Therefore, we can get:
π΄ = [1 0 β1 0 100
1 1 β1 00 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 10 1 0 β1 1 β1 00 0 β1 0 0 1 β1
]
[ π1
π2
πΏ1
πΏ2
π12
π23
π31]
= 0
In this case,
π΄ = [1 0 0 0 β1 0 10 1 0 β1 1 β1 00 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
π =
[
2001001506040150140β30β40β130β4040150140 ]
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)