inputDataAdjustments.gms 7.54 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$ontext
Supplementary tool for backbone energy building model
We read inputData.gdx and write inputDataAdjusted<x>.gdx, e.g. inputDataAdjusted1.gdx

inputDataAdjusted1.gdx
- New lower and upper temperature limits
- Elspot prices 2013

2021-12-28 Toni Lastusilta (VTT)
$offtext

* Create elspot_prices_2013.gdx from elspot-prices_2013_hourly_eur_TL_v1.xlsx
$if 1==0 $call gams input/elspot_price_xls2gdx.gms

*Use backbone definition of sets and parameters
$if not set input_dir $setglobal input_dir 'input'
$if not set output_dir $setglobal output_dir 'output'
$if not set input_file_gdx $setglobal input_file_gdx 'inputData.gdx'
$if not set input_excel_index $setglobal input_excel_index 'INDEX'
$if not set input_excel_checkdate $setglobal input_excel_checkdate ''
* Activate end of line comments and set comment character to '//'
$oneolcom
$eolcom //
$onempty   // Allow empty data definitions
* === Definitions, sets, parameters and input data=============================
$include 'inc/1a_definitions.gms'   // Definitions for possible model settings
$include 'inc/1b_sets.gms'          // Set definitions used by the models
$include 'inc/1c_parameters.gms'    // Parameter definitions used by the models


*Read data from inputData.gdx
$onmultiR
$gdxIn input\inputData.gdx
$load grid node unit unittype unitUnittype effLevelGroupUnit
$offmulti
$load ts_influx p_gnBoundaryPropertiesForStates p_gnu_io p_gn p_unit p_gnn p_s_discountFactor
$gdxin

* Modify Input (optional)
40
Parameters
41
42
43
  modify_input      "Modify input (0=no, 1=yes: to set new limits)"                     / 1      /
  c2k               "Convert celcius to kelvin degrees"                                 / 275.15 /
;
44
display unit;
45
Sets
Toni's avatar
Toni committed
46
 dir   "Direction: lo ,reference ,up"           / lo, ref, up/
47
 place "Measurement place in building"          / interior_air_and_furniture, internal_mass, envelope_mass, DHWT  /
Toni's avatar
Toni committed
48
49
 node_building                                  / IDA_ESBO_DH1, IDA_ESBO_DH2, IDA_ESBO_AB  /
 node_building_interior_air_and_furniture(node) / "IDA_ESBO_DH1.interior_air_and_furniture", "IDA_ESBO_DH2.interior_air_and_furniture", "IDA_ESBO_AB.interior_air_and_furniture" /
50
51
52
53
54
55
56
57
 node_building_internal_mass(node)              / "IDA_ESBO_DH1.internal_mass", "IDA_ESBO_DH2.internal_mass", "IDA_ESBO_AB.internal_mass" /
 node_building_envelope_mass(node)              / "IDA_ESBO_DH1.envelope_mass", "IDA_ESBO_DH2.envelope_mass", "IDA_ESBO_AB.envelope_mass" /
 node_building_DHWT(node)                       / "IDA_ESBO_DH1.DHWT1000", "IDA_ESBO_DH2.DHWT1000", "IDA_ESBO_AB.DHWT1000" /
 node_building2node(node_building,node)         /
  IDA_ESBO_DH1.("IDA_ESBO_DH1.interior_air_and_furniture", "IDA_ESBO_DH1.internal_mass", "IDA_ESBO_DH1.envelope_mass" ,"IDA_ESBO_DH1.DHWT1000")
  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")
 /
58
59
60
61
 unit_heat(unit) /
 "IDA_ESBO_DH1.ideal_heating", "IDA_ESBO_DH2.ideal_heating", "IDA_ESBO_AB.ideal_heating"
 /
 unit_cool(unit) /
62
63
64
65
66
 "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"
 /
67
68
69
70
 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"
 /
71
72
73
74
75
76
 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")
 IDA_ESBO_AB .("IDA_ESBO_AB.ideal_heating" ,"IDA_ESBO_AB.ideal_cooling" ,"IDA_ESBO_AB.ideal_DHW")
 /
;
Toni's avatar
Toni committed
77
78
79
80
81
Table
  temp(place,dir)   "Limit temperatures in Celcius"
                             lo      ref        up
interior_air_and_furniture   20      20         24
internal_mass                20      20         24
82
envelope_mass                -90     20         50
83
DHWT                         60      60         80
84
85
;

Toni's avatar
Toni committed
86
87
88
89
90
91
Parameter building_squares (node_building) Building square meters /
"IDA_ESBO_DH1"  135.56
"IDA_ESBO_DH2"  145.33
"IDA_ESBO_AB"  1608.19
/;

92
93
if(modify_input=1,
* Defintion: p_gnBoundaryPropertiesForStates(grid,node,param_gnBoundaryTypes,param_gnBoundaryProperties)
Toni's avatar
Toni committed
94
  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;
95
96
97
98
99
100
101
102
103
104
105
106
* 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');
* 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');
* 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');;
Toni's avatar
Toni committed
107
108
109
110
111
112
* 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,'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');
113
114
115
) ;


116
* Adding exogenous commodity electricity prices : ts_priceElspot
117
118
119
120
121
122
123
124
125
126
127
Set
  tsIso Time-stamp in ISO8601 format
;
Parameters
 elspotIsoBB(t,tsIso)  "Elspot Prices_2013 (EUR/MWh) with backbone timestamp and ISO date"
 ts_priceElspot(t)     "Elspot Prices_2013 (EUR/MWh)"
;
$gdxIn input\elspot_prices_2013.gdx
$load tsIso elspotIsoBB ts_priceElspot=elspotBB
$gdxin

128
129
130
*Setting
Parameter p_price_el_select "Use flat price 1 EUR/MWh (set 0). Use elspot price (set 1)" /1/;

131
132
* Write input with domains at execution time to take in consideration modifications
execute_unloaddi "input\inputDataAdjusted1.gdx";
133
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
134