tsam 2.1.0__py3-none-any.whl → 2.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,165 +1,168 @@
1
- Metadata-Version: 2.1
2
- Name: tsam
3
- Version: 2.1.0
4
- Summary: Time series aggregation module (tsam) to create typical periods
5
- Home-page: https://github.com/FZJ-IEK3-VSA/tsam
6
- Author: Leander Kotzur, Maximilian Hoffmann
7
- Author-email: l.kotzur@fz-juelich.de, max.hoffmann@fz-juelich.de
8
- Keywords: clustering,optimization
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: Intended Audience :: End Users/Desktop
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Natural Language :: English
14
- Classifier: Operating System :: OS Independent
15
- Classifier: Programming Language :: Python
16
- Classifier: Programming Language :: Python :: 2
17
- Classifier: Programming Language :: Python :: 2.7
18
- Classifier: Programming Language :: Python :: 3
19
- Classifier: Programming Language :: Python :: 3.4
20
- Classifier: Programming Language :: Python :: 3.5
21
- Classifier: Programming Language :: Python :: 3.6
22
- Classifier: Topic :: Scientific/Engineering :: Mathematics
23
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
- Description-Content-Type: text/markdown
25
- License-File: LICENSE.txt
26
- Requires-Dist: scikit-learn (>=0.0)
27
- Requires-Dist: pandas (>=0.18.1)
28
- Requires-Dist: numpy (>=1.11.0)
29
- Requires-Dist: pyomo (>=5.3)
30
- Requires-Dist: networkx
31
- Requires-Dist: tqdm
32
-
33
- [![Build Status](https://travis-ci.com/FZJ-IEK3-VSA/tsam.svg?branch=master)](https://travis-ci.com/FZJ-IEK3-VSA/tsam) [![Version](https://img.shields.io/pypi/v/tsam.svg)](https://pypi.python.org/pypi/tsam) [![Documentation Status](https://readthedocs.org/projects/tsam/badge/?version=latest)](https://tsam.readthedocs.io/en/latest/) [![PyPI - License](https://img.shields.io/pypi/l/tsam)]((https://github.com/FZJ-IEK3-VSA/tsam/blob/master/LICENSE.txt)) [![codecov](https://codecov.io/gh/FZJ-IEK3-VSA/tsam/branch/master/graph/badge.svg)](https://codecov.io/gh/FZJ-IEK3-VSA/tsam)
34
- [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1olKkfaPobXvviGabgadXmsqThKuofKHmZ4Dobnr1olJXmsr1olJXmspXmsr1olJXmsrfZ4TuhWn1olL1olJXmsqBi7X1olJXmspZmslbmMhbmsdemsVfl8ZgmsNim8Jpk8F0m7R4m7F5nLB6jbh7jbiDirOEibOGnKaMhq+PnaCVg6qWg6qegKaff6WhnpKofKGtnomxeZy3noG6dZi+n3vCcpPDcpPGn3bLb4/Mb47UbIrVa4rYoGjdaIbeaIXhoWHmZYHobXvpcHjqdHXreHLroVrsfG/uhGnuh2bwj2Hxk17yl1vzmljzm1j0nlX1olL3AJXWAAAAbXRSTlMAEBAQHx8gICAuLjAwMDw9PUBAQEpQUFBXV1hgYGBkcHBwcXl8gICAgoiIkJCQlJicnJ2goKCmqK+wsLC4usDAwMjP0NDQ1NbW3Nzg4ODi5+3v8PDw8/T09PX29vb39/f5+fr7+/z8/Pz9/v7+zczCxgAABC5JREFUeAHN1ul3k0UUBvCb1CTVpmpaitAGSLSpSuKCLWpbTKNJ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0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/FZJ-IEK3-VSA/voila-tsam/HEAD?urlpath=voila/render/Time-Series-Aggregation-Module.ipynb)
35
-
36
- <a href="https://www.fz-juelich.de/iek/iek-3"><img src="https://www.fz-juelich.de/SiteGlobals/StyleBundles/Bilder/NeuesLayout/logo.jpg?__blob=normal" alt="Forschungszentrum Juelich Logo"></a>
37
-
38
- # tsam - Time Series Aggregation Module
39
- tsam is a python package which uses different machine learning algorithms for the aggregation of time series. The data aggregation can be performed in two freely combinable dimensions: By representing the time series by a user-defined number of typical periods or by decreasing the temporal resolution.
40
- tsam was originally designed for reducing the computational load for large-scale energy system optimization models by aggregating their input data, but is applicable for all types of time series, e.g., weather data, load data, both simultaneously or other arbitrary groups of time series.
41
-
42
- If you want to use tsam in a published work, **please kindly cite** one of our latest journal articles:
43
- * Hoffmann et al. (2021):\
44
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://arxiv.org/abs/2111.12072)
45
- * Hoffmann et al. (2021):\
46
- [**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261921011545)
47
-
48
- The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
49
-
50
- ## Features
51
- * flexible handling of multidimensional time-series via the pandas module
52
- * different aggregation methods implemented (averaging, k-means, exact k-medoids, hierarchical, k-maxoids, k-medoids with contiguity), which are based on scikit-learn, or self-programmed with pyomo
53
- * novel representation methods, keeping statistical attributes, such as the distribution
54
- * flexible integration of extreme periods as own cluster centers
55
- * weighting for the case of multidimensional time-series to represent their relevance
56
-
57
-
58
- ## Installation
59
- Directly install via pip as follows:
60
-
61
- pip install tsam
62
-
63
- Alternatively, clone a local copy of the repository to your computer
64
-
65
- git clone https://github.com/FZJ-IEK3-VSA/tsam.git
66
-
67
- Then install tsam via pip as follow
68
-
69
- cd tsam
70
- pip install .
71
-
72
- Or install directly via python as
73
-
74
- python setup.py install
75
-
76
- In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default coin-cbc 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.
77
-
78
-
79
- ## Examples
80
-
81
- ### Basic workflow
82
-
83
- A small example how tsam can be used is decribed as follows
84
- ```python
85
- import pandas as pd
86
- import tsam.timeseriesaggregation as tsam
87
- ```
88
-
89
-
90
- Read in the time series data set with pandas
91
- ```python
92
- raw = pd.read_csv('testdata.csv', index_col = 0)
93
- ```
94
-
95
- Initialize an aggregation object and define the length of a single period, the number of typical periods, the number of segments in each period, the aggregation method and the representation method - here duration/distribution representation which
96
- ```python
97
- aggregation = tsam.TimeSeriesAggregation(raw,
98
- noTypicalPeriods = 8,
99
- hoursPerPeriod = 24,
100
- rescaleClusterPeriods = False,
101
- segmentation = True,
102
- representationMethod = "distributionRepresentation",
103
- distributionPeriodWise = False
104
- clusterMethod = 'hierarchical')
105
- ```
106
-
107
- Run the aggregation to typical periods
108
- ```python
109
- typPeriods = aggregation.createTypicalPeriods()
110
- ```
111
-
112
- Store the results as .csv file
113
-
114
- ```python
115
- typPeriods.to_csv('typperiods.csv')
116
- ```
117
-
118
- ### Detailed examples
119
-
120
- A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
121
-
122
- A [**second example**](/examples/aggregation_optiinput.ipynb) shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.
123
-
124
- The example time series are based on a department [publication](https://www.mdpi.com/1996-1073/10/3/361) and the [test reference years of the DWD](https://www.dwd.de/DE/leistungen/testreferenzjahre/testreferenzjahre.html).
125
-
126
- ## License
127
-
128
- MIT License
129
-
130
- Copyright (C) 2016-2019 Leander Kotzur (FZJ IEK-3), Maximilian Hoffmann (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3)
131
-
132
- You should have received a copy of the MIT License along with this program.
133
- If not, see https://opensource.org/licenses/MIT
134
-
135
- The core developer team sits in the [Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3)](https://www.fz-juelich.de/iek/iek-3/EN/Home/home_node.html) belonging to the [Forschungszentrum Jülich](https://www.fz-juelich.de/).
136
-
137
- ## Further Reading
138
-
139
- If you are further interested in the impact of time series aggregation on the cost-optimal results on different energy system use cases, you can find a publication which validates the methods and describes their cababilites via the following [**link**](https://www.sciencedirect.com/science/article/pii/S0960148117309783). A second publication introduces a method how to model state variables (e.g. the state of charge of energy storage components) between the aggregated typical periods which can be found [**here**](https://www.sciencedirect.com/science/article/pii/S0306261918300242). Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated [**here**](https://www.mdpi.com/1996-1073/12/14/2825).
140
-
141
- The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
142
- * Hoffmann et al. (2021):\
143
- [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://arxiv.org/abs/2111.12072)
144
- * Hoffmann et al. (2021):\
145
- [**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261921011545)
146
- * Hoffmann et al. (2020):\
147
- [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
148
- * Kannengießer et al. (2019):\
149
- [**Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System**](https://www.mdpi.com/1996-1073/12/14/2825)
150
- * Kotzur et al. (2018):\
151
- [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
152
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
153
- * Kotzur et al. (2018):\
154
- [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
155
- (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
156
-
157
-
158
-
159
- ## Acknowledgement
160
-
161
- This work is supported by the Helmholtz Association under the Joint Initiative ["Energy System 2050 A Contribution of the Research Field Energy"](https://www.helmholtz.de/en/research/energy/energy_system_2050/) and the program ["Energy System Design"](https://www.esd.kit.edu/index.php) and within the [BMWi/BMWk](https://www.bmwk.de/Navigation/DE/Home/home.html) funded project [**METIS**](http://www.metis-platform.net/).
162
-
163
- <a href="https://www.helmholtz.de/en/"><img src="https://www.helmholtz.de/fileadmin/user_upload/05_aktuelles/Marke_Design/logos/HG_LOGO_S_ENG_RGB.jpg" alt="Helmholtz Logo" width="200px" style="float:right"></a>
164
-
165
-
1
+ Metadata-Version: 2.1
2
+ Name: tsam
3
+ Version: 2.3.2
4
+ Summary: Time series aggregation module (tsam) to create typical periods
5
+ Home-page: https://github.com/FZJ-IEK3-VSA/tsam
6
+ Author: Leander Kotzur, Maximilian Hoffmann
7
+ Author-email: leander.kotzur@googlemail.com, maximilian.hoffmann@julumni.fz-juelich.de
8
+ Keywords: clustering,optimization
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: End Users/Desktop
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 2
17
+ Classifier: Programming Language :: Python :: 2.7
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.4
20
+ Classifier: Programming Language :: Python :: 3.5
21
+ Classifier: Programming Language :: Python :: 3.6
22
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE.txt
26
+ Requires-Dist: scikit-learn >=0.0
27
+ Requires-Dist: pandas <3.0,>=0.18.1
28
+ Requires-Dist: numpy <2.0,>=1.11.0
29
+ Requires-Dist: pyomo >=6.4.3
30
+ Requires-Dist: networkx
31
+ Requires-Dist: tqdm
32
+ Requires-Dist: highspy
33
+
34
+ [![pytest master status](https://github.com/FZJ-IEK3-VSA/tsam/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/FZJ-IEK3-VSA/tsam/actions) [![Version](https://img.shields.io/pypi/v/tsam.svg)](https://pypi.python.org/pypi/tsam) [![Documentation Status](https://readthedocs.org/projects/tsam/badge/?version=latest)](https://tsam.readthedocs.io/en/latest/) [![PyPI - License](https://img.shields.io/pypi/l/tsam)]((https://github.com/FZJ-IEK3-VSA/tsam/blob/master/LICENSE.txt)) [![codecov](https://codecov.io/gh/FZJ-IEK3-VSA/tsam/branch/master/graph/badge.svg)](https://codecov.io/gh/FZJ-IEK3-VSA/tsam)
35
+ [![badge](https://img.shields.io/badge/launch-binder-579aca.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXm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9LjGMzTmqKXPLnlWVnIlQQTvxJf8ip7VgjZjyVPrjw1te5otM7RmP7xm+sK2Gv9I8Gi++BRbEkR9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC)](https://mybinder.org/v2/gh/FZJ-IEK3-VSA/voila-tsam/HEAD?urlpath=voila/render/Time-Series-Aggregation-Module.ipynb)
36
+
37
+ <a href="https://www.fz-juelich.de/en/iek/iek-3"><img src="https://www.fz-juelich.de/static/media/Logo.2ceb35fc.svg" alt="Forschungszentrum Juelich Logo" width="230px"></a>
38
+
39
+ # tsam - Time Series Aggregation Module
40
+ tsam is a python package which uses different machine learning algorithms for the aggregation of time series. The data aggregation can be performed in two freely combinable dimensions: By representing the time series by a user-defined number of typical periods or by decreasing the temporal resolution.
41
+ tsam was originally designed for reducing the computational load for large-scale energy system optimization models by aggregating their input data, but is applicable for all types of time series, e.g., weather data, load data, both simultaneously or other arbitrary groups of time series.
42
+
43
+ The documentation of the tsam code can be found [**here**](https://tsam.readthedocs.io/en/latest/index.html).
44
+
45
+ ## Features
46
+ * flexible handling of multidimensional time-series via the pandas module
47
+ * different aggregation methods implemented (averaging, k-means, exact k-medoids, hierarchical, k-maxoids, k-medoids with contiguity), which are based on scikit-learn, or self-programmed with pyomo
48
+ * hypertuning of aggregation parameters to find the optimal combination of the number of segments inside a period and the number of typical periods
49
+ * novel representation methods, keeping statistical attributes, such as the distribution
50
+ * flexible integration of extreme periods as own cluster centers
51
+ * weighting for the case of multidimensional time-series to represent their relevance
52
+
53
+
54
+ ## Installation
55
+ Directly install via pip as follows:
56
+
57
+ pip install tsam
58
+
59
+ Alternatively, clone a local copy of the repository to your computer
60
+
61
+ git clone https://github.com/FZJ-IEK3-VSA/tsam.git
62
+
63
+ Then install tsam via pip as follow
64
+
65
+ cd tsam
66
+ pip install .
67
+
68
+ Or install directly via python as
69
+
70
+ python setup.py install
71
+
72
+ In order to use the k-medoids clustering, make sure that you have installed a MILP solver. As default [HiGHS](https://github.com/ERGO-Code/HiGHS) 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.
73
+
74
+
75
+ ## Examples
76
+
77
+ ### Basic workflow
78
+
79
+ A small example how tsam can be used is decribed as follows
80
+ ```python
81
+ import pandas as pd
82
+ import tsam.timeseriesaggregation as tsam
83
+ ```
84
+
85
+
86
+ Read in the time series data set with pandas
87
+ ```python
88
+ raw = pd.read_csv('testdata.csv', index_col = 0)
89
+ ```
90
+
91
+ Initialize an aggregation object and define the length of a single period, the number of typical periods, the number of segments in each period, the aggregation method and the representation method - here duration/distribution representation which contains the minimum and maximum value of the original time series
92
+ ```python
93
+ aggregation = tsam.TimeSeriesAggregation(raw,
94
+ noTypicalPeriods = 8,
95
+ hoursPerPeriod = 24,
96
+ segmentation = True,
97
+ noSegments = 8,
98
+ representationMethod = "distributionAndMinMaxRepresentation",
99
+ distributionPeriodWise = False
100
+ clusterMethod = 'hierarchical'
101
+ )
102
+ ```
103
+
104
+ Run the aggregation to typical periods
105
+ ```python
106
+ typPeriods = aggregation.createTypicalPeriods()
107
+ ```
108
+
109
+ Store the results as .csv file
110
+
111
+ ```python
112
+ typPeriods.to_csv('typperiods.csv')
113
+ ```
114
+
115
+ ### Detailed examples
116
+
117
+ A [**first example**](/examples/aggregation_example.ipynb) shows the capabilites of tsam as jupyter notebook.
118
+
119
+ A [**second example**](/examples/aggregation_optiinput.ipynb) shows in more detail how to access the relevant aggregation results required for paramtrizing e.g. an optimization.
120
+
121
+ The example time series are based on a department [publication](https://www.mdpi.com/1996-1073/10/3/361) and the [test reference years of the DWD](https://www.dwd.de/DE/leistungen/testreferenzjahre/testreferenzjahre.html).
122
+
123
+ ## License
124
+
125
+ MIT License
126
+
127
+ Copyright (C) 2016-2022 Leander Kotzur (FZJ IEK-3), Maximilian Hoffmann (FZJ IEK-3), Peter Markewitz (FZJ IEK-3), Martin Robinius (FZJ IEK-3), Detlef Stolten (FZJ IEK-3)
128
+
129
+ You should have received a copy of the MIT License along with this program.
130
+ If not, see https://opensource.org/licenses/MIT
131
+
132
+ The core developer team sits in the [Institute of Energy and Climate Research - Techno-Economic Energy Systems Analysis (IEK-3)](https://www.fz-juelich.de/iek/iek-3/EN/Home/home_node.html) belonging to the [Forschungszentrum Jülich](https://www.fz-juelich.de/).
133
+
134
+ ## Citing and further reading
135
+
136
+ If you want to use tsam in a published work, **please kindly cite** our latest journal articles:
137
+ * Hoffmann et al. (2022):\
138
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)
139
+
140
+
141
+ If you are further interested in the impact of time series aggregation on the cost-optimal results on different energy system use cases, you can find a publication which validates the methods and describes their cababilites via the following [**link**](https://www.sciencedirect.com/science/article/pii/S0960148117309783). A second publication introduces a method how to model state variables (e.g. the state of charge of energy storage components) between the aggregated typical periods which can be found [**here**](https://www.sciencedirect.com/science/article/pii/S0306261918300242). Finally yet importantly the potential of time series aggregation to simplify mixed integer linear problems is investigated [**here**](https://www.mdpi.com/1996-1073/12/14/2825).
142
+
143
+ The publications about time series aggregation for energy system optimization models published alongside the development of tsam are listed below:
144
+ * Hoffmann et al. (2021):\
145
+ [**The Pareto-Optimal Temporal Aggregation of Energy System Models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261922004342)\
146
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
147
+ * Hoffmann et al. (2021):\
148
+ [**Typical periods or typical time steps? A multi-model analysis to determine the optimal temporal aggregation for energy system models**](https://www.sciencedirect.com/science/article/abs/pii/S0306261921011545)
149
+ * Hoffmann et al. (2020):\
150
+ [**A Review on Time Series Aggregation Methods for Energy System Models**](https://www.mdpi.com/1996-1073/13/3/641)
151
+ * Kannengießer et al. (2019):\
152
+ [**Reducing Computational Load for Mixed Integer Linear Programming: An Example for a District and an Island Energy System**](https://www.mdpi.com/1996-1073/12/14/2825)
153
+ * Kotzur et al. (2018):\
154
+ [**Time series aggregation for energy system design: Modeling seasonal storage**](https://www.sciencedirect.com/science/article/pii/S0306261918300242)\
155
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1710.07593))
156
+ * Kotzur et al. (2018):\
157
+ [**Impact of different time series aggregation methods on optimal energy system design**](https://www.sciencedirect.com/science/article/abs/pii/S0960148117309783)\
158
+ (open access manuscript to be found [**here**](https://arxiv.org/abs/1708.00420))
159
+
160
+
161
+
162
+ ## Acknowledgement
163
+
164
+ This work is supported by the Helmholtz Association under the Joint Initiative ["Energy System 2050 A Contribution of the Research Field Energy"](https://www.helmholtz.de/en/research/energy/energy_system_2050/) and the program ["Energy System Design"](https://www.esd.kit.edu/index.php) and within the [BMWi/BMWk](https://www.bmwk.de/Navigation/DE/Home/home.html) funded project [**METIS**](http://www.metis-platform.net/).
165
+
166
+ <a href="https://www.helmholtz.de/en/"><img src="https://www.helmholtz.de/fileadmin/user_upload/05_aktuelles/Marke_Design/logos/HG_LOGO_S_ENG_RGB.jpg" alt="Helmholtz Logo" width="200px" style="float:right"></a>
167
+
168
+
@@ -0,0 +1,16 @@
1
+ tsam/__init__.py,sha256=E6QTHxEAgUQUWz5m6udpRN8FdG7bivjaG0sau60TgBA,304
2
+ tsam/hyperparametertuning.py,sha256=eM7m7eY80uSlwnLRxmctnis2Jv66D15Z1QD9CCMzSXE,10349
3
+ tsam/periodAggregation.py,sha256=h9CC06jBLNyyaFTMRynGUMN87fOH3NdSEug6EcTsKGA,5471
4
+ tsam/representations.py,sha256=2NL1wanBhGreCeJ8jh0aNdIx05YXEyyMJmMAVFS5-T4,7133
5
+ tsam/timeseriesaggregation.py,sha256=NpHsu507m6TUGIiccU3dkDKjp2SKJkJp_8IQiTkjXSs,56066
6
+ tsam/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ tsam/utils/durationRepresentation.py,sha256=k5pu5m8cRLkU2T9pepZ3wUOgf6I9mn6YmoIHBnVR1yo,9391
8
+ tsam/utils/k_maxoids.py,sha256=0PyaHQMA8vtV_SuQOZ0qdcGFK46aUvOiMSQofjGkjBQ,4415
9
+ tsam/utils/k_medoids_contiguity.py,sha256=IeTucR7OI0iBfbTJs1nVXas5bZ44rVPS2bkb-EewXxc,5843
10
+ tsam/utils/k_medoids_exact.py,sha256=5F2vHZA3GxXkR-mt7XOtecsJSE8WjGAIhJLsjV9nWRI,7100
11
+ tsam/utils/segmentation.py,sha256=y8TPv1KEqf6ByOz7TRywm3WC9ZPhGiWvhwAcQbFibt4,6132
12
+ tsam-2.3.2.dist-info/LICENSE.txt,sha256=XEzEzumoCmdJzcp5gKT6UOtKrkH-SiGpxVbIfihkNK4,1224
13
+ tsam-2.3.2.dist-info/METADATA,sha256=jyD9NgubM4lzgeECguLdiGDF0_fKUgygjlYbVDBMCdQ,12404
14
+ tsam-2.3.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
15
+ tsam-2.3.2.dist-info/top_level.txt,sha256=MFI15PnPuMv8F1hTAOXbjGu41z-l6dJbnK69WlIQNcM,5
16
+ tsam-2.3.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,16 +0,0 @@
1
- tsam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- tsam/hyperparametertuning.py,sha256=W3-FEQU1S71Fde9SJuOFKzezVXz-dZSL4W9uFN3Or8s,9259
3
- tsam/periodAggregation.py,sha256=PdemMwvgRpAEPSMvpzI2zbf4G9RTEl6buYnWRActN2I,5329
4
- tsam/representations.py,sha256=g8sq3EbcTQKC64Phh93Fmwhzdl9RJTsAcDI_soI6P80,6966
5
- tsam/timeseriesaggregation.py,sha256=wBJ_XYxXObi81w2IIB6Jy0SNELTT-GYhEcqtQmy8oM0,53007
6
- tsam/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- tsam/utils/durationRepresentation.py,sha256=oxn9Xoh4rNafFArivYO4HflZApw0C5-dM53-zUt81C8,6199
8
- tsam/utils/k_maxoids.py,sha256=ifVXTHwrbHffkgVCukr-dO3_UhsPRP5FUvVVqZAzIDw,4334
9
- tsam/utils/k_medoids_contiguity.py,sha256=FH6veNqzJnDx20Cj5MHc3xEjD2-Yn70aF7gnhk9-UQE,5708
10
- tsam/utils/k_medoids_exact.py,sha256=Pshxoy6UfbjtrmVjqRYYv1bgmQ0wLK5-_xxhFRyh3mg,6733
11
- tsam/utils/segmentation.py,sha256=4u630VhQzw2gwXjz7-CIYjmYiaS6VUBa2kLI_4WoP-4,6025
12
- tsam-2.1.0.dist-info/LICENSE.txt,sha256=B8VmjbX12BUztPNAYQR4hl3s7b2Q-YYAigrV5dkNGOw,1204
13
- tsam-2.1.0.dist-info/METADATA,sha256=RCJ2675gMbgk6126EJuBkfMcRon53Z4y0GEgDK5gcw8,11976
14
- tsam-2.1.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
15
- tsam-2.1.0.dist-info/top_level.txt,sha256=MFI15PnPuMv8F1hTAOXbjGu41z-l6dJbnK69WlIQNcM,5
16
- tsam-2.1.0.dist-info/RECORD,,