Commit 53676957 authored by Juha Kiviluoma's avatar Juha Kiviluoma
Browse files

Merge branch 'dev'

# Conflicts:
#	inc/1c_parameters.gms
parents a777677c 97303eb6
options
// 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
;
$title Backbone
$ontext
Backbone - chronological energy systems model
Copyright (C) 2016 - 2017 VTT Technical Research Centre of Finland
Copyright (C) 2016 - 2018 VTT Technical Research Centre of Finland
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......@@ -69,18 +69,8 @@ $onempty // Allow empty data definitions
* Output file streams
files log /''/, gdx, f_info /'output\info.txt'/;
options
* optca = 0
* optcr = 1e-4
* profile = 8
solvelink = %Solvelink.Loadlibrary%
* bratio = 0.25
* solveopt = merge
* savepoint = 1
threads = 1
$ifi not '%debug%' == 'yes'
solprint = Silent
;
* Include options file to control the solver
$if exist 'input\1_options.gms' $include 'input\1_options.gms';
* === Definitions, sets, parameters and input data=============================
......@@ -91,8 +81,18 @@ $include 'inc\1d_results.gms' // Parameter definitions for model results
$include 'inc\1e_inputs.gms' // Load input data
* === Variables and equations =================================================
$include 'inc\2a_variables.gms' // Define variables for the models
$include 'inc\2b_equations.gms' // Define equations for the models
$include 'inc\2a_variables.gms' // Define variables for the models
$include 'inc\2b_eqDeclarations.gms' // Equation declarations
$ifthen exist 'input\2c_alternative_objective.gms' // Objective function - either the default or an alternative from input files
$$include 'input\2c_alternative_objective.gms';
$else
$$include 'inc\2c_objective.gms'
$endif
$include 'inc\2d_constraints.gms' // Define constraint equations for the models
$ifthen exist 'input/2e_additional_constraints.gms'
$$include 'input/2e_additional_constraints.gms' // Define additional constraints from the input data
$endif
* === Model definition files ==================================================
$include 'defModels\schedule.gms'
......@@ -102,21 +102,24 @@ $include 'defModels\invest.gms'
// Load model input parameters
$include 'input\modelsInit.gms'
* === Simulation ==============================================================
$include 'inc\3a_periodicInit.gms' // Initialize modelling loop
loop(modelSolves(mSolve, tSolve),
solveCount = solveCount + 1;
$$include 'inc\3b_inputsLoop.gms' // Read input data that is updated within the loop
$$include 'inc\3c_periodicLoop.gms' // Update modelling loop
$$include 'inc\3d_setVariableLimits.gms' // Set new variable limits (.lo and .up)
$$include 'inc\3e_solve.gms' // Solve model(s)
$$include 'inc\4a_outputVariant.gms' // Store results from the loop
* $$ifi.debug '%debug%' == 'yes'
* putclose gdx;
* put_utility 'gdxout' / 'output\'mSolve.tl:0, '-', tSolve.tl:0, '.gdx';
* execute_unload
* $$include defOutput\debugSymbols.inc
* ;
* $$endifi.debug
$$include 'inc\3f_afterSolve.gms' // Post-processing variables after the solve
$$include 'inc\4a_outputVariant.gms' // Store results from the loop
$iftheni.debug '%debug%' == 'yes'
putclose gdx;
put_utility 'gdxout' / 'output\' mSolve.tl:0 '-' tSolve.tl:0 '.gdx';
execute_unload
$$include defOutput\debugSymbols.inc
;
$endif.debug
);
$if exist 'input\3z_modelsClose.gms' $include 'input\3z_modelsClose.gms';
......@@ -128,7 +131,7 @@ $include 'inc\4b_outputInvariant.gms'
$include 'inc\4c_outputQuickFile.gms'
* Post-process results
$if exist 'inc\4d_postProcess.gms' $include 'defOutput\4d_postProcess.gms'
$if exist 'input\4d_postProcess.gms' $include 'input\4d_postProcess.gms'
execute_unload 'output\results.gdx',
$$include 'defOutput\resultSymbols.inc'
......
......@@ -23,13 +23,16 @@ Backbone has been designed with a modular structure, making it easier to change
* 1d_results.gms - Contains definitions for the model results.
* 1e_inputs.gms - Contains instructions on how to load input data, as well as forms a lot of helpful sets based on said data, for example in order to facilitate writing the constraints.
* 2a_variables.gms - Contains variable definitions used by the models.
* 2b_equations.gms - Contains the equation definitions for the models.
* 2b_eqDeclarations.gms - Contains equation declarations for the models.
* 2c_objective.gms - Contains the objective function definition.
* 2d_constraints.gms - Contains definitions for constraint equations.
* *Model Definition Files* - Contains GAMS definitions for different models, essentially lists the equations (constraints) that apply. Current files include *schedule.gms*, *building.gms* and *invest.gms*.
* 3a_periodicInit.gms - Initializes various data and sets for the solve loop.
* 3b_inputsLoop.gms - Instructions for possible data import inside the solve loop, as well as forecast in-the-loop improvements.
* 3c_periodicLoop.gms - Contains instructions for the forecast-time structure of the desired model.
* 3d_setVariableLimits.gms - Defines the variable boundaries for each solve.
* 3e_solve.gms - Contains the GAMS solve command for using the solver.
* 3f_afterSolve.gms - Fixes some variable values after solve.
* 4a_outputVariant.gms - Contains instructions for storing desired results during the solve loop.
* 4b_outputInvariant.gms - Calculates further results post-solve.
* 4c_outputQuickFile.gms
......@@ -37,10 +40,11 @@ Backbone has been designed with a modular structure, making it easier to change
Most of these files are under *\inc* in the Backbone folder, except for the model definition files being housed under *\defModels*. Other than the abovementioned files, a few key input files are required for Backbone to work. These are assumed to be found under *\input* and are briefly described below.
* inputData.gdx - Contains most of the input data about the system to be modelled.
* 1_options.gms - Contains options to control the solver. Not required but included if exists.
* timeAndSamples.inc - Contains definitions for the time, forecast and sample index ranges.
* modelsInit.gms - Contains model parameters for the solve (or a link to a template under *\defModels* to be used). Useful for any additional GAMS scripting.
Backbone folder contains two template files *timeAndSamples_temp.inc* and *modelsInit_temp.gms* to provide examples of the input format. These files can be copied into *\input* and renamed to *timeAndSamples.inc* and *modelsInit.gms*.
Backbone folder contains three template files *1_options_temp.gms*, *timeAndSamples_temp.inc*, and *modelsInit_temp.gms* to provide examples of the input format. These files can be copied into *\input* and renamed to *1_options.gms*, *timeAndSamples.inc*, and *modelsInit.gms*.
## When Simply Using Backbone
......
relaxfixedinfeas = 1
......@@ -42,6 +42,7 @@ Model building /
* q_conversionSOS2InputIntermediate
* q_conversionSOS2Constraint
* q_conversionSOS2IntermediateOutput
* q_fuelUseLimit
// Energy Transfer
q_transfer
......@@ -60,9 +61,14 @@ Model building /
// Policy
* q_inertiaMin
* q_instantaneousShareMax
* q_constrainedOnlineMultiUnit
* q_capacityMargin
* q_constrainedCapMultiUnit
* q_emissioncap
* q_energyShareMax
* q_energyShareMin
$ifthen exist 'input/building_additional_constraints.gms'
$$include 'input/building_additional_constraints.gms' // Declare additional constraints from the input data
$endif
/;
......@@ -25,12 +25,12 @@ if (mType('building'),
* --- Define Key Execution Parameters in Time Indeces -------------------------
// Define simulation start and end time indeces
mSettings('building', 't_start') = 1; // Ord of first solve (i.e. >0)
mSettings('building', 't_end') = 8760;
mSettings('building', 't_start') = 1; // First time step to be solved, 1 corresponds to t000001 (t000000 will then be used for initial status of dynamic variables)
mSettings('building', 't_end') = 8760; // Last time step to be included in the solve (may solve and output more time steps in case t_jump does not match)
// Define simulation horizon and moving horizon optimization "speed"
mSettings('building', 't_horizon') = 336;
mSettings('building', 't_jump') = 168;
mSettings('building', 't_horizon') = 336; // How many active time steps the solve contains (aggregation of time steps does not impact this, unless the aggregation does not match)
mSettings('building', 't_jump') = 168; // How many time steps the model rolls forward between each solve
* =============================================================================
* --- Model Time Structure ----------------------------------------------------
......@@ -58,11 +58,11 @@ if (mType('building'),
* --- Define Time Step Intervals ----------------------------------------------
// Define the duration of a single time-step in hours
mSettings('building', 'intervalInHours') = 1;
mSettings('building', 'stepLengthInHours') = 1;
// Define the time step intervals in time-steps
mInterval('building', 'intervalLength', 'c000') = 1;
mInterval('building', 'intervalEnd', 'c000') = 336;
mInterval('building', 'stepsPerInterval', 'c000') = 1;
mInterval('building', 'lastStepInIntervalBlock', 'c000') = 336;
* =============================================================================
* --- Model Forecast Structure ------------------------------------------------
......@@ -72,10 +72,10 @@ if (mType('building'),
mSettings('building', 'forecasts') = 0;
// Define forecast properties and features
mSettings('building', 't_forecastStart') = 0;
mSettings('building', 't_forecastLength') = 0;
mSettings('building', 't_forecastJump') = 0;
mSettings('building', 'readForecastsInTheLoop') = 0;
mSettings('building', 't_forecastStart') = 0; // At which time step the first forecast is available ( 1 = t000001 )
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('building', 't_forecastJump') = 0; // How many time steps before new forecast is available
// Define Realized and Central forecasts
* mf_realization('building', f) = no;
......@@ -96,15 +96,31 @@ if (mType('building'),
* --- Define Reserve Properties -----------------------------------------------
// Lenght of reserve horizon
mSettings('building', 't_reserveLength') = 0;
// Define whether reserves are used in the model
mSettingsReservesInUse('building', 'primary', 'up') = no;
mSettingsReservesInUse('building', 'primary', 'down') = no;
mSettingsReservesInUse('building', 'secondary', 'up') = no;
mSettingsReservesInUse('building', 'secondary', 'down') = no;
mSettingsReservesInUse('building', 'tertiary', 'up') = no;
mSettingsReservesInUse('building', 'tertiary', 'down') = no;
* --- Define Unit Efficiency Approximations -----------------------------------
* --- Define Unit Approximations ----------------------------------------------
// Define unit aggregation threshold
mSettings('building', 't_aggregate') = 0;
// Define the last time step for each unit aggregation and efficiency level (3a_periodicInit.gms ensures that there is a effLevel until t_horizon)
mSettingsEff('building', 'level1') = inf;
// Define unit aggregation and efficiency levels starting indeces
mSettingsEff('building', 'level1') = 1;
// Define the horizon when start-up and shutdown trajectories are considered
mSettings('building', 't_trajectoryHorizon') = 8760;
* --- Define output settings for results --------------------------------------
// Define the length of the initialization period. Results outputting starts after the period. Uses ord(t) > t_start + t_initializationPeriod in the code.
mSettings('building', 't_initializationPeriod') = 0; // r_state and r_online are stored also for the last step in the initialization period, i.e. ord(t) = t_start + t_initializationPeriod
* --- Control the solver ------------------------------------------------------
// Control the use of advanced basis
mSettings('building', 'loadPoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
mSettings('building', 'savePoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
); // END if(mType)
......@@ -27,21 +27,24 @@ Model invest /
// Unit Operation
q_maxDownward
q_maxUpward
q_startup
q_startshut
q_startuptype
q_onlineOnStartUp
q_offlineAfterShutDown
q_onlineLimit
q_onlineMinUptime
* q_minDown
* q_genRamp
* q_genRampChange
* q_rampUpLimit
* q_rampDownLimit
q_genRamp
q_rampUpLimit
q_rampDownLimit
q_rampUpDown
q_rampSlack
q_outputRatioFixed
q_outputRatioConstrained
q_conversionDirectInputOutput
q_conversionSOS2InputIntermediate
q_conversionSOS2Constraint
q_conversionSOS2IntermediateOutput
q_fuelUseLimit
// Energy Transfer
q_transfer
......@@ -60,9 +63,14 @@ Model invest /
// Policy
q_inertiaMin
q_instantaneousShareMax
q_constrainedOnlineMultiUnit
q_capacityMargin
q_constrainedCapMultiUnit
q_emissioncap
q_energyShareMax
q_energyShareMin
$ifthen exist 'input/invest_additional_constraints.gms'
$$include 'input/invest_additional_constraints.gms' // Declare additional constraints from the input data
$endif
/;
......@@ -25,12 +25,12 @@ if (mType('invest'),
* --- Define Key Execution Parameters in Time Indeces -------------------------
// Define simulation start and end time indeces
mSettings('invest', 't_start') = 1; // Ord of first solve (i.e. >0)
mSettings('invest', 't_end') = 8760;
mSettings('invest', 't_start') = 1; // First time step to be solved, 1 corresponds to t000001 (t000000 will then be used for initial status of dynamic variables)
mSettings('invest', 't_end') = 8760; // Last time step to be included in the solve (may solve and output more time steps in case t_jump does not match)
// Define simulation horizon and moving horizon optimization "speed"
mSettings('invest', 't_horizon') = 8760;
mSettings('invest', 't_jump') = 8760;
mSettings('invest', 't_horizon') = 8760; // How many active time steps the solve contains (aggregation of time steps does not impact this, unless the aggregation does not match)
mSettings('invest', 't_jump') = 8760; // How many time steps the model rolls forward between each solve
* =============================================================================
* --- Model Time Structure ----------------------------------------------------
......@@ -64,11 +64,11 @@ if (mType('invest'),
* --- Define Time Step Intervals ----------------------------------------------
// Define the duration of a single time-step in hours
mSettings('invest', 'intervalInHours') = 1;
mSettings('invest', 'stepLengthInHours') = 1;
// Define the time step intervals in time-steps
mInterval('invest', 'intervalLength', 'c000') = 1;
mInterval('invest', 'intervalEnd', 'c000') = 8760;
mInterval('invest', 'stepsPerInterval', 'c000') = 1;
mInterval('invest', 'lastStepInIntervalBlock', 'c000') = 8760;
* =============================================================================
* --- Model Forecast Structure ------------------------------------------------
......@@ -78,10 +78,10 @@ if (mType('invest'),
mSettings('invest', 'forecasts') = 0;
// Define forecast properties and features
mSettings('invest', 't_forecastStart') = 0;
mSettings('invest', 't_forecastLength') = 0;
mSettings('invest', 't_forecastJump') = 0;
mSettings('invest', 'readForecastsInTheLoop') = 0;
mSettings('invest', 't_forecastStart') = 0; // At which time step the first forecast is available ( 1 = t000001 )
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('invest', '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_forecastJump') = 0; // How many time steps before new forecast is available
// Define Realized and Central forecasts
mf_realization('invest', f) = no;
......@@ -103,15 +103,31 @@ if (mType('invest'),
* --- Define Reserve Properties -----------------------------------------------
// Lenght of reserve horizon
mSettings('invest', 't_reserveLength') = 36; // CHECK THIS
mSettingsReservesInUse('invest', 'primary', 'up') = no;
mSettingsReservesInUse('invest', 'primary', 'down') = no;
mSettingsReservesInUse('invest', 'secondary', 'up') = no;
mSettingsReservesInUse('invest', 'secondary', 'down') = no;
mSettingsReservesInUse('invest', 'tertiary', 'up') = no;
mSettingsReservesInUse('invest', 'tertiary', 'down') = no;
* --- Define Unit Efficiency Approximations -----------------------------------
* --- Define Unit Approximations ----------------------------------------------
// Define unit aggregation threshold
mSettings('invest', 't_aggregate') = 8761;
// Define the last time step for each unit aggregation and efficiency level (3a_periodicInit.gms ensures that there is a effLevel until t_horizon)
mSettingsEff('invest', 'level1') = inf;
// Define unit aggregation and efficiency levels starting indeces
mSettingsEff('invest', 'level1') = 1;
// Define the horizon when start-up and shutdown trajectories are considered
mSettings('invest', 't_trajectoryHorizon') = 8760;
* --- Define output settings for results --------------------------------------
// Define the length of the initialization period. Results outputting starts after the period. Uses ord(t) > t_start + t_initializationPeriod in the code.
mSettings('invest', 't_initializationPeriod') = 0; // r_state and r_online are stored also for the last step in the initialization period, i.e. ord(t) = t_start + t_initializationPeriod
* --- Control the solver ------------------------------------------------------
// Control the use of advanced basis
mSettings('invest', 'loadPoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
mSettings('invest', 'savePoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
); // END if(mType)
......
......@@ -27,21 +27,24 @@ Model schedule /
// Unit Operation
q_maxDownward
q_maxUpward
q_startup
q_startshut
q_startuptype
q_onlineLimit
q_onlineOnStartUp
q_offlineAfterShutDown
q_onlineMinUptime
* q_minDown
* q_genRamp
* q_genRampChange
* q_rampUpLimit
* q_rampDownLimit
q_genRamp
q_rampUpLimit
q_rampDownLimit
q_rampUpDown
q_rampSlack
q_outputRatioFixed
q_outputRatioConstrained
q_conversionDirectInputOutput
q_conversionSOS2InputIntermediate
q_conversionSOS2Constraint
q_conversionSOS2IntermediateOutput
q_fuelUseLimit
// Energy Transfer
q_transfer
......@@ -60,10 +63,15 @@ Model schedule /
// Policy
* q_inertiaMin
* q_instantaneousShareMax
q_constrainedOnlineMultiUnit
* q_capacityMargin
* q_constrainedCapMultiUnit
* q_emissioncap
* q_energyShareMax
* q_energyShareMin
$ifthen exist 'input/schedule_additional_constraints.gms'
$$include 'input/schedule_additional_constraints.gms' // Declare additional constraints from the input data
$endif
/;
......@@ -25,12 +25,12 @@ if (mType('schedule'),
* --- Define Key Execution Parameters in Time Indeces -------------------------
// Define simulation start and end time indeces
mSettings('schedule', 't_start') = 1; // Ord of first solve (i.e. >0)
mSettings('schedule', 't_end') = 8760;
mSettings('schedule', 't_start') = 1; // First time step to be solved, 1 corresponds to t000001 (t000000 will then be used for initial status of dynamic variables)
mSettings('schedule', 't_end') = 8760; // Last time step to be included in the solve (may solve and output more time steps in case t_jump does not match)
// Define simulation horizon and moving horizon optimization "speed"
mSettings('schedule', 't_horizon') = 8760;
mSettings('schedule', 't_jump') = 3;
mSettings('schedule', 't_horizon') = 8760; // How many active time steps the solve contains (aggregation of time steps does not impact this, unless the aggregation does not match)
mSettings('schedule', 't_jump') = 3; // How many time steps the model rolls forward between each solve
* =============================================================================
* --- Model Time Structure ----------------------------------------------------
......@@ -58,19 +58,19 @@ if (mType('schedule'),
* --- Define Time Step Intervals ----------------------------------------------
// Define the duration of a single time-step in hours
mSettings('schedule', 'intervalInHours') = 1;
mSettings('schedule', 'stepLengthInHours') = 1;
// Define the time step intervals in time-steps
mInterval('schedule', 'intervalLength', 'c000') = 1;
mInterval('schedule', 'intervalEnd', 'c000') = 48;
mInterval('schedule', 'intervalLength', 'c001') = 24;
mInterval('schedule', 'intervalEnd', 'c001') = 168;
mInterval('schedule', 'intervalLength', 'c002') = 168;
mInterval('schedule', 'intervalEnd', 'c002') = 840;
mInterval('schedule', 'intervalLength', 'c003') = 720;
mInterval('schedule', 'intervalEnd', 'c003') = 8760;
mInterval('schedule', 'intervalLength', 'c004') = 168;
mInterval('schedule', 'intervalEnd', 'c004') = 8760;
mInterval('schedule', 'stepsPerInterval', 'c000') = 1;
mInterval('schedule', 'lastStepInIntervalBlock', 'c000') = 48;
mInterval('schedule', 'stepsPerInterval', 'c001') = 24;
mInterval('schedule', 'lastStepInIntervalBlock', 'c001') = 168;
mInterval('schedule', 'stepsPerInterval', 'c002') = 168;
mInterval('schedule', 'lastStepInIntervalBlock', 'c002') = 840;
mInterval('schedule', 'stepsPerInterval', 'c003') = 720;
mInterval('schedule', 'lastStepInIntervalBlock', 'c003') = 8760;
mInterval('schedule', 'stepsPerInterval', 'c004') = 168;
mInterval('schedule', 'lastStepInIntervalBlock', 'c004') = 8760;
* =============================================================================
* --- Model Forecast Structure ------------------------------------------------
......@@ -80,10 +80,21 @@ if (mType('schedule'),
mSettings('schedule', 'forecasts') = 3;
// Define forecast properties and features
mSettings('schedule', 't_forecastStart') = 1;
mSettings('schedule', 't_forecastLength') = 36;
mSettings('schedule', 't_forecastJump') = 24;
mSettings('schedule', 'readForecastsInTheLoop') = 1;
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_forecastJump') = 24; // How many time steps before new forecast is available
mTimeseries_loop_read('schedule', 'ts_reserveDemand') = no;
mTimeseries_loop_read('schedule', 'ts_unit') = no;
mTimeseries_loop_read('schedule', 'ts_effUnit') = no;
mTimeseries_loop_read('schedule', 'ts_effGroupUnit') = no;
mTimeseries_loop_read('schedule', 'ts_influx') = no;
mTimeseries_loop_read('schedule', 'ts_cf') = no;
mTimeseries_loop_read('schedule', 'ts_reserveDemand') = no;
mTimeseries_loop_read('schedule', 'ts_node') = no;
mTimeseries_loop_read('schedule', 'ts_fuelPriceChange') = no;
mTimeseries_loop_read('schedule', 'ts_unavailability') = no;
// Define Realized and Central forecasts
mf_realization('schedule', f) = no;
......@@ -107,16 +118,32 @@ if (mType('schedule'),
* --- Define Reserve Properties -----------------------------------------------
// Lenght of reserve horizon
mSettings('schedule', 't_reserveLength') = 36;
// Define whether reserves are used in the model
mSettingsReservesInUse('schedule', 'primary', 'up') = yes;
mSettingsReservesInUse('schedule', 'primary', 'down') = yes;
mSettingsReservesInUse('schedule', 'secondary', 'up') = yes;
mSettingsReservesInUse('schedule', 'secondary', 'down') = yes;
mSettingsReservesInUse('schedule', 'tertiary', 'up') = yes;
mSettingsReservesInUse('schedule', 'tertiary', 'down') = yes;
* --- Define Unit Efficiency Approximations -----------------------------------
* --- Define Unit Approximations ----------------------------------------------
// Define unit aggregation threshold
mSettings('schedule', 't_aggregate') = 168;
// Define the last time step for each unit aggregation and efficiency level (3a_periodicInit.gms ensures that there is a effLevel until t_horizon)
mSettingsEff('schedule', 'level1') = 12;
mSettingsEff('schedule', 'level2') = 36;
// Define unit aggregation and efficiency levels starting indeces
mSettingsEff('schedule', 'level1') = 1;
mSettingsEff('schedule', 'level2') = 12;
// Define the horizon when start-up and shutdown trajectories are considered
mSettings('schedule', 't_trajectoryHorizon') = 8760;
* --- Define output settings for results --------------------------------------
// Define the length of the initialization period. Results outputting starts after the period. Uses ord(t) > t_start + t_initializationPeriod in the code.
mSettings('schedule', 't_initializationPeriod') = 0; // r_state and r_online are stored also for the last step in the initialization period, i.e. ord(t) = t_start + t_initializationPeriod
* --- Control the solver ------------------------------------------------------
// Control the use of advanced basis
mSettings('schedule', 'loadPoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
mSettings('schedule', 'savePoint') = 2; // 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
); // END if(mType)
......@@ -15,49 +15,131 @@ 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
* sets
ft
ft_realized
t_active
t_current
t_full
t_invest
uft
uft_online
uft_onlineLP
uft_onlineMIP
uft_onlineLP_withPrevious
uft_onlineMIP_withPrevious
* Parameters
tSolveFirst
tSolveLast
p_stepLength
p_data
p_data2d
ts_cf
ts_inflow
ts_stoContent
ts_reserveDemand
p_unit
*ts_cf
*ts_unit
*ts_effUnit
*ts_effGroupUnit
p_gn
p_gnBoundaryPropertiesForStates
p_gnn
p_gnu
p_nReserves
p_nuReserves
p_gnPolicy
p_groupPolicy
p_groupPolicy3D
p_fuelEmission
p_uFuel
p_unitFuelEmissionCost
p_effUnit
p_effGroupUnit
p_uNonoperational
p_uStartup
p_u_maxOutputInLastRunUpInterval
p_u_runUpTimeIntervals
dt_toStartup
p_ut_runUp
p_u_maxOutputInFirstShutdownInterval
p_u_shutdownTimeIntervals
dt_toShutdown
p_ut_shutdown
* Variables
v_obj
v_stoCharge
v_gen
v_genRamp
v_transfer
v_state
v_fuelUse
v_sos2
v_spill
v_stoContent
v_online
v_online_LP
v_online_MIP
v_startup
v_transfer
v_resTransCapacity
v_shutdown
v_genRampUpDown
v_transferRightward
v_transferLeftward
v_resTransferRightward
v_resTransferLeftward
v_reserve
v_investTransfer_LP
v_investTransfer_MIP
v_invest_LP
v_invest_MIP
* equations
q_obj
q_balance
q_resDemand
q_maxDownward
q_maxUpward