Commit bf490176 authored by Niina Helistö's avatar Niina Helistö
Browse files

Updating start-up cost calculation and emission cap calculation

Start-up fuels (=nodes) are now defined in p_uStartupfuel with fixedFuelFraction. They do not need to be included in p_gnu_io.

Issue #160
parent b35503d0
...@@ -71,6 +71,7 @@ Sets ...@@ -71,6 +71,7 @@ Sets
gnu_input(grid, node, unit) "Forms of energy the unit uses as endogenous inputs" gnu_input(grid, node, unit) "Forms of energy the unit uses as endogenous inputs"
gnu_output(grid, node, unit) "Forms of energy the unit uses as endogenous outputs" gnu_output(grid, node, unit) "Forms of energy the unit uses as endogenous outputs"
nu(node, unit) "Units attached to particular nodes" nu(node, unit) "Units attached to particular nodes"
nu_startup(node, unit) "Units consuming energy from particular nodes in start-up"
gn_state(grid, node) "Nodes with a state variable" gn_state(grid, node) "Nodes with a state variable"
gn_stateSlack(grid, node) "Nodes with a state slack variable" gn_stateSlack(grid, node) "Nodes with a state slack variable"
gnn_state(grid, node, node) "Nodes with state variables interconnected via diffusion" gnn_state(grid, node, node) "Nodes with state variables interconnected via diffusion"
...@@ -219,7 +220,7 @@ alias(group, group_); ...@@ -219,7 +220,7 @@ alias(group, group_);
sets sets
tt_agg_circular(t, t, t) "Alternative aggregation ordering with embedded circulars" tt_agg_circular(t, t, t) "Alternative aggregation ordering with embedded circulars"
startp(t) "Temporary subset for time steps" startp(t) "Temporary subset for time steps"
s_realized(s) "All s among realized sft (redundant if always equivalent to s)" s_realized(s) "All s among realized sft (redundant if always equivalent to s)"
......
...@@ -205,6 +205,8 @@ unitStarttype(unit, starttypeConstrained)${ p_unit(unit, 'startWarmAfterXhours') ...@@ -205,6 +205,8 @@ unitStarttype(unit, starttypeConstrained)${ p_unit(unit, 'startWarmAfterXhours')
or p_unit(unit, 'startColdAfterXhours') or p_unit(unit, 'startColdAfterXhours')
} }
= yes; = yes;
// Units consuming energy from particular nodes in start-up
nu_startup(node, unit)$p_uStartupfuel(unit, node, 'fixedFuelFraction') = yes;
// Units with time series data enabled // Units with time series data enabled
unit_timeseries(unit)${ p_unit(unit, 'useTimeseries') } unit_timeseries(unit)${ p_unit(unit, 'useTimeseries') }
...@@ -273,6 +275,10 @@ p_uStartup(unit, 'cold', 'consumption') ...@@ -273,6 +275,10 @@ p_uStartup(unit, 'cold', 'consumption')
= p_unit(unit, 'startFuelConsCold') = p_unit(unit, 'startFuelConsCold')
* sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize')); * sum(gnu_output(grid, node, unit), p_gnu(grid, node, unit, 'unitSize'));
// Start-up fuel consumption per fuel
p_unStartup(unit, node, starttype)$p_uStartupfuel(unit, node, 'fixedFuelFraction')
= p_uStartup(unit, starttype, 'consumption')
* p_uStartupfuel(unit, node, 'fixedFuelFraction');
//shutdown cost parameters //shutdown cost parameters
p_uShutdown(unit, 'cost') p_uShutdown(unit, 'cost')
...@@ -599,8 +605,8 @@ loop( unit, ...@@ -599,8 +605,8 @@ loop( unit,
* --- Check startupfuel fraction related data ---------------------------------------- * --- Check startupfuel fraction related data ----------------------------------------
loop( unit${sum(commodity$p_uStartupfuel(unit, commodity, 'fixedFuelFraction'), 1)}, loop( unit${sum(starttype$p_uStartup(unit, starttype, 'consumption'), 1)},
if(sum(commodity, p_uStartupfuel(unit, commodity, 'fixedFuelFraction')) <> 1, if(sum(node, p_uStartupfuel(unit, node, 'fixedFuelFraction')) <> 1,
put log '!!! Error occurred on unit ' unit.tl:0 /; put log '!!! Error occurred on unit ' unit.tl:0 /;
put log '!!! Abort: The sum of fixedFuelFraction over start-up fuels needs to be one for all units using start-up fuels!' /; put log '!!! Abort: The sum of fixedFuelFraction over start-up fuels needs to be one for all units using start-up fuels!' /;
abort "The sum of 'fixedFuelFraction' over start-up fuels needs to be one for all units using start-up fuels!" abort "The sum of 'fixedFuelFraction' over start-up fuels needs to be one for all units using start-up fuels!"
...@@ -689,7 +695,7 @@ loop( unit_investMIP(unit), ...@@ -689,7 +695,7 @@ loop( unit_investMIP(unit),
* --- Check consistency of inputs for superposed node states ------------------- * --- Check consistency of inputs for superposed node states -------------------
* no checking yet because node_superpos is not given in the gdx input * no checking yet because node_superpos is not given in the gdx input
* ============================================================================= * =============================================================================
* --- Default values --------------------------------------------------------- * --- Default values ---------------------------------------------------------
......
...@@ -3209,7 +3209,7 @@ q_emissioncap(group, emission) ...@@ -3209,7 +3209,7 @@ q_emissioncap(group, emission)
+ v_startup_MIP(unit, starttype, s, f, t) + v_startup_MIP(unit, starttype, s, f, t)
${ uft_onlineMIP(unit, f, t) } ${ uft_onlineMIP(unit, f, t) }
] ]
* sum(nu(node, unit)${sum(grid, gnGroup(grid, node, group)) and p_nEmission(node, emission)}, * sum(nu_startup(node, unit)${sum(grid, gnGroup(grid, node, group)) and p_nEmission(node, emission)},
+ p_unStartup(unit, node, starttype) // MWh/start-up + p_unStartup(unit, node, starttype) // MWh/start-up
* p_nEmission(node, emission) // kg/MWh * p_nEmission(node, emission) // kg/MWh
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data / 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
......
...@@ -408,7 +408,7 @@ $offtext ...@@ -408,7 +408,7 @@ $offtext
+ dt_circular(t_)$(not gn_scenarios(grid, node, 'ts_node')))) + dt_circular(t_)$(not gn_scenarios(grid, node, 'ts_node'))))
) )
$(sameas(param_gnBoundaryTypes, 'upwardLimit') or upwardSlack(param_gnBoundaryTypes)); $(sameas(param_gnBoundaryTypes, 'upwardLimit') or upwardSlack(param_gnBoundaryTypes));
ts_gnn_(gn2n_timeseries(grid, node, node_, param_gnn), ft(f, tt_interval(t))) ts_gnn_(gn2n_timeseries(grid, node, node_, param_gnn), ft(f, tt_interval(t)))
= sum(tt_aggregate(t, t_), = sum(tt_aggregate(t, t_),
ts_gnn(grid, node, node_, param_gnn, f, t_+dt_circular(t_)) ts_gnn(grid, node, node_, param_gnn, f, t_+dt_circular(t_))
...@@ -423,7 +423,7 @@ $offtext ...@@ -423,7 +423,7 @@ $offtext
+ p_price(node, 'price')$p_price(node, 'useConstant') + p_price(node, 'price')$p_price(node, 'useConstant')
+ sum(tt_aggcircular(t, t_), ts_price(node, t_))$p_price(node, 'useTimeSeries') + sum(tt_aggcircular(t, t_), ts_price(node, t_))$p_price(node, 'useTimeSeries')
/ mInterval(mSolve, 'stepsPerInterval', counter) / mInterval(mSolve, 'stepsPerInterval', counter)
)$un_commodity_in(unit, node) )$un_commodity_in(unit, node)
// output node cost (if price > 0 --> ts_vomCost_ < 0, i.e. considered as revenue) // output node cost (if price > 0 --> ts_vomCost_ < 0, i.e. considered as revenue)
- ( - (
+ p_price(node, 'price')$p_price(node, 'useConstant') + p_price(node, 'price')$p_price(node, 'useConstant')
...@@ -435,30 +435,30 @@ $offtext ...@@ -435,30 +435,30 @@ $offtext
+ p_unitEmissionCost(unit, node, emission) + p_unitEmissionCost(unit, node, emission)
); // END sum(emission) ); // END sum(emission)
p_unStartup(unit, node, starttype)$p_uStartupfuel(unit, node, 'fixedFuelFraction')
=
+ p_uStartup(unit, starttype, 'consumption')
* p_uStartupfuel(unit, node, 'fixedFuelFraction');
// Calculating startup cost time series // Calculating startup cost time series
ts_startupCost_(unit, starttype, tt_interval(t)) ts_startupCost_(unit, starttype, tt_interval(t))
= =
+ p_uStartup(unit, starttype, 'cost') // CUR/start-up + p_uStartup(unit, starttype, 'cost') // CUR/start-up
// Start-up fuel and emission costs // Start-up fuel and emission costs
+ sum(nu(node,unit)$p_unStartup(unit, node, starttype), + sum(nu_startup(node, unit),
+ p_unStartup(unit, node, starttype) // MWh/start-up + p_unStartup(unit, node, starttype) // MWh/start-up
* [ * [
// Fuel costs
+ p_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh + p_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh
+ sum(tt_aggcircular(t, t_), + sum(tt_aggcircular(t, t_),
+ ts_price(node, t_) // CUR/MWh + ts_price(node, t_) // CUR/MWh
)$p_price(node, 'useTimeseries') )$p_price(node, 'useTimeseries')
/ mInterval(mSolve, 'stepsPerInterval', counter) / mInterval(mSolve, 'stepsPerInterval', counter)
] // END * p_uStartup // Emission costs
) // END sum(node) + sum(emission$p_nEmission(node, emission),
+ sum((nu(node, unit), emission)$p_unitEmissionCost(unit, node, emission), + p_nEmission(node, emission) // t/MWh
+ p_unStartup(unit, node, starttype) // MWh/start-up / 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* p_unitEmissionCost(unit, node, emission) // CUR/MWh * sum(gnGroup(grid, node, group),
); // END sum(nu, emission) + p_groupPolicyEmission(group, 'emissionTax', emission) // CUR/t
) // END sum(gnGroup)
) // END sum(emission)
] // END * p_unStartup
); // END sum(nu_startup)
// `storageValue` // `storageValue`
ts_storageValue_(gn_state(grid, node), sft(s, f, tt_interval(t)))${ p_gn(grid, node, 'storageValueUseTimeSeries') } ts_storageValue_(gn_state(grid, node), sft(s, f, tt_interval(t)))${ p_gn(grid, node, 'storageValueUseTimeSeries') }
......
...@@ -53,19 +53,24 @@ loop(m, ...@@ -53,19 +53,24 @@ loop(m,
* sum(unitStarttype(unit, starttype), * sum(unitStarttype(unit, starttype),
+ r_startup(unit, starttype, f, t) + r_startup(unit, starttype, f, t)
* [ * [
// Fuel costs
+ p_uStartup(unit, starttype, 'cost') // CUR/start-up + p_uStartup(unit, starttype, 'cost') // CUR/start-up
// Start-up fuel and emission costs // Start-up fuel and emission costs
+ sum(nu(node,unit)$p_unStartup(unit, node, starttype), + sum(nu_startup(node,unit),
+ p_unStartup(unit, node, starttype) // MWh/start-up + p_unStartup(unit, node, starttype) // MWh/start-up
* [ * [
+ p_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh + p_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh
+ ts_price(node, t)$p_price(node, 'useTimeseries') // CUR/MWh + ts_price(node, t)$p_price(node, 'useTimeseries') // CUR/MWh
] // END * p_uStartup // Emission costs
) // END sum(node) + sum(emission$p_nEmission(node, emission),
+ sum((nu(node, unit), emission)$p_unitEmissionCost(unit, node, emission), + p_nEmission(node, emission) // t/MWh
+ p_unStartup(unit, node, starttype) // MWh/start-up / 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* p_unitEmissionCost(unit, node, emission) // CUR/MWh * sum(gnGroup(grid, node, group),
) // END sum(nu, emission) + p_groupPolicyEmission(group, 'emissionTax', emission) // CUR/t
) // END sum(gnGroup)
) // END sum(emission)
] // END * p_unStartup
) // END sum(nu_startup)
] // END * r_startup ] // END * r_startup
); // END sum(starttype) ); // END sum(starttype)
......
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