Time series aggregation for energy system design: review and extension of modelling seasonal storages

Using optimization to design a renewable energy system has become a computationally demanding task as the high temporal fluctuations of demand and supply arise within the considered time series. The aggregation of typical operation periods has become a popular method to reduce effort. These operation periods are modelled independently and cannot interact in most cases. Consequently, seasonal storage is not reproducible. This inability can lead to a significant error, especially for energy systems with a high share of fluctuating renewable energy. The previous paper, “Time series aggregation for energy system design: Modeling seasonal storage”, has developed a seasonal storage model to address this issue. Simultaneously, the paper “Optimal design of multi-energy systems with seasonal storage” has developed a different approach. This paper aims to review these models and extend the first model. The extension is a mathematical reformulation to decrease the number of variables and constraints. Furthermore, it aims to reduce the calculation time while achieving the same results.

The optimisation problems can be solved for the complete time series or typical periods representing the time series (Lythcke-Jørgensen et al. 2016). Typical periods are recurring time slots where characteristic charging and discharging patterns occur (Kotzur et al. 2018). Typical periods reduce the calculation time due to fewer variables and constraints to handle. One problem with these periods is the consideration of storage extending the period time. These storages are modelled with a linear behaviour. The classical cyclic modelling of storage with typical days would force the storage to have the same state at the period's start, and end (Renaldi and Friedrich 2017;Harb et al. 2015;Fazlollahi et al. 2014;Nahmmacher et al. 2016). This constraint leaves the typical days unlinked to each other. A transfer of storage content of one typical period to another is impossible.
Kotzur et al. 's model introduces two-time layers, one within the period and one for linking these periods (Kotzur et al. 2018). This model allows the solver to create a gradient within the typical periods since the typical period no longer ends with the same storage state as it began. The time frame outside the typical periods can use this gradient to determine the state of charge after several periods. Disregarding the state of charge within the period can lead to overcharging or undercharging the storage. On the other hand, cyclic storage formulation would keep the same stored energy at the period's start and end. In hydro power planning, multi-time horizon approaches have already been used but not modelled by MILP (Abgottspon and Andersson 2016;Beltrán et al. 2021;Flamm et al. 2018a;Bordin et al. 2021;Flamm et al. 2018b;Ming et al. 2021;Parvez et al. 2019).
Kotzur et al. 's two-time layers enable seasonal storage calculation while deploying typical days. In (Beck et al. 2022;Göke and Kendziorski 2022;Wirtz et al. 2021;Neumann et al. 2022;von Wald et al. 2022;Hoffmann et al. 2020) the storage formulation of Kotzur et al. was applied to calculate seasonal storages. Gabrielli et al. (2018) developed a different approach to calculate seasonal storage with fewer constraints but more variables. The approach creates a storage variable for the entire year with its yearly time step. Besides, it links the charging and discharging power of the period's time step to that yearly time step. This model is used, for example, in Borasio and Moret (2022), Fochesato et al. (2021), Petkov et al. (2021. Kotzur et al. (2021), Bistline et al. (2020) claim to review and validate these storage models. Figure 1 explains the two-layer method. The day 0 until 100 and 200 until 280 are represented by period one. Period two represents the days 100 until 200 and 280 until the end.
Kotzur et al. 's seasonal model allows a positive gradient over period one and a negative gradient over period two. Consequently, the storage state of these days is increasing for days represented by period one and decreasing for days represented by period two. This state stays constant using the cyclic storage model since gradients are unconsidered.
The new idea presented in this paper is to combine storage states of periods represented by the same typical period and located after each other within the year.

Storage models
The upcoming section explains the cyclic (called C) and three seasonal storage models (called S).

Cyclic storage model
The stored energy E t is calculated from the charging P c t and discharging power P d t . Charging and discharging losses are considered by the corresponding efficiencies η charge and η discharge . Furthermore, a self-discharging rate η self with the corresponding time step duration δt is considered.
The stored energy (E t ) has to stay between zero and maximal capacity E max . (1) (2) 0 ≤ E t ≤ E max .  The storage must have the same state of charge at the period's start and end (E t=0 = E t=N ) . Additionally, this state of charge has to be the same for all periods.

Seasonal storage model of Gabrielli et al. (2018)
Seasonal storage model of Gabrielli et al. (2018) (called S-G) creates a storage variable for the entire year with its yearly time step (E h ) . Besides, it links the charging P c t =f (h) and discharging power P d t =f (h) of the period's time step to that yearly time step. The function f gets the time step of the year h as an input and is returning the corresponding period with its period's time step.
The cyclic boundary condition is used to connect the last and first storage variable of the total simulation interval ( E h=1 = E h=end+1 ).

Seasonal storage model of Kotzur et al. (2018)
The seasonal storage model of Kotzur et al. (2018) (called S-K) contains three types of constraints. The first constraint links the typical day's state of charge with the state of charge within these typical periods. The second constraint is limiting the state of charge within the typical days, which aims to avoid negative states of charge or overcharging. The last constraint considers the actual charging, discharging, and losses within the period. This equation applies to both models (S-K and the new one).
This charging and discharging constraint is formulated as follows: where E t is the stored or in case of negative values the extracted energy since the beginning of the period at the time step t. The charging P c t and discharging power P d t have a charging η charge and discharging efficiency η discharge . The stored energy at the end of each period ( E p ) is implemented as follows: N is the number of time steps in the period. The cyclic boundary condition is used to connect the last and first amount of stored energy of the total simulation interval ( E p=1 = E p=end+1 ). The boundaries during the period are implemented as follows: This equation should avoid overcharging. Due to the calculated self-discharging rate for the entire period (N) this is not ensured. This equation does not hold for filled storage at the period's beginning and a charging rate as high as the self-discharge loss of the period (7) and (8) show this connection. (3) Using the current time step within the period (t) instead of the total number of time steps within a period (N) as an exponent for the self-discharging rate avoids this overcharging. The resulting equation is:

New seasonal storage model
The new model (called S-N) checks for periods of the same type during the year in a row ( M > 1 ). If those periods occur, Eq. ( 5) which links the stored energy from the period to the inter period one, reformulates to: The summation over the self discharging rate can be simplified to (F): This simplification leads to: .
The new model summarizes the periods of the same type within a row. Ensuring no overcharging or negative state of charges needs two new boundaries within the period. The first one ensures the current states for the first summarized period and the second one for the last. Equation (9) is accomplishing this for the first one. The second one needs the storage state at the beginning of the last summarized period. Equation (5) determines this state. The combination of this equation with Eq. (10) leads to the following equation:

Methodology
This paper considers the C, S-G, S-K, and S-N model. It evaluates three system designs.
1 The first system considers a combined heat and power system with a boiler as backup. Furthermore, a hot tank stores the heat. An industrial hall building's electric and thermal demand has to be covered (Reger et al. 2020(Reger et al. , 2019. The system has a connection to the power grid and gas grid. 2 The second system is a heat pump system. It consists of an air heat pump, an electric heater, and a hot tank as thermal storage. The power grid or a photovoltaic system covers the electric demand. An industrial hall building's electric and thermal demand has to be covered (Reger et al. 2020(Reger et al. , 2019. 3 The third system is an island system. It contains a battery, photovoltaic, wind turbines, electrolyser, fuel cell, and hydrogen storage. The island system has a connection to the power grid. It can cover at maximum 10 % of the electric demand. This boundary forces the system to be grid independent. The electric demand of an example district has to be covered. Blanke (2022) provides the used time series for the heating loads, electrical loads, the typical periods, and the python code. The TSAM aggregates typical periods with 24 h as time step (Hoffmann et al. , 2022, Institute of Energy and Climate Research 2021). TSAM is a python package to aggregate typical periods from a time series. The clustering method is k-medoids. No extreme periods are integrated. The same number of typical days as in Kotzur et al. (2018) (3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 21, 27, 36, 48, 60, 90, 120, 180, 365) are considered. Taking into account three typical days means each day of the year is assigned to one of these three typical days (Hoffmann et al. 2022). The optimization models, efficiencies and costs are taken from Kotzur et al. (2018). The only exception is the hydrogen system, where the investment costs are reduced by 10 %. Therefore a self-discharging rate of 1 % per day is considered. This modification enables the possibility to evaluate the seasonal storage models with a self-discharging rate. Considering the self-discharging rate should ensure the same results for S-models while using this rate. The Gurobi solver 9.5.1 is chosen. Neither heuristic nor presolve algorithms are applied since the heuristics matches are random and the presolve is resulting in longer calculation times for a small number of typical days. The MIP-Gap is set to 1 %. Default values are applied to the rest of the solver settings. The hardware consists of two test machines containing 32 GB RAM with an AMD Ryzen 7 1700 Processor and 64 GB RAM with an Intel Xeon W-2155 Processor, respectively. Furthermore, the optimization uses 12 threads.
Equations (6) and (13) are simplified as explained in section Constraint reformulation.

Results and discussion
The results of the three systems are presented and discussed in the following section. All S-models lead within the numerical accuracy to the same results. Therefore the cost results are just shown for the one S-model (S A relative cost error of 2 % implies that the total cost difference between the reference ( ref. ) or modified (mod.) model to the considered storage scenario ( sce. ) (different model/ number of typical periods) is 2 %. This error will vary over the number of typical days since it compares the costs and not the energy system component sizes (like X kWh of battery). If the photovoltaic size is smaller than in the reference case, but the battery size is larger, this can lead to the same costs but with different component sizes. For all cases, the ratio of the number of variables and constraints compared to the S-Kmodel is always lower than one. The ratio is less for the cyclic case since the storage is not linked. For the S-N-model, the ratio is logarithmically increasing over the number of typical days up to one since the number of the same typical periods in a row decreases with increasing typical days. For the S-G-model, it is slightly decreasing.
In General, the C-model is the fastest. The S-N-model is faster or nearly as fast as the S-K-model. Besides, the S-G-model is the slowest one. Figure 3 shows the calculation time for all storage models (a) and the total costs error (b). In most cases, the calculation time for a number of typical days below 27 is less than 35 % of the time of the complete year calculation. Especially the C-model stays below 5 % of the calculation time. This time reduction results from fewer variables and constraints used by the C-model. For the most number of typical days, the total cost error is less than 1 % compared to the reference model and less than 2.5 % compared to the modified model. The S and C-models lead to nearly the same error for a number of typical days less than 8. Afterwards, they differ. All S-models lead to an error of less than 0.2 %, which is slightly better than the C-model error of 0.6 %. This same error indicates that the primary storage usage is daily and not seasonal. Figure 3c shows the number of variables (Var.) and constraints (Const.) as well as the calculation time relative to the S-K-model. In most cases, the S-N-model is more than 10 % faster and the C-model up to 80 %. The S-G-model is more than 40 % slower than the S-K-model in most cases. Figure 4 shows the calculation time for all storage models (a) and the total costs error (b). For a number of typical days below 28, the calculation time amounts to less than 40 % of the time for the complete year calculation. Especially the C-model stays below 5 (14)

Air heat pump system
% of the calculation time. The total costs error stays below 2 % for the most number of typical days compared to both the reference and modified model. The S-and C-models reduce this error below 1 % for 27 or more typical days. Both models lead to almost the same error. The concordance between the errors indicates that the storage usage is daily instead of seasonal. Figure 4c shows the number of variables (Var.) and constraints (Const.) as well as the calculation time relative to the S-K-model. In most cases, for less than 10 typical days, the S-N-model is about 20 % faster than the S-K-model. For more than 10 typical days, the S-N-model is as fast as the S-K-model. The C-model is up to 80 % faster in most cases. The S-G-model is about 100 % slower than the S-K-model in most cases. Figure 5 shows the calculation time for all storage models (a) and the total cost error (b). The total cost error amounts to 45 % at its maximum. This error is significantly higher Fig. 3 Calculation time (a) and total costs error (b) for the different storage models and relative share of number of constraints and variables as well as time for C, S-G-and S-N-to S-K-model (c) for the CHP system than the CHP and the Air heat pump system error. However, for the most numbers of typical days, the total cost error remains below 12 % compared to the reference model. Only in the case of more than 48 typical days does the cost error of the S-model differ from the C-model. The concordance between the errors in cases of up to 21 typical days indicates the storage usage as daily storage instead of seasonal storage. This statement is underlined by Fig. 6 since hydrogen storage is chosen for the number of typical days of 48 and more.

Island system
The cost error for a number of typical days less than 10 is below 2 % compared to the modified model. For a number of typical days of more than 48, the S and C-model errors differ. This trend indicates that the costs error for a number of typical days less than 10 is caused by the typical days and not by the storage models. For a number of typical days higher than 48, the error is caused by the storage model. So, the seasonal storage model has a lower error here. For a number of typical days below 36, generally, the calculation time is lower than 14 % of the full-year calculation time. Especially the C-model stays below 5 % of the calculation time. Figure 5c shows the number of variables (Var.) and constraints (Const.) as well as the calculation time relative to the S-K-model. Up to 12 typical days, the S-N-model often calculates at least 10 % faster than the S-K-model. It is approximately as fast as the seasonal model for more typical days. The calculation time reduction decreases by an increasing number of typical days because of nearly the same number of variables and constraints for both models. The C-model is up to 90 % faster in most cases, and the S-G-model is, on average, 230 % slower than the S-K-model. Figure 6 shows the total cost-share of the C-model, S-model, modified, and reference model. Until 21 typical days, the total costs increase for both storage models. Besides, the backup is used from a number of 6 typical days on. For less than 6 typical days, photovoltaic, wind turbine, and battery storage define the system. Hydrogen storage,

Conclusions
The presented work reviewed the classical cyclic storage formulation using typical days, the seasonal storage model by Kotzur et al.,  -The seasonal storage model is not reasonable for system designs where seasonal storage is not an economical option. This model results in the same outcomes but with more calculation time than the not linked storage model. -For a system that relies on seasonal storage, a seasonal storage model is a feasible option. It significantly reduces the computational time for a high number of typical days. Furthermore, it leads to nearly the same system design.
This conclusion also applies to Gabrielli

Constraint reformulation
This Eq. (6) can be reformulated using a support variable r to the following two equations: This Eq. (13) can be reformulated using a support variable r to Eqs. (16) and (17)