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
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"
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_stateSlack(grid, node) "Nodes with a state slack variable"
gnn_state(grid, node, node) "Nodes with state variables interconnected via diffusion"
......
......@@ -205,6 +205,8 @@ unitStarttype(unit, starttypeConstrained)${ p_unit(unit, 'startWarmAfterXhours')
or p_unit(unit, 'startColdAfterXhours')
}
= 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
unit_timeseries(unit)${ p_unit(unit, 'useTimeseries') }
......@@ -273,6 +275,10 @@ p_uStartup(unit, 'cold', 'consumption')
= p_unit(unit, 'startFuelConsCold')
* 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
p_uShutdown(unit, 'cost')
......@@ -599,8 +605,8 @@ loop( unit,
* --- Check startupfuel fraction related data ----------------------------------------
loop( unit${sum(commodity$p_uStartupfuel(unit, commodity, 'fixedFuelFraction'), 1)},
if(sum(commodity, p_uStartupfuel(unit, commodity, 'fixedFuelFraction')) <> 1,
loop( unit${sum(starttype$p_uStartup(unit, starttype, 'consumption'), 1)},
if(sum(node, p_uStartupfuel(unit, node, 'fixedFuelFraction')) <> 1,
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!' /;
abort "The sum of 'fixedFuelFraction' over start-up fuels needs to be one for all units using start-up fuels!"
......
......@@ -3209,7 +3209,7 @@ q_emissioncap(group, emission)
+ v_startup_MIP(unit, starttype, s, 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_nEmission(node, emission) // kg/MWh
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
......
......@@ -435,30 +435,30 @@ $offtext
+ p_unitEmissionCost(unit, node, 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
ts_startupCost_(unit, starttype, tt_interval(t))
=
+ p_uStartup(unit, starttype, 'cost') // CUR/start-up
// 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
* [
// Fuel costs
+ p_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh
+ sum(tt_aggcircular(t, t_),
+ ts_price(node, t_) // CUR/MWh
)$p_price(node, 'useTimeseries')
/ mInterval(mSolve, 'stepsPerInterval', counter)
] // END * p_uStartup
) // END sum(node)
+ sum((nu(node, unit), emission)$p_unitEmissionCost(unit, node, emission),
+ p_unStartup(unit, node, starttype) // MWh/start-up
* p_unitEmissionCost(unit, node, emission) // CUR/MWh
); // END sum(nu, emission)
// Emission costs
+ sum(emission$p_nEmission(node, emission),
+ p_nEmission(node, emission) // t/MWh
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* sum(gnGroup(grid, node, group),
+ p_groupPolicyEmission(group, 'emissionTax', emission) // CUR/t
) // END sum(gnGroup)
) // END sum(emission)
] // END * p_unStartup
); // END sum(nu_startup)
// `storageValue`
ts_storageValue_(gn_state(grid, node), sft(s, f, tt_interval(t)))${ p_gn(grid, node, 'storageValueUseTimeSeries') }
......
......@@ -53,19 +53,24 @@ loop(m,
* sum(unitStarttype(unit, starttype),
+ r_startup(unit, starttype, f, t)
* [
// Fuel costs
+ p_uStartup(unit, starttype, 'cost') // CUR/start-up
// 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_price(node, 'price')$p_price(node, 'useConstant') // CUR/MWh
+ ts_price(node, t)$p_price(node, 'useTimeseries') // CUR/MWh
] // END * p_uStartup
) // END sum(node)
+ sum((nu(node, unit), emission)$p_unitEmissionCost(unit, node, emission),
+ p_unStartup(unit, node, starttype) // MWh/start-up
* p_unitEmissionCost(unit, node, emission) // CUR/MWh
) // END sum(nu, emission)
// Emission costs
+ sum(emission$p_nEmission(node, emission),
+ p_nEmission(node, emission) // t/MWh
/ 1e3 // NOTE!!! Conversion to t/MWh from kg/MWh in data
* sum(gnGroup(grid, node, group),
+ p_groupPolicyEmission(group, 'emissionTax', emission) // CUR/t
) // END sum(gnGroup)
) // END sum(emission)
] // END * p_unStartup
) // END sum(nu_startup)
] // END * r_startup
); // 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