inputDataAdjustments.gms 6.51 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
40
41
42
43
44
$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)
Scalars
  modify_input      "Modify input (0=no, 1=yes: to set new limits)"                     / 1      /
  c2k               "Convert celcius to kelvin degrees"                                 / 275.15 /
;
Sets
Toni's avatar
Toni committed
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 dir   "Direction: lo ,reference ,up"           / lo, ref, up/
 place "Measurement place in building"          / DHWT, envelope_mass, internal_mass, interior_air_and_furniture /
 node_building                                  / IDA_ESBO_DH1, IDA_ESBO_DH2, IDA_ESBO_AB  /
 node_building_DHWT(node)                       / "IDA_ESBO_DH1.DHWT1000", "IDA_ESBO_DH2.DHWT1000", "IDA_ESBO_AB.DHWT1000" /
 node_building_envelope_mass(node)              / "IDA_ESBO_DH1.envelope_mass", "IDA_ESBO_DH2.envelope_mass", "IDA_ESBO_AB.envelope_mass" /
 node_building_internal_mass(node)              / "IDA_ESBO_DH1.internal_mass", "IDA_ESBO_DH2.internal_mass", "IDA_ESBO_AB.internal_mass" /
 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" /
 node2node_building(node_building,node) /
   IDA_ESBO_DH1.("IDA_ESBO_DH1.DHWT1000", "IDA_ESBO_DH1.envelope_mass", "IDA_ESBO_DH1.internal_mass","IDA_ESBO_DH1.interior_air_and_furniture")
   IDA_ESBO_DH2.("IDA_ESBO_DH2.DHWT1000", "IDA_ESBO_DH2.envelope_mass", "IDA_ESBO_DH2.internal_mass","IDA_ESBO_DH2.interior_air_and_furniture")
   IDA_ESBO_AB.("IDA_ESBO_AB.DHWT1000", "IDA_ESBO_AB.envelope_mass", "IDA_ESBO_AB.internal_mass","IDA_ESBO_AB.interior_air_and_furniture")
 /;




Table
  temp(place,dir)   "Limit temperatures in Celcius"
                             lo      ref        up
DHWT                         60      60         80
envelope_mass                0       20         50
interior_air_and_furniture   20      20         24
internal_mass                20      20         24
68
69
;

Toni's avatar
Toni committed
70
71
72
73
74
75
76
*TODO
Parameter building_squares (node_building) Building square meters /
"IDA_ESBO_DH1"  135.56
"IDA_ESBO_DH2"  145.33
"IDA_ESBO_AB"  1608.19
/;

77
78
if(modify_input=1,
* Defintion: p_gnBoundaryPropertiesForStates(grid,node,param_gnBoundaryTypes,param_gnBoundaryProperties)
Toni's avatar
Toni committed
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  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 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');
* 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');;
* 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 (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');
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
) ;


* Read elspot prices
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

Toni's avatar
Toni committed
113
114
115
* Adding exogenous commodity electricity that can be bought


116
117
* Write input with domains at execution time to take in consideration modifications
execute_unloaddi "input\inputDataAdjusted1.gdx";
Toni's avatar
Toni committed
118
execute_unloaddi "input\inputDataAdjusted1Squuezed.gdx" node2node_building ts_priceElspot ts_influx effLevelGroupUnit p_gnBoundaryPropertiesForStates p_gnu_io p_gn p_unit node p_gnn unit unitUnittype grid p_s_discountFactor unittype
119