forked from bert-kapsarc/KEMChinaCoal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecisionFlags.gms
222 lines (190 loc) · 7.66 KB
/
decisionFlags.gms
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
* Decision flags
* All the decision flags for the model
********************************************************************************
scalar
trans_budg 'set to 1 to enforce budget constraint for railway expansion' /0/
COrailCFS 'set to 1 to apply rails surcharges to railway costs' /0/
partialdereg 'set to 1 for partial fuel deregulation' /0/
dereg_time 'number of years for deregulation' /1/
tradecap 'cap electricity trade on the GCC grid to electricity produced without fuel subsidies - 1 = yes' /1/
rentrade 'include renewables in tradeable electricity quota' /1/
scenario 'Predefined model scenarios. current policy=1, deregulated fuel=2' /2/
;
$ifThen set currentPolicy
scenario=1;
$ifThen.tradecap %tradecap%==false
tradecap = 0
$else.tradecap
tradecap = 1
$endif.tradecap
$else
scenario=2;
$endif
set
integrate(sectors,c) 'integration flags for all sectors in the model'
fMPt(f,c) 'available fuel to produce electricity for trading'
;
parameter
/* fuel pricing rules flag for all the sectors */
ELfuelpflag(f,c) 'Upstream, refinery, and coal cost pricing rule flag for EL'
WAfuelpflag(f,c) 'Upstream and refinery fuel cost pricing rule flag for WA'
RFfuelpflag(f,c) 'Upstream fuel cost pricing rule flag for RF'
PCfuelpflag(f,c) 'Upstream and refinery fuel cost pricing rule flag for PC'
CMfuelpflag(f,c) 'Upstream and refinery fuel cost pricing rule flag for CM'
/* power pricing rules flag for all the sectors */
WAELpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for WA'
TRELpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for TR'
/* transmission pricing rules flag for all the sectors */
RFTRpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for RF'
PCTRpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for PC'
CMTRpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for CM'
ELRETRpflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for Residential'
/* pricing rules flag for all the sectors consuming goods from WA */
ELWApflag(ELl,ELs,ELday,c) 'Electricity pricing rule flag for EL supplied by WA'
/* petrochemical pricing rules flag for all the sectors */
RFPCpflag(f,c) 'material pricing rule flag for RF'
/* Emission pricing rules flag for all the sectors */
ELEMpflag(EMcp,c) 'emission cost pricing rule for the power sector'
WAEMpflag(EMcp,c) 'emission cost pricing rule for the water sector'
RFEMpflag(EMcp,c) 'emission cost pricing rule for the refinery sector'
PCEMpflag(EMcp,c) 'emission cost pricing rule for the petrochemical sector'
CMEMpflag(EMcp,c) 'emission cost pricing rule for the cement sector'
;
* Trade fuel prices settings
**************************************
* set to yes for marginal prices
fMPt(Elf,c)=yes;
* configure integrated countries
**************************************
* enabling SA and disabling all other countries
integrate(sectors,c)=no;
c_on(c)=no;
$ontext
c_on('ksa')=yes;
c_on('uae')=yes;
c_on('qat')=yes;
c_on('kuw')=yes;
c_on('bah')=yes;
c_on('omn')=yes;
$offtext
rc(rall,c)$(not c_on(c))=no;
$ontext
TODO introduce integer values to represent 4 possible pricing options
1. Deregulated (pure market marginal value)
2. Administered (unique to each sector/commodity)
3. Quasi-market average cost (market based pricing unique across sectors),
Average cost. Price fixed to average supply costs in the model
(function of other decision variables)
4. Capped (unique to each sector/commodity, upper bound)
will require additional equation(s)
$offtext
* Emission Module
**************************************
integrate('EM',c)$(c_on(c))=yes;
ELEMpflag(EMcp,c)=1;
WAEMpflag(EMcp,c)=1;
RFEMpflag(EMcp,c)=1;
PCEMpflag(EMcp,c)=1;
CMEMpflag(EMcp,c)=1;
* Upstream sector
**************************************
integrate('UP',c)$(c_on(c))=yes;
* Power sector
**************************************
integrate('EL',c)$(c_on(c))=yes;
* initializing
ELfuelpflag(ELf,c)$(c_on(c))=1;
ELRETRpflag(ELl,ELs,ELday,c)$(c_on(c))=2;
* Transmission sector
**************************************
integrate('TR',c)$(c_on(c))=yes;
TRELpflag(ELl,ELs,ELday,c)$(c_on(c))=1;
* Water sector
**************************************
integrate('WA',c)$(c_on(c))=yes;
* initializing
WAfuelpflag(WAf,c)$(c_on(c))=1;
WAELpflag(ELl,ELs,ELday,c)$(c_on(c))=1;
ELWApflag(ELl,ELs,ELday,c)$(c_on(c))=1;
* Refining sector
**************************************
integrate('RF',c)$(c_on(c) and sameas(c,'ksa'))=yes;
* initializing
* can't set upstream to administered, need quota allocation
RFfuelpflag(RFcr,c)$(c_on(c))=1;
RFTRpflag(ELl,ELs,ELday,c)$(c_on(c))=1;
RFPCpflag(RFMTBE,c)$(c_on(c))=1;
* Petchem sector
**************************************
integrate('PC',c)$(c_on(c) and sameas(c,'ksa'))=no;
* initializing
PCfuelpflag(PCM,c)$(c_on(c))=1;
PCTRpflag(ELl,ELs,ELday,c)$(c_on(c))=1;
* Cement sector
**************************************
integrate('CM',c)$(c_on(c) and sameas(c,'ksa'))=no;
* initializing
CMfuelpflag(CMf,c)$(c_on(c))=1;
CMTRpflag(ELl,ELs,ELday,c)$(c_on(c))=1;
if(scenario=1,
/* 1 - current policy -> Regulated market for fuel and electricity */
ELfuelpflag(ELfup,c)$(c_on(c))=2; /* administered upstream fuel prices except nuclear */
* ELfuelpflag('arablight',c)$(c_on(c))=1; /*set arablight to deregeulated prices*/
ELfuelpflag(ELfref,c)$(c_on(c))=2; /* administered refined fuel prices */
* ELfuelpflag('diesel',c)$(c_on(c))=1; /*set diesel to deregeulated prices*/
ELfuelpflag(ELfcoal,c)$(c_on(c))=1; /* liberalized coal prices */
ELfuelpflag(ELfnuclear,c)$(c_on(c))=1; /* libearlized uranium prices */
WAfuelpflag(WAfup,c)$(c_on(c))=2;
WAfuelpflag(WAfref,c)$(c_on(c))=2;
PCfuelpflag(PCmup,'ksa')=2;
PCfuelpflag(PCmref,'ksa')=2;
CMfuelpflag(CMfup,'ksa')=2;
CMfuelpflag(CMfref,'ksa')=2;
RFPCpflag(RFMTBE,'ksa')=2;
RFTRpflag(ELl,ELs,ELday,'ksa')=2;
PCTRpflag(ELl,ELs,ELday,'ksa')=2;
CMTRpflag(ELl,ELs,ELday,'ksa')=2;
elseif scenario=2,
/* 2 - deregulated fuel prices and regulated electricity prices */
partialdereg=0;
ELfuelpflag(ELfup,c)$(c_on(c))=1;
ELfuelpflag(ELfref,c)$(c_on(c))=1;
ELfuelpflag(ELfcoal,c)$(c_on(c))=1;
WAfuelpflag(WAfup,c)$(c_on(c))=1;
WAfuelpflag(WAfref,c)$(c_on(c))=1;
PCfuelpflag(PCmup,'ksa')=1;
PCfuelpflag(PCmref,'ksa')=1;
CMfuelpflag(CMfup,'ksa')=1;
CMfuelpflag(CMfref,'ksa')=1;
RFPCpflag(RFMTBE,'ksa')=1;
RFTRpflag(ELl,ELs,ELday,'ksa')=2;
PCTRpflag(ELl,ELs,ELday,'ksa')=2;
CMTRpflag(ELl,ELs,ELday,'ksa')=2;
fMPt(f,c) = no;
elseif scenario=3,
* TODO: Complete this scenario
/* 3 - partially deregulated fuel prices */
partialdereg=1;
ELfuelpflag(ELfup,c)$(c_on(c))=1;
ELfuelpflag(ELfref,c)$(c_on(c))=1;
ELfuelpflag(ELfcoal,c)$(c_on(c))=1;
WAfuelpflag(WAfup,c)$(c_on(c))=1;
WAfuelpflag(WAfref,c)$(c_on(c))=1;
PCfuelpflag(PCmup,'ksa')=1;
PCfuelpflag(PCmref,'ksa')=1;
CMfuelpflag(CMfup,'ksa')=1;
CMfuelpflag(CMfref,'ksa')=1;
RFPCpflag(RFMTBE,'ksa')=1;
/* Electricity is not deregulated in this scenario */
RFTRpflag(ELl,ELs,ELday,'ksa')=2;
PCTRpflag(ELl,ELs,ELday,'ksa')=2;
CMTRpflag(ELl,ELs,ELday,'ksa')=2;
elseif scenario=4,
Abort "Scenario hasn't been implemented "
else
Abort "Scenario not defined. Set to "
"1 - Regulated fuel and electricity prices "
"2 - deregulated fuel prices and regulated electricity prices "
"3 - partially deregulated fuel prices"
"4 - investment credit"
);