1b_sets.gms 12 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 /
21
    node "Nodes where different types of energy are converted"
22
23
24
25
26

* --- Fuels & resources -------------------------------------------------------
    emission "Emissions"
    fuel "Fuels"
    flow "Flow based energy resources (time series)"
27

28
29
* --- Energy generation and consumption ---------------------------------------
    unit "Set of generators, storages and loads"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
30
    unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
31
    unit_fuel(unit) "Units using a commercial fuel"
32
    unit_fail(unit) "Units that might fail"
33
    unit_minLoad(unit) "Units that have unit commitment restrictions (e.g. minimum power level)"
34
35
36
    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"
37
38
39
    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
40
41
    unit_slope(unit) "Units with piecewise linear efficiency constraints"
    unit_noSlope(unit) "Units without piecewise linear efficiency constraints"
42
43
    unitAggregator_unit(unit, unit) "Aggregate unit linked to aggregated units"
    unitUnitEffLevel(unit, unit, EffLevel) "Aggregator unit linke to aggreted units with a definition when to start the aggregation"
44
    flowUnit(flow, *) "Units or storages linked to a certain energy flow time series"
45
    unitUnittype(unit, *) "Link generation technologies to types"
46
    unitStarttype(unit, starttype) "Units with special startup properties"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
47
    uFuel(unit, param_fuel, fuel) "Units linked with fuels"
48
    unittype "Unit technology types"
49
50
    unit_investLP(unit) "Units with continuous investments allowed"
    unit_investMIP(unit) "Units with integer investments allowed"
51

Niina Helistö's avatar
Niina Helistö committed
52
* --- Nodes -------------------------------------------------------------------
53
54
    node_spill(node) "Nodes that can spill; used to remove v_spill variables where not relevant"
    flowNode(flow, node) "Nodes with flows"
55

Niina Helistö's avatar
Niina Helistö committed
56
* --- Sets bounding geography and units ---------------------------------------
Juha Kiviluoma's avatar
Juha Kiviluoma committed
57
58
    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.
59
    gn2n(grid, node, node) "All (directional) transfer links between nodes in specific energy grids"
60
    gn2n_directional(grid, node, node) "Transfer links with positive rightward transfer and negative leftward transfer"
Niina Helistö's avatar
Niina Helistö committed
61
62
    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"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
63
64
65
66
67
68
69
70
    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"
    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"
71
    gn2gnu(grid, node, grid, node, unit) "Conversions between energy grids by specific units"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
72
73
    gngnu_fixedOutputRatio(grid, node, grid, node, unit) "Units with a fixed ratio between two different grids of output (e.g. backpressure)"
    gngnu_constrainedOutputRatio(grid, node, grid, node, unit) "Units with a constrained ratio between two different grids of output (e.g. extraction)"
74
75

* --- Reserve types -----------------------------------------------------------
76
77
    restype "Reserve types"
    restypeDirection(restype, up_down) "Different combinations of reserve types and directions"
78
    restypeDirectionNode(restype, up_down, node) "Nodes with reserve requirements"
79
    resTypeDirectionNodeNode(restype, up_down, node, node) "Node node connections that can transfer reserves"
80
    nuRescapable(restype, up_down, node, unit) "Units capable and available to provide particular reserves"
Niina Helistö's avatar
Niina Helistö committed
81
    restypeReleasedForRealization(restype) "Reserve types that are released for the realized time intervals"
82

Niina Helistö's avatar
Niina Helistö committed
83
* --- Sets to define time, forecasts and samples ------------------------------
84
    $$include '%input_dir%/timeAndSamples.inc'
85
    m(mType) "model(s) in use"
86
87
    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
88
    t_active(t) "Set of active t:s within the current solve horizon, including necessary history"
89
90
    t_invest(t) "Time steps when investments can be made"
    tt(t) "Temporary subset for time steps used for calculations"
91
    tt_block(counter, t) "Temporary time step subset for storing the time interval blocks"
92
    tt_interval(t) "Temporary time steps when forming the ft structure, current sample"
93
    tt_forecast(t) "Temporary subset for time steps used for forecast updating during solve loop"
94
95
    mf(mType, f) "Forecasts present in the models"
    ms(mType, s) "Samples present in the models"
Niina Helistö's avatar
Niina Helistö committed
96
97
    mst_start(mType, s, t) "Start point of samples"
    mst_end(mType, s, t) "Last point of samples"
98
    ft(f, t) "Combination of forecasts and t:s in the current solve"
99
    ft_realized(f, t) "Realized ft"
100
    ft_realizedNoReset(f, t) "Full set of realized ft, facilitates calculation of results"
101
    ft_reservesFixed(node, restype, f, t) "Forecast-time steps with reserves fixed due to commitments on a previous solve."
102
103
    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"
104
105
    msft(mType, s, f, t) "Combination of models, samples, forecasts and t's"
    sft(s, f, t) "Combination of samples, forecasts and t's in the current model solve"
106
107
    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
108
    msft_realizedNoReset(mType, s, f, t) "Combination of realized samples, forecasts and t:s in the current model solve and previously realized t:s"
109
    mft_start(mType, f, t) "Start point of the current model solve"
110
111
112
113
    mf_realization(mType, f) "fRealization of the forecasts"
    mf_central(mType, f) "Forecast that continues as sample(s) after the forecast horizon ends"
    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"
114
    mft_lastSteps(mType, f, t) "Last interval of the current model solve"
115
    modelSolves(mType, t) "when different models are to be solved"
116
117
    f_solve(f) "forecasts in the model to be solved next"
    t_latestForecast(t) "t for the latest forecast that is available"
118
    gnss_bound(grid, node, s, s) "Bound the samples so that the state at the last interval of the first sample equals the state at the first interval of the second sample"
119
    s_parallel(s) "Samples which are treated as parallel"
120
    s_active(s) "Samples with non-zero probability in the current model solve"
121
122
    ss(s, s) "Previous sample of sample"
    s_prev(s) "Temporary set for previous sample"
123
    longtermSamples(*, node, *) "Which grid/flow, node and timeseries/param have data for long-term scenarios"
124

125
* --- Sets used for the changing unit aggregation and efficiency approximations
126
127
128
129
    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"
130
131
    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"
132
133
    uft_startupTrajectory(unit, f, t) "Units with start-up trajectories on intervals"
    uft_shutdownTrajectory(unit, f, t) "Units with shutdown trajectories on intervals"
134
    uft_aggregator_first(unit, f, t) "The first intervals when aggregator units are active"
135
136
    nuft(node, unit, f, t) "Enables aggregation of nodes and units for later intervals"
    gnuft(grid, node, unit, f, t) "Enables aggregation of nodes and units for later intervals"
137
    gnuft_ramp(grid, node, unit, f, t) "Units with ramp requirements or costs"
138
    gnuft_rampCost(grid, node, unit, slack, f, t) "Units with ramp costs"
139
140
141
142
143
144
    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"
145
    mSettingsReservesInUse(mType, *, up_down) "Reserves that are used in each model type"
146
147
148
    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"
149

Niina Helistö's avatar
Niina Helistö committed
150
* --- Sets used for grouping of units, transfer links, nodes, etc. ------------
151
    group "A group of units, transfer links, nodes, etc."
152
    uGroup(unit, group) "Units in particular groups"
153
    gnuGroup(grid, node, unit, group) "Combination of grids, nodes and units in particular groups"
154
    gn2nGroup(grid, node, node, group) "Transfer links in particular groups"
155
    gnGroup(grid, node, group) "Combination of grids and nodes in particular groups"
156

Niina Helistö's avatar
Niina Helistö committed
157
* --- Set of timeseries that will be read from files between solves -----------
158
    mTimeseries_loop_read(mType, timeseries) "Those time series that will be read between solves"
159
;
160
* Set initial values to avoid errors when checking if parameter contents have been loaded from input data
161
162
163
Option clear = modelSolves;
Option clear = ms;
Option clear = mf;
164
mf_realization(mType, 'f00') = yes;
165
Option clear = longtermSamples;
166

167
168
alias(m, mSolve);
alias(t, t_, t__, tSolve, tFuel);
169
170
alias(f, f_, f__);
alias(s, s_, s__);
Juha Kiviluoma's avatar
Juha Kiviluoma committed
171
alias(grid, grid_, grid_output);
172
alias(unit, unit_);
173
alias(node, from_node, to_node, node_, node_input, node_output);
Juha Kiviluoma's avatar
Juha Kiviluoma committed
174
175
alias(node, from_node, to_node);
alias(effSelector, effSelector_);
176
177
178
179
180
alias(effDirect, effDirect_);
alias(effDirectOff, effDirectOff_);
alias(effDirectOn, effDirectOn_);
alias(effLambda, effLambda_);
alias(lambda, lambda_, lambda__);
181
alias(op, op_, op__);
182
alias(eff, eff_, eff__);
183
alias(fuel, fuel_);
184
alias(effLevel, effLevel_);
185
alias(restype, restype_);
186
187
188
189
190
191
192
193


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



194