1c_parameters.gms 14.3 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
* --- Internal counters -------------------------------------------------------
Scalars
20
    solveCount /0/
21
22
    tSolveFirst "counter (ord) for the first t in the solve"
    tSolveLast "counter for the last t in the solve"
23
    tCounter "counter for t" /0/
Juha Kiviluoma's avatar
Juha Kiviluoma committed
24
    lastCounter "last member in use of the general counter"
25
    continueLoop "Helper to stop the looping early"
26
    currentForecastLength "Length of the forecast in the curren solve, minimum of unchanging and decreasing forecast lengths"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
27
    count "General counter"
Erkka Rinne's avatar
Erkka Rinne committed
28
29
    count_lambda
    count_lambda2 "Counter for lambdas"
30
    count_sample "Counter for samples"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
31
32
    cum_slope "Cumulative for slope"
    cum_lambda "Cumulative for lambda"
33
    heat_rate "Heat rate temporary parameter"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
34
    tmp "General temporary parameter"
35
36
    tmp_ "General temporary parameter"
    tmp__ "General temporary parameter"
Topi Rasku's avatar
Topi Rasku committed
37
    tmp_dt "Temporary parameter for evaluating the necessary amount of historical timesteps"
38
39
40
    tmp_dist "Temporary parameter for calculating the distance between operating points"
    tmp_op "Temporary parameter for operating point"
    tmp_count_op "Counting the number of valid operating points in the unit data"
41
    tmp_offset "Offset of sample in time steps"
42
43
    tRealizedLast "counter (ord) for the last realized t in the solve"
    firstResultsOutputSolve /1/;
44
45
;

46
* --- Power plant and commodity data -----------------------------------------------
47
Parameters
48
49
    p_gn(grid, node, param_gn) "Properties for energy nodes"
    p_gnBoundaryPropertiesForStates(grid, node, param_gnBoundaryTypes, param_gnBoundaryProperties) "Properties of different state boundaries and limits"
50
    p_storageValue(grid, node) "Constant value of stored something at the end of a time step (EUR/<v_state_unit>)"
51
52
    p_gnn(grid, node, node, param_gnn) "Data for interconnections between energy nodes"
    p_gnu(grid, node, unit, param_gnu) "Unit data where energy type matters"
53
    p_gnu_io(grid, node, unit, input_output, param_gnu) "Unit data where energy type matters"
54
    p_gnuBoundaryProperties(grid, node, unit, slack, param_gnuBoundaryProperties) "Properties for unit boundaries where energy type matters"
55
    p_unit(unit, param_unit) "Unit data where energy type does not matter"
56
57
    p_unitConstraint(unit, constraint) "Constant for constraints (eq1-9, gt1-9) between inputs and outputs"
    p_unitConstraintNode(unit, constraint, node) "Coefficients for constraints (eq1-9, gt1-9) between inputs and outputs"
58
59
    p_gnReserves(grid, node, restype, param_policy) "Data defining the reserve rules in each node"
    p_groupReserves(group, restype, param_policy) "Data defining the reserve rules in each node group"
60
61
    p_groupReserves3D(group, restype, up_down, param_policy) "Reserve policy in each node group separately for each reserve type and direction"
    p_groupReserves4D(group, restype, up_down, group, param_policy) "Reserve policy in each node group separately for each reserve type and direction, also linking to another group"
62
    p_gnuReserves(grid, node, unit, restype, param_policy) "Reserve provision data for units"
63
64
    p_gnnReserves(grid, node, node, restype, up_down) "Reserve provision data for node node connections"
    p_gnuRes2Res(grid, node, unit, restype, up_down, restype) "The first type of reserve can be used also in the second reserve category (with a possible multiplier)"
65
    p_gnPolicy(grid, node, param_policy, *) "Policy data for grid, node"
66
67
    p_groupPolicy(group, param_policy) "Two-dimensional policy data for groups"
    p_groupPolicy3D(group, param_policy, *) "Three-dimensional policy data for groups"
68
    p_price(node, param_price) "Commodity price parameters"
69
    p_nEmission(node, emission) "Emission content (kg/MWh)"
70
    p_uStartupfuel(unit, node, param_unitStartupfuel) "Parameters for startup fuels"
71
72
    p_unStartup(unit, node, starttype) "Consumption during the start-up (MWh/start-up)"
    p_unitEmissionCost(unit, node, emission) "Emission costs for each {unit, node, emission}, calculated from input data (CUR/MWh)"
73
74
    p_effUnit(effSelector, unit, effSelector, param_eff)  "Data for piece-wise linear efficiency blocks"
    p_effGroupUnit(effSelector, unit, param_eff) "Unit data specific to a efficiency group (e.g. left border of the unit)"
75
    p_uNonoperational(unit, starttype, min_max) "Non-operational time after being shut down before start up"
76
    p_uStartup(unit, starttype, cost_consumption) "Startup cost and fuel consumption"
77
    p_u_maxOutputInLastRunUpInterval(unit) "Maximum output in the last interval for the run-up to min. load (p.u.)"
78
    p_u_maxRampSpeedInLastRunUpInterval(unit) "Maximum ramp speed in the last interval for the run-up to min. load (p.u.)"
79
80
    p_u_runUpTimeIntervals(unit) "Time steps required for the run-up phase"
    p_u_runUpTimeIntervalsCeil(unit) "Ceiling of time steps required for the run-up phase"
81
82
    p_uCounter_runUpMin(unit, counter) "Minimum output for the time steps where the unit is being started up to the minimum load (minimum output in the last interval) (p.u.)"
    p_uCounter_runUpMax(unit, counter) "Maximum output for the time steps where the unit is being started up to the minimum load (minimum output in the last interval) (p.u.)"
83
    p_u_maxOutputInFirstShutdownInterval(unit) "Maximum output in the first interval for the shutdown from min. load (p.u.)"
84
    p_uShutdown(unit, cost_consumption) "Shutdown cost per unit"
85
    p_u_shutdownTimeIntervals(unit) "Time steps required for the shutdown phase"
86
    p_u_shutdownTimeIntervalsCeil(unit) "Floor of time steps required for the shutdown phase"
87
88
    p_uCounter_shutdownMin(unit, counter) "Minimum output for the time steps where the unit is being shut down from the minimum load (minimum output in the first interval) (p.u.)"
    p_uCounter_shutdownMax(unit, counter) "Maximum output for the time steps where the unit is being shut down from the minimum load (minimum output in the first interval) (p.u.)"
89
90
    p_u_minRampSpeedInLastRunUpInterval(unit) "Minimum ramp speed in the last interval for the run-up to min. load (p.u./min)"
    p_u_minRampSpeedInFirstShutdownInterval(unit) "Minimum ramp speed in the fist interval for the shutdown from min. load (p.u./min)"
91
// Time dependent unit & commodity parameters
92
93
94
    ts_unit(unit, param_unit, f, t) "Time dependent unit data, where energy type doesn't matter"
    ts_effUnit(effSelector, unit, effSelector, param_eff, f, t) "Time dependent data for piece-wise linear efficiency blocks"
    ts_effGroupUnit(effSelector, unit, param_eff, f, t) "Time dependent efficiency group unit data"
95
// Alias used for interval aggregation
96
97
98
    ts_unit_(unit, param_unit, f, t)
*    ts_effUnit_(effSelector, unit, effSelector, param_eff, f, t)
*    ts_effGroupUnit_(effSelector, unit, param_eff, f, t)
99
100
101
102
;

* --- Probability -------------------------------------------------------------
Parameters
103
    p_msWeight(mType, s) "Temporal weight of sample: number of similar periods represented by sample s"
104
    p_msAnnuityWeight(mType, s) "Temporal weight of sample: used when calculating annuities"
105
106
107
    p_msProbability(mType, s) "Probability to reach sample conditioned on anchestor samples"
    p_mfProbability(mType, f) "Probability of forecast"
    p_msft_probability(mType, s, f, t) "Probability of forecast"
108
    p_sProbability(s) "Probability of sample"
109
$if defined scenario
110
    p_scenProbability(scenario) "Original probability of scenario"
111
112
;

113
$if declared p_scenProbability
114
115
Option clear = p_scenProbability;  // Initialize with empty data

116
117
118
119
Scalar p_sWeightSum "Sum of sample weights";

* --- Model structure ---------------------------------------------------------
Parameters
120
    // Time displacement arrays
121
    dt(t) "Displacement needed to reach the previous time interval (in time steps)"
122
    dt_circular(t) "Circular t displacement if the time series data is not long enough to cover the model horizon"
123
    dt_next(t) "Displacement needed to reach the next time interval (in time steps)"
124
    dt_active(t) "Displacement needed to reach the corresponding active time interval from any time interval (in time steps)"
125
126
127
128
129
    dt_toStartup(unit, t) "Displacement from the current time interval to the time interval where the unit was started up in case online variable changes from 0 to 1 (in time steps)"
    dt_toShutdown(unit, t) "Displacement from the current time interval to the time interval where the shutdown phase began in case generation becomes 0 (in time steps)"
    dt_starttypeUnitCounter(starttype, unit, counter) "Displacement needed to account for starttype constraints (in time steps)"
    dt_downtimeUnitCounter(unit, counter) "Displacement needed to account for downtime constraints (in time steps)"
    dt_uptimeUnitCounter(unit, counter) "Displacement needed to account for uptime constraints (in time steps)"
130
    dt_trajectory(counter) "Run-up/shutdown trajectory time index displacement"
131
    dt_scenarioOffset(*, node, *, s) "Time offset to make periodic time series data (for grid/flow, unit, label) to go into different scenarios"
132
133

    // Forecast displacement arrays
134
135
    df(f, t) "Displacement needed to reach the realized forecast on the current time step"
    df_central(f, t) "Displacement needed to reach the central forecast - this is needed when the forecast tree gets reduced in dynamic equations"
136
    df_reserves(grid, node, restype, f, t) "Forecast index displacement needed to reach the realized forecast when committing reserves"
137
    df_reservesGroup(group, restype, f, t) "Forecast index displacement needed to reach the realized forecast when committing reserves"
138
    df_scenario(f, t) "Forecast index displacement needed to get central forecast data for long-term scenarios"
139
    df_realization(f, t) "Displacement needed to reach the realized forecast on the current time step when no forecast is available"
140

141
142
143
144
    // Sample displacement arrays
    ds(s, t) "Displacement needed to reach the sample of previous time step"
    ds_state(grid, node, s, t) "Displacement needed to reach the sample of previous time step at this node"

145
    // Temporary displacement arrays
146
    ddt(t) "Temporary time displacement array"
147
148
    ddf(f) "Temporary forecast displacement array"
    ddf_(f) "Temporary forecast displacement array"
149

150
    // Other
151
    p_slackDirection(param_gnBoundaryTypes) "+1 for upward slacks and -1 for downward slacks"
152
153
154
155
    tForecastNext(mType) "When the next forecast will be available (ord time)"
    aaSolveInfo(mType, t, solveInfoAttributes) "Stores information about the solve status"
    msStart(mType, s) "Start point of samples: first time step in the sample"
    msEnd(mType, s) "End point of samples: first time step not in the sample"
156
    tOrd(t) "Order of t"
157
158
159
160
;

* --- Stochastic data parameters ----------------------------------------------
Parameters
161
    // Used mostly for raw data storage
162
163
    ts_influx(grid, node, f, t) "External power inflow/outflow during a time step (MWh/h)"
    ts_cf(flow, node, f, t) "Available capacity factor time series (p.u.)"
164
    ts_reserveDemand(restype, up_down, group, f, t) "Reserve demand in region in the time step (MW)"
165
    ts_node(grid, node, param_gnBoundaryTypes, f, t) "Fix the states of a node according to time-series form exogenous input ([v_state])"
166
    ts_storageValue(grid, node, f, t) "Timeseries value of stored something at the end of a time step (EUR/<v_state_unit>)"
167
168
    ts_priceChange(node, t) "Initial commodity price and consequent changes in commodity price (EUR/MWh)"
    ts_price(node, t) "Commodity price time series (EUR/MWh)"
169
    ts_unavailability(unit, t) "Unavailability of a unit in the time step (p.u.)"
170

171
    // Aliases used in the equations after interval aggregation
172
173
    ts_influx_(grid, node, s, f, t) "Mean external power inflow/outflow during a time step (MWh/h)"
    ts_cf_(flow, node, s, f, t) "Mean available capacity factor time series (p.u.)"
174
    ts_reserveDemand_(restype, up_down, group, f, t) "Mean reserve demand in region in the time step (MW)"
175
    ts_node_(grid, node, param_gnBoundaryTypes, s, f, t) "Mean value of ts_node"
176
    ts_storageValue_(grid, node, s, f, t) "Mean value of ts_storageValue"
177
178
    ts_vomCost_(grid, node, unit, t) "Calculated variable O&M cost that includes O&M cost, fuel cost and emission cost"
    ts_startupCost_(unit, starttype, t) "Calculated variable startup cost that includes startup cost, fuel cost and emission cost"
179

180
    // Aliases used for updating data in inputsLoop.gms
181
182
183
    ts_unit_update(unit, param_unit, f, t)
    ts_effUnit_update(effSelector, unit, effSelector, param_eff, f, t)
    ts_effGroupUnit_update(effSelector, unit, param_eff, f, t)
184
185
    ts_influx_update(grid, node, f, t)
    ts_cf_update(flow, node, f, t)
186
    ts_reserveDemand_update(restype, up_down, group, f, t)
187
    ts_node_update(grid, node, param_gnBoundaryTypes, f, t)
188
    ts_priceChange_update(node, t)
189
    ts_unavailability_update(unit, t)
190

191
    // Help parameters for calculating smoothening of time series
192
193
    ts_influx_std(grid, node, t)  "Standard deviation of ts_influx over samples"
    ts_cf_std(flow, node, t) "Standard deviation of ts_cf over samples (p.u.)"
194

195
    p_autocorrelation(*, node, timeseries) "Autocorrelation of time series for the grid/flow, node and time series type (lag = 1 time step)"
196
197

    // Bounds for scenario smoothening
198
199
    p_tsMinValue(*, node, timeseries) "Minimum allowed value of timeseries for grid/flow and node"
    p_tsMaxValue(*, node, timeseries) "Maximum allowed value of timeseries in grid/flow and node"
200
201
202

    // Help parameters for scenario reduction
    ts_energy_(s) "Total energy available from inflow and other flows (MWh)"
203
204
205
206
;

* --- Other time dependent parameters -----------------------------------------
Parameters
207
208
    p_stepLength(mType, f, t) "Length of an interval in hours"
    p_stepLengthNoReset(mType, f, t) "Length of an interval in hours - includes also lengths of previously realized intervals"
209
    p_s_discountFactor(s) "Discount factor for samples when using a multi-year horizon"
210
;