* --- Define Time Step Intervals ----------------------------------------------
...
...
@@ -109,6 +107,7 @@ if (mType('schedule'),
mSettings('schedule', 't_forecastStart') = 1; // At which time step the first forecast is available ( 1 = t000001 )
mSettings('schedule', 't_forecastLengthUnchanging') = 36; // 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)
mSettings('schedule', 't_forecastLengthDecreasesFrom') = 168; // 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)
mSettings('schedule', 't_perfectForesight') = 0; // How many time steps after there is perfect foresight (including t_jump)
mSettings('schedule', 't_forecastJump') = 24; // How many time steps before new forecast is available
mSettings('schedule', 't_improveForecast') = 0; // Number of time steps ahead of time that the forecast is improved on each solve.
tt_block(counter, t) "Temporary time step subset for storing the time interval blocks"
tt_interval(t) "Temporary time steps when forming the ft structure, current sample"
tt_forecast(t) "Temporary subset for time steps used for forecast updating during solve loop"
tt_aggregate(t, t) "Time steps included in each active time step for time series aggregation"
mf(mType, f) "Forecasts present in the models"
ms(mType, s) "Samples present in the models"
mst_start(mType, s, t) "Start point of samples"
...
...
@@ -106,12 +107,14 @@ Sets
msf(mType, s, f) "Combination of samples and forecasts in the models"
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"
fts(f, t, s) "Like `sft` but different order"
sft_realized(s, f, t) "Realized sft"
sft_realizedNoReset(s, f, t) "Full set of realized sft, facilitates calculation of results"
msft_realizedNoReset(mType, s, f, t) "Combination of realized samples, forecasts and t:s in the current model solve and previously realized t:s"
mft_start(mType, f, t) "Start point of the current model solve"
mf_realization(mType, f) "fRealization of the forecasts"
mf_realization(mType, f) "Realization of the forecasts"
mf_central(mType, f) "Forecast that continues as sample(s) after the forecast horizon ends"
mf_scenario(mType, f) "Forecast label that is used for long-term scenario data"
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"
mft_lastSteps(mType, f, t) "Last interval of the current model solve"
...
...
@@ -121,9 +124,9 @@ Sets
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"
s_active(s) "Samples with non-zero probability in the current model solve"
s_stochastic(s) "Samples used for stochastic programming"
ss(s, s) "Previous sample of sample"
s_prev(s) "Temporary set for previous sample"
$if defined scenario
s_scenario(s, scenario) "Which samples belong to which scenarios"
gn_scenarios(*, node, *) "Which grid/flow, node and timeseries/param have data for long-term scenarios"
p_mfProbability(mType, f) "Probability of forecast"
p_msft_probability(mType, s, f, t) "Probability of forecast"
p_sProbability(s) "Probability of sample"
$if defined scenario
p_scenProbability(scenario) "Probability of scenarios"
;
$if declared p_scenProbability
Option clear = p_scenProbability; // Initialize with empty data
Scalar p_sWeightSum "Sum of sample weights";
* --- Model structure ---------------------------------------------------------
...
...
@@ -108,7 +112,7 @@ Parameters
dt(t) "Displacement needed to reach the previous time interval (in time steps)"
dt_circular(t) "Circular t displacement if the time series data is not long enough to cover the model horizon"
dt_next(t) "Displacement needed to reach the next time interval (in time steps)"
dtt(t, t) "Displacement needed to reach any previous time interval (in time steps)"
dt_active(t) "Displacement needed to reach the corresponding active time interval from any time interval (in time steps)"
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)"
...
...
@@ -121,7 +125,7 @@ Parameters
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"
df_reserves(node, restype, f, t) "Forecast index displacement needed to reach the realized forecast when committing reserves"
df_scenario(f, t) "Forecast index displacement needed to get realized scenario data for long-term scenarios"
df_scenario(f, t) "Forecast index displacement needed to get central forecast data for long-term scenarios"
// Sample displacement arrays
ds(s, t) "Displacement needed to reach the sample of previous time step"
...
...
@@ -133,7 +137,7 @@ Parameters
ddf_(f) "Temporary forecast displacement array"
// Other
p_slackDirection(slack) "+1 for upward slacks and -1 for downward slacks"
p_slackDirection(param_gnBoundaryTypes) "+1 for upward slacks and -1 for downward slacks"
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"
...
...
@@ -172,18 +176,19 @@ Parameters
ts_unavailability_update(unit, t)
// Help parameters for calculating smoothening of time series
ts_influx_mean(grid, node, t) "Mean of ts_influx over samples"
ts_influx_std(grid, node, t) "Standard deviation of ts_influx over samples"
ts_cf_mean(flow, node, t) "Mean of ts_cf over samples (p.u.)"
ts_cf_std(flow, node, t) "Standard deviation of ts_cf over samples (p.u.)"
p_autocorrelation(*, node, timeseries) "Autocorrelation of time series for the grid/flow, node and time series type (lag = 1 time step)"
// Bounds for scenario smoothening
p_tsMinValue(node, timeseries)
p_tsMaxValue(node, timeseries)
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"
;
* Reset values for some parameters
Options clear = ts_influx_std, clear = ts_cf_std;
* --- Other time dependent parameters -----------------------------------------
Parameters
p_storageValue(grid, node, t) "Value of stored something at the end of a time step"
v_transfer(grid, node, node, s, f, t) "Average electricity transmission level from node to node during an interval (MW)"
;
Integer variables
v_startup_MIP(unit, starttype, s, f, t) "Sub-units started up after/during an interval (p.u.), (MIP variant)"
v_shutdown_MIP(unit, s, f, t) "Sub-units shut down after/during an interval (p.u.) (MIP variant)"
v_online_MIP(unit, s, f, t) "Number of sub-units online for units with unit commitment restrictions"
v_invest_MIP(unit, t) "Number of invested sub-units"
v_investTransfer_MIP(grid, node, node, t) "Number of invested transfer links"
...
...
@@ -35,8 +37,8 @@ SOS2 variables
;
Positive variables
v_fuelUse(fuel, unit, s, f, t) "Fuel use of a unit during an interval (MWh_fuel)"
v_startup(unit, starttype, s, f, t) "Sub-units started up after/during an interval (p.u.)"
v_shutdown(unit, s, f, t) "Sub-units shut down after/during an interval (p.u.)"
v_startup_LP(unit, starttype, s, f, t) "Sub-units started up after/during an interval (p.u.), (LP variant)"
v_shutdown_LP(unit, s, f, t) "Sub-units shut down after/during an interval (p.u.) (LP variant)"
v_genRampUpDown(grid, node, unit, slack, s, f, t) "Change in energy generation or consumption over an interval, separated into different 'slacks' (MW/h)"
v_spill(grid, node, s, f, t) "Spill of energy from storage node during an interval (MWh)"
v_transferRightward(grid, node, node, s, f, t) "Average electricity transmission level from the first node to the second node during an interval (MW)"