forked from a280558071/IEDS_Planning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IEDS_planning.asv
245 lines (229 loc) · 9.58 KB
/
IEDS_planning.asv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
clc;
clear all;
%% 颲�剖�韐�脩瑪(餈��典��耨�?)
load('dayInput.mat','day01','day02','day03','day04','day05','day06','day07','day08');
C=[day01',day02',day03',day04',day05',day06',day07',day08'];
Load_E=C(1,:);
Load_C=C(2,:);
Load_H=C(3,:);
k_number=8; %�詨��乩葵�堆��?潔蛹8
Load_scene=24*k_number; %銝葵�詨��伐�銝?銝芸�24撠%�?192: x1*24
Proportion_typicalday=[65/365;26/365;66/365;26/365;65/365;26/365;65/365;26/365]; %5:2:5:2:5:2:5:2
%% ��萎遠嚗隞瑞�亙�刻�銝?憟�
Price_electricity_day=[
0.3818
0.3818
0.3818
0.3818
0.3818
0.3818
0.3818
0.8395
0.8395
0.8395
1.3222
1.3222
1.3222
1.3222
1.3222
0.8395
0.8395
0.8395
1.3222
1.3222
1.3222
0.8395
0.8395
0.3818];
%% 霈曉��嚗蛹鈭靘輯挽憭��亙��唬耨�對��?�蓮���挽蝵格���嚗?
Price_gas=3.3; %��隞瑟銝?2.5�?/蝡蝐?
Planning_years=10;
CCHP_types=6;
GB_types=10;
AC_types=32;
EB_types=20;
SUB_types=30;
n_SUB=1;
n_E_Min=0.35;
n_E_Max=0.4;
n_E=n_E_Min:(n_E_Max-n_E_Min)/(CCHP_types-1):n_E_Max; %cchp鈭抒��
n_H_Min=0.4;
n_H_Max=0.45;
n_H=n_H_Min:(n_H_Max-n_H_Min)/(CCHP_types-1):n_H_Max; %cchp鈭抒��
COP_C=1.2; %CCHP雿�嗥��瑞���
COP_H=0.9;
n_GB=0.8;
COP_AC=2.5; % 蝛箄�隞亦�W����coefficient of power
n_EB_Min=0.9;
n_EB_Max=0.95;
n_EB=n_EB_Min:(n_EB_Max-n_EB_Min)/(EB_types-1):n_EB_Max;
LHV=35.544/3.6; %LHV��銝榭W*h/m3�?�雿���?32.967 MJ/m3嚗�摨衣蝑�3.6MJ嚗隞?3.6銵函內��銝榭W*h/m3
%% �遣�賡��血��拚
Converter_SUB=repmat([n_SUB;0;0],1,SUB_types);
Converter_CCHP=[n_E;n_H*COP_C;n_H*COP_H];
Converter_GB=repmat([0;0;n_GB],1,GB_types);
Converter_AC=repmat([0;COP_AC;0],1,AC_types);
Converter_EB=[zeros(1,EB_types);zeros(1,EB_types);n_EB];
C_matrix=[Converter_SUB,Converter_CCHP,Converter_GB,Converter_AC,Converter_EB];
%% 撱箄挽�寞��
CCHP_capacity_min=800;%�嚗?6獢��銝?獢?600kw
CCHP_capacity_max=3800;%3800
CCHP_capacity=CCHP_capacity_min:((CCHP_capacity_max-CCHP_capacity_min)/(CCHP_types-1)):CCHP_capacity_max;%���啁韐
CCHP_cost=CCHP_capacity*300;%2500 %��雿?遠 7560銝�/MW憭拍瘞恣蝞�撌桐�憭?200�銝?���瘞靘�嚗?�憭靘�嚗之璁�隞?3嚗?
GB_capacity_min=500;%�﹝嚗�獢?500kw
GB_capacity_max=5000;
GB_capacity=GB_capacity_min:((GB_capacity_max-GB_capacity_min)/(GB_types-1)):GB_capacity_max;%���啁韐
GB_cost=GB_capacity*70;%40 %��撱箄挽�嚗�雿?遠 40銝�/MW,40
AC_capacity_min=500;%�嗅��32獢��銝?獢?500kw
AC_capacity_max=16000;%100
AC_capacity=(AC_capacity_min:((AC_capacity_max-AC_capacity_min)/(AC_types-1)):AC_capacity_max)/COP_AC; %���啁瘨???
AC_cost=AC_capacity*COP_AC*870; %�萄�瑞征靚��穿����遠 43銝� /MW�瑁��?,*COP_AC嚗��孵2.3kw�嗅�榆銝�2000嚗?(2000/2.3)���臬�
EB_capacity_min=250;%2�?6獢��銝?獢?
EB_capacity_max=5000;%32
EB_capacity=EB_capacity_min:((EB_capacity_max-EB_capacity_min)/(EB_types-1)):EB_capacity_max;%���啁瘨??
EB_cost=EB_capacity*55;%10����?3000撌血
SUB_capacity_min=500;
SUB_capacity_max=15000;
SUB_capacity=(SUB_capacity_min:((SUB_capacity_max-SUB_capacity_min)/(SUB_types-1)):SUB_capacity_max);
SUB_cost=SUB_capacity*4;%銝支���摰��臬銝�撌血嚗���摰停�?4�撌血嚗����臬�
%% 璅∪���憯唳�
%0-1�箇�撱箄挽�喟���
X_CCHP=binvar(1,CCHP_types,'full');
X_GB=binvar(1,GB_types,'full');
X_AC=binvar(1,AC_types,'full');
X_EB=binvar(1,EB_types,'full');
X_SUB=binvar(1,SUB_types,'full');
%�箇����餈賒��
P_CCHP_gas=sdpvar(Load_scene,CCHP_types,'full'); %CCHP���園���函�瘞�潘����烘W嚗�霂乩耨�寞�kw瘥��?�
V_CCHP_gas=sdpvar(Load_scene,CCHP_types,'full'); %CCHP���園���函�瘞�嚗�雿m3/h
P_SUB_electricity=sdpvar(Load_scene,SUB_types,'full'); %�蝡�����烘W
P_GB_gas=sdpvar(Load_scene,GB_types,'full'); %GB���園���函�瘞�潘����烘W
V_GB_gas=sdpvar(Load_scene,GB_types,'full'); %GB���園���函�瘞�嚗�雿m3/h
P_AC_electricity=sdpvar(Load_scene,AC_types,'full'); %銝剖亢蝛箄�颲�萄����MW
P_EB_electricity=sdpvar(Load_scene,EB_types,'full');%�菟����亦�踝���MW
%%
Constraints=[];
%%
Cons_PL=[];
P=sdpvar(SUB_types+CCHP_types+GB_types+AC_types+EB_types,Load_scene,'full');
for t=1:Load_scene
Cons_PL=[ Cons_PL,P(:,t)==[P_SUB_electricity(t,:)';P_CCHP_gas(t,:)';P_GB_gas(t,:)';P_AC_electricity(t,:)';P_EB_electricity(t,:)']];%瘜冽�餈��舐�鈭?==
end
L=sdpvar(3,Load_scene,'full');
for t=1:Load_scene
Cons_PL=[Cons_PL,L(:,t)==[Load_E(t)+sum(P_AC_electricity(t,:),2)+sum(P_EB_electricity(t,:),2);Load_C(t);Load_H(t)]];
end
Constraints=[Constraints,Cons_PL];
%% 韐撟唾
Cons_loadbalance=[];
for t=1:Load_scene
Cons_loadbalance=[Cons_loadbalance,L(1,t)==C_matrix(1,:)*P(:,t)];
Cons_loadbalance=[Cons_loadbalance,L(2,t)<=C_matrix(2,:)*P(:,t)];
Cons_loadbalance=[Cons_loadbalance,L(3,t)<=C_matrix(3,:)*P(:,t)];
end
Constraints=[Constraints,Cons_loadbalance];
%% CCHP撱箸芋
Cons_CCHP=[];
for i=1:CCHP_types
Cons_CCHP=[Cons_CCHP,0<=P_CCHP_gas(:,i)*n_E(i)<=CCHP_capacity(i)*X_CCHP(i)];%/n_E(i) CCHP�箏�銝��?,�臭誑撠蝏��啣?潸�銵�颲�敺��餉��?0/1
end
Cons_CCHP=[Cons_CCHP,P_CCHP_gas==V_CCHP_gas*LHV]; % V_CCHP_gas��銝榦3/h, LHV��銝榭W.h/m3嚗_CCHP_gas��銝撤W(銝隞?1000嚗停�疼w��雿?)
Cons_CCHP=[Cons_CCHP,sum(X_CCHP)<=1];
Constraints=[Constraints,Cons_CCHP];
%% GB撱箸芋
Cons_GB=[];
for j=1:GB_types
Cons_GB=[Cons_GB,0<=P_GB_gas(:,j)<=GB_capacity(j)*X_GB(j)/n_GB];
end
Cons_GB=[Cons_GB,P_GB_gas==V_GB_gas*LHV];
Cons_GB=[Cons_GB,sum(X_GB)<=1];
Constraints=[Constraints,Cons_GB];
%% AC撱箸芋
Cons_AC=[];
for k=1:AC_types
Cons_AC=[Cons_AC,0<=P_AC_electricity(:,k)<=AC_capacity(k)*X_AC(k)];
end
Cons_AC=[Cons_AC,sum(X_AC)<=1];
Constraints=[Constraints,Cons_AC];
%% EB撱箸芋
Cons_EB=[];
for n=1:EB_types
Cons_EB=[Cons_EB,0<=P_EB_electricity(:,n)<=EB_capacity(n)*X_EB(n)];
end
Cons_EB=[Cons_EB,sum(X_EB)<=1];
Constraints=[Constraints,Cons_EB];
%% SUB撱箸芋
Cons_SUB=[];
for m=1:SUB_types
Cons_SUB=[Cons_SUB,0<=P_SUB_electricity(:,m)<=SUB_capacity(m)*X_SUB(m)];%��鋆漲嚗?20%�?�隞亙�隡���亙���雿銝蔣�?�嚗�霂交撱箄挽��霈曄蔭�桅�
end
Cons_SUB=[Cons_SUB,sum(X_SUB)<=1];
Constraints=[Constraints,Cons_SUB];
%% 撱箄挽�撟游??
Obj_bulding_CCHP=sum(CCHP_cost.*X_CCHP,2);
Obj_bulding_GB=sum(GB_cost.*X_GB,2);
Obj_bulding_AC=sum(AC_cost.*X_AC,2);
Obj_bulding_EB=sum(EB_cost.*X_EB,2);
Obj_bulding_SUB=sum(SUB_cost.*X_SUB,2);
r=0.07;
U=(r*(1+r)^Planning_years)/((1+r)^Planning_years-1);
Obj_building=U*(Obj_bulding_CCHP+Obj_bulding_GB+Obj_bulding_AC+Obj_bulding_EB+Obj_bulding_SUB);%U*
%% 撟渲�銵��?
Proportion_typicalday_rep=repmat(Proportion_typicalday,1,24);
Proportion_typicalday_reshape=reshape(Proportion_typicalday_rep',1,[]);
Proportion_typicalday_CCHP=repmat(Proportion_typicalday_reshape',1,CCHP_types);
Proportion_typicalday_GB=repmat(Proportion_typicalday_reshape',1,GB_types);
Proportion_typicalday_SUB=repmat(Proportion_typicalday_reshape',1,SUB_types);
Proportion_typicalday_AC=repmat(Proportion_typicalday_reshape',1,AC_types);
Proportion_typicalday_EB=repmat(Proportion_typicalday_reshape',1,EB_types);
Price_electricity_typicalday=repmat(Price_electricity_day,k_number,1);%3�臬���?
Price_electricity_SUB=repmat(Price_electricity_typicalday,1,SUB_types);
Price_electricity_AC=repmat(Price_electricity_typicalday,1,AC_types);
Price_electricity_EB=repmat(Price_electricity_typicalday,1,EB_types);
Obj_operation_CCHP=365*Price_gas*sum(sum(Proportion_typicalday_CCHP.*V_CCHP_gas));
Obj_operation_GB=365*Price_gas*sum(sum(Proportion_typicalday_GB.*V_GB_gas));
Obj_operation_SUB=365*sum(sum(Price_electricity_SUB.*Proportion_typicalday_SUB.*P_SUB_electricity));
Obj_operation_AC=365*sum(sum(Price_electricity_AC.*Proportion_typicalday_AC.*P_AC_electricity));
Obj_operation_EB=365*sum(sum(Price_electricity_EB.*Proportion_typicalday_EB.*P_EB_electricity));
Obj_operation=Obj_operation_CCHP+Obj_operation_GB+Obj_operation_SUB;
Obj=Obj_building+Obj_operation;
%% �桅�瘙圾
ops=sdpsettings('solver','gurobi','verbose',2);
optimize(Constraints,Obj,ops);
%% �餃撅內
S_X_CCHP=value(X_CCHP);
S_X_GB=value(X_GB);
S_X_AC=value(X_AC);
S_X_EB=value(X_EB);
S_X_SUB=value(X_SUB);
S_P_CCHP_gas=value(P_CCHP_gas);
S_V_CCHP_gas=value(V_CCHP_gas);
S_P_SUB_electricity=value(P_SUB_electricity);
S_P_GB_gas=value(P_GB_gas);
S_V_GB_gas=value(V_GB_gas);
S_P_AC_electricity=value(P_AC_electricity);
S_P_EB_electricity=value(P_EB_electricity);
S_P=value(P);
S_L=value(L);
S1_X_CCHP=find(S_X_CCHP);%�曉撱箄挽�寞�
S1_X_GB=find(S_X_GB);
S1_X_AC=find(S_X_AC);
S1_X_EB=find(S_X_EB);
S1_X_SUB=find(S_X_SUB);
CCHP_building=sum(S_X_CCHP.*CCHP_capacity(1,:),2);
GB_building=sum(S_X_GB.*GB_capacity(1,:),2);
AC_building=sum(S_X_AC.*AC_capacity(1,:),2);
EB_building=sum(S_X_EB.*EB_capacity(1,:),2);
SUB_building=sum(S_X_SUB.*SUB_capacity(1,:),2);%霈曉�撱箄挽摰寥�
CCHP_building_cost=value(Obj_bulding_CCHP);
GB_building_cost=value(Obj_bulding_GB);
AC_building_cost=value(Obj_bulding_AC);
EB_building_cost=value(Obj_bulding_EB);
SUB_building_cost=value(Obj_bulding_SUB);
building_cost=value(Obj_building);
operation_CCHP_cost=value(Obj_operation_CCHP);
operation_GB_cost=value(Obj_operation_GB);
operation_SUB_cost=value(Obj_operation_SUB);
operation_AC_cost=value(Obj_operation_AC);
operation_EB_cost=value(Obj_operation_EB);
Obj_operation_cost=value(Obj_operation);