Commit b929de99 authored by Toni's avatar Toni
Browse files

Added ambient(outside) temperature to plots

parent 9fdf399d
$ontext
Read temperature data from Excel
Source:
Topi Rasku(VTT)
2022-01-14 Toni Lastusilta (VTT)
$offtext
*Definition
Set
tsIso Time-stamp in ISO8601 format
t "Model time steps" / t000000 * t050000 /
;
Parameters
temp_outIso(tsIso) "Ambient temperature (C)"
temp_out(t) "Ambient temperature (C)"
;
*Read from Excel
$onEcho > howToRead.txt
set=tsIso rng=Hki-Vantaa_Ref_2012_no_WS!I2:I8787 rDim=1 values=noData
par=temp_outIso rng=Hki-Vantaa_Ref_2012_no_WS!I2:J8787 rDim=1
$offEcho
$call gdxxrw input\WeatherDataManipulation_TLv1.xlsx squeeze=n output=input\WeatherDataManipulation_2012.xlsx.gdx @howToRead.txt trace=3'
$gdxIn input\WeatherDataManipulation_2012.xlsx.gdx
$loaddc tsIso
$loaddc temp_outIso
$gdxIn
temp_out(t)$(ord(t)<=card(tsIso)) =sum(tsIso$(ord(t)=ord(tsIso)),temp_outIso(tsIso));
execute_unloaddi "input\ambient_temp_2012.gdx" temp_out;
......@@ -124,11 +124,15 @@ Parameters
$gdxIn input\elspot_prices_2013.gdx
$load tsIso elspotIsoBB ts_priceElspot=elspotBB
$gdxin
*Setting
Parameter p_price_el_select "Use flat price 1 EUR/MWh (set 0). Use elspot price (set 1)" /1/;
* Adding temperature data
Parameter
temp_out(t) "Outside temperature (C)";
execute_load "input\ambient_temp_2012.gdx" temp_out;
* Write input with domains at execution time to take in consideration modifications
execute_unloaddi "input\inputDataAdjusted1.gdx";
execute_unloaddi "input\inputDataAdjusted1Squuezed.gdx" node_building2node, node_building2unit, ts_priceElspot ts_influx effLevelGroupUnit p_gnBoundaryPropertiesForStates p_gnu_io p_gn p_unit node p_gnn unit unitUnittype grid p_s_discountFactor unittype
......@@ -16,10 +16,6 @@ $set archive_prefix 2022-01-XX_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
* Script to call R for making plots
$onechoV > runR.inc
$$log runR.inc creates line graphs with R from a two-dimensional parameter in a GDX file
......@@ -45,11 +41,15 @@ $onechoV > runR.inc
)
$offecho
* Load sets and parameter definition from backbone
$set input_file_gdx inputDataAdjusted1.gdx
$batinclude backbone_definitions_4plots.gms
* 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
* Define common sets and parameters
$set GDXparam2 priceElec
$set GDXparam2set2 price_2013
$set GDXparam2alt2 TempOut
......@@ -69,26 +69,32 @@ Parameter
sign "Switch sign" / -1 /
%GDXparam2%(t,%GDXparam2set2%) "Electricity spot price (EUR/MWh)"
%GDXparam2alt2%(t,%GDXparam2set2alt2%) "Temperature outside (Celcius)"
temp_out(t) "Outside temperature (C)"
;
* Prepare priceElspot
execute_loaddc "%backbone_output_GDX%", mSettings, ts_priceElspot ;
tparam(t)=(ord(t)<=(min(mSettings('building','dataLength'),mSettings('building','t_end')) - (mSettings('building','t_horizon')-mSettings('building','t_jump'))));
%GDXparam2%(tparam,%GDXparam2set2%)=ts_priceElspot(tparam) +eps ;
* CREATE PLOTS:
* Read common sets and parameters
* note that ts_priceElspot is already read in backbone_definitions_4plots.gms
$gdxin input/%input_file_gdx%
$loaddc temp_out
$gdxin
* Read tparam : what is visible in plots
execute_loaddc "%backbone_output_GDX%", mSettings ;
*tparam(t)=(ord(t)<=(min(mSettings('building','dataLength'),mSettings('building','t_end')) - (mSettings('building','t_horizon')-mSettings('building','t_jump'))));
tparam(t)=(ord(t)<=(mSettings('building','t_end') - (mSettings('building','t_horizon')-mSettings('building','t_jump'))));
* Read Elspot
%GDXparam2%(tparam,%GDXparam2set2%)=ts_priceElspot(tparam) + eps ;
$set Ylabel2_alt1 "Price of electricity (EUR/MWh) :"
*Prepare outside temperature
*%GDXparam2alt2%(tparam,%GDXparam2set2alt2%)=16 +eps ;
%GDXparam2alt2%(tparam,%GDXparam2set2alt2%)=0 ;
* Read temp_out
%GDXparam2alt2%(tparam,%GDXparam2set2alt2%)= temp_out(tparam)+ eps ;
$set Ylabel2_alt2 "Outside temperature (C) :"
* Create summary_emob.gdx
$include plots/summary_emob.inc
* CREATE PLOTS:
* Common for all plots
* None
* %GDXfile% for R, %GDXparam% parameter to plot, %TMPParam% two-dimensional counterpart to %GDXparam%
* CREATE INDIVIDUAL PLOTS
* Input for runR.inc : %GDXfile% for R, %GDXparam% parameter to plot, %TMPParam% two-dimensional counterpart to %GDXparam%
* %GDXparam2% is an additional two-dimensional parameter to plot on right-hand side Y-axis
* Plots 1 : ts_influx
* The influence of external power (weather) on building, namely envelope_mass due outside temperature changes and interior air due to ventilation
* Plot ts_influx_absolute *******************************************************
......@@ -178,8 +184,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at interior_air_and_furniture (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%TMPparam%(tparam(t),node_building_interior_air_and_furniture(node))=sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state(internal_mass) *******************************************************
......@@ -191,8 +197,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at internal_mass: inside walls (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%TMPparam%(tparam(t),node_building_internal_mass(node))=sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state(envelope_mass) *******************************************************
......@@ -204,8 +210,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at envelope_mass: outside walls (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%TMPparam%(tparam(t),node_building_envelope_mass(node))=sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state(DHWT) *******************************************************
......@@ -217,8 +223,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%TMPparam%(tparam(t),node_building_DHWT(node))=sum((grid,f)$(sameas(grid,"building") and sameas(f,'f00')),%GDXparam%(grid,node,f,t) - c2k + eps);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
......@@ -232,8 +238,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%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);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state: Building DH2 *******************************************************
......@@ -245,8 +251,8 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%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);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
* Plot r_state: Building AB *******************************************************
......@@ -258,7 +264,7 @@ $set Ylabel2 %Ylabel2_alt1%
Parameter %TMPparam%(t,*) "Temperature at Domestic Hot Water Tank (Celcius)" ;
execute_loaddc "%backbone_output_GDX%", %GDXparam%;
* Below line is adjusted for each paramGDX and paramPlot pair
%TMPparam%(tparam(t),'out_temp')=temp_out(t);
%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);
*%TMPparam%(tparam(t),'out_temp')=16;
execute_unload 'plots/%GDXfile%', tparam=t, node, %TMPparam%, %GDXparam2set2%, %GDXparam2% ;
$batInclude runR.inc %GDXfile% %TMPparam% %GDXparam2%
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