flixopt 1.0.12__py3-none-any.whl → 2.0.1__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.

Potentially problematic release.


This version of flixopt might be problematic. Click here for more details.

Files changed (73) hide show
  1. docs/examples/00-Minimal Example.md +5 -0
  2. docs/examples/01-Basic Example.md +5 -0
  3. docs/examples/02-Complex Example.md +10 -0
  4. docs/examples/03-Calculation Modes.md +5 -0
  5. docs/examples/index.md +5 -0
  6. docs/faq/contribute.md +49 -0
  7. docs/faq/index.md +3 -0
  8. docs/images/architecture_flixOpt-pre2.0.0.png +0 -0
  9. docs/images/architecture_flixOpt.png +0 -0
  10. docs/images/flixopt-icon.svg +1 -0
  11. docs/javascripts/mathjax.js +18 -0
  12. docs/release-notes/_template.txt +32 -0
  13. docs/release-notes/index.md +7 -0
  14. docs/release-notes/v2.0.0.md +93 -0
  15. docs/release-notes/v2.0.1.md +12 -0
  16. docs/user-guide/Mathematical Notation/Bus.md +33 -0
  17. docs/user-guide/Mathematical Notation/Effects, Penalty & Objective.md +132 -0
  18. docs/user-guide/Mathematical Notation/Flow.md +26 -0
  19. docs/user-guide/Mathematical Notation/LinearConverter.md +21 -0
  20. docs/user-guide/Mathematical Notation/Piecewise.md +49 -0
  21. docs/user-guide/Mathematical Notation/Storage.md +44 -0
  22. docs/user-guide/Mathematical Notation/index.md +22 -0
  23. docs/user-guide/Mathematical Notation/others.md +3 -0
  24. docs/user-guide/index.md +124 -0
  25. {flixOpt → flixopt}/__init__.py +5 -2
  26. {flixOpt → flixopt}/aggregation.py +113 -140
  27. flixopt/calculation.py +455 -0
  28. {flixOpt → flixopt}/commons.py +7 -4
  29. flixopt/components.py +630 -0
  30. {flixOpt → flixopt}/config.py +9 -8
  31. {flixOpt → flixopt}/config.yaml +3 -3
  32. flixopt/core.py +970 -0
  33. flixopt/effects.py +386 -0
  34. flixopt/elements.py +534 -0
  35. flixopt/features.py +1042 -0
  36. flixopt/flow_system.py +409 -0
  37. flixopt/interface.py +265 -0
  38. flixopt/io.py +308 -0
  39. flixopt/linear_converters.py +331 -0
  40. flixopt/plotting.py +1340 -0
  41. flixopt/results.py +898 -0
  42. flixopt/solvers.py +77 -0
  43. flixopt/structure.py +630 -0
  44. flixopt/utils.py +62 -0
  45. flixopt-2.0.1.dist-info/METADATA +145 -0
  46. flixopt-2.0.1.dist-info/RECORD +57 -0
  47. {flixopt-1.0.12.dist-info → flixopt-2.0.1.dist-info}/WHEEL +1 -1
  48. flixopt-2.0.1.dist-info/top_level.txt +6 -0
  49. pics/architecture_flixOpt-pre2.0.0.png +0 -0
  50. pics/architecture_flixOpt.png +0 -0
  51. pics/flixopt-icon.svg +1 -0
  52. pics/pics.pptx +0 -0
  53. scripts/gen_ref_pages.py +54 -0
  54. site/release-notes/_template.txt +32 -0
  55. flixOpt/calculation.py +0 -629
  56. flixOpt/components.py +0 -614
  57. flixOpt/core.py +0 -182
  58. flixOpt/effects.py +0 -410
  59. flixOpt/elements.py +0 -489
  60. flixOpt/features.py +0 -942
  61. flixOpt/flow_system.py +0 -351
  62. flixOpt/interface.py +0 -203
  63. flixOpt/linear_converters.py +0 -325
  64. flixOpt/math_modeling.py +0 -1145
  65. flixOpt/plotting.py +0 -712
  66. flixOpt/results.py +0 -563
  67. flixOpt/solvers.py +0 -21
  68. flixOpt/structure.py +0 -733
  69. flixOpt/utils.py +0 -134
  70. flixopt-1.0.12.dist-info/METADATA +0 -174
  71. flixopt-1.0.12.dist-info/RECORD +0 -29
  72. flixopt-1.0.12.dist-info/top_level.txt +0 -3
  73. {flixopt-1.0.12.dist-info → flixopt-2.0.1.dist-info/licenses}/LICENSE +0 -0
@@ -1,325 +0,0 @@
1
- """
2
- This Module contains high-level classes to easily model a FlowSystem.
3
- """
4
-
5
- import logging
6
- from typing import Dict, Optional
7
-
8
- import numpy as np
9
-
10
- from .components import LinearConverter
11
- from .core import Numeric_TS, TimeSeriesData
12
- from .elements import Flow
13
- from .interface import OnOffParameters
14
-
15
- logger = logging.getLogger('flixOpt')
16
-
17
-
18
- class Boiler(LinearConverter):
19
- def __init__(
20
- self,
21
- label: str,
22
- eta: Numeric_TS,
23
- Q_fu: Flow,
24
- Q_th: Flow,
25
- on_off_parameters: OnOffParameters = None,
26
- meta_data: Optional[Dict] = None,
27
- ):
28
- """
29
- constructor for boiler
30
-
31
- Parameters
32
- ----------
33
- label : str
34
- name of bolier.
35
- eta : float or TS
36
- thermal efficiency.
37
- Q_fu : Flow
38
- fuel input-flow
39
- Q_th : Flow
40
- thermal output-flow.
41
- meta_data : Optional[Dict]
42
- used to store more information about the element. Is not used internally, but saved in the results
43
- """
44
- super().__init__(
45
- label,
46
- inputs=[Q_fu],
47
- outputs=[Q_th],
48
- conversion_factors=[{Q_fu: eta, Q_th: 1}],
49
- on_off_parameters=on_off_parameters,
50
- meta_data=meta_data,
51
- )
52
-
53
- self.eta = eta
54
- self.Q_fu = Q_fu
55
- self.Q_th = Q_th
56
-
57
- check_bounds(eta, 'eta', self.label_full, 0, 1)
58
-
59
-
60
- class Power2Heat(LinearConverter):
61
- def __init__(
62
- self,
63
- label: str,
64
- eta: Numeric_TS,
65
- P_el: Flow,
66
- Q_th: Flow,
67
- on_off_parameters: OnOffParameters = None,
68
- meta_data: Optional[Dict] = None,
69
- ):
70
- """
71
- Parameters
72
- ----------
73
- label : str
74
- name of bolier.
75
- eta : float or TS
76
- thermal efficiency.
77
- P_el : Flow
78
- electric input-flow
79
- Q_th : Flow
80
- thermal output-flow.
81
- meta_data : Optional[Dict]
82
- used to store more information about the element. Is not used internally, but saved in the results
83
-
84
- """
85
- super().__init__(
86
- label,
87
- inputs=[P_el],
88
- outputs=[Q_th],
89
- conversion_factors=[{P_el: eta, Q_th: 1}],
90
- on_off_parameters=on_off_parameters,
91
- meta_data=meta_data,
92
- )
93
-
94
- self.eta = eta
95
- self.P_el = P_el
96
- self.Q_th = Q_th
97
-
98
- check_bounds(eta, 'eta', self.label_full, 0, 1)
99
-
100
-
101
- class HeatPump(LinearConverter):
102
- def __init__(
103
- self,
104
- label: str,
105
- COP: Numeric_TS,
106
- P_el: Flow,
107
- Q_th: Flow,
108
- on_off_parameters: OnOffParameters = None,
109
- meta_data: Optional[Dict] = None,
110
- ):
111
- """
112
- Parameters
113
- ----------
114
- label : str
115
- name of heatpump.
116
- COP : float or TS
117
- Coefficient of performance.
118
- P_el : Flow
119
- electricity input-flow.
120
- Q_th : Flow
121
- thermal output-flow.
122
- meta_data : Optional[Dict]
123
- used to store more information about the element. Is not used internally, but saved in the results
124
- """
125
- super().__init__(
126
- label,
127
- inputs=[P_el],
128
- outputs=[Q_th],
129
- conversion_factors=[{P_el: COP, Q_th: 1}],
130
- on_off_parameters=on_off_parameters,
131
- meta_data=meta_data,
132
- )
133
-
134
- self.COP = COP
135
- self.P_el = P_el
136
- self.Q_th = Q_th
137
-
138
- check_bounds(COP, 'COP', self.label_full, 1, 20)
139
-
140
-
141
- class CoolingTower(LinearConverter):
142
- def __init__(
143
- self,
144
- label: str,
145
- specific_electricity_demand: Numeric_TS,
146
- P_el: Flow,
147
- Q_th: Flow,
148
- on_off_parameters: OnOffParameters = None,
149
- meta_data: Optional[Dict] = None,
150
- ):
151
- """
152
- Parameters
153
- ----------
154
- label : str
155
- name of cooling tower.
156
- specific_electricity_demand : float or TS
157
- auxiliary electricty demand per cooling power, i.g. 0.02 (2 %).
158
- P_el : Flow
159
- electricity input-flow.
160
- Q_th : Flow
161
- thermal input-flow.
162
- meta_data : Optional[Dict]
163
- used to store more information about the element. Is not used internally, but saved in the results
164
-
165
- """
166
- super().__init__(
167
- label,
168
- inputs=[P_el, Q_th],
169
- outputs=[],
170
- conversion_factors=[{P_el: 1, Q_th: -specific_electricity_demand}],
171
- on_off_parameters=on_off_parameters,
172
- meta_data=meta_data,
173
- )
174
-
175
- self.specific_electricity_demand = specific_electricity_demand
176
- self.P_el = P_el
177
- self.Q_th = Q_th
178
-
179
- check_bounds(specific_electricity_demand, 'specific_electricity_demand', self.label_full, 0, 1)
180
-
181
-
182
- class CHP(LinearConverter):
183
- def __init__(
184
- self,
185
- label: str,
186
- eta_th: Numeric_TS,
187
- eta_el: Numeric_TS,
188
- Q_fu: Flow,
189
- P_el: Flow,
190
- Q_th: Flow,
191
- on_off_parameters: OnOffParameters = None,
192
- meta_data: Optional[Dict] = None,
193
- ):
194
- """
195
- constructor of cCHP
196
-
197
- Parameters
198
- ----------
199
- label : str
200
- name of CHP-unit.
201
- eta_th : float or TS
202
- thermal efficiency.
203
- eta_el : float or TS
204
- electrical efficiency.
205
- Q_fu : cFlow
206
- fuel input-flow.
207
- P_el : cFlow
208
- electricity output-flow.
209
- Q_th : cFlow
210
- heat output-flow.
211
- meta_data : Optional[Dict]
212
- used to store more information about the element. Is not used internally, but saved in the results
213
- """
214
- heat = {Q_fu: eta_th, Q_th: 1}
215
- electricity = {Q_fu: eta_el, P_el: 1}
216
-
217
- super().__init__(
218
- label,
219
- inputs=[Q_fu],
220
- outputs=[Q_th, P_el],
221
- conversion_factors=[heat, electricity],
222
- on_off_parameters=on_off_parameters,
223
- meta_data=meta_data,
224
- )
225
-
226
- # args to attributes:
227
- self.eta_th = eta_th
228
- self.eta_el = eta_el
229
- self.Q_fu = Q_fu
230
- self.P_el = P_el
231
- self.Q_th = Q_th
232
-
233
- check_bounds(eta_th, 'eta_th', self.label_full, 0, 1)
234
- check_bounds(eta_el, 'eta_el', self.label_full, 0, 1)
235
- check_bounds(eta_el + eta_th, 'eta_th+eta_el', self.label_full, 0, 1)
236
-
237
-
238
- class HeatPumpWithSource(LinearConverter):
239
- def __init__(
240
- self,
241
- label: str,
242
- COP: Numeric_TS,
243
- P_el: Flow,
244
- Q_ab: Flow,
245
- Q_th: Flow,
246
- on_off_parameters: OnOffParameters = None,
247
- meta_data: Optional[Dict] = None,
248
- ):
249
- """
250
- Parameters
251
- ----------
252
- label : str
253
- name of heatpump.
254
- COP : float, TS
255
- Coefficient of performance.
256
- Q_ab : Flow
257
- Heatsource input-flow.
258
- P_el : Flow
259
- electricity input-flow.
260
- Q_th : Flow
261
- thermal output-flow.
262
- meta_data : Optional[Dict]
263
- used to store more information about the element. Is not used internally, but saved in the results
264
- """
265
-
266
- # super:
267
- electricity = {P_el: COP, Q_th: 1}
268
- heat_source = {Q_ab: COP / (COP - 1), Q_th: 1}
269
-
270
- super().__init__(
271
- label,
272
- inputs=[P_el, Q_ab],
273
- outputs=[Q_th],
274
- conversion_factors=[electricity, heat_source],
275
- on_off_parameters=on_off_parameters,
276
- meta_data=meta_data,
277
- )
278
-
279
- self.COP = COP
280
- self.P_el = P_el
281
- self.Q_ab = Q_ab
282
- self.Q_th = Q_th
283
-
284
- check_bounds(COP, 'eta_th', self.label_full, 1, 20)
285
-
286
-
287
- def check_bounds(
288
- value: Numeric_TS, parameter_label: str, element_label: str, lower_bound: Numeric_TS, upper_bound: Numeric_TS
289
- ):
290
- """
291
- Check if the value is within the bounds. The bounds are exclusive.
292
- If not, log a warning.
293
- Parameters
294
- ----------
295
- value: Numeric_TS
296
- The value to check.
297
- parameter_label: str
298
- The label of the value.
299
- element_label: str
300
- The label of the element.
301
- lower_bound: Numeric_TS
302
- The lower bound.
303
- upper_bound: Numeric_TS
304
- The upper bound.
305
-
306
- Returns
307
- -------
308
-
309
- """
310
- if isinstance(value, TimeSeriesData):
311
- value = value.data
312
- if isinstance(lower_bound, TimeSeriesData):
313
- lower_bound = lower_bound.data
314
- if isinstance(upper_bound, TimeSeriesData):
315
- upper_bound = upper_bound.data
316
- if not np.all(value > lower_bound):
317
- logger.warning(
318
- f"'{element_label}.{parameter_label}' is equal or below the common lower bound {lower_bound}."
319
- f' {parameter_label}.min={np.min(value)}; {parameter_label}={value}'
320
- )
321
- if not np.all(value < upper_bound):
322
- logger.warning(
323
- f"'{element_label}.{parameter_label}' exceeds or matches the common upper bound {upper_bound}."
324
- f' {parameter_label}.max={np.max(value)}; {parameter_label}={value}'
325
- )