Commit f6a6cb32 authored by Toni's avatar Toni
Browse files

Added building specific plots and improve archiving functionality

parent 5bb776ca
......@@ -48,9 +48,9 @@ q_obj ..
+ sum(inc_dec,
+ sum(gn(grid, node),
+ vq_gen(inc_dec, grid, node, s, f, 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
* * 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 )
......
......@@ -79,7 +79,7 @@ Table
lo ref up
interior_air_and_furniture 20 20 24
internal_mass 20 20 24
envelope_mass 0 20 50
envelope_mass -90 20 50
DHWT 60 60 80
;
......
......@@ -210,15 +210,15 @@ if(!empty(df_p2)){
my_title_font_size = 8
my_axis_title_font_size = 7
my_axis_scale_font_size = 6
my_legend_title_font_size <- 7
my_legend_entry_font_size <- 6
my_legend_title_font_size <- 6
my_legend_entry_font_size <- 5
nr_cat <- nr_colors + nr_shapes
if(nr_cat<=8){
mypalette="Dark2"
} else if(nr_cat<=12){
mypalette="Set"
my_legend_title_font_size <- 7
my_legend_entry_font_size <- 6
my_legend_title_font_size <- 6
my_legend_entry_font_size <- 5
}else if(nr_cat<=20) {
mypalette=NULL
my_legend_title_font_size <- 4
......
......@@ -8,6 +8,14 @@ Plot backbone output with R for energy modelling of buildings
Toni Lastusilta (VTT) , 2022-01-09
$offtext
* ARCHIVE SETTINGS
* Set TRUE or FALSE
$set archive FALSE
* Set file name prefix for archivation
$set archive_prefix 2022-01-12_Testing
$set archive_exec 0
$if "%archive%"=="TRUE" $set archive_exec 1
* Load sets and parameter definition from backbone
$set input_file_gdx inputDataAdjusted1.gdx
$batinclude backbone_definitions_4plots.gms
......@@ -28,7 +36,7 @@ $onechoV > runR.inc
$$if set Ylabel2 $set r_ylabel2 -z "%Ylabel2%"
$$set r_xlabel
$$if set Xlabel $set r_xlabel -x "%Xlabel%"
execute 'Rscript "%gams.wDir%plots\do_r_plot.r" -i "%gams.wDir%plots/%1" -o "%gams.wDir%output/%2.pdf" -p %2 %r_param2% -w 168 -a FALSE %r_ylabel% %r_ylabel2% %r_xlabel% ';
execute 'Rscript "%gams.wDir%plots\do_r_plot.r" -i "%gams.wDir%plots/%1" -o "%gams.wDir%output/%2.pdf" -p %2 %r_param2% -w 168 -a %archive% %r_ylabel% %r_ylabel2% %r_xlabel% ';
myerrorlevel = errorlevel;
if(myerrorlevel=0,
Execute.ASyncNC 'SumatraPDF.exe "%gams.wDir%output/%2.pdf"';
......@@ -39,6 +47,7 @@ $offecho
* Define source GDX for plotting data
$set backbone_output_GDX "output\out.gdx"
$if "%archive%"=="TRUE" $call cp "%backbone_output_GDX%" "plots/archive/%archive_prefix%_backbone_out.gdx"
* Preparation
$set GDXparam2 priceElec
......@@ -187,3 +196,38 @@ execute_loaddc "%backbone_output_GDX%", tparam=t_realized, %GDXparam%;
%TMPparam%(tparam(t),node_building_DHWT(node))=sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plots 4 Building specific plots
* Plot r_state: Building DH1 *******************************************************
$set GDXfile plot4r.gdx
$set GDXparam r_state
$set TMPparam r_state_DH1
$set Ylabel Temperture (Celcius) :
Parameter %TMPparam%(t,node) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", tparam=t_realized, %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),node)$(node_building2node("IDA_ESBO_DH1",node)) = sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state: Building DH2 *******************************************************
$set GDXfile plot4r.gdx
$set GDXparam r_state
$set TMPparam r_state_DH2
$set Ylabel Temperture (Celcius) :
Parameter %TMPparam%(t,node) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", tparam=t_realized, %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),node)$(node_building2node("IDA_ESBO_DH2",node)) = sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state: Building AB *******************************************************
$set GDXfile plot4r.gdx
$set GDXparam r_state
$set TMPparam r_state_AB
$set Ylabel Temperture (Celcius) :
Parameter %TMPparam%(t,node) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", tparam=t_realized, %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),node)$(node_building2node("IDA_ESBO_AB",node)) = sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
......@@ -75,4 +75,9 @@ if (error_unit > 1e-3,
abort "A unit is pushing electricity to the grid " , error_unit_details;
);
execute_unload 'output/summary_emob.gdx', summary, info;
$set emob_GDX "output/summary_emob.gdx"
execute_unload "%emob_GDX%", summary, info;
if(%archive_exec%,
Execute 'cp "%emob_GDX%" "plots/archive/%archive_prefix%_summary_emob.gdx"';
);
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