In GitLab by @jkiviluo on Mar 22, 2019, 13:45
Time series data is stored as it is - typically in arrays with associated information when the time series start, what is its resolution, etc (as defined in https://gitlab.vtt.fi/spine/toolbox/wikis/Spine-Toolbox-JSON-specification). On the other hand there is a model that should be solved in a specific way from the temporal perspective. E.g. a single-go investment problem or a looping scheduling and dispatch problem. Both model types might use the same data. For Spine Model, we have come up with a data structure the model will use (https://gitlab.vtt.fi/spine/model/issues/17). The next step is to define a structure for Spine Data Store that can link the data with the model(s). This is a proposal for that.
First we need a 'model' object_class and model objects, e.g. 'Spine_schedule'. This object will serve other purposes than the temporal structure, but here only the temporal structure is discussed.
Next, we need to tell the time frame the model should solve, in absolute terms, e.g. 1.1.2020 - 31.12.2020. For this we need an object_class 'time_frame'. It will have parameters like start_datetime, time_jump, finish_datetime (different models/tools can have different names for these, so these could be model specific or shared between models through parameter name mapping).
Then, we also need a temporal object that can tell us about the relative temporal structure within the time_frame. In a rolling model, this relative structure defines the shape of the time structure that rolls forward. Let's call the object_class for this purpose with 'time_section'. Let's then say we have scheduling model:
- The first time_section would define a period of realization: order=1, resolution=1, steps=6, forecast=[f00], etc.
- The next time_section would define a first forecast period: order=2, resolution=1, steps=18, forecast=[f01,f02,f03]
- The final time_section would define a tail: order=3, resolution=24, steps=364, forecast=[f02]
Together the 'time_frame' and 'time_section'(s) can be used to flexibly define any kind of temporal structure and associated looping structure.
For an investment model, possibly only one time_section would be sufficient. Although e.g. representative weeks could be sliced with a time_section for each representative week. In this case, an additional parameter would be needed to state the starting point of the time_section within the time_frame.
Finally, the time_sections need to be connected with the entities they apply to. This includes both units and nodes. Together they could be called 'block's. In a simple model all nodes and units are in the same block and they all use the same temporal structure. In a more complicated model, an arbitrary system of time_sections and blocks can be related to each other. This allows to arrive in systems like demonstrated in https://docs.google.com/presentation/d/1mwGX6mm3PwbhJ9OvLlnS5Vm17y1HpPdaiouCrFEGonk (slide 4).
An illustration of the object structure (could have e.g. realization in one hour resolution, Ireland forecasts in one hour and GB forecasts in three hour)
![image](/uploads/91284d13e72129a8788a6e440ba36bfd/image.png)
The task of JuMP_All_Out would be to pass the structural data to the model specific layer that creates the right sets. In case of Spine Model, the model specific layer would create t_t_overlap, t_in_t, etc. based on the structure it gets from the Data Store. The 'temporal_block' in Spine Model will then present the combination of time slices and geographic entities (nodes or units). The model specific layer will also need to generate a looping structure (more parameters will be needed for more advanced structures like day-ahead markets).
There are some additional things that need to be considered. E.g. one want to run 2030 scenario with 2017 time series profiles. I think this could happen through the time_frame - it should allow to define the target year and the source year separately. The source year could even be multiple different years depending on the data set, although that would be bad practice in most cases. This might be achieved with a separate object_class 'time_source' that is linked with the 'time_frame'. But this really needs some further thought.