Commit b4ed51bd authored by DaKi404's avatar DaKi404
Browse files

Merge branch 'dev' into wastewater

parents 56b7b9c0 13471bd4
{"type": "parameter_renamer", "name_map": {"boundaryValue": "ts_node", "capacityFactor": "ts_cf", "coefficient": "p_unitConstraintNode", "constant": "p_unitConstraint", "discountFactor": "p_s_discountFactor", "emission_content": "p_nEmission", "forwardReserve": "p_gnuRes2Res", "influx": "ts_influx", "priceChange": "ts_priceChange", "reserveDemand": "ts_reserveDemand", "storageValue": "p_storageValue", "value": "p_gnPolicy"}}
\ No newline at end of file
{"type": "entity_class_renamer", "name_map": {"boundarytypes": "param_gnBoundaryTypes", "effLevel__group__unit": "effLevelGroupUnit", "flow__unit": "flowUnit", "grid__node__group": "gnGroup", "grid__node__node__group": "gn2nGroup", "grid__node__sample__sample": "gnss_bound", "grid__node__unit__group": "gnuGroup", "restype__direction": "restypeDirection", "restype_released_for_realization": "restypeReleasedForRealization", "sample__group": "sGroup", "unit__group": "uGroup", "unit__sample__sample": "uss_bound", "unit__t__availability": "utAvailabilityLimits", "unit__unittype": "unitUnittype", "unit_aggregate__unit__efflevel": "unitUnitEffLevel"}}
\ No newline at end of file
This diff is collapsed.
......@@ -139,6 +139,12 @@ $include '%input_dir%/modelsInit.gms'
* === Simulation ==============================================================
// Macro for checking solve status (1 = normal completion)
$macro checkSolveStatus(mdl) \
if(mdl.solveStat > 1 and (mdl.modelStat <> 1 or mdl.modelStat <> 8), \
execError = execError + 1 \
)
$include 'inc/3a_periodicInit.gms' // Initialize modelling loop
loop(modelSolves(mSolve, tSolve)$(execError = 0),
solveCount = solveCount + 1;
......
......@@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- Dynamic generation portfolios aka pathway modelling aka multi-year simulations with discounted costs enabled
- Reserve activation duration and reactivation time included (in state constraints)
- Raise execution error if solver did not finish normally
### 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
### Fixed
- Updated the selection of unit efficiency approximation levels
## [1.2.1] - 2019-11-26
### Fixed
......
......@@ -39,6 +39,8 @@ r_uTotalStartupCost
r_gnStateSlackCost
r_gnTotalStateSlackCost
r_gnStorageValueChange
r_gnnVariableTransCost
r_gnnTotalVariableTransCost
// Investment and Fixed Operation and Maintenance Cost Components
r_gnuFOMCost
......@@ -73,6 +75,8 @@ r_stateSlack
// Energy transfer and spill variable results
r_transfer
r_transferRightward
r_transferLeftward
r_spill
//Energy diffusion - ADDITIONS OF THE WWTP MODEL
......@@ -163,6 +167,11 @@ r_resDemandLargestInfeedUnit
r_invest
r_investTransfer
* --- Sum results for groups --------------------------------------------------
// gnTotalgen in units that belong to gnuGroups over the simulation
r_gnTotalGenGnuGroup
* --- Dummy and Diagnostic Variable Result Symbols ----------------------------
// Results regarding solution feasibility
......
......@@ -190,6 +190,7 @@ Parameter
* settings(mSetting)
mSettings(mType, mSetting) "Model settings array"
mSettingsEff(mtype, effLevel) "Model efficiency approximation array"
mSettingsEff_start(mtype, effLevel) "The first time step of the efficiency level - mSettingsEff is the last"
mInterval(mType, mSetting, counter) "Model interval array"
t_skip_counter "Numerical counter for solve time steps"
;
......@@ -263,6 +264,7 @@ param_gnn "Set of possible data parameters for grid, node, node (nodal interconn
recycle "recycle parameter for biomass into substrate USED IN THE WWTP MODEL"
ICrampUp
ICrampDown
variableTransCost "Variable cost applied to transfers (EUR/MW)"
/
param_gnu "Set of possible data parameters for grid, node, unit" /
......@@ -373,12 +375,14 @@ param_policy "Set of possible data parameters for groups or grid, node, regulati
staticInertia "A flag to indicate static inertia constraint should be implemented - q_inertiaMin"
dynamicInertia "A flag to indicate dynamic inertia constraint should be implemented - q_rateOfChangeOfFrequencyUnit/Transfer"
// Reserve related parameters, currently without a proper parameter set
update_frequency "Frequency of updating reserve contributions"
update_offset "Optional offset for delaying the reserve update frequency"
update_frequency "Frequency of updating reserve contributions (number of timesteps)"
update_offset "Optional offset for delaying the reserve update frequency (number of timesteps)"
gate_closure "Number of timesteps ahead of dispatch that reserves are fixed"
* use_time_series "Flag for using time series data. !!! REDUNDANT WITH useTimeseries, PENDING REMOVAL !!!"
useTimeSeries "Flag for using time series data"
reserve_length "Length of reserve horizon"
reserve_length "Length of reserve horizon (number of timesteps)"
reserve_activation_duration "How long the reserve should be provided once activated (h)"
reserve_reactivation_time "How soon the unit providing reserve needs to be able to reactivate after the start of the previous activation (h)"
reserveReliability "Reliability parameter of reserve provisions"
reserve_increase_ratio "Unit output is multiplied by this factor to get the increase in reserve demand"
portion_of_infeed_to_reserve "Proportion of the generation of a tripping unit that needs to be covered by reserves from other units"
......
......@@ -39,6 +39,8 @@ Parameters
r_gnStateSlackCost(grid, node, f, t) "Costs for states requiring slack (MEUR)"
r_gnTotalStateSlackCost(grid, node) "Total costs for state slacks over the simulation (MEUR)"
r_gnStorageValueChange(grid, node) "Change in storage values over the simulation (MEUR)"
r_gnnVariableTransCost(grid, node_,node, f, t) "Variable Transfer costs (MEUR)"
r_gnnTotalVariableTransCost(grid, node_, node) "Total Variable Transfer costs over the simulation (MEUR)"
// Investment and Fixed Operation and Maintenance Cost Components
r_gnuFOMCost(grid, node, unit) "Total gnu fixed O&M costs over the simulation (MEUR)"
......@@ -79,6 +81,8 @@ Parameters
// Energy transfer and spill variable results
r_transfer(grid, from_node, to_node, f, t) "Energy transfer (MW)"
r_transferRightward(grid, from_node, to_node, f, t) "Energy transfer from first node to second node (MW)"
r_transferLeftward(grid, to_node, from_node, f, t) "Energy transfer from second node to first node (MW)"
r_spill(grid, node, f, t) "Spill of energy from storage node during time interval (MWh)"
//Energy diffusion results - ADDITIONS OF THE WWTP MODEL
......@@ -131,10 +135,10 @@ Parameters
r_emissions (node, emission, unit, f, t) "Emissions from units (tCO2)"
// Emission sums
r_nuTotalEmissions (node, unit, emission) "Total emissions from units (tCO2)"
r_nTotalEmissions(node, emission) "Emissions in gn (tCO2)"
r_uTotalEmissions(unit, emission) "Emissions in gn (tCO2)"
r_totalEmissions (emission) "Summed emissions (tCO2)"
r_nuTotalEmissions (node, unit, emission) "node unit total emissions (tCO2)"
r_nTotalEmissions(node, emission) "node total emissions (tCO2)"
r_uTotalEmissions(unit, emission) "unit total emissions (tCO2)"
r_totalEmissions (emission) "Total emissions (tCO2)"
* --- Unit Online State Results -----------------------------------------------
......@@ -173,6 +177,11 @@ Parameters
r_invest(unit) "Number/amount of invested sub-units"
r_investTransfer(grid, node, node, t) "Amount of invested transfer link capacity"
* --- Group results -----------------------------------------------------------
// gnTotalgen in units that belong to gnuGroups over the simulation
r_gnTotalGenGnuGroup(grid, node, group) "gnTotalGen in units that belong to gnuGroup (MWh)"
* --- Dummy Variable Results --------------------------------------------------
// Results regarding solution feasibility
......
......@@ -410,6 +410,23 @@ flowNode(flow, node)${ sum((f, t), ts_cf(flow, node, f, t))
// NOTE! Reserves can be disabled through the model settings file.
// The sets are disabled in "3a_periodicInit.gms" accordingly.
* --- Correct values for critical reserve related parameters - Part 1 ---------
// Reserve activation duration assumed to be 1 hour if not provided in data
p_groupReserves(group, restype, 'reserve_activation_duration')
${ not p_groupReserves(group, restype, 'reserve_activation_duration')
and p_groupReserves(group, restype, 'reserve_length')
}
= 1;
// Reserve reactivation time assumed to be 1 hour if not provided in data
p_groupReserves(group, restype, 'reserve_reactivation_time')
${ not p_groupReserves(group, restype, 'reserve_reactivation_time')
and p_groupReserves(group, restype, 'reserve_length')
}
= 1;
* --- Copy reserve data and create necessary sets -----------------------------
// Copy data from p_groupReserves to p_gnReserves
loop(gnGroup(grid, node, group)${sum(restype, p_groupReserves(group, restype, 'reserve_length'))},
p_gnReserves(grid, node, restype, param_policy) = p_groupReserves(group, restype, param_policy);
......@@ -465,7 +482,7 @@ restypeDirectionGridNodeGroup(restypeDirection(restype, up_down), gnGroup(grid,
}
= yes;
* --- Correct values for critical reserve related parameters ------------------
* --- Correct values for critical reserve related parameters - Part 2 ---------
// Reserve reliability assumed to be perfect if not provided in data
p_gnuReserves(gnu(grid, node, unit), restype, 'reserveReliability')
......@@ -597,14 +614,22 @@ loop( unitStarttype(unit, starttypeConstrained),
* --- Check reserve related data ----------------------------------------------
// Check that reserve_length is long enough for properly commitment of reserves
loop( restypeDirectionGridNode(restype, up_down, grid, node),
// Check that reserve_length is long enough for properly commitment of reserves
if(p_gnReserves(grid, node, restype, 'reserve_length') < p_gnReserves(grid, node, restype, 'update_frequency') + p_gnReserves(grid, node, restype, 'gate_closure'),
put log '!!! Error occurred on node ', node.tl:0 /;
loop( restypeDirectionGroup(restype, up_down, group),
// Check that reserve_length is long enough for proper commitment of reserves
if(p_groupReserves(group, restype, 'reserve_length') < p_groupReserves(group, restype, 'update_frequency') + p_groupReserves(group, restype, 'gate_closure'),
put log '!!! Error occurred on group ', group.tl:0 /;
put log '!!! Abort: The reserve_length parameter should be longer than update_frequency + gate_closure to fix the reserves properly!' /;
abort "The 'reserve_length' parameter should be longer than 'update_frequency' + 'gate_closure' to fix the reserves properly!"
); // END if
// Check that the duration of reserve activation is less than the reserve reactivation time
if(p_groupReserves(group, restype, 'reserve_reactivation_time') < p_groupReserves(group, restype, 'reserve_activation_duration'),
put log '!!! Error occurred on group ', group.tl:0 /;
put log '!!! Abort: The reserve_reactivation_time should be greater than or equal to the reserve_activation_duration!' /;
abort "The reserve_reactivation_time should be greater than or equal to the reserve_activation_duration!"
); // END if
); // END loop(restypeDirectionGroup)
loop( restypeDirectionGridNode(restype, up_down, grid, node),
// Check for each restype that a node does not belong to multiple groups
if(sum(restypeDirectionGridNodeGroup(restype, up_down, grid, node, group), 1) > 1,
put log '!!! Error occurred on node ', node.tl:0 /;
......@@ -617,7 +642,7 @@ loop( restypeDirectionGridNode(restype, up_down, grid, node),
put log '!!! Abort: A node with reserve provision/transfer capability has to belong to a reserve node group!' /;
abort "A node with reserve provision/transfer capability has to belong to a reserve node group!"
); // END if
); // END loop(restypeDirectionNode)
); // END loop(restypeDirectionGridNode)
// Check that reserve overlaps are possible
loop( (gnu(grid, node, unit), restypeDirection(restype, up_down)),
......
......@@ -111,6 +111,17 @@ q_obj ..
] // END * p_sft_probability(s,f,t)
// Variable Transfer
+ sum(gn2n_directional(grid, node_, node),
+ p_gnn(grid, node, node_, 'variableTransCost')
* v_transferLeftward(grid, node_, node, s, f, t)
) // END sum(gn2n_directional(grid, node_, node))
+ sum(gn2n_directional(grid, node_, node),
+ p_gnn(grid, node_, node, 'variableTransCost')
* v_transferRightward(grid, node_, node, s, f, t)
) // END sum(gn2n_directional(grid, node_, node))
) // END sum over msft(m, s, f, t)
// Cost of energy storage change (note: not discounted)
......
......@@ -2317,6 +2317,8 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Downward reserves from units that output energy to the node
+ sum(gnuRescapable(restype, 'down', grid_, node_input, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ v_reserve(restype, 'down', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
/ sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2329,6 +2331,8 @@ q_stateUpwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Downward reserves from units that use the node as energy input
+ sum(gnuRescapable(restype, 'down', grid_, node_output, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ v_reserve(restype, 'down', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
* sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2381,6 +2385,8 @@ q_stateDownwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Upward reserves from units that output energy to the node
+ sum(gnuRescapable(restype, 'up', grid_, node_input, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_input, restype, 'reserve_length') },
+ v_reserve(restype, 'up', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
/ sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2393,6 +2399,8 @@ q_stateDownwardLimit(gn_state(grid, node), msft(m, s, f, t))
// Upward reserves from units that use the node as energy input
+ sum(gnuRescapable(restype, 'up', grid_, node_output, unit)${ ord(t) < tSolveFirst + p_gnReserves(grid_, node_output, restype, 'reserve_length') },
+ v_reserve(restype, 'up', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
* sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2423,6 +2431,8 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t)) ..
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'down', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
/ sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2436,6 +2446,8 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t)) ..
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'down', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
* sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2468,6 +2480,8 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t)) ..
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'up', grid_, node_input, unit, s, f+df_reserves(grid_, node_input, restype, f, t), t)
* p_gnReserves(grid_, node_input, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_input, restype, 'reserve_reactivation_time')
/ sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......@@ -2481,6 +2495,8 @@ q_boundStateMaxDiff(gnn_boundState(grid, node, node_), msft(m, s, f, t)) ..
and ord(t) < tSolveFirst + p_gnReserves(grid_, node, restype, 'reserve_length')
},
+ v_reserve(restype, 'up', grid_, node_output, unit, s, f+df_reserves(grid_, node_output, restype, f, t), t)
* p_gnReserves(grid_, node_output, restype, 'reserve_activation_duration')
/ p_gnReserves(grid_, node_output, restype, 'reserve_reactivation_time')
* sum(suft(effGroup, unit, f, t),
+ p_effGroupUnit(effGroup, unit, 'slope')${not ts_effGroupUnit(effGroup, unit, 'slope', f, t)}
+ ts_effGroupUnit(effGroup, unit, 'slope', f, t) // Efficiency approximated using maximum slope of effGroup?
......
......@@ -190,7 +190,7 @@ loop(m,
* --- Calculate 'lastStepNotAggregated' for aggregated units and aggregator units ---
loop(effLevel$mSettingsEff(m, effLevel),
loop(effLevel_${mSettingsEff(m, effLevel_) and ord(effLevel_) <= ord(effLevel)},
loop(effLevel_${mSettingsEff(m, effLevel_) and ord(effLevel_) < ord(effLevel)},
p_unit(unit_aggregated(unit), 'lastStepNotAggregated')${ sum(unit_,unitUnitEffLevel(unit_, unit, effLevel)) }
= mSettingsEff(m, effLevel_);
p_unit(unit_aggregator(unit), 'lastStepNotAggregated')${ sum(unit_,unitUnitEffLevel(unit, unit_, effLevel)) }
......@@ -237,6 +237,12 @@ loop(m,
);
);
);
// Store the first time step of the effLevel
loop(effLevel$mSettingsEff(m, effLevel),
loop(effLevel_${mSettingsEff(m, effLevel_) and ord(effLevel_) < ord(effLevel)},
mSettingsEff_start(m, effLevel) = mSettingsEff(m, effLevel_) + 1;
);
);
);
* --- Units with online variables in the first active effLevel ---------------
......
......@@ -639,7 +639,7 @@ Option clear = sufts;
// Loop over the defined efficiency groups for units
loop(effLevelGroupUnit(effLevel, effGroup, unit)${ mSettingsEff(mSolve, effLevel) },
// Determine the used effGroup for each uft
suft(effGroup, uft(unit, f, t))${ ord(t) >= tSolveFirst + mSettingsEff(mSolve, effLevel - 1) + 1
suft(effGroup, uft(unit, f, t))${ ord(t) >= tSolveFirst + mSettingsEff_start(mSolve, effLevel)
and ord(t) <= tSolveFirst + mSettingsEff(mSolve, effLevel) }
= yes;
); // END loop(effLevelGroupUnit)
......
......@@ -51,18 +51,21 @@ $offtext
schedule.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
schedule.OptFile = 1;
solve schedule using mip minimizing v_obj;
checkSolveStatus(schedule);
); // END IF SCHEDULE
if (mSolve('building'),
building.holdfixed = 1;
building.OptFile = 1;
solve building using mip minimizing v_obj;
checkSolveStatus(building);
); // END IF BUILDING
if (mSolve('invest'),
invest.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
invest.OptFile = 1;
solve invest using mip minimizing v_obj;
checkSolveStatus(invest);
); // END IF INVEST
......
......@@ -124,6 +124,14 @@ loop(sft_realized(s, f, t),
r_transfer(gn2n(grid, from_node, to_node), f, t)$[ord(t) > mSettings(mSolve, 't_start') + mSettings(mSolve, 't_initializationPeriod')]
= v_transfer.l(grid, from_node, to_node, s, f, t)
;
// Transfer of energy from first node to second node
r_transferRightward(gn2n_directional(grid, from_node, to_node), f, t)$[ord(t) > mSettings(mSolve, 't_start') + mSettings(mSolve, 't_initializationPeriod')]
= v_transferRightward.l(grid, from_node, to_node, s, f, t)
;
// Transfer of energy from second node to first node
r_transferLeftward(gn2n_directional(grid, to_node, from_node), f, t)$[ord(t) > mSettings(mSolve, 't_start') + mSettings(mSolve, 't_initializationPeriod')]
= v_transferLeftward.l(grid, to_node, from_node, s, f, t)
;
// Energy spilled from nodes
r_spill(gn(grid, node), f, t)$[ord(t) > mSettings(mSolve, 't_start') + mSettings(mSolve, 't_initializationPeriod')]
= v_spill.l(grid, node, s, f, t)
......
......@@ -64,6 +64,15 @@ loop(m,
] // END * r_startup
); // END sum(starttype)
//Variable Trnasfer Costs
r_gnnVariableTransCost(gn2n_directional(grid, node_, node), ft_realizedNoReset(f,t))$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
*[+ p_gnn(grid, node, node_, 'variableTransCost')
* r_transferLeftward(grid, node_, node, f, t)
+ p_gnn(grid, node_, node, 'variableTransCost')
* r_transferRightward(grid, node_, node, f, t)];
// Node state slack costs
r_gnStateSlackCost(gn_stateSlack(grid, node), ft_realizedNoReset(f,t))$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= 1e-6 // Scaling to MEUR
......@@ -102,6 +111,13 @@ loop(m,
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s) * p_s_discountFactor(s))
);
// Total Variable Transfer costs
r_gnnTotalVariableTransCost(gn2n_directional(grid, node_, node))
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_gnnVariableTransCost(grid, node_, node, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s) * p_s_discountFactor(s))
);
// Total fuel & emission costs
r_uTotalFuelEmissionCost(commodity, unit)$un_commodity(unit, commodity)
= sum(ft_realizedNoReset(f,t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
......@@ -188,6 +204,10 @@ loop(m,
+ r_uStartupCost(unit, f, t)
}
)
+ sum(gn2n_directional(grid, node_, node),
// Variable Transfer costs
+ r_gnnVariableTransCost(grid, node_, node, f, t)
)
// Node state slack costs
+ r_gnStateSlackCost(grid, node, f, t);
......@@ -573,6 +593,14 @@ r_uTotalShutdown(unit)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* --- Sum results for groups --------------------------------------------------
// gnTotalgen in units that belong to gnuGroups over the simulation
r_gnTotalGenGnuGroup(grid, node, group)
= sum(unit $ {gnuGroup(grid, node, unit, group)},
+ r_gnuTotalGen(grid, node, unit)
); // END sum(unit)
* --- Diagnostic Results ------------------------------------------------------
// Only include these if '--diag=yes' given as a command line argument
......
......@@ -12,8 +12,11 @@
],
"description": "Backbone",
"inputfiles": [
"input/modelsInit.gms",
"input/inputData.gdx",
"input/modelsInit.gms"
"input/timeAndSamples.inc",
"input/1_options.gms",
"input/scheduleInit.gms"
],
"inputfiles_opt": [
"input/*.*"
......@@ -23,6 +26,6 @@
"Backbone.lst"
],
"cmdline_args": [],
"execute_in_work": true,
"includes_main_path": "C:/data/backbone"
"execute_in_work": false,
"includes_main_path": "."
}
\ No newline at end of file
{"name": "ToBackboneParameters", "item_type": "Data Transformer", "description": "", "filter": {"type": "parameter_rename", "settings": {"annuity": "annuity", "availability": "availability", "boundaryValue": "ts_node", "capacity": "capacity", "capacityFactor": "ts_cf", "coefficient": "p_unitConstraintNode", "constant": "p_unitConstraint", "conversionCoeff": "conversionCoeff", "discountFactor": "p_s_discountFactor", "down": "down", "eff00": "eff00", "eff01": "eff01", "emission_content": "p_nEmission", "energyStoredPerUnitOfState": "energyStoredPerUnitOfState", "fixedFuelFraction": "fixedFuelFraction", "forwardReserve": "p_gnuRes2Res", "influx": "ts_influx", "initialGeneration": "initialGeneration", "initialOnlineStatus": "initialOnlineStatus", "invCosts": "invCosts", "maxRampDown": "maxRampDown", "maxRampUp": "maxRampUp", "minOperationHours": "minOperationHours", "minShutDownHours": "minShutDownHours", "nodeBalance": "nodeBalance", "op00": "op00", "op01": "op01", "portion_of_infeed_to_reserve": "portion_of_infeed_to_reserve", "priceChange": "ts_priceChange", "rampSpeedToMinLoad": "rampSpeedToMinLoad", "reserveDemand": "ts_reserveDemand", "reserve_length": "reserve_length", "shutdownCost": "shutdownCost", "startColdAfterXhours": "startColdAfterXhours", "startCostCold": "startCostCold", "startCostHot": "startCostHot", "startCostWarm": "startCostWarm", "startFuelConsCold": "startFuelConsCold", "startFuelConsHot": "startFuelConsHot", "startWarmAfterXHours": "startWarmAfterXHours", "startfuelConsWarm": "startfuelConsWarm", "storageValue": "p_storageValue", "storageValue_ts": "ts_storageValue", "transferCap": "transferCap", "transferLoss": "transferLoss", "ts_unit": "ts_unit", "unitCount": "unitCount", "unitSize": "unitSize", "up": "up", "update_frequency": "update_frequency", "useConstant": "useConstant", "useInitialGeneration": "useInitialGeneration", "useInitialOnlineStatus": "useInitialOnlineStatus", "value": "p_gnPolicy", "vomCosts": "vomCosts"}}}
\ No newline at end of file
{"name": "ToBackboneParameters", "item_type": "Data Transformer", "description": "", "filter": {"type": "parameter_rename", "settings": {"availability": "availability", "boundStart": "boundStart", "boundStartAndEnd": "boundStartAndEnd", "boundaryValue": "ts_node", "capacity": "capacity", "capacityFactor": "ts_cf", "coefficient": "p_unitConstraintNode", "constant": "p_unitConstraint", "conversionCoeff": "conversionCoeff", "discountFactor": "p_s_discountFactor", "down": "down", "eff00": "eff00", "eff01": "eff01", "emission_content": "p_nEmission", "energyStoredPerUnitOfState": "energyStoredPerUnitOfState", "fixedFuelFraction": "fixedFuelFraction", "forwardReserve": "p_gnuRes2Res", "gate_closure": "gate_closure", "influx": "ts_influx", "minOperationHours": "minOperationHours", "minShutdownHours": "minShutdownHours", "multiplier": "multiplier", "nodeBalance": "nodeBalance", "op00": "op00", "op01": "op01", "opFirstCross": "opFirstCross", "priceChange": "ts_priceChange", "reserveDemand": "ts_reserveDemand", "reserve_length": "reserve_length", "selfDischargeLoss": "selfDischargeLoss", "startCostCold": "startCostCold", "startFuelConsCold": "startFuelConsCold", "storageValue": "p_storageValue", "transferCap": "transferCap", "transferLoss": "transferLoss", "ts_storageValue": "ts_storageValue", "ts_unit": "ts_unit", "unitCount": "unitCount", "unitSize": "unitSize", "up": "up", "update_frequency": "update_frequency", "useConstant": "useConstant", "useTimeseries": "useTimeseries", "value": "p_gnPolicy", "vomCosts": "vomCosts"}}}
\ No newline at end of file
{"name": "ToBackboneSets", "item_type": "Data Transformer", "description": "", "filter": {"type": "entity_class_rename", "settings": {"availability": "availability", "boundarytypes": "param_gnBoundaryTypes", "commodity": "commodity", "commodity_price": "commodity_price", "constraint": "constraint", "direction": "direction", "efflevel": "efflevel", "efflevel__group__unit": "effLevelGroupUnit", "effselector": "effSelector", "emission": "emission", "f": "f", "flow": "flow", "flow__unit": "flowUnit", "gnu__restype__up_down__restype": "gnu__restype__up_down__restype", "grid": "grid", "grid__node": "grid__node", "grid__node__boundary": "grid__node__boundary", "grid__node__f_storageValue": "grid__node__f_storageValue", "grid__node__group": "gnGroup", "grid__node__node": "grid__node__node", "grid__node__node__group": "gn2nGroup", "grid__node__node__restype": "grid__node__node__restype", "grid__node__policy__emission": "grid__node__policy__emission", "grid__node__sample__sample": "gnss_bound", "grid__node__unit__boundary": "grid__node__unit__boundary", "grid__node__unit__group": "gnuGroup", "grid__node__unit__io": "grid__node__unit__io", "grid__node__unit__restype": "grid__node__unit__restype", "group": "group", "group__restype": "group__restype", "group__restype__up_down": "group__restype__up_down", "group__restype__up_down__group": "group__restype__up_down__group", "group__unit": "group__unit", "input_output": "input_output", "node": "node", "node__emission": "node__emission", "param_availability_units": "param_availability_units", "policy": "policy", "restype": "restype", "restype__direction": "restypeDirection", "restype_inertia": "restype_inertia", "restype_released_for_realization": "restypeReleasedForRealization", "s": "s", "sample__group": "sGroup", "sample_discountFactor": "sample_discountFactor", "scenario": "scenario", "slack": "slack", "t_availability": "t_availability", "t_invest": "t_invest", "ts_flow__node__f": "ts_flow__node__f", "ts_grid__node__boundary__f": "ts_grid__node__boundary__f", "ts_grid__node__f": "ts_grid__node__f", "ts_restype__up_down__group": "ts_restype__up_down__group", "ts_unit__param__f": "ts_unit__param__f", "unit": "unit", "unit__constraint": "unit__constraint", "unit__constraint__node": "unit__constraint__node", "unit__group": "uGroup", "unit__sample__sample": "uss_bound", "unit__startupFuel": "unit__startupFuel", "unit__t__availability": "utAvailabilityLimits", "unit__unittype": "unitUnittype", "unit_aggregate__unit__efflevel": "unitUnitEffLevel", "unit_fail": "unit_fail", "unittype": "unittype", "up_down": "up_down"}}}
\ No newline at end of file
{"name": "ToBackboneSets", "item_type": "Data Transformer", "description": "", "filter": {"type": "entity_class_rename", "settings": {"availability": "availability", "boundarytypes": "param_gnBoundaryTypes", "commodity": "commodity", "constraint": "constraint", "effLevel": "effLevel", "effLevel__group__unit": "effLevelGroupUnit", "effSelector": "effSelector", "emission": "emission", "f": "f", "flow": "flow", "flow__unit": "flowUnit", "gnu__restype__up_down__restype": "gnu__restype__up_down__restype", "grid": "grid", "grid__node": "grid__node", "grid__node__boundary": "grid__node__boundary", "grid__node__f_storageValue": "grid__node__f_storageValue", "grid__node__group": "gnGroup", "grid__node__node": "grid__node__node", "grid__node__node__group": "gn2nGroup", "grid__node__node__restype": "grid__node__node__restype", "grid__node__policy__emission": "grid__node__policy__emission", "grid__node__sample__sample": "gnss_bound", "grid__node__unit__boundary": "grid__node__unit__boundary", "grid__node__unit__group": "gnuGroup", "grid__node__unit__io": "grid__node__unit__io", "grid__node__unit__restype": "grid__node__unit__restype", "group": "group", "group__restype": "group__restype", "group__restype__up_down": "group__restype__up_down", "group__restype__up_down__group": "group__restype__up_down__group", "group__unit": "group__unit", "input_output": "input_output", "node": "node", "node__emission": "node__emission", "param_unit_ts": "param_unit_ts", "policy": "policy", "restype": "restype", "restype__direction": "restypeDirection", "restype_inertia": "restype_inertia", "restype_released_for_realization": "restypeReleasedForRealization", "s": "s", "sample__group": "sGroup", "sample_discountFactor": "sample_discountFactor", "scenario": "scenario", "slack": "slack", "t_availability": "t_availability", "t_invest": "t_invest", "ts_flow__node__f": "ts_flow__node__f", "ts_grid__node__boundary__f": "ts_grid__node__boundary__f", "ts_grid__node__f": "ts_grid__node__f", "ts_restype__up_down__group": "ts_restype__up_down__group", "unit": "unit", "unit__constraint": "unit__constraint", "unit__constraint__node": "unit__constraint__node", "unit__group": "uGroup", "unit__sample__sample": "uss_bound", "unit__startupFuel": "unit__startupFuel", "unit__t__availability": "utAvailabilityLimits", "unit__unittype": "unitUnittype", "unit_aggregate__unit__efflevel": "unitUnitEffLevel", "unit_fail": "unit_fail", "unit_ts": "unit_ts", "unittype": "unittype", "up_down": "up_down"}}}
\ No newline at end of file
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