Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding time series aggregation with the tsam repository #973

Open
Maxhi77 opened this issue Aug 29, 2023 · 5 comments · May be fixed by #980
Open

Adding time series aggregation with the tsam repository #973

Maxhi77 opened this issue Aug 29, 2023 · 5 comments · May be fixed by #980

Comments

@Maxhi77
Copy link

Maxhi77 commented Aug 29, 2023

I am adding a pipeline to the tsam repository for time series aggregation. Tsam includes several aggregation algorithms. The quality of different algorithms are explained in the paper linked.

Tsam will be integrated into a function into _helpers, called aggregate_time_series(). (The rigth place to integrate tsam is a point to discuss)

The idea is:

  1. Aggregate the input time series (aggregate_time_series())
  2. Generating a energy system with the aggregated timeseries index
  3. Add the aggregated time series to the components.

In the first draft all time steps of a series have to have the same resolution. This is based on the workflow of tsam. So it's not possible to have non euidistant time steps like in: non_equidistant_time_step_example.py

Two main advantages of the aggregation:

  1. Optimization with aggregated time series need less time and have low loss in accuracy
  2. Optimization of storages, espically long-term/seasonal, with less timesteps because of aggregation are still accurate. For this the gaps in between two periods are setted and the losses are considered by the timeincrement.

tsam:

@henhuy
Copy link
Contributor

henhuy commented Sep 13, 2023

I'm very interested in this, as we need this in our project.
I already looked into the paper and have an idea on how to implement this.
As in newest solph version multi-periods are supported as well, we have to apply timeseries aggregation via TSAM within each period.

My first idea would have been to only implement new storage behavior depending on TSAM config and neglect automatic timeseries aggregation within solph and leave this part to the user, as there are tricky parts:

  • apply TSAM for all timeseries within each period
  • adapt summed energies, full_load_hours and other vars to consider reduced timesteps (i.e. a component which originally holds full load hours of 200h per year must be reduced to 200h * 100d/365d in case of using 100 typical days of a year instead of whole year)

Instead, user has to do aggregation for each period and adaption of variables up front, but inter-period (period in the sense of TSAM-periods, not multi-periods) storage levels are handled by solph.

In order to implement new storage behavior, followinging code lines would have to be adapted (IMO):

@henhuy
Copy link
Contributor

henhuy commented Sep 19, 2023

After having a discussion with developer of FINE, I learned that adapting summed energies, full_load_hours etc. is not as simple as dividing it by reduction factor, but instead they have to be weighted according to TSAM clustering of typical periods (aka multiply full_load_hours of a given period by "occurrences" of that typical period in original timeseries - sum of all weighted full_load_hours should meet original full_load_hours given by user). Therefore, oemof rules for setting up summed energies or full_load_hours, etc. have to be adapted.
My first approach would be to adapt following lines:

For now, I would neglect NonConvexFlowBlock and positive or negative gradients (which might have to be adapted as well, if they should be used in time-reduced scenario) and instead raise a warning, when used in time-reduced setup.

@fwitte
Copy link
Member

fwitte commented Sep 19, 2023

The group around SESMG seems to have implement some time series aggregation methods in context of oemof-solph models, maybe worth a look: https://spreadsheet-energy-system-model-generator.readthedocs.io/en/latest/01.03.00_model_simplification.html

@henhuy
Copy link
Contributor

henhuy commented Sep 20, 2023

The group around SESMG seems to have implement some time series aggregation methods in context of oemof-solph models, maybe worth a look: https://spreadsheet-energy-system-model-generator.readthedocs.io/en/latest/01.03.00_model_simplification.html

Thanks for the hint! As far as I can see, the timeseries reduction mentioned there seems to be a simple reduction or aggregation of timesteps with no attention to resulting effects on storage behaviour etc.
The approach mentioned here, consists of two steps:

  1. reduction of timeseries by identifying typical periods (same methods as in SESMG can be used therefore)
  2. adapting model constraints and rules to preserve storage and flow behaviours

Ideally, quality of results and "real" storage behaviour and investment are preserved by the second step.

@jokochems
Copy link
Member

Just to draw your attention to it, there is also some interest from the user community side, see: https://forum.openmod.org/t/oemof-in-combination-with-time-series-aggregation-module-tsam/4157/6

@henhuy henhuy linked a pull request Sep 28, 2023 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants