Commit 195f863a authored by Niina Helistö's avatar Niina Helistö
Browse files

Merge branch 'dev' into #121_domain_checking

parents 3eaefe92 419bc30a
......@@ -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
);
......
......@@ -28,7 +28,7 @@ loop(m,
r_gnuVOMCost(gnu(grid, node, unit), ft_realizedNoReset(f,t))$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
* r_gen(grid, node, unit, f, t)
* abs(r_gen(grid, node, unit, f, t))
* p_gnu(grid, node, unit, 'vomCosts');
// Fuel and emission costs during normal operation
......@@ -36,12 +36,8 @@ loop(m,
= 1e-6 // Scaling to MEUR
* p_stepLengthNoReset(m, f, t)
* r_fuelUse(commodity, unit, f, t)
* [ // Fuel price when input
+ p_price(commodity, 'price')${p_price(commodity, 'useConstant') and un_commodity_in(unit, commodity)}
+ ts_price(commodity, t)${p_price(commodity, 'useTimeSeries') and un_commodity_in(unit, commodity)}
// Fuel price when output
- p_price(commodity, 'price')${p_price(commodity, 'useConstant') and un_commodity_out(unit, commodity)}
- ts_price(commodity, t)${p_price(commodity, 'useTimeSeries') and un_commodity_out(unit, commodity)}
* [ + p_price(commodity, 'price')$p_price(commodity, 'useConstant')
+ ts_price(commodity, t)$p_price(commodity, 'useTimeSeries')
// Emission costs
+ sum(emission, p_unitEmissionCost(unit, commodity, emission))
];
......@@ -180,11 +176,12 @@ loop(m,
)
// Allocate fuel and startup costs on energy basis, but for output nodes only
+ sum(unit$gnu(grid, node, unit),
+ sum(gnu(grid, node, unit)$(gnu_output(grid, node, unit) and r_gen[grid, node, unit, f, t]),
+ abs{r_gen[grid, node, unit, f, t]} // abs is due to potential negative outputs like energy from a cooling unit. It's the energy contribution that matters, not direction.
/
sum(gnu_output(grid_output, node_output, unit)$r_gen[grid_output, node_output, unit, f, t], abs{r_gen[grid_output, node_output, unit, f, t]})
)
+ [
+ abs{r_gen(grid, node, unit, f, t)} // abs is due to potential negative outputs like energy from a cooling unit. It's the energy contribution that matters, not direction.
/ sum(gnu_output(grid_output, node_output, unit),
+ abs{r_gen(grid_output, node_output, unit, f, t)}
) // END sum(gnu_output)
]$(gnu_output(grid, node, unit) and abs{r_gen(grid, node, unit, f, t)} > eps)
*
{
+ sum(un_commodity(unit, commodity), r_uFuelEmissionCost(commodity, unit, f, t))
......@@ -265,6 +262,37 @@ loop(m,
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
); // END sum(ft_realizedNoReset)
* --- Emission Results --------------------------------------------------------
// Emissions of units (only for commodities, not including startup fuels)
r_emissions(commodity, emission, unit, ft_realizedNoReset(f,t))$ {un_commodity(unit, commodity) and [ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]}
= + p_stepLengthNoReset(m, f, t)
* r_fuelUse(commodity, unit, f, t)
* p_nEmission(commodity, emission)
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
;
// Emission sums
r_nuTotalEmissions (commodity, unit, emission)
= sum(ft_realizedNoReset(f, t)$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')],
+ r_emissions(commodity, emission, unit, f, t)
* sum(msft_realizedNoReset(m, s, f, t), p_msProbability(m, s) * p_msWeight(m, s))
)
;
r_nTotalEmissions(commodity, emission)
= sum(unit, r_nuTotalEmissions (commodity, unit, emission))
;
r_uTotalEmissions(unit, emission)
= sum(commodity, r_nuTotalEmissions (commodity, unit, emission))
;
r_totalEmissions (emission)
= sum(commodity, r_nTotalEmissions(commodity, emission))
;
* --- Total Unit Online Results -----------------------------------------------
// Total sub-unit-hours for units over the simulation
......@@ -563,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
......
This diff is collapsed.
{
"name": "Backbone",
"description": "Backbone",
"tooltype": "gams",
"includes": [
"Backbone.gms",
"inc/*.gms",
"inc/rampSched/*.gms",
"inc/rampSched/*.gms",
"defModels/*.gms",
"defOutput/debugSymbols.inc",
"defOutput/resultSymbols.inc",
"cplex.opt"
],
"description": "Backbone",
"inputfiles": [
"input/inputData.gdx",
"input/modelsInit.gms"
......@@ -19,10 +19,10 @@
"input/*.*"
],
"outputfiles": [
"Backbone.lst",
"output/results.gdx"
"output/results.gdx",
"Backbone.lst"
],
"cmdline_args": "",
"cmdline_args": [],
"execute_in_work": true,
"includes_main_path": "."
}
"includes_main_path": "C:/data/backbone"
}
\ No newline at end of file
......@@ -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 /
This diff is collapsed.
This diff is collapsed.
{"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": "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
{"table_mappings": {"s": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "s"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "f": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "f"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "scenario": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "scenario"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "input_output": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "input_output"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "effLevel": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "effLevel"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "effSelector": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "effSelector"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}], "up_down": [{"map_type": "ObjectClass", "skip_columns": [], "read_start_row": 0, "name": {"map_type": "constant", "reference": "up_down"}, "parameters": {"map_type": "None"}, "import_objects": true, "objects": {"map_type": "column", "reference": 0}, "object_metadata": {"map_type": "None"}, "mapping_name": "Mapping 0"}]}, "table_options": {"s": {}, "f": {}, "scenario": {}, "input_output": {}, "effLevel": {}, "effSelector": {}, "up_down": {}}, "table_types": {"s": {"0": "string"}, "f": {"0": "string"}, "scenario": {"0": "string"}, "input_output": {"0": "string"}, "effLevel": {"0": "string"}, "effSelector": {"0": "string"}, "up_down": {"0": "string"}}, "table_row_types": {}, "selected_tables": ["s", "f", "scenario", "up_down", "input_output", "effLevel", "effSelector"], "source_type": "GdxConnector"}
\ No newline at end of file
This diff is collapsed.
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