Skip to main content

Time series aggregation module (tsam) to create typical periods

Project description

Build Status

Forschungszentrum Juelich Logo

tsam - Time Series Aggregation Module

tsam is a python package which uses different machine learning algorithms for the aggregation of typical periods. It is applicable for all type of time series, eather weather data, load data or both simultaneously. The module is able to significantly reduce input time series for energy system models, and therefore the model's complexity and computational time.

If you want to use tsam in a published work, please kindly cite following publication which validates the methods and describes their cababilites. The manuscript is found here.

A second publication introduces a method how to model states (e.g. state of charge of storage) between the aggregated typical periods.

Features

  • flexible read-in and handling of multidimensional time-series via the pandas module
  • different aggregation methods implemented (averaging, k-means, exact k-medoids, hierarchical), which are based on scikit-learn or pyomo
  • flexible integration of extreme periods as own cluster centers
  • weighting for the case of multidimensional time-series to represent their relevance

Installation

Directly install via pip as follows:

pip install tsam

Alternatively, clone a local copy of the repository to your computer

git clone https://github.com/FZJ-IEK3-VSA/tsam.git

Then install tsam via pip as follow

cd tsam
pip install . 

Or install directly via python as

python setup.py install

In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default solver GLPK is used. Nevertheless, in case you have access to a license we recommend commercial solvers (e.g. Gurobi or CPLEX) since they have a better performance.

Examples

Basic workflow

A small example how tsam can be used is decribed as follows

	import pandas as pd
	import tsam.timeseriesaggregation as tsam

Read in the time series data set with pandas

	raw = pd.read_csv('testdata.csv', index_col = 0)

Initialize an aggregation object and define the number of typical periods, the length of a single period and the aggregation method

	aggregation = tsam.TimeSeriesAggregation(raw, 
						noTypicalPeriods = 8, 
						hoursPerPeriod = 24, 
						clusterMethod = 'hierarchical')

Run the aggregation to typical periods

	typPeriods = aggregation.createTypicalPeriods()

Store the results as .csv file

	typPeriods.to_csv('typperiods.csv')

Detailed examples

A first example shows the capabilites of tsam as jupyter notebook.

A second example shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.

The example time series are based on a department publication and the test reference years of the DWD.

License

MIT License

Copyright (C) 2016-2018 Leander Kotzur (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3)

You should have received a copy of the MIT License along with this program. If not, see https://opensource.org/licenses/MIT

About Us

Abteilung VSA

We are the Process and Systems Analysis department at the Institute of Energy and Climate Research: Electrochemical Process Engineering (IEK-3) belonging to the Forschungszentrum Jülich. Our interdisciplinary department's research is focusing on energy-related process and systems analyses. Data searches and system simulations are used to determine energy and mass balances, as well as to evaluate performance, emissions and costs of energy systems. The results are used for performing comparative assessment studies between the various systems. Our current priorities include the development of energy strategies, in accordance with the German Federal Government’s greenhouse gas reduction targets, by designing new infrastructures for sustainable and secure energy supply chains and by conducting cost analysis studies for integrating new technologies into future energy market frameworks.

Acknowledgement

This work was supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 A Contribution of the Research Field Energy".

Helmholtz Logo

DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsam-1.0.1.tar.gz (360.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsam-1.0.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file tsam-1.0.1.tar.gz.

File metadata

  • Download URL: tsam-1.0.1.tar.gz
  • Upload date:
  • Size: 360.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for tsam-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6b62317311dc8bcf61be0da9521068a372f804f27e0fe1877a084e76a1569271
MD5 b98406901d0a576ed32a160d6f09bbb3
BLAKE2b-256 c5bc675b95035ffba608c4a76d80d173348232e78dc22e8dee8160d3b7f08952

See more details on using hashes here.

File details

Details for the file tsam-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: tsam-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for tsam-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0493b1ced41667a4ed72cdfbdbda6793e9f1e213bf47ff5526c20966f9b0bec
MD5 8fd1646f9f7504424e358a11848d6911
BLAKE2b-256 f79271477285b45184b78e7163b661cd695c7f90bb63c8c064e01d10099a1396

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page