Commit 1c57c98f authored by Niina Helistö's avatar Niina Helistö
Browse files

Merge branch 'dev' into #129_reserve_activation_duration

parents 3941510c e08045e3
......@@ -25,6 +25,18 @@ loop(gnu(grid, node, unit)${r_invest(unit)},
tmp = round(r_invest(unit), 0) * p_gnu(grid, node, unit, 'unitSize');
put "p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'capacity') = p_gnu('", grid.tl, "', '", node.tl, "', '", unit.tl, "', 'capacity') + ", tmp, ";"/;);
* Example updates for storage units (commented out at the moment, use names etc. that work in your case)
*p_gnBoundaryPropertiesForStates('battery_grid', 'battery_node', 'upwardLimit', 'useConstant') = 1;
*p_gnBoundaryPropertiesForStates('battery_grid', 'battery_node', 'upwardLimit', 'multiplier') = 1;
*p_gnBoundaryPropertiesForStates('battery_grid', 'battery_node', 'upwardLimit', 'constant')
* = p_gnu('battery_grid', 'battery_node', 'battery_charge', 'upperLimitCapacityRatio') * p_gnu('battery_grid', 'battery_node', 'battery_charge', 'capacity');
*p_gnu('battery_grid', 'battery_node', 'battery_charge', 'upperLimitCapacityRatio') = 0;
*uGroup('battery_charge', 'battery_online_group1') = yes;
*uGroup('battery_discharge', 'battery_online_group1') = yes;
*p_groupPolicy('battery_online_group1', 'constrainedOnlineTotalMax') = p_unit('battery_charge', 'unitCount');
*p_groupPolicy3D('battery_online_group1', 'constrainedOnlineMultiplier', 'battery_charge') = 1;
*p_groupPolicy3D('battery_online_group1', 'constrainedOnlineMultiplier', 'battery_discharge') = 1;
* Do not allow investments in the child setups (commented out at the moment)
*loop(gn2n_directional(grid, node, node_),
* put "p_gnn('", grid.tl, "', '", node.tl, "', '", node_.tl, "', 'transferCapMax') = 0;"/;
......
......@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Static inertia requirement can be fulfilled by both rotational inertia of machines and certain reserve products
- Parameters p_gnPolicy and p_groupPolicy3D replaced with p_groupPolicyEmission and p_groupPolicyUnit
## [1.2.1] - 2019-11-26
### Fixed
......@@ -45,6 +46,28 @@ All notable changes to this project will be documented in this file.
- Limiting the provision of online reserve based on the online variable
- Sample probability bug from scenario reduction (probability of single scenario above one)
## 1.1.5 - 2020-11-28
### Fixed
- Long-term scenario data when using only one scenario
- Bug with scenario smooting which caused wrong values on later than first solve
## 1.1.4 - 2019-11-02
### Fixed
- Sample probability bug from scenario reduction
## 1.1.3 - 2019-10-24
### Changed
- Scenario reduction is done based on total available energy
## 1.1.2 - 2019-10-23
### Changed
- Maintain original scenario labels after reduction
## [1.1] - 2019-04-17
### Added
- New model setting 't_perfectForesight' tells the number of time steps (from
......
......@@ -6,7 +6,8 @@ If you use Backbone in a published work, please cite the [following publication]
## Getting Started
Make sure that you have [Git](https://git-scm.com/) version control system and a Git interface, such as [TortoiseGit](https://tortoisegit.org/) or [SourceTree](https://www.sourcetreeapp.com/), installed on your computer. You also need to have [GAMS](https://www.gams.com/) installed.
Make sure that you have [Git](https://git-scm.com/) version control system and a Git interface, such as [TortoiseGit](https://tortoisegit.org/) or [SourceTree](https://www.sourcetreeapp.com/), installed on your computer.
You also need to have [GAMS](https://www.gams.com/) version 24.0 or later installed.
In order to get a copy of the Backbone project, you need to clone it using Git. Copy and paste the URL of the original Backbone repository and select the directory where you want Backbone to be cloned. The URL of the original Backbone repository is https://gitlab.vtt.fi/backbone/backbone.
......
......@@ -140,6 +140,9 @@ if (mType('schedule'),
mf_realization('schedule', 'f00') = yes;
mf_central('schedule', f) = no;
mf_central('schedule', 'f02') = yes;
// Define special forecast label that holds scenario data
//mf_scenario('schedule', 'scen') = yes;
// Define forecast probabilities (weights)
p_mfProbability('schedule', f) = 0;
......
......@@ -46,9 +46,9 @@ p_gnn
p_gnu
p_groupReserves
p_gnuReserves
p_gnPolicy
p_groupPolicy
p_groupPolicy3D
p_groupPolicyUnit
p_groupPolicyEmission
p_nEmission
p_unitEmissionCost
p_effUnit
......
......@@ -19,6 +19,9 @@ $offtext
* --- Results Symbols Included in Output --------------------------------------
* =============================================================================
* --- Symbols related to the simulation setup ---------------------------------
t_realized = t
* --- Cost Result Symbols -----------------------------------------------------
// Total Objective Function
......
......@@ -32,36 +32,36 @@ Sets
mSetting "setting categories for models" /
// General Time Structure
t_start, // First time step for the start of simulation
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 = latest solve, 2 = all solves, 3 = first solve
savePoint, // Save advanced basis; 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve
lastStepInIntervalBlock, // Last time step in the block of intervals with the same length
stepsPerInterval, // Number of time steps aggregated within interval
stepLengthInHours, // Length of one time step in hours
t_start "First time step for the start of simulation"
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 = latest solve, 2 = all solves, 3 = first solve"
savePoint "Save advanced basis; 0 = no basis, 1 = latest solve, 2 = all solves, 3 = first solve"
lastStepInIntervalBlock "Last time step in the block of intervals with the same length"
stepsPerInterval "Number of time steps aggregated within interval"
stepLengthInHours "Length of a time step in hours"
// 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_forecastJump, // Number of time steps between each update of the 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_forecastJump "Number of time steps between each update of the forecasts"
t_improveForecast "Number of time steps ahead of time on which the forecast is improved on each solve"
t_perfectForesight "Number of time steps for which realized data is used instead of forecasts"
onlyExistingForecasts "Use only existing forecast values when reading updated forecasts. Note: zero values need to be saved as Eps in the gdx file."
scenarios "Number of long-term scenarios used"
scenarioLength "Length of scenario in time steps for creating stocahstic scenarios from time series data"
scenarioLength "Length of scenario in time steps for creating stochastic scenarios from time series data"
// Features
t_trajectoryHorizon, // Length of the horizon when start-up and shutdown trajectories are considered (in time steps)
t_initializationPeriod, // Number of time steps in the beginning of the simulation which are solved but the results of which are not stored
dataLength, // The maximum number of time steps in any input data time series (recommended for correctly circulating data)
red_num_leaves "Desired number of preserved scenarios or leaves (SCENRED)"
t_trajectoryHorizon "Length of the horizon when start-up and shutdown trajectories are considered (in time steps)"
t_initializationPeriod "Number of time steps in the beginning of the simulation which are solved but the results of which are not stored"
dataLength "The maximum number of time steps in any input data time series (recommended for correctly circulating data)"
red_num_leaves "Desired number of preserved scenarios or leaves of scenario reduction (SCENRED)"
red_percentage "Desired relative distance (accuracy) of scenario reduction (SCENRED)"
incHRAdditionalConstraints // Method to include the two additional constraints for incremental heat rates;
incHRAdditionalConstraints "Method to include the two additional constraints for incremental heat rates"
// 0 = include for units with non-convex fuel use, 1 = include for all units
/
......@@ -226,11 +226,11 @@ param_gn "Possible parameters for grid, node" /
/
param_gnBoundaryTypes "Types of boundaries that can be set for a node with a state variable" /
upwardLimit "Absolute maximum state of the node (unit depends on energyCapacity)"
downwardLimit "Absolute minimum energy in the node (unit depends on energyCapacity)"
upwardSlack01*upwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit depends on energyCapacity)"
downwardSlack01*downwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit depends on energyCapacity)"
reference "Reference value for a state that can be used to bound a state (unit depends on energyCapacity)"
upwardLimit "Absolute maximum state of the node (unit of measure depends on energyStoredPerUnitOfState)"
downwardLimit "Absolute minimum energy in the node (unit of measure depends on energyStoredPerUnitOfState)"
upwardSlack01*upwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit of measure depends on energyStoredPerUnitOfState)"
downwardSlack01*downwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit of measure depends on energyStoredPerUnitOfState)"
reference "Reference value for a state that can be used to bound a state (unit of measure depends on energyStoredPerUnitOfState)"
maxSpill "Maximum spill rate from the node (MWh/h)"
minSpill "Minimum spill rate from the node (MWh/h)"
balancePenalty "Penalty value for violating the energy balance of that particular node (EUR/MWh) (can be interpretated as the energy price in certain settings)"
......@@ -252,7 +252,7 @@ param_gnn "Set of possible data parameters for grid, node, node (nodal interconn
diffCoeff "Coefficients for energy diffusion between nodes (MW/[v_state])"
boundStateMaxDiff "Maximum difference of node state pairs ([v_state])"
transferCapInvLimit "Capacity limit for investments (MW)"
investMIP "A flag to make integer investment instead of continous investment (MW versus number of links)"
investMIP "A flag to make integer investment instead of continuous investment (MW versus number of links)"
unitSize "Size of one link for integer investments (MW)"
invCost "Investment cost (EUR/MW)"
annuity "Investment annuity"
......
......@@ -27,6 +27,7 @@ Sets
* --- Energy generation and consumption ---------------------------------------
unit "Set of generators, storages and loads"
unittype "Unit technology types"
unit_flow(unit) "Unit that depend directly on variable energy flows (RoR, solar PV, etc.)"
unit_commodity(unit) "Units using an exogenous commodity with a price"
unit_fail(unit) "Units that might fail"
......@@ -40,14 +41,13 @@ Sets
unit_slope(unit) "Units with piecewise linear efficiency constraints"
unit_noSlope(unit) "Units without piecewise linear efficiency constraints"
unitAggregator_unit(unit, unit) "Aggregate unit linked to aggregated units"
unitUnitEffLevel(unit, unit, EffLevel) "Aggregator unit linke to aggreted units with a definition when to start the aggregation"
flowUnit(flow, *) "Units or storages linked to a certain energy flow time series"
unitUnittype(unit, *) "Link generation technologies to types"
unitUnitEffLevel(unit, unit, EffLevel) "Aggregator unit linked to aggreted units with a definition when to start the aggregation"
flowUnit(flow, unit) "Units linked to a certain energy flow time series"
unitUnittype(unit, unittype) "Link generation technologies to types"
unitStarttype(unit, starttype) "Units with special startup properties"
un_commodity(unit, node) "Units linked with commodities"
un_commodity_in(unit, node) "Units linked with input commodities"
un_commodity_out(unit, node) "Units linked with output commodities"
unittype "Unit technology types"
unit_investLP(unit) "Units with continuous investments allowed"
unit_investMIP(unit) "Units with integer investments allowed"
unit_timeseries(unit) "Units with time series enabled"
......@@ -96,6 +96,7 @@ Sets
t_current(t) "Set of time steps within the current solve horizon"
t_active(t) "Set of active t:s within the current solve horizon, including necessary history"
t_invest(t) "Time steps when investments can be made"
t_realized(t) "Set of realized time steps in the simulation"
tt(t) "Temporary subset for time steps used for calculations"
tt_(t) "Another temporary subset for time steps used for calculations"
tt_block(counter, t) "Temporary time step subset for storing the time interval blocks"
......@@ -157,7 +158,7 @@ $if defined scenario
effGroupSelector(effSelector, effSelector) "Efficiency selectors included in efficiency groups, e.g. Lambda02 contains Lambda01 and Lambda02."
effLevelGroupUnit(effLevel, effSelector, unit) "What efficiency selectors are in use for each unit at each efficiency representation level"
effGroupSelectorUnit(effSelector, unit, effSelector) "Group name for efficiency selector set, e.g. Lambda02 contains Lambda01 and Lambda02"
mSettingsReservesInUse(mType, *, up_down) "Reserves that are used in each model type"
mSettingsReservesInUse(mType, restype, up_down) "Reserves that are used in each model type"
unitCounter(unit, counter) "Counter used for restricting excessive looping over the counter set when defining unit startup/shutdown/online time restrictions"
runUpCounter(unit, counter) "Counter used for unit run-up intervals"
shutdownCounter(unit, counter) "Counter used for unit shutdown intervals"
......
......@@ -62,9 +62,9 @@ Parameters
p_gnuReserves(grid, node, unit, restype, param_policy) "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)"
p_gnPolicy(grid, node, param_policy, *) "Policy data for grid, node"
p_groupPolicy(group, param_policy) "Two-dimensional policy data for groups"
p_groupPolicy3D(group, param_policy, *) "Three-dimensional policy data for groups"
p_groupPolicyUnit(group, param_policy, unit) "Three-dimensional policy data for groups and units"
p_groupPolicyEmission(group, param_policy, emission) "Three-dimensional policy data for groups and emissions"
p_price(node, param_price) "Commodity price parameters"
p_nEmission(node, emission) "Emission content (kg/MWh)"
p_uStartupfuel(unit, node, param_unitStartupfuel) "Parameters for startup fuels"
......@@ -102,7 +102,7 @@ Parameters
Parameters
p_msWeight(mType, s) "Temporal weight of sample: number of similar periods represented by sample s"
p_msAnnuityWeight(mType, s) "Temporal weight of sample: used when calculating annuities"
p_msProbability(mType, s) "Probability to reach sample conditioned on anchestor samples"
p_msProbability(mType, s) "Probability to reach sample conditioned on ancestor samples"
p_mfProbability(mType, f) "Probability of forecast"
p_msft_probability(mType, s, f, t) "Probability of forecast"
p_sProbability(s) "Probability of sample"
......
......@@ -52,7 +52,6 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc p_gnuRes2Res
$$loaddc ts_reserveDemand
$$loaddc p_gnBoundaryPropertiesForStates
$$loaddc p_gnPolicy
$$loaddc p_uStartupfuel
$$loaddc flowUnit
$$loaddc emission
......@@ -73,7 +72,8 @@ $ifthen exist '%input_dir%/inputData.gdx'
$$loaddc gnGroup
$$loaddc sGroup
$$loaddc p_groupPolicy
$$loaddc p_groupPolicy3D
$$loaddc p_groupPolicyUnit
$$loaddc p_groupPolicyEmission
$$loaddc gnss_bound
$$loaddc uss_bound
$$gdxin
......@@ -266,8 +266,8 @@ p_uShutdown(unit, 'cost')
p_unitEmissionCost(unit, node, emission)${nu(node, unit) and p_nEmission(node, emission)}
= p_nEmission(node, emission)
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* sum(gnu_input(grid, node, unit),
+ p_gnPolicy(grid, node, 'emissionTax', emission)
* sum(gnGroup(grid, node, group)$gnu_input(grid, node, unit),
+ p_groupPolicyEmission(group, 'emissionTax', emission)
)
;
......
......@@ -374,18 +374,6 @@ $ifthen exist '%input_dir%/p_gnBoundaryPropertiesForStates3.gdx'
$$gdxin
$endif
$ifthen exist '%input_dir%/p_gnPolicy2.gdx'
$$gdxin '%input_dir%/p_gnPolicy2.gdx'
$$loaddcm p_gnPolicy
$$gdxin
$endif
$ifthen exist '%input_dir%/p_gnPolicy3.gdx'
$$gdxin '%input_dir%/p_gnPolicy3.gdx'
$$loaddcm p_gnPolicy
$$gdxin
$endif
$ifthen exist '%input_dir%/p_uStartupFuel2.gdx'
$$gdxin '%input_dir%/p_uStartupFuel2.gdx'
$$loaddcm p_uStartupFuel
......@@ -614,15 +602,27 @@ $ifthen exist '%input_dir%/p_groupPolicy3.gdx'
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicy3D2.gdx'
$$gdxin '%input_dir%/p_groupPolicy3D2.gdx'
$$loaddcm p_groupPolicy3D
$ifthen exist '%input_dir%/p_groupPolicyUnit2.gdx'
$$gdxin '%input_dir%/p_groupPolicyUnit2.gdx'
$$loaddcm p_groupPolicyUnit
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicyUnit3.gdx'
$$gdxin '%input_dir%/p_groupPolicyUnit3.gdx'
$$loaddcm p_groupPolicyUnit
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicyEmission2.gdx'
$$gdxin '%input_dir%/p_groupPolicyEmission2.gdx'
$$loaddcm p_groupPolicyEmission
$$gdxin
$endif
$ifthen exist '%input_dir%/p_groupPolicy3D3.gdx'
$$gdxin '%input_dir%/p_groupPolicy3D3.gdx'
$$loaddcm p_groupPolicy3D
$ifthen exist '%input_dir%/p_groupPolicyEmission3.gdx'
$$gdxin '%input_dir%/p_groupPolicyEmission3.gdx'
$$loaddcm p_groupPolicyEmission
$$gdxin
$endif
......
......@@ -1975,8 +1975,16 @@ q_unitEqualityConstraint(s_active(s), eq_constraint, uft(unit, f, t))
=E=
// Constant multiplied by capacity
// Constant multiplied by the number of online sub-units
+ p_unitConstraint(unit, eq_constraint)
* [ // Unit online state
+ 1 // if the unit does not have an online variable
${not uft_online(unit, f, t)}
+ v_online_LP(unit, s, f+df_central(f,t), t)
${uft_onlineLP(unit, f, t)}
+ v_online_MIP(unit, s, f+df_central(f,t), t)
${uft_onlineMIP(unit, f, t)}
]
;
* --- Commodity Use Limitation -----------------------------------------------------
......@@ -1993,8 +2001,16 @@ q_unitGreaterThanConstraint(s_active(s), gt_constraint, uft(unit, f, t))
=G=
// Constant multiplied by capacity
// Constant multiplied by the number of online sub-units
+ p_unitConstraint(unit, gt_constraint)
* [ // Unit online state
+ 1 // if the unit does not have an online variable
${not uft_online(unit, f, t)}
+ v_online_LP(unit, s, f+df_central(f,t), t)
${uft_onlineLP(unit, f, t)}
+ v_online_MIP(unit, s, f+df_central(f,t), t)
${uft_onlineMIP(unit, f, t)}
]
;
* --- Total Transfer Limits ---------------------------------------------------
......@@ -2663,18 +2679,18 @@ $offtext
q_constrainedOnlineMultiUnit(group, sft(s, f, t))
${ p_groupPolicy(group, 'constrainedOnlineTotalMax')
or sum(unit$uGroup(unit, group), abs(p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)))
or sum(unit$uGroup(unit, group), abs(p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)))
} ..
// Sum of multiplied online units
+ sum(unit$uGroup(unit, group),
+ p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)
+ p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)
* [
+ v_online_LP(unit, s, f+df_central(f,t), t)
${uft_onlineLP(unit, f, t)}
+ v_online_MIP(unit, s, f+df_central(f,t), t)
${uft_onlineMIP(unit, f, t)}
] // END * p_groupPolicy3D(group, 'constrainedOnlineMultiplier', unit)
] // END * p_groupPolicyUnit(group, 'constrainedOnlineMultiplier', unit)
) // END sum(unit)
=L=
......@@ -2778,16 +2794,16 @@ q_capacityMargin(gn(grid, node), sft(s, f, t))
q_constrainedCapMultiUnit(group)
${ p_groupPolicy(group, 'constrainedCapTotalMax')
or sum(uGroup(unit, group), abs(p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)))
or sum(uGroup(unit, group), abs(p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)))
} ..
// Sum of multiplied investments
+ sum(uGroup(unit, group),
+ p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)
+ p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)
* [
+ v_invest_LP(unit)${unit_investLP(unit)}
+ v_invest_MIP(unit)${unit_investMIP(unit)}
] // END * p_groupPolicy3D(group, 'constrainedCapMultiplier', unit)
] // END * p_groupPolicyUnit(group, 'constrainedCapMultiplier', unit)
) // END sum(unit)
=L=
......@@ -2802,7 +2818,7 @@ q_constrainedCapMultiUnit(group)
// Is there any way to make it work?
q_emissioncap(group, emission)
${ p_groupPolicy3D(group, 'emissionCap', emission)
${ p_groupPolicyEmission(group, 'emissionCap', emission)
} ..
+ sum(msft(m, s, f, t)${sGroup(s, group)},
......@@ -2836,7 +2852,7 @@ q_emissioncap(group, emission)
=L=
// Permitted nodal emission cap
+ p_groupPolicy3D(group, 'emissionCap', emission)
+ p_groupPolicyEmission(group, 'emissionCap', emission)
;
*--- Maximum Energy -----------------------------------------------------------
......
......@@ -49,6 +49,12 @@ loop(m,
abort "t_end is not divisible by t_jump";
);
// Calculate realized timesteps in the simulation
t_realized(t_full(t))${ ord(t) >= mSettings(m, 't_start') + 1
and ord(t) <= mSettings(m, 't_end') + 1
}
= yes;
* --- Samples and Forecasts ---------------------------------------------------
$ontext
// Check that forecast length is feasible
......
......@@ -124,6 +124,7 @@ Option clear = q_constrainedOnlineMultiUnit;
Option clear = q_capacityMargin;
Option clear = q_constrainedCapMultiUnit;
Option clear = q_emissioncap;
Option clear = q_energyMax;
Option clear = q_energyShareMax;
Option clear = q_energyShareMin;
Option clear = q_ReserveShareMax;
......@@ -466,7 +467,7 @@ loop(mf_realization(mSolve, f_),
);
// Central forecast for the long-term scenarios comes from a special forecast label
Option clear = df_scenario;
if(mSettings(mSolve, 'scenarios') > 1,
if(mSettings(mSolve, 'scenarios') >= 1,
loop((msft(ms_central(mSolve, s), f, t), mf_scenario(mSolve, f_)),
df_scenario(ft(f, t)) = ord(f_) - ord(f);
);
......
......@@ -510,10 +510,13 @@ $ifthen.autocorr defined p_autocorrelation
// Do smoothing
if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scenarios
// Select the initial sample, first `t` not in it and `f` of the last `t` in it
// Select the initial sample, the last time in it (t_)
// and the forecast (f_) of the last simulated time step (t__) in it
loop((ms_initial(mSolve, s_), t_, ft(f_, t__))
$[ord(t_) = msEnd(mSolve, s_) and mst_end(mSolve, s_, t__)
and (mf_realization(mSolve, f_) xor mf_central(mSolve, f_))],
$[ord(t_) = msEnd(mSolve, s_) + tSolveFirst - 1
and mst_end(mSolve, s_, t__)
and (mf_realization(mSolve, f_) xor mf_central(mSolve, f_))
],
$$batinclude 'inc/smoothing.gms' ts_influx
$$batinclude 'inc/smoothing.gms' ts_cf
);
......
......@@ -591,15 +591,15 @@ d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) > mSettings(m, 't_start') + mSe
]
+ Eps; // Eps to correct GAMS plotting (zeroes are not skipped)
// Estimated efficiency
// Estimated efficiency, calculated from commodity based inputs
d_eff(unit_commodity(unit), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= sum(gnu_output(grid, node, unit),
+ r_gen(grid, node, unit, f, t)
) // END sum(gnu_output)
/ [ sum(uFuel(unit, 'main', fuel),
+ r_fuelUse(fuel, unit, f, t)
) // END sum(uFuel)
+ 1${not sum(uFuel(unit, 'main', fuel), r_fuelUse(fuel, unit, f, t))}
/ [ sum(gnu_input(grid, node, unit)$un_commodity(unit, node),
+ r_fuelUse(node, unit, f, t)
) // END sum(gnu_input)
+ 1${not sum(gnu_input(grid, node, unit)$un_commodity(unit, node), r_fuelUse(node, unit, f, t))}
]
+ Eps; // Eps to correct GAMS plotting (zeroes are not skipped)
$endif.diag
......
......@@ -20,6 +20,8 @@ $offtext
* =============================================================================
s "Samples from historical periods" / s000 * s999 /
f "Forecasts for the short term" / f00 * f99 /
f "Forecasts for the short term" / f00 * f99,
scen 'long-term scenarios',
/
t "Model time steps" / t000000 * t017568 /
scenario "Long-term scenarios" / scen00 /
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment