1a_definitions.gms 20.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
19
20
21
22
23
24
* =============================================================================
* --- Model Related Set Definitions -------------------------------------------
* =============================================================================

Sets

* --- Model Related Selections ------------------------------------------------
25

26
27
28
29
    mType "model types in the Backbone" /
        building,
        invest,
        schedule
30
        /
31
32
33
34
35
36

    mSetting "setting categories for models" /

        // General Time Structure
        t_start, // First time step for the start of simulation
        t_jump, // Number of time steps realized with each solve
37
        t_horizon, // Length of the simulation horizon in time steps (central forecast)
38
        t_end, // Last time step of the simulation
Niina Helistö's avatar
Niina Helistö committed
39
40
        loadPoint, // Load advanced basis; 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
        savePoint, // Save advanced basis; 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
41
42
43
        lastStepInIntervalBlock, // Last time step in the block of intervals with the same length
        stepsPerInterval, // Number of time steps aggregated within interval
        stepLengthInHours, // Length of one time step in hours
44
45
46
47

        // Samples and Forecasts
        samples, // Number of active samples
        forecasts, // Number of active forecasts
48
49
        t_forecastLengthUnchanging, // Length of forecasts in time steps - this does not decrease when the solve moves forward (requires forecast data that is longer than the horizon at first)
        t_forecastLengthDecreasesFrom, // Length of forecasts in time steps - this decreases when the solve moves forward until the new forecast data is read (then extends back to full length)
50
51
        t_forecastStart, // Time step for first reading the forecasts (not necessarily t_start)
        t_forecastJump, // Number of time steps between each update of the forecasts
52
        t_improveForecast "Number of time steps ahead of time on which the forecast is improved on each solve"
53
        sampleLength   "Length of sample in time steps for creating stocahstic scenarios from time series data"
54
55

        // Features
56
        t_trajectoryHorizon, // Length of the horizon when start-up and shutdown trajectories are considered (in time steps)
57
        t_initializationPeriod,  // Number of time steps in the beginning of the simulation which are solved but the results of which are not stored
58
        dataLength, // The maximum number of time steps in any input data time series (recommended for correctly circulating data)
Erkka Rinne's avatar
Erkka Rinne committed
59
        red_num_leaves "Desired number of preserved scenarios or leaves (SCENRED)"
60
        red_percentage "Desired relative distance (accuracy) of scenario reduction (SCENRED)"
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
    // Solve info
    solveInfoAttributes "Information about model solves" /
        modelStat
        solveStat
        totalTime
        iterations
        nodes
        numEqu
        numDVar
        numVar
        numNZ
        sumInfes
        objEst
        objVal
        /

    // !!! REDUNDANT SETS PENDING REMOVAL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    solve_info "Containers for solve information" /
        modelStat "Status of the model after solve"
        solveStat "Status of the solve"
        totalTime "Total solve time"
        iterations "Number of iteration"
        nodes "Number of nodes in the solve"
        numEqu "Number of equations in the problem"
        numDVar "Number of D variables in the problem"
        numVar "Number of variables in the problem"
        numNZ "Number of non-zeros in the problem"
        sumInfes "Sum of infeasibilities"
        objEst "Estimate for the best possible objective value"
        objVal "Objectiv value"
93
        /
94
95
96
97
98
99

* --- Efficiency Approximation Related Sets -----------------------------------

    // Efficiency Levels and Categories
    effLevel "Pre-defined levels for efficiency representation that can start from t_solve + x"
        / level1*level9 /
Juha Kiviluoma's avatar
Juha Kiviluoma committed
100
    effSelector "Select equations and lambdas/slope for efficiency calculations"
101
        / lambda01*lambda12, directOff, directOnLP, directOnMIP / // NOTE! Lambdas required first!
Juha Kiviluoma's avatar
Juha Kiviluoma committed
102
    effDirect(effSelector) "Using direct input to output equation"
103
        / directOff, directOnLP, directOnMIP /
Juha Kiviluoma's avatar
Juha Kiviluoma committed
104
105
106
    effDirectOff(effSelector) "Using direct input to output equation without online variable, i.e. constant efficiency"
        / directOff /
    effDirectOn(effSelector) "Using direct input to output equation with online variable"
107
        / directOnLP, directOnMIP /
Juha Kiviluoma's avatar
Juha Kiviluoma committed
108
109
    effLambda(effSelector) "Lambdas in use for part-load efficiency representation"
        / lambda01*lambda12 /
110
    effOnline(effSelector) "Efficiency selectors that use online variables"
111
        / directOnLP, directOnMIP, lambda01*lambda12 / // IMPORTANT! Online variables are generated based on this, so keep it up to date!
112

113
114
115
* --- General and Directional Sets --------------------------------------------

    // General Counter
116
    counter "General counter set"
117
        /c000*c999/
118
    cc(counter) "Temporary subset of counter used for calculations"
119
120

    // Directional Sets
121
122
123
    up_down "Direction set used by some variables, e.g. reserve provisions and generation ramps"
        / up, down /
    inc_dec "Increase or decrease in dummy, or slack variables"
124
        / increase, decrease /
125
126
    min_max "Minimum and maximum"
        / min, max /
127

128
129
130
131
132
133
134
* --- Model Feature Sets ------------------------------------------------------

    // Unit Startup Related Sets
    starttype "Startup types" /
        hot "Hot start"
        warm "Warm start"
        cold "Cold start"
135
136
137
        /
    starttypeConstrained(starttype) "Startup types with constrained maximum non-opearational time"
        / hot, warm /
138
139
    cost_consumption "Startup cost or startup fuel consumption"
        / cost, consumption /
140

141
142
    // Other Features
    feature "Set of optional model features" /
143
*        findStorageStart "Solve for optimal storage start levels" // NOT IMPLEMENTED
144
        storageValue     "Use storage value instead of fixed control"
145
146
147
148
*        storageEnd       "Expected storage end levels greater than starting levels" // NOT IMPLEMENTED
*        addOn            "Use StoSSch as a storage add-on to a larger model" // NOT IMPLEMENTED
*        extraRes         "Use extra tertiary reserves for error in elec. load during time step" // NOT IMPLEMENTED
*        rampSched        "Use power based scheduling" // PARTIALLY IMPLEMENTED
149
        scenRed          "Reduce number of long-tem scenarios using GAMS SCENRED2"
150
151
        checkUnavailability "Take into account ts_unit unavailability data"
         /
152
153
154
155
156
157
158
159
* --- Set to declare time series that will be read between solves ------------------------------------------------------
    timeseries "Names of time series that could be loop read from files between solves" /
        ts_unit
        ts_effUnit
        ts_effGroupUnit
        ts_influx
        ts_cf
        ts_reserveDemand
160
        ts_node
161
162
163
164
165
        ts_fuelPriceChange
        ts_fuelPrice
        ts_unavailability
        /

166
167
168
169
170
171
172
173
174
; // END Sets

* =============================================================================
* --- Model Parameter Definitions ---------------------------------------------
* =============================================================================

* --- Numeric Model Parameters ------------------------------------------------

// General model parameter arrays
175
Parameter
176
177
178
179
180
*    settings(mSetting)
    mSettings(mType, mSetting) "Model settings array"
    mSettingsEff(mtype, effLevel) "Model efficiency approximation array"
    mInterval(mType, mSetting, counter) "Model interval array"
    t_skip_counter "Numerical counter for solve time steps"
181
182
;

183
// Include additional parameters if found
184
185
186
187
Parameter params(*) /
$if exist 'params.inc' $include 'params.inc'
/;

188
// Features
Topi Rasku's avatar
Topi Rasku committed
189
Set active(mType, feature) "Set membership tells active model features";
190
option clear = active;
191

192
193
194
* =============================================================================
* --- Parameter Set Definitions -----------------------------------------------
* =============================================================================
195

Juha Kiviluoma's avatar
Juha Kiviluoma committed
196
197
Sets

198
199
* --- Parameter Data Related Sets ---------------------------------------------

200
param_gn  "Possible parameters for grid, node" /
201
202
    selfDischargeLoss "Self discharge rate of the node (MW/[v_state])"
    energyStoredPerUnitOfState "A possible unit conversion if v_state uses something else than MWh (MWh/[v_state])"
203
204
205
206
207
    boundStart    "A flag to bound the first t in the run using reference constant or time series"
    boundStartAndEnd "A flag that both start and end are bound using reference constant or time series"
    boundEnd      "A flag to bound last t in each solve based on the reference constant or time series"
    boundAll      "A flag to bound the state to the reference in all time steps"
    boundStartToEnd  "Force the last states to equal the first state"
208
    forecastLength "Length of forecasts in use for the node (hours). After this, the node will use the central forecast."
209
    capacityMargin "Capacity margin used in invest mode (MW)"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
210
211
/

212
213
214
215
216
217
218
219
param_gnBoundaryTypes "Types of boundaries that can be set for a node with a state variable" /
    upwardLimit   "Absolute maximum state of the node (unit depends on energyCapacity)"
    downwardLimit "Absolute minimum energy in the node (unit depends on energyCapacity)"
    upwardSlack01*upwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit depends on energyCapacity)"
    downwardSlack01*downwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit depends on energyCapacity)"
    reference     "Reference value for a state that can be used to bound a state (unit depends on energyCapacity)"
    maxSpill      "Maximum spill rate from the node (MWh/h)"
    minSpill      "Minimum spill rate from the node (MWh/h)"
220
    balancePenalty "Penalty value for violating the energy balance of that particular node (EUR/MWh) (can be interpretated as the energy price in certain settings)"
221
222
223
224
225
226
227
228
229
230
231
/

param_gnBoundaryProperties "Properties that can be set for the different boundaries" /
    useTimeSeries "A flag to use time series to set state bounds and limits"
    useConstant   "A flag to use constant to set state bounds and limits"
    deltaFromReference "The constant or the time series indicate how much the boundary deviates from reference (instead of being an absolute number)"
    constant      "A constant value for the boundary or the reference"
    slackCost     "The cost of exceeding the slack boundary"
    multiplier    "A multiplier to change the value (either constant or time series), default 1"
/

Juha Kiviluoma's avatar
Juha Kiviluoma committed
232
param_gnn "Set of possible data parameters for grid, node, node (nodal interconnections)" /
233
234
235
236
237
    transferCap   "Transfer capacity limits (MW)"
    transferCapBidirectional "Total bidirectional transfer capacity limit (MW)"
    transferLoss  "Transfer losses"
    diffCoeff     "Coefficients for energy diffusion between nodes (MW/[v_state])"
    boundStateMaxDiff "Maximum difference of node state pairs ([v_state])"
238
    transferCapInvLimit "Capacity limit for investments (MW)"
239
240
241
242
    investMIP     "A flag to make integer investment instead of continous investment (MW versus number of links)"
    unitSize      "Size of one link for integer investments (MW)"
    invCost       "Investment cost (EUR/MW)"
    annuity       "Investment annuity"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
243
244
245
/

param_gnu "Set of possible data parameters for grid, node, unit" /
246
247
    maxGen        "Maximum output capacity (MW)"
    maxCons       "Maximum loading capacity (MW)"
248
249
    useInitialGeneration     "A flag to indicate whether to fix generation for the first time step (binary)"
    initialGeneration        "Initial generation/consumption of the unit in the first time step (MW)"
250
251
    conversionFactor "Conversion factor for inputs or outputs (for changing the unit of measurement)"
    doNotOutput   "Flag for inputs that are not included in the output commodities"
252
253
254
255
256
257
258
259
260
261
262
263
    cV            "Reduction in primary output when increasing secondary output, e.g. reduction of electricity generation due to heat generation in extraction CHP (MWh_e/MWh_h)"
    maxRampUp     "Speed to ramp up (p.u./min)"
    maxRampDown   "Speed to ramp down (p.u./min)"
    upperLimitCapacityRatio  "Ratio of the upper limit of the node state and the unit capacity investment ([v_state]/MW)"
    unitSizeGen   "Output capacity of one subunit for integer investments (MW)"
    unitSizeCons  "Loading capacity of one subunit for integer investments (MW)"
    unitSizeTot   "Sum of output and loading capacity of one subunit (MW)"
    invCosts      "Investment costs (EUR/MW)"
    annuity       "Investment annuity factor"
    fomCosts      "Fixed operation and maintenance costs (EUR/MW/a)"
    inertia       "Inertia of the unit (s)"
    unitSizeMVA   "Generator MVA rating of one subunit (MVA)"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
264
/
265

266
param_gnuBoundaryProperties "Properties that can be set for the different boundaries" /
267
268
    rampLimit     "Maximum ramp speed (p.u./min)"
    rampCost      "Wear and tear cost of ramping up (EUR/MW)"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
269
/
270

Topi Rasku's avatar
Topi Rasku committed
271
param_unit "Set of possible data parameters for units" /
272
    unitCount     "Number of subunits if aggregated"
273
    outputCapacityTotal "Output capacity of the unit, calculated by summing all the outputs together by default, unless defined in data"
274
275
    unitOutputCapacityTotal "Output capacity of the unit, calculated by summing all the subunit output sizes together by default"
    availability  "Availability of given energy conversion technology (p.u.)"
276
277
    useInitialOnlineStatus   "A flag to fix the online status of a unit for the first time step (binary)"
    initialOnlineStatus      "Initial online status of the unit in the first time step (0-1)"
278
    unavailability  "Unavailability of given energy conversion technology (p.u.)"
279
280
281
282
    omCosts       "Variable operation and maintenance costs (EUR/MWh)"
    startCostCold "Variable start-up costs for cold starts excluding fuel costs (EUR/MW)"
    startCostWarm "Variable start-up costs for warm starts excluding fuel costs (EUR/MW)"
    startCostHot  "Variable start-up costs for hot starts excluding fuel costs (EUR/MW)"
283
    startFuelConsCold "Consumption of start-up fuel per cold subunit started up (MWh_fuel/MW)"
284
285
    startFuelConsWarm "Consumption of start-up fuel per warm subunit started up (MWh_fuel/MW)"
    startFuelConsHot "Consumption of start-up fuel per hot subunit started up (MWh_fuel/MW)"
286
287
288
289
    startColdAfterXhours "Offline hours after which the start-up will be a cold start (h)"
    startWarmAfterXhours "Offline hours after which the start-up will be a warm start (h)"
    rampSpeedToMinLoad "Ramping speed from start-up to minimum load (p.u./min)"
    rampSpeedFromMinLoad "Ramping speed from shutdown decision to zero load (p.u./min)"
290
291
    minOperationHours "Minimum operation time (h), prevents shutdown after startup until the defined amount of time has passed"
    minShutdownHours "Minimum shut down time (h), prevents starting up again after the defined amount of time has passed"
292
293
294
295
296
297
298
299
    SO2           "SO2 emissions (tonne per MWh_fuel)"
    NOx           "NOx emissions (tonne per MWh_fuel)"
    CH4           "CH4 emissions (tonne per MWh_fuel)"
    resTimelim    "How long should a storage be able to provide reserve (h)"
    eff00 * eff12 "Efficiency of the unit to convert input to output/intermediate product"
    opFirstCross  "The operating point where the real efficiency curve and approximated efficiency curve cross"
    op00 * op12   "Right border of the efficiency point"
    section       "Possibility to define a no load fuel use for units with zero minimum output"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
300
    level1 * level9 "Level of simplification in the part-load efficiency representation"
301
302
303
304
    useTimeseries "A flag to use time series form input for unit parameters whenever possible"
    investMIP     "A flag to make integer investment instead of continous investment"
    maxUnitCount  "Maximum number of units when making integer investments"
    minUnitCount  "Minimum number of units when making integer investments"
305
    lastStepNotAggregated "Last time step when the unit is not yet aggregated - calculated in inputsLoop.gms for units that have aggregation"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
306
/
307

308
309
310
311
312
313
314
param_eff "Parameters used for unit efficiency approximations" /
    lb      "Minimum load of the unit"
    op      "Maximum load of the unit, or the operating point of the SOS2 variable in the piecewise linear heat rate approximation (lambda)"
    section "Operational heat rate of the unit, or the SOS2 variable in the piecewise linear heat rate approximation (lambda)"
    slope   "Heat rate parameter representing no-load fuel consumption"
/

Juha Kiviluoma's avatar
Juha Kiviluoma committed
315
param_fuel "Parameters for fuels" /
316
317
    main          "Main fuel of the unit - unless input fuels defined as grids"
    startup       "Startup fuel of the unit, if exists. Can be the same as main fuel - consumption using startupFuelCons"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
318
319
320
/

param_unitFuel "Parameters for fuel limits in units" /
321
    maxFuelCons   "Maximum absolute fuel consumption in a unit - not used for start-up fuels"
322
323
    maxFuelFraction "Maximum share of a fuel in the consumption mix"   //only for main fuels
    fixedFuelFraction "Fixed share of a fuel in the consumption mix"   //only for start-up fuels
Juha Kiviluoma's avatar
Juha Kiviluoma committed
324
325
326
/

param_policy "Set of possible data parameters for grid, node, regulation" /
327
328
    emissionTax   "Emission tax (EUR/tonne)"
    emissionCap   "Emission limit (tonne)"
329
330
331
    instantaneousShareMax "Maximum instantaneous share of generation and import from a particular group of units and transfer links"
    energyShareMax "Maximum energy share of generation from a particular group of units"
    energyShareMin "Minimum energy share of generation from a particular group of units"
332
    kineticEnergyMin "Minimum system kinetic energy (MWs)"
333
334
    constrainedCapMultiplier "Multiplier a(i) for unit investments in equation Sum(i, a(i)*v_invest(i)) <= b"
    constrainedCapTotalMax "Total maximum b for unit investments in equation Sum(i, a(i)*v_invest(i)) <= b"
335
336
    constrainedOnlineMultiplier "Multiplier a(i) for online units in equation Sum(i, a(i)*v_online(i)) <= b"
    constrainedOnlineTotalMax "Total maximum b for online units in equation Sum(i, a(i)*v_online(i)) <= b"
337
338
339
340
341
342
343
344
    // Reserve related parameters, currently without a proper parameter set
    update_frequency "Frequency of updating reserve contributions"
    update_offset "Optional offset for delaying the reserve update frequency"
    gate_closure  "Number of timesteps ahead of dispatch that reserves are fixed"
    use_time_series "Flag for using time series data. !!! REDUNDANT WITH useTimeseries, PENDING REMOVAL !!!"
    reserve_length "Length of reserve horizon"
    reserveReliability "Reliability parameter of reserve provisions"
    reserve_increase_ratio "Unit output is multiplied by this factor to get the increase in reserve demand"
345
    portion_of_infeed_to_reserve "Proportion of the generation of a tripping unit that needs to be covered by reserves from other units"
346
347
/

348
349
350
351
352
353
354
355
356
357
* --- Efficiency Approximation Related Sets -----------------------------------

// Efficiency Approximation related Counters
op(param_unit) "Operating points in the efficiency curves, also functions as index for data points"
        /op00*op12/ // IMPORTANT! Has to equal the same param_unit!
eff(param_unit) "Effiency for the corresponding operating point ('op') in the efficiency curves, also used for data indexing"
        /eff00*eff12/ // IMPORTANT! Has to equal the same param_unit!
lambda "Lambda approximation indeces"
        /lambda01*lambda12/ // IMPORTANT! Has to equal effLambda!

358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
* --- Counters and Directional Sets -------------------------------------------

// Slack categories
slack(param_gnBoundaryTypes) "Categories for slack variables"
       / upwardSlack01*upwardSlack20, downwardSlack01*downwardSlack20 /
upwardSlack(slack) "Set of upward slacks"
       / upwardSlack01*upwardSlack20 /
downwardSlack(slack) "Set of downward slacks"
       / downwardSlack01*downwardSlack20 /

// Flags for boundaries
stateLimits(param_gnBoundaryTypes) "set of upward and downward state limits"
       / upwardLimit, downwardLimit /
spillLimits(param_gnBoundaryTypes) "set of upward and downward state limits"
       / maxSpill, minSpill /
useConstantOrTimeSeries(param_gnBoundaryProperties) "useTimeSeries and useConstant property together"
       / useTimeSeries, useConstant /
; // END parameter set declarations