// Solution gap: the first one reached will end iteration
optca = 0 // Absolute gap between the found solution and the best possible solution
optcr = 0.0004 // Relative gap between the found solution and the best possible solution
solvelink = %Solvelink.Loadlibrary% // Solvelink controls how the problem is passed from GAMS to the solver. Loadlibrary constant means that the model is passed in core without the use of temporary files.
* profile = 8 // Profile will show the execution speed of statements at the defined depth within loops.
* bratio = 0.25 // How large share of the candidate elements need to be found for advanced basis in LP problems. Default 0.25.
* solveopt = merge // How solution values are stored after multiple solves. Default merge.
* savepoint = 1 // NOTE! Savepoint is controlled by Backbone model options.
threads = -1 // How many cores the solver can use: 0 = all cores; negative values = all cores - n
$ifi not '%debug%' == 'yes'
solprint = Silent // Controls solution file outputs - debug mode will be more verbose
mSettings('building', 't_forecastLengthUnchanging') = 0; // 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('building', 't_forecastLengthDecreasesFrom') = 0; // 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('invest', 't_forecastLengthUnchanging') = 0; // 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('building', 't_forecastLengthDecreasesFrom') = 0; // 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_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('building', '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)
t_jump, // Number of time steps realized with each solve
t_horizon, // Length of the simulation horizon in time steps (central forecast)
t_end, // Last time step of the simulation
loadPoint, // load advanced basis; 0 = no basis, 1 = all solves, 2 = first solve
savePoint, // save advanced basis; 0 = no basis, 1 = all solves, 2 = first solve
intervalEnd, // Last time step in the block of intervals with the same length
intervalLength, // Number of time steps aggregated within interval
IntervalInHours, // Length of one time step in hours
...
...
@@ -43,15 +45,16 @@ Sets
// Samples and Forecasts
samples, // Number of active samples
forecasts, // Number of active forecasts
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)
t_forecastStart, // Time step for first reading the forecasts (not necessarily t_start)
t_forecastLength, // Length of forecasts in time steps
t_forecastJump, // Number of time steps between each update of the forecasts
readForecastsInTheLoop, // Flag for updating forecasts in the solve loop
// Features
t_reserveLength, // Length of reserve provision horizon in time steps
t_aggregate, // Unit aggregation threshold time index
t_omitTrajectories // Threshold time index for omitting start-up and shutdown trajectories
t_omitTrajectories, // Threshold time index for omitting start-up and shutdown trajectories
results_t_start // time period where results outputting starts
/
// Solve info
...
...
@@ -149,6 +152,21 @@ Sets
extraRes "Use extra tertiary reserves for error in elec. load during time step"
rampSched "Use power based scheduling"
/
* --- 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" /
@@ -130,8 +130,7 @@ tSolveFirst = ord(tSolve); // tSolveFirst: the start of the current solve, t0 u
// Is there any case where t_forecastLength should be larger than t_horizon?
// If not, add a check for mSettings(mSolve, 't_forecastLength') <= mSettings(mSolve, 't_horizon')
// and change the line below to 'tSolveLast = ord(tSolve) + mSettings(mSolve, 't_horizon');'
tSolveLast = ord(tSolve) + max(mSettings(mSolve, 't_forecastLength'), mSettings(mSolve, 't_horizon')); // tSolveLast: the end of the current solve
Option clear = t_current;
tSolveLast = ord(tSolve) + max(mSettings(mSolve, 't_forecastLengthUnchanging'), mSettings(mSolve, 't_horizon')); // tSolveLast: the end of the current solveOption clear = t_current;
currentForecastLength = min( mSettings(mSolve, 't_forecastLengthUnchanging'), // Unchanging forecast length would remain the same
mSettings(mSolve, 't_forecastLengthDecreasesFrom') - [mSettings(mSolve, 't_forecastJump') - {tForecastNext(mSolve) - tSolveFirst}] // While decreasing forecast length has a fixed horizon point and thus gets shorter
); // Smallest forecast horizon is selected
// Loop over the defined blocks of intervals
loop(cc(counter),
// Loop over defined samples
...
...
@@ -191,7 +194,7 @@ loop(cc(counter),
msft(msf(mSolve, s, f_solve), tt_interval(t))${ not mf_central(mSolve, f_solve)
and not mf_realization(mSolve, f_solve)
and ord(t) > tSolveFirst + mSettings(mSolve, 't_jump')
and ord(t) < tSolveFirst + mSettings(mSolve, 't_forecastLength')
and ord(t) < tSolveFirst + currentForecastLength
}
= yes;
...
...
@@ -252,7 +255,7 @@ loop(cc(counter),
msft(msf(mSolve, s, f_solve), tt_interval(t))${ not mf_central(mSolve, f_solve)
and not mf_realization(mSolve, f_solve)
and ord(t) > tSolveFirst + mSettings(mSolve, 't_jump')
and ord(t) < tSolveFirst + mSettings(mSolve, 't_forecastLength')