Thanks Fred for your answer,
there are still a few things that I do not understand.
$eval tSlices ceil(card(tt)/288)
why do we need a Compile-Time Variable here? You anyways specify the number of total timeslots. So the number of time slices can be computed based on this.
map(tSlice,tt) = (ord(tSlice)-1)*288 < ord(tt) and (ord(tSlice))*288 >= ord(tt);
I could not find a good description of the mapping operator. What is done in the statement “(ord(tSlice)-1)*288 < ord(tt) and (ord(tSlice))*288 >= ord(tt)”?
option map:0:0:1; display map;
The same question here. What does 0:0:1 mean?
Regarding my code I changed the name of the variable that I used before from t to t_a. This set (and all other parameters) are loaded from the file “data_5min_Jan_DayAhead_1HH.gdx.”
Set
t_a timeslices
household households;
$call gdxxrw data_5min_Jan_DayAhead_1HH.xlsx index=index!A1
$ife errorlevel<>0 $abort Problems running GDXXRW
$GDXIN 'data_5min_Jan_DayAhead_1HH.gdx';
$LOAD t_a
$LOAD household
set tt 'super set of time steps' /t1*t8928/;
$eval tSlices ceil(card(tt)/288)
set tSlice / ts1*ts%tSlices% /
t(tt) 'dynamic subset of tt'
map(tSlice,tt) 'mapping of time slice to time steps'
;
map(tSlice,tt) = (ord(tSlice)-1)*288 < ord(tt) and (ord(tSlice))*288 >= ord(tt);
option map:0:0:1; display map;
....
I also load other parameters from that file and define variables.
...
Parameter
demand_heating(t, household)
$LOAD demand_heating
demand_electrical(t, household)
$LOAD demand_electrical
...
temperature_level_DHWTank.lo(t, household) = minimalDHWTankTemperature;
temperature_level_DHWTank.up(t, household) = maximalDHWTankTemperature;
...
If I run the model I get many error messages stating “Values for domain 1 are unknown - no checking possible” and “Set has not been initialized”.
My questin is whether I have to adjust the arguments for all those variables and parameters? For example shall I change “demand_electrical(t, household)” to “demand_electrical(tt, household)” or something like that?