Commit 122c72ea authored by Toni's avatar Toni
Browse files

Using ts_node for spot prices instead of alternative objective function

Identified a possible bug, see inputDataAdjustments.gms
parent eb64ea9d
......@@ -20,7 +20,7 @@ $offtext
* --- Objective Function Definition -------------------------------------------
* =============================================================================
Parameter
ts_priceElspotNode(node,t) /#node.#t 1E6/;
ts_priceElspotNode(node,t) /#node.#t 1E9/;
*node_building_DHWT node_building_envelope_mass node_building_interior_air_and_furniture node_building_internal_mass
*ts_priceElspotNode(node_building_DHWT,t)=ts_priceElspot(t);
*ts_priceElspotNode(node_building_interior_air_and_furniture,t)=ts_priceElspot(t);
......
......@@ -36,6 +36,39 @@ $offmulti
$load ts_influx p_gnBoundaryPropertiesForStates p_gnu_io p_gn p_unit p_gnn p_s_discountFactor
$gdxin
* Adding exogenous commodity electricity prices : ts_priceElspot
Set
tsIso Time-stamp in ISO8601 format
;
Parameters
elspotIsoBB(t,tsIso) "Elspot Prices_2013 (EUR/MWh) with backbone timestamp and ISO date"
ts_priceElspotNP(t) "Elspot NordPool Prices_2013 (EUR/MWh)"
ts_priceElspot(t) "Elspot Prices_2013 inc. tarifs and taxes (EUR/MWh)"
ts_priceElspot_backup(t) "Elspot Prices_2013 inc. tarifs and taxes (backup) (EUR/MWh)"
;
$gdxIn input\elspot_prices_2013.gdx
$load tsIso elspotIsoBB ts_priceElspotNP=elspotBB
$gdxin
* Add taxes Shk snt/kWh veroluokka I : 2,253 snt/kWh --> 22,53 /MWh
* https://www.vero.fi/yritykset-ja-yhteisot/verot-ja-maksut/valmisteverotus/sahkovero/verotaulukot/
* Considering Lumo tarif: Margin call: 0,24 snt/kWh + Basic fee 1,90 /month
* Ignoring basic fee: 0,24 snt/kWh --> 2,4 /MWh
* https://www.sahkon-kilpailutus.fi/en/market-electricity-price/
ts_priceElspot(t)$ts_priceElspotNP(t)=ts_priceElspotNP(t) + 22.53 + 2.4 ;
ts_priceElspot_backup(t)=ts_priceElspot(t);
*Settings
Parameter p_price_el_select "Use flat price 1 EUR/MWh (set 0). Use elspot price (set 1)" /1/;
if(0=p_price_el_select,
ts_priceElspot(t)=1$ts_priceElspot(t);
elseif 1=p_price_el_select,
ts_priceElspot(t)=ts_priceElspot(t);
else
abort "Error, invalid value for p_price_el_select, set 0 or 1";
);
* Modify Input (optional)
Parameters
modify_input "Modify input (0=no, 1=yes: to set new limits)" / 1 /
......@@ -94,57 +127,47 @@ if(modify_input=1,
display grid,node,node_building_DHWT,node_building_envelope_mass,node_building_interior_air_and_furniture,node_building_internal_mass,param_gnBoundaryTypes,param_gnBoundaryProperties,p_gnBoundaryPropertiesForStates;
* Set temperature (Celcius) limits for building_interior_air_and_furniture in Celcius
p_gnBoundaryPropertiesForStates('building',node_building_interior_air_and_furniture,'downwardLimit','constant') = c2k + temp('interior_air_and_furniture' ,'lo');
p_gnBoundaryPropertiesForStates('building',node_building_interior_air_and_furniture,'reference','constant') = c2k + temp('interior_air_and_furniture' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_interior_air_and_furniture,'upwardLimit','constant') = c2k + temp('interior_air_and_furniture' ,'up');
p_gnBoundaryPropertiesForStates('building',node_building_interior_air_and_furniture,'reference','constant') = c2k + temp('interior_air_and_furniture' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_interior_air_and_furniture,'upwardLimit','constant') = c2k + temp('interior_air_and_furniture' ,'up');
* Set temperature (Celcius) limits for building_internal_mass in Celcius
p_gnBoundaryPropertiesForStates('building',node_building_internal_mass,'downwardLimit','constant') = c2k + temp('internal_mass','lo');
p_gnBoundaryPropertiesForStates('building',node_building_internal_mass,'reference','constant') = c2k + temp('internal_mass','ref');
p_gnBoundaryPropertiesForStates('building',node_building_internal_mass,'upwardLimit','constant') = c2k + temp('internal_mass','up');
p_gnBoundaryPropertiesForStates('building',node_building_internal_mass,'reference','constant') = c2k + temp('internal_mass','ref');
p_gnBoundaryPropertiesForStates('building',node_building_internal_mass,'upwardLimit','constant') = c2k + temp('internal_mass','up');
* Set temperature limits for building_envelope_mass in Celcius
p_gnBoundaryPropertiesForStates('building',node_building_envelope_mass,'downwardLimit','constant') = c2k + temp('envelope_mass' ,'lo ');
p_gnBoundaryPropertiesForStates('building',node_building_envelope_mass,'reference','constant') = c2k + temp('envelope_mass' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_envelope_mass,'upwardLimit','constant') = c2k +temp('envelope_mass' ,'up');;
p_gnBoundaryPropertiesForStates('building',node_building_envelope_mass,'reference','constant') = c2k + temp('envelope_mass' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_envelope_mass,'upwardLimit','constant') = c2k + temp('envelope_mass' ,'up');;
* Set temperature limits for Domestic Hot Water Tank (DHWT)
p_gn(grid, node_building_DHWT, 'boundStart') = 1;
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'reference','useConstant') = 1;
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'reference','useConstant') = 1;
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'downwardLimit','constant') = c2k + temp('DHWT' ,'lo');
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'reference','constant') = c2k + temp('DHWT' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'upwardLimit','constant')= c2k + temp('DHWT' ,'up');
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'reference','constant') = c2k + temp('DHWT' ,'ref');
p_gnBoundaryPropertiesForStates('building',node_building_DHWT,'upwardLimit','constant') = c2k + temp('DHWT' ,'up');
* Set electricity price with ts_node modifier
p_gnBoundaryPropertiesForStates('elec', 'link_node', 'balancePenalty', 'useTimeSeries') = 1 ;
p_gnBoundaryPropertiesForStates('elec', 'link_node', 'balancePenalty', 'useConstant') = 0 ;
p_gnBoundaryPropertiesForStates('elec', 'link_node', 'balancePenalty', 'constant') = 0 ;
ts_node(grid, node, 'balancePenalty', f, t) = 1E9;
ts_node('elec', 'link_node', 'balancePenalty', f, t) = ts_priceElspot(t);
$ontext
POSSIBLE BUG
See 1e_inputs.gms lines:
gn_state(grid, node)${ gn_stateSlack(grid, node)
or p_gn(grid, node, 'energyStoredPerUnitOfState')
or sum((stateLimits, useConstantOrTimeSeries), p_gnBoundaryPropertiesForStates(grid, node, stateLimits, useConstantOrTimeSeries))
or sum(useConstantOrTimeSeries, p_gnBoundaryPropertiesForStates(grid, node, 'reference', useConstantOrTimeSeries))
}
= yes;
Issue: Using 'balancePenalty' does not affect gn_state !
$offtext
* Work around
p_gnBoundaryPropertiesForStates('elec', 'link_node','upwardLimit','useTimeSeries') = 1E50;
) ;
* Adding exogenous commodity electricity prices : ts_priceElspot
Set
tsIso Time-stamp in ISO8601 format
;
Parameters
elspotIsoBB(t,tsIso) "Elspot Prices_2013 (EUR/MWh) with backbone timestamp and ISO date"
ts_priceElspotNP(t) "Elspot NordPool Prices_2013 (EUR/MWh)"
ts_priceElspot(t) "Elspot Prices_2013 inc. tarifs and taxes (EUR/MWh)"
ts_priceElspot_backup(t) "Elspot Prices_2013 inc. tarifs and taxes (backup) (EUR/MWh)"
;
$gdxIn input\elspot_prices_2013.gdx
$load tsIso elspotIsoBB ts_priceElspotNP=elspotBB
$gdxin
* Add taxes Shk snt/kWh veroluokka I : 2,253 snt/kWh --> 22,53 /MWh
* https://www.vero.fi/yritykset-ja-yhteisot/verot-ja-maksut/valmisteverotus/sahkovero/verotaulukot/
* Considering Lumo tarif: Margin call: 0,24 snt/kWh + Basic fee 1,90 /month
* Ignoring basic fee: 0,24 snt/kWh --> 2,4 /MWh
* https://www.sahkon-kilpailutus.fi/en/market-electricity-price/
ts_priceElspot(t)=ts_priceElspotNP(t) + 22.53 + 2.4 ;
ts_priceElspot_backup(t)=ts_priceElspot(t);
*Setting
Parameter p_price_el_select "Use flat price 1 EUR/MWh (set 0). Use elspot price (set 1)" /0/;
if(0=p_price_el_select,
ts_priceElspot(t)=1$ts_priceElspot(t);
elseif 1=p_price_el_select,
ts_priceElspot(t)=ts_priceElspot(t);
else
abort "Error, invalid value for p_price_el_select, set 0 or 1";
);
* Adding temperature data
......
......@@ -12,7 +12,7 @@ $offtext
* Set TRUE or FALSE
$set archive FALSE
* Set file name prefix for archivation
$set archive_prefix 2022-01-19_TESTING_Case_flat_elec_price
$set archive_prefix 2022-01-21_TESTING_case_spot_price_in_ts_node
$set archive_exec 0
$if "%archive%"=="TRUE" $set archive_exec 1
......
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