Commit 5bb776ca authored by Toni's avatar Toni
Browse files

Added summary reporting and possibility to run with flat energy price (base case)

summary reporting: semmary_emob_inc
run with flat energy price: modify 2c_alternative_objective.gms
parent 9ec30b46
......@@ -181,13 +181,15 @@ $if defined scenario
* --- Energy modelling for buildings ---------------------------------------------------------------
node_building
node_building_DHWT(node),
node_building_envelope_mass(node),
node_building_interior_air_and_furniture(node),
node_building_DHWT(node)
node_building_envelope_mass(node)
node_building_interior_air_and_furniture(node)
node_building_internal_mass(node)
node_building2node(node_building,node)
unit_heat_and_cool(unit)
unit_heat(unit)
unit_cool(unit)
unit_DHW(unit)
unit_heat_and_cool(unit)
node_building2unit(node_building,unit)
* --- Set of timeseries that will be read from files between solves -----------
......
......@@ -98,9 +98,11 @@ $loaddc node_building_envelope_mass
$loaddc node_building_interior_air_and_furniture
$loaddc node_building_internal_mass
$loaddc node_building2node
$loaddc unit_heat_and_cool
$loaddc unit_heat
$loaddc unit_cool
$loaddc unit_DHW
$loaddc node_building2unit
$loaddc unit_heat_and_cool
$loaddc node_building2unit
$loaddc building_squares c2k
$gdxin
......
......@@ -48,7 +48,9 @@ q_obj ..
+ sum(inc_dec,
+ sum(gn(grid, node),
+ vq_gen(inc_dec, grid, node, s, f, t)
* ts_priceElspotNode(node,t)
* ts_priceElspotNode(node,t) // Line A: Use line A or B by commenting out the other one. Line A using Elspot price
* * 1 // Line B: Use line A or B by commenting out the other one. Line B: Flat price
* original *( PENALTY_BALANCE(grid, node)${not p_gnBoundaryPropertiesForStates(grid, node, 'balancePenalty', 'useTimeSeries')}
* original + ts_node_(grid, node, 'balancePenalty', s, f, t)${p_gnBoundaryPropertiesForStates(grid, node, 'balancePenalty', 'useTimeSeries')}
* original )
......
......@@ -55,13 +55,19 @@ Sets
IDA_ESBO_DH2.("IDA_ESBO_DH2.interior_air_and_furniture", "IDA_ESBO_DH2.internal_mass", "IDA_ESBO_DH2.envelope_mass" ,"IDA_ESBO_DH2.DHWT1000")
IDA_ESBO_AB .("IDA_ESBO_AB.interior_air_and_furniture" , "IDA_ESBO_AB.internal_mass" , "IDA_ESBO_AB.envelope_mass" ,"IDA_ESBO_AB.DHWT1000")
/
unit_heat_and_cool(unit) /
"IDA_ESBO_DH1.ideal_heating", "IDA_ESBO_DH2.ideal_heating", "IDA_ESBO_AB.ideal_heating",
unit_heat(unit) /
"IDA_ESBO_DH1.ideal_heating", "IDA_ESBO_DH2.ideal_heating", "IDA_ESBO_AB.ideal_heating"
/
unit_cool(unit) /
"IDA_ESBO_DH1.ideal_cooling", "IDA_ESBO_DH2.ideal_cooling", "IDA_ESBO_AB.ideal_cooling"
/
unit_DHW(unit) /
"IDA_ESBO_DH1.ideal_DHW", "IDA_ESBO_DH2.ideal_DHW", "IDA_ESBO_AB.ideal_DHW"
/
unit_heat_and_cool(unit) /
"IDA_ESBO_DH1.ideal_heating", "IDA_ESBO_DH2.ideal_heating", "IDA_ESBO_AB.ideal_heating",
"IDA_ESBO_DH1.ideal_cooling", "IDA_ESBO_DH2.ideal_cooling", "IDA_ESBO_AB.ideal_cooling"
/
node_building2unit(node_building,unit) /
IDA_ESBO_DH1.("IDA_ESBO_DH1.ideal_heating","IDA_ESBO_DH1.ideal_cooling","IDA_ESBO_DH1.ideal_DHW")
IDA_ESBO_DH2.("IDA_ESBO_DH2.ideal_heating","IDA_ESBO_DH2.ideal_cooling","IDA_ESBO_DH2.ideal_DHW")
......
......@@ -38,7 +38,7 @@ $onechoV > runR.inc
$offecho
* Define source GDX for plotting data
$set backbone_output_GDX "output\archive\out_alt_obj.gdx"
$set backbone_output_GDX "output\out.gdx"
* Preparation
$set GDXparam2 priceElec
......@@ -61,6 +61,9 @@ execute_loaddc "%backbone_output_GDX%", tparam=t_realized, ts_priceElspot;
%GDXparam2%(tparam,%GDXparam2set2%)=ts_priceElspot(tparam) +eps ;
$set Ylabel2 "Price of electricity (EUR/MWh) :"
* Create summary_emob.gdx
$include plots/summary_emob.inc
* CREATE PLOTS:
* Common for all plots
* None
......
$ontext
Create summary of Energy Modelling Of Buildings (EMOB)
Create file summary_emob.txt
Toni Lastusilta (VTT) , 2022-01-09
$offtext
Scalars
error_elec_tot "Supplementary scalar of error checking of electricity" /0/
error_unit "Detect if unit supplies energy to grid " /0/
e_per_Mw_2_e_per_kw "Convert price from /MW to /kW" /1e-3 /
info "Run date is %system.date% %system.time% " /1/
;
Set
cat "Summary categories"/
elec_ideal_heating_kWh_by_m2 " Heating electricity usage (kWh)"
elec_ideal_cooling_kWh_by_m2 " Cooling electricity usage (kWh)"
elec_ideal_DHW_kWh_by_m2 " Domestic Hot Water heating electricity usage (kWh)"
elec_tot_kWh_by_m2 " Total electricity usage (kWh)"
elec_tot_kWh " Total electricity usage (kWh)"
cost_ideal_heating_by_m2 " Heating cost ()"
cost_ideal_cooling_by_m2 " Cooling cost ()"
cost_ideal_DHW_by_m2 " Domestic Hot Water heating cost ()"
cost_tot_by_m2 " Total cost ()"
cost_tot " Total cost ()"
/;
Parameters
summary(*,node_building) "Summary of Energy Modelling of Buildings in Backbone"
tmp_cost(*,node_building,t) "Auxiliary parameter for calculations"
error_unit_details(node,unit,t) "Show which unit supplies energy to grid "
;
*Load result file : r_gen(grid, node, unit,f,t)
execute_loaddc "%backbone_output_GDX%", tparam=t_realized, r_gen;
summary("elec_ideal_heating_kWh_by_m2",node_building) = sum((node_building2node(node_building,node),unit_heat(unit),tparam(t)), w2kw * r_gen("building", node, unit,'f00',t)/ building_squares(node_building)+ eps) ;
summary("elec_ideal_cooling_kWh_by_m2",node_building) = sum((node_building2node(node_building,node),unit_cool(unit),tparam(t)), w2kw * r_gen("building", node, unit,'f00',t)/ building_squares(node_building)+ eps);
summary("elec_ideal_DHW_kWh_by_m2" ,node_building) = sum((node_building2node(node_building,node),unit_DHW(unit),tparam(t)) , w2kw * r_gen("building", node, unit,'f00',t)/ building_squares(node_building)+ eps);
summary("elec_tot_kWh_by_m2",node_building) = sum((node_building2node(node_building,node),unit,tparam(t)), w2kw * r_gen("building", node, unit,'f00',t) / building_squares(node_building) + eps);
summary("elec_tot_kWh",node_building) = sum((node_building2node(node_building,node),unit,tparam(t)), w2kw * r_gen("building", node, unit,'f00',t)+ eps);
tmp_cost("cost_ideal_heating_by_m2",node_building,tparam(t)) = sum((node,node_building2unit(node_building,unit),unit_heat(unit))$(sameas(node,'link_node')), sign * w2kw * r_gen("elec", node, unit,'f00',t)/ building_squares(node_building)+ eps) ;
tmp_cost("cost_ideal_cooling_by_m2",node_building,tparam(t)) = sum((node,node_building2unit(node_building,unit),unit_cool(unit))$(sameas(node,'link_node')), sign * w2kw * r_gen("elec", node, unit,'f00',t)/ building_squares(node_building)+ eps);
tmp_cost("cost_ideal_DHW_by_m2" ,node_building,tparam(t)) = sum((node,node_building2unit(node_building,unit),unit_DHW(unit))$(sameas(node,'link_node')) , sign * w2kw * r_gen("elec", node, unit,'f00',t)/ building_squares(node_building)+ eps);
tmp_cost("cost_tot_by_m2",node_building,tparam(t)) = sum((node,node_building2unit(node_building,unit))$(sameas(node,'link_node')), sign * w2kw * r_gen("elec", node, unit,'f00',t) / building_squares(node_building)+ eps);
tmp_cost("cost_tot",node_building,tparam(t)) = sum((node,node_building2unit(node_building,unit))$(sameas(node,'link_node')), sign * w2kw * r_gen("elec", node, unit,'f00',t)+ eps);
* Make negative values to zero (no selling of energy to the grid)
tmp_cost("cost_ideal_heating_by_m2",node_building,tparam(t)) = max(0, tmp_cost("cost_ideal_heating_by_m2",node_building,t) );
tmp_cost("cost_ideal_cooling_by_m2",node_building,tparam(t)) = max(0, tmp_cost("cost_ideal_cooling_by_m2",node_building,t) );
tmp_cost("cost_ideal_DHW_by_m2" ,node_building,tparam(t)) = max(0, tmp_cost("cost_ideal_DHW_by_m2" ,node_building,t) );
tmp_cost("cost_tot_by_m2",node_building,tparam(t)) = max(0, tmp_cost("cost_tot_by_m2",node_building,t) );
* calculate cost : ts_priceElspot
summary("cost_ideal_heating_by_m2",node_building) = sum(tparam(t),ts_priceElspot(t) * e_per_Mw_2_e_per_kw * tmp_cost("cost_ideal_heating_by_m2",node_building,t));
summary("cost_ideal_cooling_by_m2",node_building) = sum(tparam(t),ts_priceElspot(t) * e_per_Mw_2_e_per_kw * tmp_cost("cost_ideal_cooling_by_m2",node_building,t));
summary("cost_ideal_DHW_by_m2" ,node_building) = sum(tparam(t),ts_priceElspot(t) * e_per_Mw_2_e_per_kw * tmp_cost("cost_ideal_DHW_by_m2" ,node_building,t));
summary("cost_tot_by_m2",node_building) = sum(tparam(t),ts_priceElspot(t) * e_per_Mw_2_e_per_kw * tmp_cost("cost_tot_by_m2" ,node_building,t));
summary("cost_tot",node_building) = sum(tparam(t),ts_priceElspot(t) * e_per_Mw_2_e_per_kw * tmp_cost("cost_tot" ,node_building,t));
*Error checks
error_elec_tot = sum(node_building,summary("elec_tot_kWh_by_m2",node_building) - (
summary("elec_ideal_heating_kWh_by_m2",node_building) +
summary("elec_ideal_cooling_kWh_by_m2",node_building) +
summary("elec_ideal_DHW_kWh_by_m2" ,node_building) ))
if (abs(error_elec_tot) > 1e-3, abort "Error in summary calculation of elec_tot",error_elec_tot;);
error_unit= smax((node,node_building2unit(node_building,unit),tparam(t))$(sameas(node,'link_node')), w2kw * r_gen("elec", node, unit,'f00',t));
if (error_unit > 1e-3,
loop((unit,tparam(t)),
if( w2kw * r_gen("elec", 'link_node', unit,'f00',t) > 1e-3 ,
error_unit_details('link_node',unit,t) = r_gen("elec", 'link_node', unit,'f00',t);
);
);
abort "A unit is pushing electricity to the grid " , error_unit_details;
);
execute_unload 'output/summary_emob.gdx', summary, info;
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