1b_sets.gms 14.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$ontext
This file is part of Backbone.

Backbone is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Backbone is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Backbone.  If not, see <http://www.gnu.org/licenses/>.
$offtext

18
Sets
Juha Kiviluoma's avatar
Juha Kiviluoma committed
19
* --- Geography ---------------------------------------------------------------
20
    grid "Forms of energy endogenously presented in the model" / empty /
Juha Kiviluoma's avatar
Juha Kiviluoma committed
21
    node "Nodes maintain the energy balance or track exogenous commodities"
22

23
* --- Commodities & resources -------------------------------------------------------
24
    emission "Emissions"
25
    commodity(node) "Commodities that can be bought or sold exogenous to model"
26
    flow "Flow based energy resources (time series)"
27

28
29
* --- Energy generation and consumption ---------------------------------------
    unit "Set of generators, storages and loads"
30
    unittype "Unit technology types"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
31
    unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
32
    unit_commodity(unit) "Units using an exogenous commodity with a price"
33
    unit_fail(unit) "Units that might fail"
34
    unit_minLoad(unit) "Units that have unit commitment restrictions (e.g. minimum power level)"
35
36
37
    unit_online(unit) "Units that have an online variable in the first active effLevel"
    unit_online_LP(unit) "Units that have an LP online variable in the first active effLevel"
    unit_online_MIP(unit) "Units that have an MIP online variable in the first active effLevel"
38
39
40
    unit_aggregator(unit) "Aggregator units aggragating several units"
    unit_aggregated(unit) "Units that are aggregated"
    unit_noAggregate(unit) "Units that are not aggregated and are not aggregators"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
41
42
    unit_slope(unit) "Units with piecewise linear efficiency constraints"
    unit_noSlope(unit) "Units without piecewise linear efficiency constraints"
43
    unitAggregator_unit(unit, unit) "Aggregate unit linked to aggregated units"
44
    unitUnitEffLevel(unit, unit, EffLevel) "Aggregator unit linked to aggreted units with a definition when to start the aggregation"
45
46
    flowUnit(flow, unit) "Units linked to a certain energy flow time series"
    unitUnittype(unit, unittype) "Link generation technologies to types"
47
    unitStarttype(unit, starttype) "Units with special startup properties"
48
    un_commodity(unit, node) "Units linked with commodities"
49
    un_commodity_in(unit, node) "Units linked with input commodities"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
50
    un_commodity_out(unit, node) "Units linked with output commodities"
51
52
    unit_investLP(unit) "Units with continuous investments allowed"
    unit_investMIP(unit) "Units with integer investments allowed"
53
    unit_timeseries(unit) "Units with time series enabled"
Ciara O'Dwyer's avatar
Ciara O'Dwyer committed
54
    unit_incHRAdditionalConstraints(unit) "Units that use the two additional incremental heat rate constraints"
55

Niina Helistö's avatar
Niina Helistö committed
56
* --- Nodes -------------------------------------------------------------------
57
58
    node_spill(node) "Nodes that can spill; used to remove v_spill variables where not relevant"
    flowNode(flow, node) "Nodes with flows"
59
    node_superpos(node) "Nodes whose state is monitored in the z dimension using superpositioning of state"
60

Niina Helistö's avatar
Niina Helistö committed
61
* --- Sets bounding geography and units ---------------------------------------
62
    group "A group of units, transfer links, nodes, etc."
Juha Kiviluoma's avatar
Juha Kiviluoma committed
63
64
    gn(grid, node) "Grids and their nodes"
* NOTE! Should it be possible to permit time-series form upper or lower bounds on states? If so, then gn() needs rethinking.
65
    gn2n(grid, node, node) "All (directional) transfer links between nodes in specific energy grids"
66
    gn2n_directional(grid, node, node) "Transfer links with positive rightward transfer and negative leftward transfer"
Niina Helistö's avatar
Niina Helistö committed
67
68
    gn2n_directional_investLP(grid, node, node) "Transfer links with with continuous investments allowed"
    gn2n_directional_investMIP(grid, node, node) "Transfer links with with integer investments allowed"
69
    gn2n_timeseries(grid, node, node, param_gnn) "Transfer links with time series enabled for certain parameters"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
70
71
72
73
    gnu(grid, node, unit) "Units in specific nodes of particular energy grids"
    gnu_input(grid, node, unit) "Forms of energy the unit uses as endogenous inputs"
    gnu_output(grid, node, unit) "Forms of energy the unit uses as endogenous outputs"
    nu(node, unit) "Units attached to particular nodes"
74
    nu_startup(node, unit) "Units consuming energy from particular nodes in start-up"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
75
76
77
78
    gn_state(grid, node) "Nodes with a state variable"
    gn_stateSlack(grid, node) "Nodes with a state slack variable"
    gnn_state(grid, node, node) "Nodes with state variables interconnected via diffusion"
    gnn_boundState(grid, node, node) "Nodes with state variables bound by other nodes"
79
    gn2gnu(grid, node, grid, node, unit) "Conversions between energy grids by specific units"
80
81

* --- Reserve types -----------------------------------------------------------
82
83
    restype "Reserve types"
    restypeDirection(restype, up_down) "Different combinations of reserve types and directions"
84
85
86
    restypeDirectionGridNode(restype, up_down, grid, node) "Nodes with up/down reserve requirements"
    resTypeDirectionGridNodeNode(restype, up_down, grid, node, node) "Node node connections that can transfer up/down reserves"
    restypeDirectionGroup(restype, up_down, group) "Groups with up/down reserve requirements"
87
    restypeDirectionGridNodeGroup(restype, up_down, grid, node, group)
88
    gnuRescapable(restype, up_down, grid, node, unit) "Units capable and available to provide particular up/down reserves"
89
    gnuOfflineRescapable(restype, grid, node, unit) "Units capable and available to provide offline reserves"
Niina Helistö's avatar
Niina Helistö committed
90
    restypeReleasedForRealization(restype) "Reserve types that are released for the realized time intervals"
Ciara O'Dwyer's avatar
Ciara O'Dwyer committed
91
92
    offlineRes (restype) "Reserve types where offline reserve provision possible"
    offlineResUnit (unit) "Units where offline reserve provision possible"
93
    restype_inertia(restype) "Reserve types where the requirement can also be fulfilled with the inertia of synchronous machines"
94
    groupRestype(group, restype) "Groups with reserve requirements"
95

Niina Helistö's avatar
Niina Helistö committed
96
* --- Sets to define time, forecasts and samples ------------------------------
97
    $$include '%input_dir%/timeAndSamples.inc'
98
    m(mType) "model(s) in use"
99
100
    t_full(t) "Full set of time steps in the current model"
    t_current(t) "Set of time steps within the current solve horizon"
Topi Rasku's avatar
Topi Rasku committed
101
    t_active(t) "Set of active t:s within the current solve horizon, including necessary history"
102
    t_invest(t) "Time steps when investments can be made"
Erkka Rinne's avatar
Erkka Rinne committed
103
    t_realized(t) "Set of realized time steps in the simulation"
104
    tt(t) "Temporary subset for time steps used for calculations"
105
    tt_(t) "Another temporary subset for time steps used for calculations"
106
    tt_block(counter, t) "Temporary time step subset for storing the time interval blocks"
107
    tt_interval(t) "Temporary time steps when forming the ft structure, current sample"
108
    tt_forecast(t) "Temporary subset for time steps used for forecast updating during solve loop"
109
    tt_aggregate(t, t) "Time steps included in each active time step for time series aggregation"
110
111
    mf(mType, f) "Forecasts present in the models"
    ms(mType, s) "Samples present in the models"
Niina Helistö's avatar
Niina Helistö committed
112
113
    mst_start(mType, s, t) "Start point of samples"
    mst_end(mType, s, t) "Last point of samples"
114
    ft(f, t) "Combination of forecasts and t:s in the current solve"
115
    ft_realized(f, t) "Realized ft"
116
    ft_realizedNoReset(f, t) "Full set of realized ft, facilitates calculation of results"
117
    ft_reservesFixed(group, restype, f, t) "Forecast-time steps with reserves fixed due to commitments on a previous solve."
118
119
    mft(mType, f, t) "Combination of forecasts and t:s in the current model solve"
    msf(mType, s, f) "Combination of samples and forecasts in the models"
120
    msft(mType, s, f, t) "Combination of models, samples, forecasts and t's"
121
    mst(mType, s, t) "Combination of models samples and t's"
122
    sft(s, f, t) "Combination of samples, forecasts and t's in the current model solve"
123
124
    sft_realized(s, f, t) "Realized sft"
    sft_realizedNoReset(s, f, t) "Full set of realized sft, facilitates calculation of results"
Niina Helistö's avatar
Niina Helistö committed
125
    msft_realizedNoReset(mType, s, f, t) "Combination of realized samples, forecasts and t:s in the current model solve and previously realized t:s"
126
    mft_start(mType, f, t) "Start point of the current model solve"
Erkka Rinne's avatar
Erkka Rinne committed
127
    mf_realization(mType, f) "Realization of the forecasts"
128
    mf_central(mType, f) "Forecast that continues as sample(s) after the forecast horizon ends"
129
    mf_scenario(mType, f) "Forecast label that is used for long-term scenario data"
130
131
    ms_initial(mType, s) "Sample that presents the realized/forecasted period"
    ms_central(mType, s) "Sample that continues the central forecast after the forecast horizon ends"
132
    mft_lastSteps(mType, f, t) "Last interval of the current model solve"
133
    modelSolves(mType, t) "when different models are to be solved"
134
135
    f_solve(f) "forecasts in the model to be solved next"
    t_latestForecast(t) "t for the latest forecast that is available"
136
137
    gnss_bound(grid, node, s, s) "Bound the samples so that the node state at the last interval of the first sample equals the state at the first interval of the second sample"
    uss_bound(unit, s, s) "Bound the samples so that the unit online state at the last interval of the first sample equals the state at the first interval of the second sample"
138
    s_active(s) "Samples with non-zero probability in the current model solve"
139
140
    ss(s, s) "Previous sample of sample"
    s_prev(s) "Temporary set for previous sample"
141
$if defined scenario
142
    s_scenario(s, scenario) "Which samples belong to which scenarios"
143
144
    gn_forecasts(*, node, timeseries) "Which grid/flow, node and timeseries use short-term forecasts"
    gn_scenarios(*, node, timeseries) "Which grid/flow, node and timeseries have data for long-term scenarios"
145

146
147
148
    mz(mType, z) "z periods in the models"
    zs(z, s) "relationship between the z-periods and samples"

149
* --- Sets used for the changing unit aggregation and efficiency approximations as well as unit lifetimes
150
151
152
153
    uft(unit, f, t) "Active units on intervals, enables aggregation of units for later intervals"
    uft_online(unit, f, t) "Units with any online and startup variables on intervals"
    uft_onlineLP(unit, f, t) "Units with LP online and startup variables on intervals"
    uft_onlineMIP(unit, f, t) "Units with MIP online and startup variables on intervals"
154
155
    uft_onlineLP_withPrevious(unit,f,t) "Units with LP online and startup variables on intervals, including t0"
    uft_onlineMIP_withPrevious(unit,f,t) "Units with MIP online and startup variables on intervals, including t0"
156
157
    uft_startupTrajectory(unit, f, t) "Units with start-up trajectories on intervals"
    uft_shutdownTrajectory(unit, f, t) "Units with shutdown trajectories on intervals"
158
    uft_aggregator_first(unit, f, t) "The first intervals when aggregator units are active"
159
*    nuft(node, unit, f, t) "Enables aggregation of nodes and units for later intervals"
160
    gnuft(grid, node, unit, f, t) "Enables aggregation of nodes and units for later intervals"
161
    gnuft_ramp(grid, node, unit, f, t) "Units with ramp requirements or costs"
162
    gnuft_rampCost(grid, node, unit, slack, f, t) "Units with ramp costs"
163
164
165
166
167
168
    suft(effSelector, unit, f, t) "Selecting conversion efficiency equations"
    sufts(effSelector, unit, f, t, effSelector) "Selecting conversion efficiency equations"
    effGroup(effSelector) "Group name for efficiency selector set, e.g. DirectOff and Lambda02"
    effGroupSelector(effSelector, effSelector) "Efficiency selectors included in efficiency groups, e.g. Lambda02 contains Lambda01 and Lambda02."
    effLevelGroupUnit(effLevel, effSelector, unit) "What efficiency selectors are in use for each unit at each efficiency representation level"
    effGroupSelectorUnit(effSelector, unit, effSelector) "Group name for efficiency selector set, e.g. Lambda02 contains Lambda01 and Lambda02"
169
    mSettingsReservesInUse(mType, restype, up_down) "Reserves that are used in each model type"
170
171
172
    unitCounter(unit, counter) "Counter used for restricting excessive looping over the counter set when defining unit startup/shutdown/online time restrictions"
    runUpCounter(unit, counter) "Counter used for unit run-up intervals"
    shutdownCounter(unit, counter) "Counter used for unit shutdown intervals"
173
    utAvailabilityLimits(unit, t, availabilityLimits) "Time step when the unit becomes available/unavailable, e.g. because of technical lifetime"
174

Niina Helistö's avatar
Niina Helistö committed
175
* --- Sets used for grouping of units, transfer links, nodes, etc. ------------
176
    uGroup(unit, group) "Units in particular groups"
177
    gnuGroup(grid, node, unit, group) "Combination of grids, nodes and units in particular groups"
178
    gn2nGroup(grid, node, node, group) "Transfer links in particular groups"
179
    gnGroup(grid, node, group) "Combination of grids and nodes in particular groups"
180
    sGroup(s, group) "Samples in particular groups"
181

Niina Helistö's avatar
Niina Helistö committed
182
* --- Set of timeseries that will be read from files between solves -----------
183
    mTimeseries_loop_read(mType, timeseries) "Those time series that will be read between solves"
184
;
185
* Set initial values to avoid errors when checking if parameter contents have been loaded from input data
186
187
188
Option clear = modelSolves;
Option clear = ms;
Option clear = mf;
189
mf_realization(mType, 'f00') = yes;
190
Option clear = mf_scenario;
191
Option clear = gn_scenarios;
192
Option clear = mTimeseries_loop_read;
193
Option clear = mSettingsReservesInUse;
194

195
196
alias(m, mSolve);
alias(t, t_, t__, tSolve, tFuel);
197
198
alias(f, f_, f__);
alias(s, s_, s__);
Juha Kiviluoma's avatar
Juha Kiviluoma committed
199
alias(grid, grid_, grid_output);
200
alias(unit, unit_);
201
alias(node, from_node, to_node, node_, node_input, node_output, node_fail, node_left, node_right);
Juha Kiviluoma's avatar
Juha Kiviluoma committed
202
alias(effSelector, effSelector_);
203
204
205
206
207
alias(effDirect, effDirect_);
alias(effDirectOff, effDirectOff_);
alias(effDirectOn, effDirectOn_);
alias(effLambda, effLambda_);
alias(lambda, lambda_, lambda__);
208
alias(op, op_, op__);
209
alias(hrop, hrop_, hrop__);
210
alias(eff, eff_, eff__);
211
alias(hr, hr_, hr__);
212
alias(commodity, commodity_);
213
alias(effLevel, effLevel_);
214
alias(restype, restype_);
215
alias(group, group_);
216
217
218
219
220
221
222
223


*if(active('rampSched'),
  $$include inc/rampSched/sets_rampSched.gms
*);



224

225
sets
226
227
228
229
230
231
232
233
234
    tt_agg_circular(t, t, t) "Alternative aggregation ordering with embedded circulars"
    startp(t) "Temporary subset for time steps"
    s_realized(s) "All s among realized sft (redundant if always equivalent to s)"
    sft_resdgn(restype, up_down, grid, node, s,f,t) "Temporary tuplet for reserves by restypeDirectionGridNode"
;