-
Notifications
You must be signed in to change notification settings - Fork 0
/
gdx_convert.m
77 lines (67 loc) · 1.09 KB
/
gdx_convert.m
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
clear
clc
%% init
var_str = {'B_exit',...
'B_s_tu', ...
'B_tu', ...
'B_tu_tup', ...
'B_exit',...
'B_tu',...
'B_in_sgu',...
'B_exit_sgu',...
'B_rec_otsg_bbd',...
'B_pro',...
'cost_fix_s', ...
'cost_fix_tu_a', ...
'cost_fix_tu_b', ...
'Cost_tot_tu', ...
'cost_var_s', ...
'cost_var_tu_a', ...
'cost_var_tu_b', ...
'C_c_s', ...
'C_exit', ...
'C_in', ...
'C_in_max', ...
'C_loss', ...
'C_out', ...
'C_rout', ...
'C_target', ...
'F_in_sgu', ...
'F_exit', ...
'F_in', ...
'F_loss', ...
'F_out', ...
'F_rec', ...
'F_s', ...
'F_s_tu', ...
'HY', ...
'ML_in', ...
'ML_out', ...
'ML_rem_c', ...
'ML_rem_tu_c', ...
'NS_max', ...
'RR', ...
} ;
gdx_file = 'main_loc.gdx';
pref.form = 'full';
for i = 1:length(var_str)
pref.name = var_str{i};
exp = [var_str{i},' = rgdx(gdx_file,pref);'];
eval(exp);
end
%building sets
tu_start = 1;
tu_end = 7;
c_start = 8;
c_end = 11;
s_start = 12;
s_end = 14;
uels = B_s_tu.uels{1,1} ;
for i = 1:length(uels)
exp = ['i', uels{i}, '= i;'];
eval(exp);
end
set_tu = uels(tu_start:tu_end);
set_c = uels(c_start:c_end);
set_s = uels(s_start:s_end);
save minlp_main.mat ;