Skip to content

Time Series Compression

Time Series Compression

Simplification of time series resolution—referred to below as compression—is necessary to prevent the optimization problem from becoming too large and the calculation time from becoming too long, for example in the case of year-round coupled optimization or structural optimization.

The settings for time series compression are specific to the selected simulation node, are saved with the project, and remain even after reopening. Select the compression level in the Simulation ribbon in the group Pre-stage from the drop-down list (see following figure).

The following compression levels are available.

  • No compression/exactly
  • Very slow/very accurate
  • Slow/acccurate
  • Medium compression
  • Fast/Inaccurate
  • Very fast/very inaccurate

Time-series compression automatically takes place according to this selected setting.

Exporting a CSV File

If you have selected time series compression (and not No compression), you can export the compressed time series as CSV files. Enable this option under Extras → Advanced settings → Simulation → Time series compressionSave compressed time series as csv-file.

During simulation, the message 8387 is displayed in the Simulator window at Log-Level 3 Details:

The csv-file containing the compressed time series was saved.

From there you can open the CSV file directly by clicking on the link (see the following figure).

Compression Process

In the simplified pre-stage, depending on the specific application, a method for reducing the time series is automatically applied in the background: Clustering or Downsampling. These methods make it possible to calculate with fewer time steps and still achieve a valid result. The procedures run largely invisibly, only some Simulator messages at Log-Level 3 Details indicate this (see the following figure).

Clustering

A Clustering method is used for pure structural optimization.

The k-Means++ centroid-based algorithm is used as the clustering method. By default, it randomly selects the starting values for cluster formation, the initial cluster centers (random seed), and then optimizes them. Therefore, the compressed time series usually differ slightly between several simulation runs. To avoid these discrepancies in simulations by TOP-Energy, you can specify a Constant seed (e.g., 0) instead of a random seed in the Advanced settings (Options) under Simulation → Time series compression.

The following figure shows how the individual time steps are grouped into clusters.

Structural Optimization

The number of clusters affects oth the computing time and the accuracy of the results. The exact number of clusters depends on the compression level, the number of time series, and the size of the optimization problem.

You can influence the number of clusters by adjusting the compression level. If possible, select No Compression/Exactly to achieve the highest possible accuracy.

The number of clusters is displayed at Log-Level 3 Details in the Simulator window in the message 8385. Depending on whether the model includes storage components, different clustering methods are used, as reflected in the wording of message 8385: clustering by data point frequency or type day clustering.

 

Clustering by (without storage)

If the model does not contain any storage components, the time steps are grouped into clusters based on the similarity of their data values. Frequently occurring combinations of values are given greater weight in this process. Extreme values (minima and maxima) are stored internally by the algorithm as separate time steps so that load peaks and feed-in peaks are not lost in the results. In this case, message 8385 reads as follows:

[Pre-stage] The time series have been compressed for structural optimization to … time steps.

In frequency-based clustering, the number of clusters is equal to the number of frequent data points.

The Clustering method based on the frequency of data points is also availble in the ETA as a time series method, but only with a random seed.

 

Type Day Clustering (with non-seasonal storage)

If the model includes storage components, the daily structure of the time series must be preserved. Storage systems, such as battery storage, are subject to a periodicity constraint: The filling level at the end of the day must match the filling level at the beginning. To prevent this daily pattern from being disrupted by simple type day clustering, day sampling is performed first. Day sampling reduces the time steps within each day to a fixed number of representative sample points. Only then is the type-day clustering performed: It groups similar days into type days. Each “typical day” represents several similar days throughout the year. In addition, the global extreme values (minimum/maximum) across all time series are synchronized retrospectively to ensure the correct charging and discharging of the storage components in the optimization problem.

In this case, message 8385 reads as follows:

[Pre-stage] The time series have been compressed for structural optimization to … type days with … time steps each.

In type day clustering, the number of clusters is the product of the number of type days and the number of time steps per type day.

Compression by type days is also availble in the ETA as a time series method, but only with a random seed.

Downsampling

The downsampling method is used to simplify time series when performing a year-round coupled optimization (e.g., for energy systems with seasonal storage), even if the energy system includes structural/design variables and a structural optimization is being performed at the same time.

In downsampling, the time series is not grouped into clusters of similar time steps, as in clustering, but is aggregated uniformly: Several consecutive time points are combined into a single one by calculating their arithmetic mean. Downsampling is a method of reducing a time series through aggregation. For example, with a downsampling rate of 4, four consecutive time steps are replaced by their average value. The result is a shorter time series that retains the average trend of the original—short-term peaks may be lost in the process.

Downsampling is used exclusively in the pre-stage. The pre-stage performs the full-year-coupled optimization using the simplified time series and provides results that are then incorporated as boundary conditions into the actual main optimization. The main optimization itself uses the original, high-resolution time series.

If the model also includes structural variables, the global extreme values (minima and maxima) of the time series are preserved during downsampling so that load peaks and feed-in peaks are not lost in the pre-stage.

The specific reduction rate by which the time series are simplified is derived internally using a heuristic based on the selected compression level and is not reported separately.

Simplified Prestage

If, on the one hand, a compression level other than No compression/exactly has been set and, on the other hand, optimization with a year-round coupled constraint, structural optimization, or a combination of both has also been enabled, a simplified pre-stage is performed. In this preliminary step, time series compression is performed through clustering or downsampling, and the calculations are carried out using the compressed time series.

However, there is an exception: if there are too few time steps in the pre-stage model, compression is disabled, and the compression level is thus set internally (by the software, without any active change in the Simulation ribbon) to exactly. In this case, warning 8214 is issued, informing you that no compression is being performed.

No Time Series Compression

With the time series compression level No compression/exactly, no time series compression takes place. The entire optimization problem is solved over the full simulation period using a MILP optimization in which all time steps (typically 8,760 time steps for one year on in hourly intervals) are coupled together from the first to the last.

Because the optimization problem in this case always covers the entire (filtered) time period, the settings for the Look-ahead (also known as the rolling horizon, e.g., 24 h) and the Result time frame for Operational optimization (e.g., 12 h) are not applicable and are grayed out in the Simulation ribbon. These settings are relevant only for operational optimization anyway.

If a time filter is set, only the filtered time range is optimized. For example, for input time series ranging from January 1, 2028, to December 31, 2028, only the period from March 31 at 12:00 p.m. to September 30 at 12:00 p.m. can be considered—the entire system is then fully coupled exclusively for this time period.

Without compression (with selected level No compression/exactly or with less than 50 time steps), only one optimization, the main stage, is performed, in which the entire system is fully coupled. A preliminary stage is not necessary in this case. A system with structural optimization and without time series compression is optimized according to the objective function of the structural optimization. The objective function of the operational optimization is grayed out in the Simulation ribbon in this case. This is effectively an operational optimization with integrated structural variables.

Own Compressed Time Series (Structural Optimization)

In the Simulation form, in the Settings of Structural optimization, there is the option Use your own compressed time series. This switches off the compression of the time series by the simulator. The setting regarding the compression level set in the Simulation ribbon then becomes irrelevant.
This option is not compatible with year-round coupled constraints.
In the Simulation form, activate the option Use your own compressed time series if you want to store time series compressed by yourself. If you activate this function with a check mark, two additional input fields for the Length of typical period (hours) and the Time points per typical period are displayed. The input time series are interpreted as compressed time series in the simulator. Because compressed time series have a different structure to uncompressed time series, the user must explicitly specify how they are to be interpreted in these menu items. This is particularly relevant if there are storage components, for example Electricity storage, in the model because the simulator uses this information to establish the temporal coupling between the typical periods.
Time points per typical period specifies how many time steps a single typical period contains in the compressed time series—that is, the length of a typical period in time steps. For example, a typical day with hourly resolution has 24 time points per type period.

Length of typical period (hours) specifies the actual time period that a typical period represents. For typical days, this value is 24; for typical weeks, it is 168.

Based on these two values, the simulator calculates the physical step size (= Sample time) for a single time step:

\( \begin{aligned} Sample\ time = \frac{Length\ of\ typical\ period}{Tim\ points\ per\ typical\ period} \end{aligned} \)
Example
If an equidistant time series is compressed normally in a 2-hour grid (no typical days, typical weeks, etc.), 1 should be selected for the Time points per typical period and 2 for the Length of typical period (hours). However, if the same time series is compressed to typical days, 12 should be selected for Time points per typical period and 24 for the Length of typical period (hours).

If you do not want to specify the typical period, leave the default setting of the Length of a typical period with 24 h unchanged.

Operational Constraints

Watch the information on Operating constraints with time series compression.

Demands

The demands should be combined in one component and not distributed to several components. Otherwise, due to the compression of the time series, a demand could not be summed up in the desired way.
Back To Top