-
Notifications
You must be signed in to change notification settings - Fork 5
/
osemosys_dec.gms
235 lines (231 loc) · 9.73 KB
/
osemosys_dec.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
223
224
225
226
227
228
229
230
231
232
233
234
235
* OSEMOSYS_DEC.GMS - declarations for sets, parameters, variables (but not equations)
*
* OSEMOSYS 2011.07.07 conversion to GAMS by Ken Noble, Noble-Soft Systems - August 2012
* OSEMOSYS 2017.11.08 update by Thorsten Burandt, Konstantin Löffler and Karlo Hainsch, TU Berlin (Workgroup for Infrastructure Policy) - October 2017
*
* OSEMOSYS 2017.11.08
* Open Source energy Modeling SYStem
*
* ============================================================================
*
* #########################################
* ######################## Model Definition #############
* #########################################
*
* ##############
* # Sets #
* ##############
*
set YEAR;
alias (y,yy,YEAR);
set TECHNOLOGY;
alias (t,TECHNOLOGY)
set TIMESLICE;
alias (l,TIMESLICE);
set FUEL;
alias (f,FUEL);
set EMISSION;
alias (e,EMISSION);
set MODE_OF_OPERATION;
alias (m,MODE_OF_OPERATION);
set REGION;
alias (r,REGION,rr);
set SEASON;
alias (ls,SEASON,lsls);
set DAYTYPE;
alias (ld,DAYTYPE,ldld);
set DAILYTIMEBRACKET;
alias (lh,DAILYTIMEBRACKET,lhlh);
set STORAGE;
alias (s,STORAGE);
*
* ####################
* # Parameters #
* ####################
*
* ####### Global #############
*
parameter YearSplit(TIMESLICE,YEAR);
parameter DiscountRate(REGION);
parameter DaySplit(YEAR,DAILYTIMEBRACKET);
parameter Conversionls(TIMESLICE,SEASON);
parameter Conversionld(TIMESLICE,DAYTYPE);
parameter Conversionlh(TIMESLICE,DAILYTIMEBRACKET);
parameter DaysInDayType(YEAR,SEASON,DAYTYPE);
parameter TradeRoute(REGION,rr,FUEL,YEAR);
parameter DepreciationMethod(REGION);
*
* ####### Demands #############
*
parameter SpecifiedAnnualDemand(REGION,FUEL,YEAR);
parameter SpecifiedDemandProfile(REGION,FUEL,TIMESLICE,YEAR);
parameter AccumulatedAnnualDemand(REGION,FUEL,YEAR);
*
* ######## Performance #############
*
parameter CapacityToActivityUnit(REGION,TECHNOLOGY);
parameter CapacityFactor(REGION,TECHNOLOGY,TIMESLICE,YEAR);
parameter AvailabilityFactor(REGION,TECHNOLOGY,YEAR);
parameter OperationalLife(REGION,TECHNOLOGY);
parameter ResidualCapacity(REGION,TECHNOLOGY,YEAR);
parameter InputActivityRatio(REGION,TECHNOLOGY,FUEL,MODE_OF_OPERATION,YEAR);
parameter OutputActivityRatio(REGION,TECHNOLOGY,FUEL,MODE_OF_OPERATION,YEAR);
*
* ######## Technology Costs #############
*
parameter CapitalCost(REGION,TECHNOLOGY,YEAR);
parameter VariableCost(REGION,TECHNOLOGY,MODE_OF_OPERATION,YEAR);
parameter FixedCost(REGION,TECHNOLOGY,YEAR);
*
* ######## Storage Parameters #############
*
parameter TechnologyToStorage(REGION,MODE_OF_OPERATION,TECHNOLOGY,STORAGE);
parameter TechnologyFromStorage(REGION,MODE_OF_OPERATION,TECHNOLOGY,STORAGE);
parameter StorageLevelStart(REGION,STORAGE);
parameter StorageMaxChargeRate(REGION,STORAGE);
parameter StorageMaxDischargeRate(REGION,STORAGE);
parameter MinStorageCharge(REGION,STORAGE,YEAR);
parameter OperationalLifeStorage(REGION,STORAGE);
parameter CapitalCostStorage(REGION,STORAGE,YEAR);
parameter ResidualStorageCapacity(REGION,STORAGE,YEAR);
*
* ######## Capacity Constraints #############
*
parameter CapacityOfOneTechnologyUnit(REGION,TECHNOLOGY,YEAR);
parameter TotalAnnualMaxCapacity(REGION,TECHNOLOGY,YEAR);
parameter TotalAnnualMinCapacity(REGION,TECHNOLOGY,YEAR);
*
* ######## Investment Constraints #############
*
parameter TotalAnnualMaxCapacityInvestment(REGION,TECHNOLOGY,YEAR);
parameter TotalAnnualMinCapacityInvestment(REGION,TECHNOLOGY,YEAR);
*
* ######## Activity Constraints #############
*
parameter TotalTechnologyAnnualActivityUpperLimit(REGION,TECHNOLOGY,YEAR);
parameter TotalTechnologyAnnualActivityLowerLimit(REGION,TECHNOLOGY,YEAR);
parameter TotalTechnologyModelPeriodActivityUpperLimit(REGION,TECHNOLOGY);
parameter TotalTechnologyModelPeriodActivityLowerLimit(REGION,TECHNOLOGY);
*
* ######## Reserve Margin ############
*
parameter ReserveMarginTagTechnology(REGION,TECHNOLOGY,YEAR);
parameter ReserveMarginTagFuel(REGION,FUEL,YEAR);
parameter ReserveMargin(REGION,YEAR);
*
* ######## RE Generation Target ############
*
parameter RETagTechnology(REGION,TECHNOLOGY,YEAR);
parameter RETagFuel(REGION,FUEL,YEAR);
parameter REMinProductionTarget(REGION,YEAR);
*
* ######### Emissions & Penalties #############
*
parameter EmissionActivityRatio(REGION,TECHNOLOGY,EMISSION,MODE_OF_OPERATION,YEAR);
parameter EmissionsPenalty(REGION,EMISSION,YEAR);
parameter AnnualExogenousEmission(REGION,EMISSION,YEAR);
parameter AnnualEmissionLimit(REGION,EMISSION,YEAR);
parameter ModelPeriodExogenousEmission(REGION,EMISSION);
parameter ModelPeriodEmissionLimit(REGION,EMISSION);
*
* #####################
* # Model Variables #
* #####################
*
* ############### Demands ############
*
positive variable RateOfDemand(REGION,TIMESLICE,FUEL,YEAR);
positive variable Demand(REGION,TIMESLICE,FUEL,YEAR);
*
* ############### Storage ###########
*
free variable RateOfStorageCharge(REGION,STORAGE,SEASON,DAYTYPE,DAILYTIMEBRACKET,YEAR);
free variable RateOfStorageDischarge(REGION,STORAGE,SEASON,DAYTYPE,DAILYTIMEBRACKET,YEAR);
free variable NetChargeWithinYear(REGION,STORAGE,SEASON,DAYTYPE,DAILYTIMEBRACKET,YEAR);
free variable NetChargeWithinDay(REGION,STORAGE,SEASON,DAYTYPE,DAILYTIMEBRACKET,YEAR);
positive variable StorageLevelYearStart(REGION,STORAGE,YEAR);
positive variable StorageLevelYearFinish(REGION,STORAGE,YEAR);
positive variable StorageLevelSeasonStart(REGION,STORAGE,SEASON,YEAR);
positive variable StorageLevelDayTypeStart(REGION,STORAGE,SEASON,DAYTYPE,YEAR);
positive variable StorageLevelDayTypeFinish(REGION,STORAGE,SEASON,DAYTYPE,YEAR);
positive variable StorageLowerLimit(REGION,STORAGE,YEAR);
positive variable StorageUpperLimit(REGION,STORAGE,YEAR);
positive variable AccumulatedNewStorageCapacity(REGION,STORAGE,YEAR);
positive variable NewStorageCapacity(REGION,STORAGE,YEAR);
positive variable CapitalInvestmentStorage(REGION,STORAGE,YEAR);
positive variable DiscountedCapitalInvestmentStorage(REGION,STORAGE,YEAR);
positive variable SalvageValueStorage(REGION,STORAGE,YEAR);
positive variable DiscountedSalvageValueStorage(REGION,STORAGE,YEAR);
positive variable TotalDiscountedStorageCost(REGION,STORAGE,YEAR);
*
* ############### Capacity Variables ############
*
integer variable NumberOfNewTechnologyUnits(REGION,TECHNOLOGY,YEAR);
positive variable NewCapacity(REGION,TECHNOLOGY,YEAR);
positive variable AccumulatedNewCapacity(REGION,TECHNOLOGY,YEAR);
positive variable TotalCapacityAnnual(REGION,TECHNOLOGY,YEAR);
*
* ############### Activity Variables #############
*
positive variable RateOfActivity(REGION,TIMESLICE,TECHNOLOGY,MODE_OF_OPERATION,YEAR);
positive variable RateOfTotalActivity(REGION,TIMESLICE,TECHNOLOGY,YEAR);
positive variable TotalTechnologyAnnualActivity(REGION,TECHNOLOGY,YEAR);
positive variable TotalAnnualTechnologyActivityByMode(REGION,TECHNOLOGY,MODE_OF_OPERATION,YEAR);
positive variable RateOfProductionByTechnologyByMode(REGION,TIMESLICE,TECHNOLOGY,MODE_OF_OPERATION,FUEL,YEAR);
positive variable RateOfProductionByTechnology(REGION,TIMESLICE,TECHNOLOGY,FUEL,YEAR);
positive variable ProductionByTechnology(REGION,TIMESLICE,TECHNOLOGY,FUEL,YEAR);
positive variable ProductionByTechnologyAnnual(REGION,TECHNOLOGY,FUEL,YEAR);
positive variable RateOfProduction(REGION,TIMESLICE,FUEL,YEAR);
positive variable Production(REGION,TIMESLICE,FUEL,YEAR);
positive variable RateOfUseByTechnologyByMode(REGION,TIMESLICE,TECHNOLOGY,MODE_OF_OPERATION,FUEL,YEAR);
positive variable RateOfUseByTechnology(REGION,TIMESLICE,TECHNOLOGY,FUEL,YEAR);
positive variable UseByTechnologyAnnual(REGION,TECHNOLOGY,FUEL,YEAR);
positive variable RateOfUse(REGION,TIMESLICE,FUEL,YEAR);
positive variable UseByTechnology(REGION,TIMESLICE,TECHNOLOGY,FUEL,YEAR);
positive variable Use(REGION,TIMESLICE,FUEL,YEAR);
positive variable Trade(REGION,rr,TIMESLICE,FUEL,YEAR);
positive variable TradeAnnual(REGION,rr,FUEL,YEAR);
*
positive variable ProductionAnnual(REGION,FUEL,YEAR);
positive variable UseAnnual(REGION,FUEL,YEAR);
*
* ############### Costing Variables #############
*
positive variable CapitalInvestment(REGION,TECHNOLOGY,YEAR);
positive variable DiscountedCapitalInvestment(REGION,TECHNOLOGY,YEAR);
*
positive variable SalvageValue(REGION,TECHNOLOGY,YEAR);
positive variable DiscountedSalvageValue(REGION,TECHNOLOGY,YEAR);
positive variable OperatingCost(REGION,TECHNOLOGY,YEAR);
positive variable DiscountedOperatingCost(REGION,TECHNOLOGY,YEAR);
*
positive variable AnnualVariableOperatingCost(REGION,TECHNOLOGY,YEAR);
positive variable AnnualFixedOperatingCost(REGION,TECHNOLOGY,YEAR);
positive variable VariableOperatingCost(REGION,TIMESLICE,TECHNOLOGY,YEAR);
*
positive variable TotalDiscountedCostByTechnology(REGION,TECHNOLOGY,YEAR);
positive variable TotalDiscountedCost(REGION,YEAR);
*
positive variable ModelPeriodCostByRegion(REGION);
*
* ######## Reserve Margin #############
*
positive variable TotalCapacityInReserveMargin(REGION,YEAR);
positive variable DemandNeedingReserveMargin(REGION,TIMESLICE,YEAR);
*
* ######## RE Gen Target #############
*
free variable TotalREProductionAnnual(REGION,YEAR);
free variable RETotalProductionOfTargetFuelAnnual(REGION,YEAR);
*
free variable TotalTechnologyModelPeriodActivity(REGION,TECHNOLOGY);
*
* ######## Emissions #############
*
positive variable AnnualTechnologyEmissionByMode(REGION,TECHNOLOGY,EMISSION,MODE_OF_OPERATION,YEAR);
positive variable AnnualTechnologyEmission(REGION,TECHNOLOGY,EMISSION,YEAR);
positive variable AnnualTechnologyEmissionPenaltyByEmission(REGION,TECHNOLOGY,EMISSION,YEAR);
positive variable AnnualTechnologyEmissionsPenalty(REGION,TECHNOLOGY,YEAR);
positive variable DiscountedTechnologyEmissionsPenalty(REGION,TECHNOLOGY,YEAR);
positive variable AnnualEmissions(REGION,EMISSION,YEAR);
positive variable ModelPeriodEmissions(EMISSION,REGION);