1c_parameters.gms 13.1 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
* --- Internal counters -------------------------------------------------------
Scalars
    errorcount /0/
21
    solveCount /0/
22
23
    tSolveFirst "counter (ord) for the first t in the solve"
    tSolveLast "counter for the last t in the solve"
24
    tCounter "counter for t" /0/
Juha Kiviluoma's avatar
Juha Kiviluoma committed
25
    lastCounter "last member in use of the general counter"
26
    continueLoop "Helper to stop the looping early"
27
    currentForecastLength "Length of the forecast in the curren solve, minimum of unchanging and decreasing forecast lengths"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
28
29
    count "General counter"
    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
47
* --- Power plant and fuel data -----------------------------------------------
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
51
    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"
52
    p_gnuBoundaryProperties(grid, node, unit, slack, param_gnuBoundaryProperties) "Properties for unit boundaries where energy type matters"
53
    p_unit(unit, param_unit) "Unit data where energy type does not matter"
54
    p_gnReserves(grid, node, restype, *) "Data defining the reserve rules in each node"
55
    p_groupReserves(group, restype, *) "Data defining the reserve rules in each node group"
56
57
    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"
58
59
60
    p_gnuReserves(grid, node, unit, restype, *) "Reserve provision data for units"
    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)"
61
    p_gnPolicy(grid, node, param_policy, *) "Policy data for grid, node"
62
63
    p_groupPolicy(group, param_policy) "Two-dimensional policy data for groups"
    p_groupPolicy3D(group, param_policy, *) "Three-dimensional policy data for groups"
64
    p_fuelPrice(fuel, param_fuelPrice) "Fuel price parameters"
65
    p_fuelEmission(fuel, emission) "Fuel emission content"
Juha Kiviluoma's avatar
Juha Kiviluoma committed
66
    p_uFuel(unit, param_fuel, fuel, param_unitFuel) "Parameters interacting between units and fuels"
67
    p_unitFuelEmissionCost(unit, fuel, emission) "Emission costs for each unit, calculated from input data"
68
69
    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)"
70
    p_uNonoperational(unit, starttype, min_max) "Non-operational time after being shut down before start up"
71
    p_uStartup(unit, starttype, cost_consumption) "Startup cost and fuel consumption"
72
    p_u_maxOutputInLastRunUpInterval(unit) "Maximum output in the last interval for the run-up to min. load (p.u.)"
73
    p_u_maxRampSpeedInLastRunUpInterval(unit) "Maximum ramp speed in the last interval for the run-up to min. load (p.u.)"
74
75
    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"
76
77
    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.)"
78
    p_u_maxOutputInFirstShutdownInterval(unit) "Maximum output in the first interval for the shutdown from min. load (p.u.)"
79
    p_uShutdown(unit, cost_consumption) "Shutdown cost per unit"
80
    p_u_shutdownTimeIntervals(unit) "Time steps required for the shutdown phase"
81
    p_u_shutdownTimeIntervalsCeil(unit) "Floor of time steps required for the shutdown phase"
82
83
    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.)"
84
85
    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)"
86
// Time dependent unit & fuel parameters
87
88
89
    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"
90
// Alias used for interval aggregation
91
92
93
    ts_unit_(unit, param_unit, f, t)
*    ts_effUnit_(effSelector, unit, effSelector, param_eff, f, t)
*    ts_effGroupUnit_(effSelector, unit, param_eff, f, t)
94
95
96
97
;

* --- Probability -------------------------------------------------------------
Parameters
98
99
100
101
    p_msWeight(mType, s) "Weight of sample"
    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"
102
    p_sProbability(s) "Probability of sample"
103
$if defined scenario
104
    p_scenProbability(scenario) "Probability of scenarios"
105
106
;

107
$if declared p_scenProbability
108
109
Option clear = p_scenProbability;  // Initialize with empty data

110
111
112
113
Scalar p_sWeightSum "Sum of sample weights";

* --- Model structure ---------------------------------------------------------
Parameters
114
    // Time displacement arrays
115
    dt(t) "Displacement needed to reach the previous time interval (in time steps)"
116
    dt_circular(t) "Circular t displacement if the time series data is not long enough to cover the model horizon"
117
    dt_next(t) "Displacement needed to reach the next time interval (in time steps)"
118
    dt_active(t) "Displacement needed to reach the corresponding active time interval from any time interval (in time steps)"
119
120
121
122
123
    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)"
124
    dt_trajectory(counter) "Run-up/shutdown trajectory time index displacement"
125
    dt_scenarioOffset(*, node, *, s) "Time offset to make periodic time series data (for grid/flow, unit, label) to go into different scenarios"
126
127

    // Forecast displacement arrays
128
129
    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"
130
    df_reserves(grid, node, restype, f, t) "Forecast index displacement needed to reach the realized forecast when committing reserves"
131
    df_reservesGroup(group, restype, f, t) "Forecast index displacement needed to reach the realized forecast when committing reserves"
132
    df_scenario(f, t) "Forecast index displacement needed to get central forecast data for long-term scenarios"
133

134
135
136
137
    // 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"

138
    // Temporary displacement arrays
139
    ddt(t) "Temporary time displacement array"
140
141
    ddf(f) "Temporary forecast displacement array"
    ddf_(f) "Temporary forecast displacement array"
142

143
    // Other
144
    p_slackDirection(param_gnBoundaryTypes) "+1 for upward slacks and -1 for downward slacks"
145
146
147
148
    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"
149
    tOrd(t) "Order of t"
150
151
152
153
;

* --- Stochastic data parameters ----------------------------------------------
Parameters
154
    // Used mostly for raw data storage
155
156
    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.)"
157
    ts_reserveDemand(restype, up_down, group, f, t) "Reserve demand in region in the time step (MW)"
158
    ts_node(grid, node, param_gnBoundaryTypes, f, t) "Fix the states of a node according to time-series form exogenous input ([v_state])"
159
    ts_fuelPriceChange(fuel, t) "Initial fuel price and consequent changes in fuel price (EUR/MWh)"
160
    ts_fuelPrice(fuel, t) "Fuel price time series (EUR/MWh)"
161
    ts_unavailability(unit, t) "Unavailability of a unit in the time step (p.u.)"
162

163
    // Aliases used in the equations after interval aggregation
164
    // NOTE: Sample dimension has to be last because of the scenario reduction algorithm
165
166
    ts_influx_(grid, node, f, t, s) "Mean external power inflow/outflow during a time step (MWh/h)"
    ts_cf_(flow, node, f, t, s) "Mean available capacity factor time series (p.u.)"
167
    ts_reserveDemand_(restype, up_down, group, f, t) "Mean reserve demand in region in the time step (MW)"
168
169
    ts_node_(grid, node, param_gnBoundaryTypes, f, t, s) "Mean value of ts_node"
    ts_fuelPrice_(fuel, t) "Mean fuel price time during time step (EUR/MWh)"
170

171
    // Aliases used for updating data in inputsLoop.gms
172
173
174
    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)
175
176
    ts_influx_update(grid, node, f, t)
    ts_cf_update(flow, node, f, t)
177
    ts_reserveDemand_update(restype, up_down, group, f, t)
178
179
180
    ts_node_update(grid, node, param_gnBoundaryTypes, f, t)
    ts_fuelPriceChange_update(fuel, t)
    ts_unavailability_update(unit, t)
181

182
    // Help parameters for calculating smoothening of time series
183
184
    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.)"
185

186
    p_autocorrelation(*, node, timeseries) "Autocorrelation of time series for the grid/flow, node and time series type (lag = 1 time step)"
187
188

    // Bounds for scenario smoothening
189
190
    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"
191
192
;

193
194
195
* Reset values for some parameters
Options clear = ts_influx_std, clear = ts_cf_std;

196
197
* --- Other time dependent parameters -----------------------------------------
Parameters
Juha Kiviluoma's avatar
Juha Kiviluoma committed
198
    p_storageValue(grid, node, t) "Value of stored something at the end of a time step"
199
200
    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"
201
;