pycity_scheduling.classes.html 561 KB
Newer Older
1
2
3
4
5
6
7

<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
Sebastian Schwarz's avatar
v1.0.1    
Sebastian Schwarz committed
8
    <title>pycity_scheduling.classes package &#8212; pycity_scheduling v1.0.1 documentation</title>
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"extensions": ["tex2jax.js"], "jax": ["input/TeX", "output/HTML-CSS"]})</script>
    
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="pycity_scheduling.util package" href="pycity_scheduling.util.html" />
    <link rel="prev" title="pycity_scheduling.algorithms package" href="pycity_scheduling.algorithms.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="pycity_scheduling.util.html" title="pycity_scheduling.util package"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="pycity_scheduling.algorithms.html" title="pycity_scheduling.algorithms package"
             accesskey="P">previous</a> |</li>
Sebastian Schwarz's avatar
v1.0.1    
Sebastian Schwarz committed
40
        <li class="nav-item nav-item-0"><a href="index.html">pycity_scheduling v1.0.1 documentation</a> &#187;</li>
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        <li class="nav-item nav-item-this"><a href="">pycity_scheduling.classes package</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="pycity-scheduling-classes-package">
<h1>pycity_scheduling.classes package<a class="headerlink" href="#pycity-scheduling-classes-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-pycity_scheduling.classes.apartment">
<span id="pycity-scheduling-classes-apartment-module"></span><h2>pycity_scheduling.classes.apartment module<a class="headerlink" href="#module-pycity_scheduling.classes.apartment" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
58
59
60
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.apartment.Apartment">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.apartment.</code><code class="sig-name descname">Apartment</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">net_floor_area</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">occupancy</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.apartment.Apartment" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer" title="pycity_scheduling.classes.entity_container.EntityContainer"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.entity_container.EntityContainer</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.demand.apartment.Apartment</span></code></p>
<p>Extension of pyCity_base class Apartment for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common to all other objects. Includes time and weather instances</p></li>
<li><p><strong>net_floor_area</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – netto floor area in [m^2]</p></li>
<li><p><strong>occupancy</strong> (<em>Occupancy</em><em>, </em><em>optional</em>) – Occupancy profile from pycity_base for the apartment.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>Apartments inherit their set of constraints from EntityContainer.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.apartment.Apartment.addEntity" title="pycity_scheduling.classes.apartment.Apartment.addEntity"><code class="xref py py-obj docutils literal notranslate"><span class="pre">addEntity</span></code></a>(entity)</p></td>
<td><p>Add entity to apartment.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.apartment.Apartment.get_lower_entities" title="pycity_scheduling.classes.apartment.Apartment.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.apartment.Apartment.addEntity">
<code class="sig-name descname">addEntity</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">entity</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.apartment.Apartment.addEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Add entity to apartment.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>entity</strong> (<a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity"><em>OptimizationEntity</em></a>) – Entity to be added to the apartment; must be of type FixedLoad,
DeferrableLoad, CurtailableLoad, SpaceHeating, SpaceCooling or DomesticHotWater.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.apartment.Apartment.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.apartment.Apartment.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.battery">
<span id="pycity-scheduling-classes-battery-module"></span><h2>pycity_scheduling.classes.battery module<a class="headerlink" href="#module-pycity_scheduling.classes.battery" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
134
135
136
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.battery.Battery">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.battery.</code><code class="sig-name descname">Battery</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">e_el_max</span></em>, <em class="sig-param"><span class="n">p_el_max_charge</span></em>, <em class="sig-param"><span class="n">p_el_max_discharge</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">soc_init</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">storage_end_equality</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.battery.Battery" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.battery.Battery</span></code></p>
<p>Extension of pyCity_base class Battery for scheduling purposes.</p>
<p>Initialize Battery.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>e_el_max</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Electric capacity of the battery [kWh].</p></li>
<li><p><strong>p_el_max_charge</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Maximum charging power [kW].</p></li>
<li><p><strong>p_el_max_discharge</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Maximum discharging power [kW]. Defaults to zero.</p></li>
<li><p><strong>soc_init</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Initial state of charge. Defaults to 50%.</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Charging and discharging efficiency. Must be in (0,1]. Defaults
to one.</p></li>
<li><p><strong>storage_end_equality</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – <cite>True</cite> if the soc at the end of the scheduling has to be equal to
the initial soc.
<cite>False</cite> if it has to be greater or equal than the initial soc.
Defaults to <cite>False</cite>.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>Batteries offer sets of constraints for operation. In the <cite>convex</cite> mode
the following constraints and bounds are generated by the battery:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el} &amp;=&amp; p_{el\_demand} - p_{el\_supply} \\
p_{el\_max\_discharge} &amp;\geq&amp; p_{el\_supply} \geq 0 \\
p_{el\_max\_charge} &amp;\geq&amp; p_{el\_demand} \geq 0 \\
e_{el\_max} &amp;\geq&amp; e_{el} \geq 0 \\
e_{el} &amp;=&amp; e_{el\_previous} + (\eta * p_{el\_demand}
- (1 / \eta) * p_{el\_supply}) * \Delta t \\
\text{with} \quad e_{el\_previous} &amp;=&amp; \
\begin{bmatrix} e_{el\_ini} &amp; e_{el\_0} &amp; \cdots &amp; e_{el\_n-1}\end{bmatrix}\end{split}\]</div>
<ul class="simple">
<li><p>Additional constraints generated by the parameters are:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}e_{el\_t\_last} &amp;=&amp; soc\_init * e_{el\_max}, &amp; \quad \text{if storage_end_equality} \\
e_{el\_t\_last} &amp;\geq&amp; soc\_init * e_{el\_max}, &amp; \quad \text{else}\end{split}\]</div>
<ul class="simple">
<li><p>In <cite>integer</cite> mode the following constraints are added additionally:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el\_demand} &amp;\leq&amp; p_{state} * p_{el\_max\_discharge} \\
p_{el\_supply} &amp;\leq&amp; (1-p_{state}) * p_{el\_max\_charge}\end{split}\]</div>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.battery.Battery.populate_model" title="pycity_scheduling.classes.battery.Battery.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block of variables and constraints to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.battery.Battery.update_model" title="pycity_scheduling.classes.battery.Battery.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.battery.Battery.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.battery.Battery.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block of variables and constraints to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> method and set variables lower bounds to
<cite>None</cite>. Then add variables for demand, supply and the state of charge,
with their corresponding upper bounds (<cite>self.p_el_max_charge</cite>,
<cite>self.p_el_max_discharge</cite>, <cite>self.e_el_max</cite>). Finally add continuity
constraints to the block.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.battery.Battery.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.battery.Battery.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.boiler">
<span id="pycity-scheduling-classes-boiler-module"></span><h2>pycity_scheduling.classes.boiler module<a class="headerlink" href="#module-pycity_scheduling.classes.boiler" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
260
261
262
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.boiler.Boiler">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.boiler.</code><code class="sig-name descname">Boiler</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_th_nom</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">lower_activation_limit</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.boiler.Boiler" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating" title="pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.boiler.Boiler</span></code></p>
<p>Extension of pyCity_base class Boiler for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.Environment" title="pycity_scheduling.classes.Environment"><em>pycity_scheduling.classes.Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>p_th_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal heat output in [kW].</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Efficiency of the gas boiler (without unit).</p></li>
<li><p><strong>lower_activation_limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em><em> (</em><em>only adhered to in integer mode</em><em>)</em>) – <p>Must be in [0, 1]. Lower activation limit of the gas boiler as a
percentage of the rated power. When the gas boiler is in operation, its
power must be zero or between the lower activation limit and its
rated power.</p>
<ul>
<li><p><cite>lower_activation_limit = 0</cite>: Linear behavior</p></li>
<li><p><cite>lower_activation_limit = 1</cite>: Two-point controlled</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>Gas boilers offer sets of constraints for operation. In the <cite>convex</cite> mode the
following constraints and bounds are generated by the boiler:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[0 \geq p_{th\_heat} \geq -p_{th\_nom}\]</div>
<ul class="simple">
<li><dl class="simple">
<dt>See also:</dt><dd><ul>
<li><p>pycity_scheduling.util.generic_constraints.LowerActivationLimit:
Generates additional constraints for the <cite>lower_activation_limit</cite> in <cite>integer</cite> mode.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.boiler.Boiler.get_objective" title="pycity_scheduling.classes.boiler.Boiler.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.boiler.Boiler.populate_model" title="pycity_scheduling.classes.boiler.Boiler.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.boiler.Boiler.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.boiler.Boiler.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the boiler weighted with coeff.
Sum of <cite>p_th_heat</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.boiler.Boiler.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.boiler.Boiler.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel</p>
<p>Call parent’s <cite>populate_model</cite> method and set variables upper bounds
to <cite>self.p_th_nom</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.building">
<span id="pycity-scheduling-classes-building-module"></span><h2>pycity_scheduling.classes.building module<a class="headerlink" href="#module-pycity_scheduling.classes.building" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
375
376
377
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.building.Building">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.building.</code><code class="sig-name descname">Building</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">objective</span><span class="o">=</span><span class="default_value">'price'</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">profile_type</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">building_type</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">storage_end_equality</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building.Building" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer" title="pycity_scheduling.classes.entity_container.EntityContainer"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.entity_container.EntityContainer</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.building.Building</span></code></p>
<p>Extension of pyCity_base class Building for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>objective</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Objective for the scheduling. The default is ‘price’.</p>
<ul>
<li><p>’price’ : Optimize for the prices given by <cite>prices.tou_prices</cite>.</p></li>
<li><p>’co2’ : Optimize for the CO2 emissions given by <cite>prices.co2_prices</cite>.</p></li>
<li><p>’peak-shaving’ : Try to flatten the schedule as much as possible.</p></li>
<li><p>’max-consumption’ : Try to reduce the maximum of the absolute values of the schedule as much as possible.</p></li>
<li><p>’none’ : No objective (leave all flexibility to other participants).</p></li>
</ul>
</p></li>
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Name for the building.
If name is None, set it to self._long_id.</p></li>
<li><p><strong>profile_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Thermal SLP profile name
Requires <cite>method=1</cite></p>
<ul>
<li><p>’HEF’ : Single family household</p></li>
<li><p>’HMF’ : Multi family household</p></li>
<li><p>’GBA’ : Bakeries</p></li>
<li><p>’GBD’ : Other services</p></li>
<li><p>’GBH’ : Accommodations</p></li>
<li><p>’GGA’ : Restaurants</p></li>
<li><p>’GGB’ : Gardening</p></li>
<li><p>’GHA’ : Retailers</p></li>
<li><p>’GHD’ : Summed load profile business, trade and services</p></li>
<li><p>’GKO’ : Banks, insurances, public institutions</p></li>
<li><p>’GMF’ : Household similar businesses</p></li>
<li><p>’GMK’ : Automotive</p></li>
<li><p>’GPD’ : Paper and printing</p></li>
<li><p>’GWA’ : Laundries</p></li>
</ul>
</p></li>
<li><p><strong>building_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Build year profile name, the detailed list is implemented in
<cite>tabula_data.py</cite>.</p></li>
<li><p><strong>storage_end_equality</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – <cite>True</cite> if the soc at the end of the scheduling has to be equal to
the initial soc.
<cite>False</cite> if it has to be greater or equal than the initial soc.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>The exchange of thermal energy between different buildings is currently not supported.
As a result, the building adds the following set of constrains additionally to the
ones of the EntityContainer:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{th\_heat} &amp;=&amp; 0 \\
p_{th\_cool} &amp;=&amp; 0\end{split}\]</div>
<ul class="simple">
<li><p>The building can also add robustness constrains for thermal heating storage:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}e_{u\_bound} \geq \sum_i e_{th\_heat\_i} \geq e_{l\_bound} \\\end{split}\]</div>
<ul class="simple">
<li><p>The <span class="math notranslate nohighlight">\(E_{u\_bound}\)</span> and <span class="math notranslate nohighlight">\(E_{l\_bound}\)</span> are determined by the
robustness parameter, the available capacity of thermal heating storage, the magnitude of heating
required by SpaceHeating and the magnitude of heating that can be produced by the building’s heating units.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.building.Building.get_lower_entities" title="pycity_scheduling.classes.building.Building.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.building.Building.populate_model" title="pycity_scheduling.classes.building.Building.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode, robustness])</p></td>
<td><p>Add building block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.building.Building.update_model" title="pycity_scheduling.classes.building.Building.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode, robustness])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.building.Building.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building.Building.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.building.Building.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em>, <em class="sig-param"><span class="n">robustness</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building.Building.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add building block to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> method and set variables lower
bounds to <cite>None</cite>. Then call <cite>populate_model</cite> method of the BES
and all contained apartments and add constraints that the sum
of their variables for each period equals the corresponding
own variable.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use same constraints as convex mode</p></li>
</ul>
</p></li>
<li><p><strong>robustness</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)"><em>tuple</em></a><em>, </em><em>optional</em>) – Tuple of two floats. First entry defines how many time steps are
protected from deviations. Second entry defines the magnitude of
deviations which are considered.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.building.Building.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em>, <em class="sig-param"><span class="n">robustness</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building.Building.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the device
according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use same constraints as convex mode</p></li>
</ul>
</p></li>
<li><p><strong>robustness</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)"><em>tuple</em></a><em>, </em><em>optional</em>) – Tuple of two floats. First entry defines how many time steps are
protected from deviations. Second entry defines the magnitude of
deviations which are considered.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.building_energy_system">
<span id="pycity-scheduling-classes-building-energy-system-module"></span><h2>pycity_scheduling.classes.building_energy_system module<a class="headerlink" href="#module-pycity_scheduling.classes.building_energy_system" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
540
541
542
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.building_energy_system.</code><code class="sig-name descname">BuildingEnergySystem</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer" title="pycity_scheduling.classes.entity_container.EntityContainer"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.entity_container.EntityContainer</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.building_energy_system.BES</span></code></p>
<p>Extension of pyCity_base class BES for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – </p>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>The constraints generated by a BES are the same as the ones created by an EntityContainer.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Attributes</dt>
<dd class="field-odd"><dl class="simple">
<dt><a class="reference internal" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.tcs_units" title="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.tcs_units"><code class="xref py py-obj docutils literal notranslate"><span class="pre">tcs_units</span></code></a></dt><dd><p>Provides all TCS units.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.ths_units" title="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.ths_units"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ths_units</span></code></a></dt><dd><p>Provides all THS units.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.getHasDevices" title="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.getHasDevices"><code class="xref py py-obj docutils literal notranslate"><span class="pre">getHasDevices</span></code></a>([all_devices, battery, …])</p></td>
<td><p>Get information if certain devices are installed devices.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.get_lower_entities" title="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.getHasDevices">
<code class="sig-name descname">getHasDevices</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">all_devices</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">battery</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">boiler</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">chp</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">chiller</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">electrical_heater</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">heatpump</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">inverter_acdc</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">inverter_dcac</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">pv</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">ths</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">tcs</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.getHasDevices" title="Permalink to this definition">¶</a></dt>
<dd><p>Get information if certain devices are installed devices.
The result is in alphabetical order, starting with “battery”</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>all_devices</strong> (<em>boolean</em><em>, </em><em>optional</em>) – If true: Return all installed devices
If false: Only return the specified devices</p></li>
<li><p><strong>battery</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the battery</p></li>
<li><p><strong>boiler</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the boiler</p></li>
<li><p><strong>chp</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the chp unit</p></li>
<li><p><strong>chiller</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the chiller unit</p></li>
<li><p><strong>electrical_heater</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the electrical heater</p></li>
<li><p><strong>heatpump</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the heat pump</p></li>
<li><p><strong>inverter_acdc</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the AC-DC inverter</p></li>
<li><p><strong>inverter_dcac</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the DC-AC inverter</p></li>
<li><p><strong>pv</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the PV modules</p></li>
<li><p><strong>ths</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the thermal heating storage</p></li>
<li><p><strong>tcs</strong> (<em>boolean</em><em>, </em><em>optional</em>) – Return information on the thermal cooling storage</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.tcs_units">
<em class="property">property </em><code class="sig-name descname">tcs_units</code><a class="headerlink" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.tcs_units" title="Permalink to this definition">¶</a></dt>
<dd><p>Provides all TCS units.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.ths_units">
<em class="property">property </em><code class="sig-name descname">ths_units</code><a class="headerlink" href="#pycity_scheduling.classes.building_energy_system.BuildingEnergySystem.ths_units" title="Permalink to this definition">¶</a></dt>
<dd><p>Provides all THS units.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.chiller">
<span id="pycity-scheduling-classes-chiller-module"></span><h2>pycity_scheduling.classes.chiller module<a class="headerlink" href="#module-pycity_scheduling.classes.chiller" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
648
649
650
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.chiller.Chiller">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.chiller.</code><code class="sig-name descname">Chiller</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_th_nom</span></em>, <em class="sig-param"><span class="n">cop</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">0.36</span></em>, <em class="sig-param"><span class="n">t_min</span><span class="o">=</span><span class="default_value">4.0</span></em>, <em class="sig-param"><span class="n">lower_activation_limit</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">t_flow</span><span class="o">=</span><span class="default_value">16.0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.chiller.Chiller" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling" title="pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.compression_chiller.CompressionChiller</span></code></p>
<p>Extension of pyCity_base class CompressionChiller for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>p_th_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal thermal power of the chiller in [kW].</p></li>
<li><p><strong>cop</strong> (<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.19)"><em>numpy.ndarray</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The chiller’s coefficient of performance (without unit)
If array, it must provide the coefficient of performance (cop) for
each time step in the simulation horizon.
If int or float, a constant cop over the whole horizon is assumed.
If omitted, an air-water chiller is assumed and the cop is
calculated based on the ambient air temperature, eta and t_flow.</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The Carnot efficiency of the chiller.
If cop is omitted, eta is used to calculate the cop based on T_sink and T_source
according to: cop = eta * T_sink * (T_sink - T_source) with T_sink and T_source in Kelvin</p></li>
<li><p><strong>t_min</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The chiller’s minimum provided temperature in °C</p></li>
<li><p><strong>lower_activation_limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em><em> (</em><em>only adhered to in integer mode</em><em>)</em>) – <p>Must be in [0, 1]. Lower activation limit of the chiller as a
percentage of the rated power. When the chiller is in operation, its
power must be zero or between the lower activation limit and its
rated power.</p>
<ul>
<li><p><cite>lower_activation_limit = 0</cite>: Linear behavior</p></li>
<li><p><cite>lower_activation_limit = 1</cite>: Two-point controlled</p></li>
</ul>
</p></li>
<li><p><strong>t_flow</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – T_sink temperature delivered by CC in °C.
Is used for cop calculation if cop is omitted.
Note that t_flow &gt;= t_min must hold.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>CHs offer sets of constraints for operation. In the <cite>convex</cite> mode the
following constraints and bounds are generated by the CH:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}0 \geq p_{th\_cool} &amp;\geq&amp; -p_{th\_nom} \\
cop * p_{el} &amp;=&amp; - p_{th\_cool}\end{split}\]</div>
<ul class="simple">
<li><dl class="simple">
<dt>See also:</dt><dd><ul>
<li><p>pycity_scheduling.util.generic_constraints.LowerActivationLimit:
Generates additional constraints for the <cite>lower_activation_limit</cite> in <cite>integer</cite> mode.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.chiller.Chiller.populate_model" title="pycity_scheduling.classes.chiller.Chiller.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.chiller.Chiller.update_model" title="pycity_scheduling.classes.chiller.Chiller.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.chiller.Chiller.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.chiller.Chiller.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> method and set thermal variables lower
bounds to <cite>-self.p_th_nom</cite> and the upper bounds to zero. Also add
constraint to bind electrical demand to thermal output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.chiller.Chiller.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.chiller.Chiller.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.city_district">
<span id="pycity-scheduling-classes-city-district-module"></span><h2>pycity_scheduling.classes.city_district module<a class="headerlink" href="#module-pycity_scheduling.classes.city_district" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
776
777
778
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.city_district.CityDistrict">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.city_district.</code><code class="sig-name descname">CityDistrict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">objective</span><span class="o">=</span><span class="default_value">'price'</span></em>, <em class="sig-param"><span class="n">valley_profile</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.city_district.CityDistrict" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.city_district.CityDistrict</span></code></p>
<p>Extension of pyCity_base class CityDistrict for scheduling purposes. Also represents the district operator.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – </p></li>
<li><p><strong>objective</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Objective for the district operator. Default is ‘price’.</p>
<ul>
<li><p>’price’ : Optimize for the minimum total cost given by <cite>prices.da_prices</cite>.</p></li>
<li><p>’peak-shaving’ : Try to ‘flatten’ the schedule as much as possible.</p></li>
<li><p>’max-consumption’ : Try to minimize the maximum power subscription.</p></li>
<li><p>’co2’ : Optimize for the minimum total co2 emissions given by <cite>prices.co2_prices</cite>.</p></li>
<li><p>valley-filling : Try to fill the ‘valleys’ given by a reference power profile.</p></li>
<li><p>flexibility-quantification: To be used to quantify the flexibility potential of the city district only.</p></li>
<li><p>’none’ : No objective.</p></li>
</ul>
</p></li>
<li><p><strong>valley_profile</strong> (<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.19)"><em>numpy.ndarray</em></a><em>, </em><em>optional</em>) – Profile to be filled by applying valley filling.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>The constraints generated by a CD are the same as the ones created by an EntityContainer.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.city_district.CityDistrict.account_imbalance" title="pycity_scheduling.classes.city_district.CityDistrict.account_imbalance"><code class="xref py py-obj docutils literal notranslate"><span class="pre">account_imbalance</span></code></a>()</p></td>
<td><p>Changes the current schedule to account imbalances.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.city_district.CityDistrict.get_lower_entities" title="pycity_scheduling.classes.city_district.CityDistrict.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.city_district.CityDistrict.get_objective" title="pycity_scheduling.classes.city_district.CityDistrict.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.city_district.CityDistrict.populate_model" title="pycity_scheduling.classes.city_district.CityDistrict.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add city district block to pyomo ConcreteModel.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.city_district.CityDistrict.account_imbalance">
<code class="sig-name descname">account_imbalance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.city_district.CityDistrict.account_imbalance" title="Permalink to this definition">¶</a></dt>
<dd><p>Changes the current schedule to account imbalances.</p>
<p>The imbalances are determined from the current schedules of the contained
entities.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.city_district.CityDistrict.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.city_district.CityDistrict.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.city_district.CityDistrict.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.city_district.CityDistrict.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the entity weighted with
coeff.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.city_district.CityDistrict.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.city_district.CityDistrict.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add city district block to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> methods and set variables lower
bounds to <cite>None</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use same constraints as convex mode</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.combined_heat_power">
<span id="pycity-scheduling-classes-combined-heat-power-module"></span><h2>pycity_scheduling.classes.combined_heat_power module<a class="headerlink" href="#module-pycity_scheduling.classes.combined_heat_power" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
904
905
906
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.combined_heat_power.CombinedHeatPower">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.combined_heat_power.</code><code class="sig-name descname">CombinedHeatPower</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_th_nom</span></em>, <em class="sig-param"><span class="n">p_el_nom</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">lower_activation_limit</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.combined_heat_power.CombinedHeatPower" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating" title="pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.combined_heat_power.CHP</span></code></p>
<p>Extension of pyCity_base class CHP for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>p_th_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal thermal power output in [kW].</p></li>
<li><p><strong>p_el_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Nominal electrical power output in [kW]. Defaults to <cite>p_th_nom</cite>.</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Total efficiency of the CHP (without unit).</p></li>
<li><p><strong>lower_activation_limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em><em> (</em><em>only adhered to in integer mode</em><em>)</em>) – <p>Must be in [0, 1]. Lower activation limit of the CHP as a
percentage of the rated power. When the CHP is in operation, its power
must be zero or between the lower activation limit and its rated
power.</p>
<ul>
<li><p><cite>lower_activation_limit = 0</cite>: Linear behavior</p></li>
<li><p><cite>lower_activation_limit = 1</cite>: Two-point controlled</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>CHPs offer sets of constraints for operation. In the <cite>convex</cite> mode the
following constraints and bounds are generated by the CHP:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}0 &amp;\geq&amp; p_{th\_heat} \geq -p_{th\_nom} \\
0 &amp;\geq&amp; p_{el} \geq -p_{el\_nom} \\
\frac{p_{el}}{p_{el\_nom}} &amp;=&amp; \frac{p_{th\_heat}}{p_{th\_nom}}\end{split}\]</div>
<ul class="simple">
<li><dl class="simple">
<dt>See also:</dt><dd><ul>
<li><p>pycity_scheduling.util.generic_constraints.LowerActivationLimit:
Generates additional constraints for the <cite>lower_activation_limit</cite> in <cite>integer</cite> mode.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.combined_heat_power.CombinedHeatPower.populate_model" title="pycity_scheduling.classes.combined_heat_power.CombinedHeatPower.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.combined_heat_power.CombinedHeatPower.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.combined_heat_power.CombinedHeatPower.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel.</p>
<p>Call both parents’ <cite>populate_model</cite> methods and set the upper bounds
of the thermal variables to <cite>self.p_th_nom</cite>, the lower bounds of the
electrical variables to <cite>-self.p_el_nom</cite> and the upper bounds to zero.
Also add constraints to bind electrical demand to thermal output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.curtailable_load">
<span id="pycity-scheduling-classes-curtailable-load-module"></span><h2>pycity_scheduling.classes.curtailable_load module<a class="headerlink" href="#module-pycity_scheduling.classes.curtailable_load" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1002
1003
1004
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.curtailable_load.CurtailableLoad">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.curtailable_load.</code><code class="sig-name descname">CurtailableLoad</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_el_nom</span></em>, <em class="sig-param"><span class="n">max_curtailment</span></em>, <em class="sig-param"><span class="n">max_low</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">min_full</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.curtailable_load.CurtailableLoad" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.demand.electrical_demand.ElectricalDemand</span></code></p>
<p>Extension of pyCity_base class ElectricalDemand for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>p_el_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal electric power in [kW].</p></li>
<li><p><strong>max_curtailment</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Maximal Curtailment of the load</p></li>
<li><p><strong>max_low</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – Maximum number of timesteps the curtailable load can stay under
nominal load</p></li>
<li><p><strong>min_full</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – Minimum number of timesteps the curtailable load has to stay at
nominal operation level when switching to the nominal operation
level</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>CLs offer sets of constraints for operation. In the <cite>convex</cite> mode the following
constraints and bounds are generated by the CL:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el\_nom} * max\_curtailment \geq p_{el} \geq 0 \\
\sum_{j=i}^{i+max\_low+min\_full} p_{el\_j} \geq p_{el\_nom} *
(min\_full + max\_low * max\_curtailment)\end{split}\]</div>
<ul class="simple">
<li><p>The last constraint is replaced in integer mode with the following constraints:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el} \geq p_{state} * p_{el\_nom} \\
\sum_{j=i}^{i+max\_low} p_{state\_j} \geq 1 \\
\sum_{j=i}^{i+min\_full-1} p_{state\_j} \geq
(p_{state\_i} - p_{state\_i-1}) * min\_full\end{split}\]</div>
<ul class="simple">
<li><p>These constraints take also the previous values before the current optimization
horizon into account using the current schedule. Values before <span class="math notranslate nohighlight">\(t=0\)</span> are
assumed to be perfect.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.curtailable_load.CurtailableLoad.populate_model" title="pycity_scheduling.classes.curtailable_load.CurtailableLoad.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.curtailable_load.CurtailableLoad.update_model" title="pycity_scheduling.classes.curtailable_load.CurtailableLoad.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.curtailable_load.CurtailableLoad.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.curtailable_load.CurtailableLoad.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel</p>
<p>Call parent’s <cite>populate_model</cite> method and set variables upper bounds to
the loadcurve and lower bounds to <cite>self.p_el_Min</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Uses integer variables for max_low and min_full constraints if necessary</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.curtailable_load.CurtailableLoad.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.curtailable_load.CurtailableLoad.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.deferrable_load">
<span id="pycity-scheduling-classes-deferrable-load-module"></span><h2>pycity_scheduling.classes.deferrable_load module<a class="headerlink" href="#module-pycity_scheduling.classes.deferrable_load" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1117
1118
1119
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.deferrable_load.DeferrableLoad">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.deferrable_load.</code><code class="sig-name descname">DeferrableLoad</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_el_nom</span></em>, <em class="sig-param"><span class="n">e_consumption</span></em>, <em class="sig-param"><span class="n">load_time</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lt_pattern</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.demand.electrical_demand.ElectricalDemand</span></code></p>
<p>Extension of pyCity_base class ElectricalDemand for scheduling purposes.</p>
<p>The Load will always run once in the op_horizon</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>p_el_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal electric power in [kW].</p></li>
<li><p><strong>e_consumption</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Power to be consumed over the op_horizon in [kWh].</p></li>
<li><p><strong>load_time</strong> (<em>array of binaries</em><em>, </em><em>optional</em>) – Indicator when deferrable load can be turned on. Defaults to always.
<cite>load_time[t] == 0</cite>: device is off in t
<cite>load_time[t] == 1</cite>: device can be turned on in t
It must contain at least one <cite>0</cite> otherwise the model will become
infeasible. Its length has to be consistent with <cite>lt_pattern</cite>.</p></li>
<li><p><strong>lt_pattern</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Define how the <cite>load_time</cite> profile is to be used</p>
<ul>
<li><p><cite>None</cite> : Profile matches simulation horizon.</p></li>
<li><p>’daily’ : Profile matches one day.</p></li>
<li><p>’weekly’ : Profile matches one week.</p></li>
</ul>
</p></li>
</ul>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError :</strong> – If <cite>lt_pattern</cite> does not match <cite>load_time</cite>.</p>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>DLs offer sets of constraints for operation. In the <cite>convex</cite> mode the following
constraints and bounds are generated by the DL:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el\_nom} \geq p_{el\_i} \geq 0, &amp; \quad \text{if} \quad lt\_pattern_i = 1  \\
p_{el\_i} = 0, &amp; \quad \text{else}\end{split}\]</div>
<div class="math notranslate nohighlight">
\[\sum_i p_{el\_i} * \Delta t = e_{consumption}\]</div>
<ul class="simple">
<li><p>The constraints are replaced in integer mode with the following constraints:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}\sum_i p_{state\_i} &amp;=&amp; 1 \\
runtime &amp;=&amp; \lfloor \frac{p_{el\_nom} * \Delta t}{e_{consumption}} \rceil \\
p_{el\_i} &amp;=&amp; p_{el\_nom} * \sum_{j=i-runtime+1}^{i} p_{state\_j} \\
p_{state\_i} &amp;=&amp; 0, \quad \text{if} \quad \sum_{j=i}^{i+runtime-1}
lt\_pattern_j = runtime \\\end{split}\]</div>
<ul class="simple">
<li><p>These constraints do not take the previous values before the current optimization
horizon into account. In the optimization horizon <span class="math notranslate nohighlight">\(e_{consumption}\)</span> always
has to be consumed.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.get_objective" title="pycity_scheduling.classes.deferrable_load.DeferrableLoad.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.populate_model" title="pycity_scheduling.classes.deferrable_load.DeferrableLoad.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.update_model" title="pycity_scheduling.classes.deferrable_load.DeferrableLoad.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.deferrable_load.DeferrableLoad.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the deferrable load weighted with
coeff. Quadratic term minimizing the deviation from the optimal
loadcurve.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.deferrable_load.DeferrableLoad.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel</p>
<p>Call parent’s <cite>populate_model</cite> method and set the upper bounds to the
nominal power or zero depending on <cite>self.load_time</cite>. Also set a constraint
for the minimum load. If mode == <cite>integer</cite> add binary variables to model
load as one block that can be shifted in time.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><dl class="simple">
<dt><cite>integer</cite><span class="classifier">Uses integer variables to restrict the DL to operate</span></dt><dd><p>at nominal load or no load and restricts the DL to consume
E_Min_Consumption when DL is started without returning to a no
load state</p>
</dd>
</dl>
</li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.deferrable_load.DeferrableLoad.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.deferrable_load.DeferrableLoad.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.electrical_entity">
<span id="pycity-scheduling-classes-electrical-entity-module"></span><h2>pycity_scheduling.classes.electrical_entity module<a class="headerlink" href="#module-pycity_scheduling.classes.electrical_entity" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1276
1277
1278
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.electrical_entity.ElectricalEntity">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.electrical_entity.</code><code class="sig-name descname">ElectricalEntity</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.optimization_entity.OptimizationEntity</span></code></a></p>
<p>Base class for all electrical entities derived from OptimizationEntity.</p>
<p>This class provides functionality common to all electrical entities.
It adds variables for the electrical demand / supply of the entity to the
block.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use same constraints as convex mode</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>EEs add the <span class="math notranslate nohighlight">\(p_{el}\)</span> variable to the model. When not modified
by other classes, the following constraint is added:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p_{el} \geq 0\]</div>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity.get_objective" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity.populate_model" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add entity block to pyomo ConcreteModel.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_entity.ElectricalEntity.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the entity weighted with
coeff.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_entity.ElectricalEntity.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add entity block to pyomo ConcreteModel.</p>
<p>Places the block with the name of the entity in the ConcreteModel.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : May use integer variables</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.electrical_heater">
<span id="pycity-scheduling-classes-electrical-heater-module"></span><h2>pycity_scheduling.classes.electrical_heater module<a class="headerlink" href="#module-pycity_scheduling.classes.electrical_heater" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1378
1379
1380
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.electrical_heater.ElectricalHeater">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.electrical_heater.</code><code class="sig-name descname">ElectricalHeater</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_th_nom</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">lower_activation_limit</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_heater.ElectricalHeater" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating" title="pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.electrical_heater.ElectricalHeater</span></code></p>
<p>Extension of pyCity_base class ElectricalHeater for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.Environment" title="pycity_scheduling.classes.Environment"><em>pycity_scheduling.classes.Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>p_th_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal thermal power output in [kW].</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Efficiency of the electrical heater. Defaults to one.</p></li>
<li><p><strong>lower_activation_limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em><em> (</em><em>only adhered to in integer mode</em><em>)</em>) – <p>Must be in [0, 1]. Lower activation limit of the electrical heater
as a percentage of the rated power. When the electrical heater is
in operation, its power must be zero or between the lower activation
limit and its rated power.</p>
<ul>
<li><p><cite>lower_activation_limit = 0</cite>: Linear behavior</p></li>
<li><p><cite>lower_activation_limit = 1</cite>: Two-point controlled</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>EHs offer sets of constraints for operation. In the <cite>convex</cite> mode the
following constraints and bounds are generated by the EH:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}0 \geq p_{th\_heat} &amp;\geq&amp; -p_{th\_nom} \\
\eta * p_{el} &amp;=&amp; - p_{th\_heat}\end{split}\]</div>
<ul class="simple">
<li><dl class="simple">
<dt>See also:</dt><dd><ul>
<li><p>pycity_scheduling.util.generic_constraints.LowerActivationLimit: Generates additional constraints for the
<cite>lower_activation_limit</cite> in <cite>integer</cite> mode.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_heater.ElectricalHeater.populate_model" title="pycity_scheduling.classes.electrical_heater.ElectricalHeater.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_heater.ElectricalHeater.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_heater.ElectricalHeater.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> method and set thermal variables upper
bounds to <cite>self.p_th_nom</cite>. Also add constraint to bind electrical
demand to thermal output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.electrical_vehicle">
<span id="pycity-scheduling-classes-electrical-vehicle-module"></span><h2>pycity_scheduling.classes.electrical_vehicle module<a class="headerlink" href="#module-pycity_scheduling.classes.electrical_vehicle" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1473
1474
1475
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.electrical_vehicle.</code><code class="sig-name descname">ElectricalVehicle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">e_el_max</span></em>, <em class="sig-param"><span class="n">p_el_max_charge</span></em>, <em class="sig-param"><span class="n">p_el_max_discharge</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">soc_init</span><span class="o">=</span><span class="default_value">0.5</span></em>, <em class="sig-param"><span class="n">charging_time</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ct_pattern</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.battery.Battery" title="pycity_scheduling.classes.battery.Battery"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.battery.Battery</span></code></a></p>
<p>Class representing an electrical vehicle for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>e_el_max</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Electric capacity of the battery in [kWh].</p></li>
<li><p><strong>p_el_max_charge</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Maximum charging power in [kW].</p></li>
<li><p><strong>p_el_max_discharge</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Maximum discharging power in [kW]. Defaults to zero.</p></li>
<li><p><strong>soc_init</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Initial state of charge. Defaults to 50%.</p></li>
<li><p><strong>charging_time</strong> (<em>array of binaries</em><em>, </em><em>optional</em>) – <p>Indicator when electrical vehicle can be charged.</p>
<ul>
<li><p><cite>charging_time[t] == 0</cite>: EV cannot be charged in t</p></li>
<li><p><cite>charging_time[t] == 1</cite>: EV can be charged in t</p></li>
</ul>
<p>It must contain at least one <cite>0</cite> otherwise the model will become
infeasible. Its length has to be consistent with <cite>ct_pattern</cite>.
Defaults to only charge during night.</p>
</p></li>
<li><p><strong>ct_pattern</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Define how the <cite>charging_time</cite> profile is to be used.</p>
<ul>
<li><p><cite>None</cite> : Profile matches simulation horizon (default).</p></li>
<li><p>’daily’ : Profile matches one day.</p></li>
<li><p>’weekly’ : Profile matches one week.</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>EVs offer sets of constraints for operation. The <span class="math notranslate nohighlight">\(e_{el}\)</span> equivalence
constraint is replaced by the following constraint:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}e_{el} &amp;=&amp; e_{el\_previous} + (\eta * p_{el\_demand}
- (1 / \eta) * p_{el\_supply} - p_{el\_drive}) * \Delta t \\\end{split}\]</div>
<ul class="simple">
<li><p>The following constraints are added:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el\_drive} \geq 0 \\
p_{el\_demand\_i} = p_{el\_supply} = 0,
&amp; \quad \text{if} \quad ct\_pattern_i = 0 \\
p_{el\_drive\_i} = 0, &amp; \quad \text{if} \quad ct\_pattern_i = 1 \\
e_{el\_i} = soc\_init * e_{el\_max}, &amp; \quad \text{if} \quad \sum_{j=0}^i ct\_pattern_j = 0 \\
e_{el\_i} = 0.2 * e_{el\_max}, &amp; \quad \text{else if} \quad ct\_pattern_i = 0 \\
e_{el\_i} = e_{el\_max}, &amp; \quad \text{else if} \quad ct\_pattern_i+1 = 0\end{split}\]</div>
<ul class="simple">
<li><p>The constraint for the parameter <cite>storage_end_equality</cite> is removed. Instead,
the EV needs to be fully charged at the end of the <cite>simu_horizon</cite> if parameter <cite>ct_pattern</cite>
is one at the end of the simulation horizon.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.get_objective" title="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.populate_model" title="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.update_model" title="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the electric vehicle weighted with
coeff. Quadratic term with additional weights to reward charging the
vehicle earlier.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel</p>
<p>Call parent’s <cite>populate_model</cite> method. Replace coupling
constraints from Battery class with coupling constraints
of EV. Simulate power consumption while driving.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.electrical_vehicle.ElectricalVehicle.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.entity_container">
<span id="pycity-scheduling-classes-entity-container-module"></span><h2>pycity_scheduling.classes.entity_container module<a class="headerlink" href="#module-pycity_scheduling.classes.entity_container" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1627
1628
1629
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.entity_container.</code><code class="sig-name descname">EntityContainer</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling" title="pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating" title="pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a></p>
<p>Base class for entities containing other entities.</p>
<p><cite>p_th</cite> and <cite>p_el</cite> imbalances are propagated to this entities variables.
During calls to its scheduling functions, the contained entities are also
called with the same parameters.</p>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>EntityContainers offer sets of constraints for operation. The following
constraints are added.</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{th\_cool} &amp;=&amp; \sum_i p_{th\_cool\_i} \\
p_{th\_heat} &amp;=&amp; \sum_i p_{th\_heat\_i} \\
p_{el} &amp;=&amp; \sum_i p_{el\_i}\end{split}\]</div>
<ul class="simple">
<li><p><span class="math notranslate nohighlight">\(p_{th\_cool\_i}\)</span>, <span class="math notranslate nohighlight">\(p_{th\_heat\_i}\)</span>, and <span class="math notranslate nohighlight">\(p_{el\_i}\)</span> are the variables from lower
entities. The Bounds from TEC, TEH, and EE are removed.</p></li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer.get_lower_entities" title="pycity_scheduling.classes.entity_container.EntityContainer.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer.populate_model" title="pycity_scheduling.classes.entity_container.EntityContainer.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add entity block and lower entities blocks to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer.reset" title="pycity_scheduling.classes.entity_container.EntityContainer.reset"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code></a>([schedule])</p></td>
<td><p>Reset all values of specified schedule.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer.update_model" title="pycity_scheduling.classes.entity_container.EntityContainer.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.entity_container.EntityContainer.update_schedule" title="pycity_scheduling.classes.entity_container.EntityContainer.update_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_schedule</span></code></a>()</p></td>
<td><p>Update the schedule with the scheduling model solution.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add entity block and lower entities blocks to pyomo ConcreteModel.</p>
<p>Call both parent’s <cite>populate_model</cite> methods and set variables lower
bounds to <cite>None</cite>. Then call <cite>populate_model</cite> method of all contained
entities and add constraints that the sum of their variables for each
period equals the corresponding own variable.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use same constraints as convex mode</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset all values of specified schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specify which schedule to reset.</p>
<ul class="simple">
<li><p><cite>None</cite> : Resets all schedules</p></li>
<li><p>’default’ : Resets normal schedule</p></li>
<li><p>’ref’ : Resets reference schedule</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.entity_container.EntityContainer.update_schedule">
<code class="sig-name descname">update_schedule</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.entity_container.EntityContainer.update_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the schedule with the scheduling model solution.</p>
<p>Retrieve the solution from the scheduling model and write it to the
schedule. The model must be optimal. The time / position of the
solution in the schedule is determined by <cite>self.timer.current_timestep</cite>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.environment">
<span id="pycity-scheduling-classes-environment-module"></span><h2>pycity_scheduling.classes.environment module<a class="headerlink" href="#module-pycity_scheduling.classes.environment" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1770
1771
1772
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.environment.Environment">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.environment.</code><code class="sig-name descname">Environment</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">timer</span></em>, <em class="sig-param"><span class="n">weather</span></em>, <em class="sig-param"><span class="n">prices</span></em>, <em class="sig-param"><span class="n">location</span><span class="o">=</span><span class="default_value">(50.76, 6.07)</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.environment.Environment" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.environment.Environment</span></code></p>
<p>Extension of pyCity_base class Environment for scheduling purposes.</p>
</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.fixed_load">
<span id="pycity-scheduling-classes-fixed-load-module"></span><h2>pycity_scheduling.classes.fixed_load module<a class="headerlink" href="#module-pycity_scheduling.classes.fixed_load" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1795
1796
1797
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.fixed_load.FixedLoad">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.fixed_load.</code><code class="sig-name descname">FixedLoad</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">method</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">demand</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">annual_demand</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">profile_type</span><span class="o">=</span><span class="default_value">'H0'</span></em>, <em class="sig-param"><span class="n">single_family_house</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">total_nb_occupants</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">randomize_appliances</span><span class="o">=</span><span class="default_value">True</span></em>, <em class="sig-param"><span class="n">light_configuration</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">occupancy</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">do_normalization</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">method_3_type</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">method_4_type</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">prev_heat_dev</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">app_filename</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">light_filename</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">season_light_mod</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">light_mod_fac</span><span class="o">=</span><span class="default_value">0.25</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.fixed_load.FixedLoad" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.demand.electrical_demand.ElectricalDemand</span></code></p>
<p>Extension of pyCity_base class ElectricalDemand for scheduling purposes.</p>
<p>As for all uncontrollable loads, the <cite>p_el_schedule</cite> contains the forecast
of the load.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>method</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – <p>Defaults to method zero.</p>
<ul>
<li><p>0 : provide load curve directly</p></li>
<li><p>1 : standard load profile (for households)</p></li>
<li><p>2 : stochastic electrical load model</p></li>
<li><p>3 : annual profile based on measured weekly profiles (non-residential)</p></li>
<li><p>4 : annual profile based on measured annual profiles (non-residential)</p></li>
</ul>
</p></li>
<li><p><strong>demand</strong> (<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.19)"><em>numpy.ndarray</em></a><em>, </em><em>optional</em>) – Demand for all investigated time steps in [kW] when using <cite>method=0</cite>.</p></li>
<li><p><strong>annual_demand</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Required for SLP and recommended for method 2.
Defines the annual electrical demand in [kWh].
If method 2 is chosen but no value is given, a standard value for
Germany (<a class="reference external" href="https://lena.sachsen-anhalt.de/fileadmin/Bibliothek/Sonstige_Webprojekte/Lena/Pressemitteilungen/">https://lena.sachsen-anhalt.de/fileadmin/Bibliothek/Sonstige_Webprojekte/Lena/Pressemitteilungen/</a>
Stromspiegel/Stromspiegel2014_Medienblatt.pdf, accessed on 2020/09/28) is used.</p></li>
<li><p><strong>profile_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <ul>
<li><p>H0 : Household</p></li>
<li><p>L0 : Farms</p></li>
<li><p>L1 : Farms with breeding / cattle</p></li>
<li><p>L2 : Farms without cattle</p></li>
<li><p>G0 : Business (general)</p></li>
<li><p>G1 : Business (workingdays 8:00 AM - 6:00 PM)</p></li>
<li><p>G2 : Business with high loads in the evening</p></li>
<li><p>G3 : Business (24 hours)</p></li>
<li><p>G4 : Shops / Barbers</p></li>
<li><p>G5 : Bakery</p></li>
<li><p>G6 : Weekend operation</p></li>
</ul>
</p></li>
<li><p><strong>total_nb_occupants</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – Number of people living in the household for <cite>method=2</cite>.</p></li>
<li><p><strong>randomize_appliances</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – <p>Randomization of appliances for <cite>method=2</cite>. Defaults to <cite>True</cite>.</p>
<ul>
<li><p>True : distribute installed appliances randomly</p></li>
<li><p>False : use the standard distribution</p></li>
</ul>
</p></li>
<li><p><strong>light_configuration</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – There are 100 light bulb configurations predefined for the
stochastic model when using <cite>method=2</cite>. Defaults to zero.
A value between 0 and 100 should be provided.</p></li>
<li><p><strong>occupancy</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><em>optional</em>) – Occupancy given at 10-minute intervals for a full year for <cite>method=2</cite>.</p></li>
<li><p><strong>do_normalization</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – Defines, if stochastic profile (<cite>method=2</cite>) should be
normalized to given annual_demand value. Defaults to <cite>False</cite>.
If set to <cite>False</cite>, annual el. demand depends on stochastic el. load
profile generation. If set to <cite>True</cite>, does normalization with
annual_demand.</p></li>
<li><p><strong>method_3_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Defines type of profile for method=3. Defaults to <cite>None</cite>.
Options:</p>
<ul>
<li><p>’food_pro’: Food production</p></li>
<li><p>’metal’: Metal company</p></li>
<li><p>’rest’: Restaurant (with large cooling load)</p></li>
<li><p>’sports’: Sports hall</p></li>
<li><p>’repair’: Repair / metal shop</p></li>
</ul>
</p></li>
<li><p><strong>method_4_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Defines type of profile for method=4. Defaults to <cite>None</cite>.</p>
<ul>
<li><p>’metal_1’ : Metal company with smooth profile</p></li>
<li><p>’metal_2’ : Metal company with fluctuation in profile</p></li>
<li><p>’warehouse’ : Warehouse</p></li>
</ul>
</p></li>
<li><p><strong>prev_heat_dev</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – Defines, if heating devices should be prevented within chosen
appliances for <cite>method=2</cite>. Defaults to <cite>False</cite>.
If set to True, DESWH, E-INST, Electric shower, Storage heaters
and Other electric space heating are set to zero.</p></li>
<li><p><strong>app_filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Path to Appliances file for <cite>method=2</cite>. Defaults to <cite>None</cite>.
If set to None, uses default file Appliances.csv in
/inputs/stochastic_electrical_load/.</p></li>
<li><p><strong>light_filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Path to Lighting configuration file for <cite>method=2</cite>. Defaults to <cite>None</cite>.
If set to None, uses default file Appliances.csv in
/inputs/stochastic_electrical_load/.</p></li>
<li><p><strong>season_light_mod</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – Defines, if cosine-wave should be used to strengthen seasonal
influence on lighting. Defaults to <cite>False</cite>.
If True, enlarges lighting power demand in winter month and reduces
lighting power demand in summer month.</p></li>
<li><p><strong>light_mod_fac</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Define factor, related to maximal lighting power, which is used
to implement seasonal influence. Defaults to 25%.
Only relevant, if <cite>season_light_mod</cite> == True</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>Standard load profiles, for instance for Germany, can be found here:
<a class="reference external" href="https://www.bdew.de/energie/standardlastprofile-strom/">https://www.bdew.de/energie/standardlastprofile-strom/</a> (accessed on 2020/09/28)</p></li>
<li><p>Average German electricity consumption data per household can be found here:
<a class="reference external" href="https://lena.sachsen-anhalt.de/fileadmin/Bibliothek/Sonstige_Webprojekte/Lena/Pressemitteilungen/">https://lena.sachsen-anhalt.de/fileadmin/Bibliothek/Sonstige_Webprojekte/Lena/Pressemitteilungen/</a>
Stromspiegel/Stromspiegel2014_Medienblatt.pdf (accessed on 2020/09/28)</p></li>
<li><p>The following constraint is added for removing the bounds from EE:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p_{el} = load\_curve\]</div>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.fixed_load.FixedLoad.new_schedule" title="pycity_scheduling.classes.fixed_load.FixedLoad.new_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">new_schedule</span></code></a>(schedule)</p></td>
<td><p>Create a new schedule with default values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.fixed_load.FixedLoad.reset" title="pycity_scheduling.classes.fixed_load.FixedLoad.reset"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code></a>([schedule])</p></td>
<td><p>Reset all values of specified schedule.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.fixed_load.FixedLoad.update_model" title="pycity_scheduling.classes.fixed_load.FixedLoad.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.fixed_load.FixedLoad.update_schedule" title="pycity_scheduling.classes.fixed_load.FixedLoad.update_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_schedule</span></code></a>()</p></td>
<td><p>Update the schedule with the scheduling model solution.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.fixed_load.FixedLoad.new_schedule">
<code class="sig-name descname">new_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.fixed_load.FixedLoad.new_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new schedule with default values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of new schedule.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.fixed_load.FixedLoad.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.fixed_load.FixedLoad.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset all values of specified schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specify which schedule to reset.</p>
<ul class="simple">
<li><p><cite>None</cite> : Resets all schedules</p></li>
<li><p>’default’ : Resets normal schedule</p></li>
<li><p>’ref’ : Resets reference schedule</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.fixed_load.FixedLoad.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.fixed_load.FixedLoad.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.fixed_load.FixedLoad.update_schedule">
<code class="sig-name descname">update_schedule</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.fixed_load.FixedLoad.update_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the schedule with the scheduling model solution.</p>
<p>Retrieve the solution from the scheduling model and write it to the
schedule. The model must be optimal. The time / position of the
solution in the schedule is determined by <cite>self.timer.current_timestep</cite>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.heat_pump">
<span id="pycity-scheduling-classes-heat-pump-module"></span><h2>pycity_scheduling.classes.heat_pump module<a class="headerlink" href="#module-pycity_scheduling.classes.heat_pump" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
1995
1996
1997
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.heat_pump.HeatPump">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.heat_pump.</code><code class="sig-name descname">HeatPump</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">p_th_nom</span></em>, <em class="sig-param"><span class="n">cop</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">eta</span><span class="o">=</span><span class="default_value">0.36</span></em>, <em class="sig-param"><span class="n">t_max</span><span class="o">=</span><span class="default_value">55.0</span></em>, <em class="sig-param"><span class="n">lower_activation_limit</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">t_flow</span><span class="o">=</span><span class="default_value">55.0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.heat_pump.HeatPump" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating" title="pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_heating.ThermalEntityHeating</span></code></a>, <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.heat_pump.Heatpump</span></code></p>
<p>Extension of pyCity_base class Heatpump for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common to all other objects. Includes time and weather instances.</p></li>
<li><p><strong>p_th_nom</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Nominal thermal power of the heat pump in [kW].</p></li>
<li><p><strong>cop</strong> (<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.19)"><em>numpy.ndarray</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The heat pump’s coefficient of performance (without unit)
If array, it must provide the coefficient of performance (cop) for
each time step in the simulation horizon.
If int or float, a constant cop over the whole horizon is assumed.
If omitted, an air-water heat pump is assumed and the cop is
calculated with the ambient air temperature.</p></li>
<li><p><strong>eta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The Carnot efficiency of the heat pump.
If cop is omitted, eta is used to calculate the cop based on T_sink and T_source
according to: cop = eta * T_sink * (T_sink - T_source) with T_sink and T_source in Kelvin</p></li>
<li><p><strong>t_max</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – The heat pump’s maximum provided temperature in °C</p></li>
<li><p><strong>lower_activation_limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em><em> (</em><em>only adhered to in integer mode</em><em>)</em>) – <p>Must be in [0, 1]. Lower activation limit of the heat pump as a
percentage of the rated power. When the heat pump is in operation, its
power must be zero or between the lower activation limit and its
rated power.</p>
<ul>
<li><p><cite>lower_activation_limit = 0</cite>: Linear behavior</p></li>
<li><p><cite>lower_activation_limit = 1</cite>: Two-point controlled</p></li>
</ul>
</p></li>
<li><p><strong>t_flow</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – T_sink temperature delivered by HP in °C.
Is used for cop calculation if cop is omitted.
Note that t_flow &lt;= t_max must hold.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>HPs offer sets of constraints for operation. In the <cite>convex</cite> mode the
following constraints and bounds are generated by the HP:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}0 \geq p_{th\_heat} &amp;\geq&amp; -p_{th\_nom} \\
cop * p_{el} &amp;=&amp; - p_{th\_heat}\end{split}\]</div>
<ul class="simple">
<li><dl class="simple">
<dt>See also:</dt><dd><ul>
<li><p>pycity_scheduling.util.generic_constraints.LowerActivationLimit:
Generates additional constraints for the <cite>lower_activation_limit</cite> in <cite>integer</cite> mode.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.heat_pump.HeatPump.populate_model" title="pycity_scheduling.classes.heat_pump.HeatPump.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.heat_pump.HeatPump.update_model" title="pycity_scheduling.classes.heat_pump.HeatPump.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.heat_pump.HeatPump.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.heat_pump.HeatPump.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel.</p>
<p>Call parent’s <cite>populate_model</cite> method and set thermal variables lower
bounds to <cite>-self.p_th_nom</cite> and the upper bounds to zero. Also add
constraint to bind electrical demand to thermal output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.heat_pump.HeatPump.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.heat_pump.HeatPump.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.optimization_entity">
<span id="pycity-scheduling-classes-optimization-entity-module"></span><h2>pycity_scheduling.classes.optimization_entity module<a class="headerlink" href="#module-pycity_scheduling.classes.optimization_entity" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
2123
2124
2125
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.optimization_entity.</code><code class="sig-name descname">OptimizationEntity</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Base class for all optimization entities.</p>
<p>This class provides functionality common to all entities which take part
in the scheduling optimization.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p>
</dd>
<dt class="field-even">Attributes</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_horizon" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_horizon"><code class="xref py py-obj docutils literal notranslate"><span class="pre">op_horizon</span></code></a></dt><dd><p>Number of time steps in a scheduling period.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_slice" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_slice"><code class="xref py py-obj docutils literal notranslate"><span class="pre">op_slice</span></code></a></dt><dd><p>Slice to select values of current scheduling from whole horizon.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_time_vec" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_time_vec"><code class="xref py py-obj docutils literal notranslate"><span class="pre">op_time_vec</span></code></a></dt><dd><p>Iterator over scheduling period.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.schedule" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">schedule</span></code></a></dt><dd><p>The current loaded schedule.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.simu_horizon" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.simu_horizon"><code class="xref py py-obj docutils literal notranslate"><span class="pre">simu_horizon</span></code></a></dt><dd><p>Number of time steps in the whole simulation horizon.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.time_slot" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.time_slot"><code class="xref py py-obj docutils literal notranslate"><span class="pre">time_slot</span></code></a></dt><dd><p>Length of a time step as a portion of an hour.</p>
</dd>
<dt><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.timestep" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.timestep"><code class="xref py py-obj docutils literal notranslate"><span class="pre">timestep</span></code></a></dt><dd><p>Time step indicating the current scheduling.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.copy_schedule" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.copy_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">copy_schedule</span></code></a>([dst, src, name])</p></td>
<td><p>Copy values of one schedule in another schedule.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_all_entities" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_all_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_all_entities</span></code></a>()</p></td>
<td><p>Yield all entities.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_entities" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_entities</span></code></a>()</p></td>
<td><p>Yield all lowest contained entities.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_lower_entities" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_lower_entities"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_lower_entities</span></code></a>()</p></td>
<td><p>Yield all lower-level entities.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_objective" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function for entity level scheduling.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">load_schedule</span></code></a>(schedule)</p></td>
<td><p>Copy values of one schedule in another schedule.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule_into_model" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule_into_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">load_schedule_into_model</span></code></a>([schedule])</p></td>
<td><p>Overwrites the values in the entity model with the values in the schedule.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_schedule" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">new_schedule</span></code></a>(schedule)</p></td>
<td><p>Create a new schedule with default values.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_var" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_var"><code class="xref py py-obj docutils literal notranslate"><span class="pre">new_var</span></code></a>(name[, dtype, func])</p></td>
<td><p>Create a new entry and empty schedule for variable with specified name.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.populate_model" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add entity block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.reset" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.reset"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code></a>([schedule])</p></td>
<td><p>Reset all values of specified schedule.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.set_objective" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.set_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_objective</span></code></a>(objective)</p></td>
<td><p>Set a new objective to be returned by get_objective.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_model" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_schedule" title="pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_schedule</span></code></a>()</p></td>
<td><p>Update the schedule with the scheduling model solution.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.copy_schedule">
<code class="sig-name descname">copy_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dst</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">src</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">name</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.copy_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy values of one schedule in another schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dst</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of schedule to insert values into.
If <cite>None</cite>, use current schedule.</p></li>
<li><p><strong>src</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of schedule to copy values from.
If <cite>None</cite>, use current schedule.</p></li>
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of variable to copy sub schedule of.
If <cite>None</cite>, copy all variables between schedules.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_all_entities">
<code class="sig-name descname">get_all_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_all_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities and sub-entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_entities">
<code class="sig-name descname">get_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lowest contained entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p>Lowest contained entities or <cite>self</cite>.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_lower_entities">
<code class="sig-name descname">get_lower_entities</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_lower_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Yield all lower-level entities.</p>
<dl class="field-list simple">
<dt class="field-odd">Yields</dt>
<dd class="field-odd"><p><em>All contained entities.</em></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function for entity level scheduling.</p>
<p>Return the objective function of the entity weighted with
coeff.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule">
<code class="sig-name descname">load_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Copy values of one schedule in another schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – </p></li>
<li><p><strong>of schedule to set as current schedule.</strong> (<em>Name</em>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule_into_model">
<code class="sig-name descname">load_schedule_into_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.load_schedule_into_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Overwrites the values in the entity model with the values in the schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of schedule to load values from.
If <cite>None</cite>, use current schedule.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_schedule">
<code class="sig-name descname">new_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new schedule with default values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of new schedule.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_var">
<code class="sig-name descname">new_var</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">dtype=&lt;class 'numpy.float64'&gt;</em>, <em class="sig-param">func=None</em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.new_var" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new entry and empty schedule for variable with specified name.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name to access new variable with.</p></li>
<li><p><strong>dtype</strong> (<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v1.19)"><em>numpy.dtype</em></a><em>, </em><em>optional</em>) – Data type which should be used for new schedule.</p></li>
<li><p><strong>func</strong> (<em>Callable</em><em>[</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>]</em><em>, </em><em>Any</em><em>]</em><em>, </em><em>optional</em>) – Function to generate schedule with.
If <cite>None</cite>, schedule is generated with values of variables.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_horizon">
<em class="property">property </em><code class="sig-name descname">op_horizon</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_horizon" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of time steps in a scheduling period.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_slice">
<em class="property">property </em><code class="sig-name descname">op_slice</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_slice" title="Permalink to this definition">¶</a></dt>
<dd><p>Slice to select values of current scheduling from whole horizon.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_time_vec">
<em class="property">property </em><code class="sig-name descname">op_time_vec</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.op_time_vec" title="Permalink to this definition">¶</a></dt>
<dd><p>Iterator over scheduling period.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add entity block to pyomo ConcreteModel.</p>
<p>Places the block with the name of the entity in the ConcreteModel.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : May use integer variables</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset all values of specified schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specify which schedule to reset.</p>
<ul class="simple">
<li><p><cite>None</cite> : Resets all schedules</p></li>
<li><p>’default’ : Resets normal schedule</p></li>
<li><p>’ref’ : Resets reference schedule</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.schedule">
<em class="property">property </em><code class="sig-name descname">schedule</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>The current loaded schedule.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.set_objective">
<code class="sig-name descname">set_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">objective</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.set_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Set a new objective to be returned by get_objective.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>objective</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – <p>Objective for the scheduling.</p>
<ul class="simple">
<li><p>’none’ : No objective (leave all flexibility to other participants).</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.simu_horizon">
<em class="property">property </em><code class="sig-name descname">simu_horizon</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.simu_horizon" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of time steps in the whole simulation horizon.</p>
</dd></dl>

<dl class="py attribute">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.static_entity_id">
<code class="sig-name descname">static_entity_id</code><em class="property"> = 0</em><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.static_entity_id" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.time_slot">
<em class="property">property </em><code class="sig-name descname">time_slot</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.time_slot" title="Permalink to this definition">¶</a></dt>
<dd><p>Length of a time step as a portion of an hour.</p>
<p class="rubric">Examples</p>
<p>time step length = 60 mins =&gt; time_slot = 1
time step length = 15 mins =&gt; time_slot = 0.25</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.timestep">
<em class="property">property </em><code class="sig-name descname">timestep</code><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.timestep" title="Permalink to this definition">¶</a></dt>
<dd><p>Time step indicating the current scheduling.</p>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_schedule">
<code class="sig-name descname">update_schedule</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.optimization_entity.OptimizationEntity.update_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the schedule with the scheduling model solution.</p>
<p>Retrieve the solution from the scheduling model and write it to the
schedule. The model must be optimal. The time / position of the
solution in the schedule is determined by <cite>self.timer.current_timestep</cite>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.photovoltaic">
<span id="pycity-scheduling-classes-photovoltaic-module"></span><h2>pycity_scheduling.classes.photovoltaic module<a class="headerlink" href="#module-pycity_scheduling.classes.photovoltaic" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
2476
2477
2478
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.photovoltaic.Photovoltaic">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.photovoltaic.</code><code class="sig-name descname">Photovoltaic</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">method</span></em>, <em class="sig-param"><span class="n">area</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">peak_power</span><span class="o">=</span><span class="default_value">0.0</span></em>, <em class="sig-param"><span class="n">eta_noct</span><span class="o">=</span><span class="default_value">0.18</span></em>, <em class="sig-param"><span class="n">radiation_noct</span><span class="o">=</span><span class="default_value">1000.0</span></em>, <em class="sig-param"><span class="n">t_cell_noct</span><span class="o">=</span><span class="default_value">45.0</span></em>, <em class="sig-param"><span class="n">t_ambient_noct</span><span class="o">=</span><span class="default_value">20.0</span></em>, <em class="sig-param"><span class="n">alpha_noct</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">beta</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">gamma</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">tau_alpha</span><span class="o">=</span><span class="default_value">0.9</span></em>, <em class="sig-param"><span class="n">force_renewables</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.electrical_entity.ElectricalEntity" title="pycity_scheduling.classes.electrical_entity.ElectricalEntity"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.electrical_entity.ElectricalEntity</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.supply.photovoltaic.PV</span></code></p>
<p>Extension of pyCity_base class PV for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<a class="reference internal" href="#pycity_scheduling.classes.environment.Environment" title="pycity_scheduling.classes.environment.Environment"><em>Environment</em></a>) – Common Environment instance.</p></li>
<li><p><strong>method</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – <ul>
<li><p>0 : Calculate PV power based on an area in m^2 equipped with PV panels</p></li>
<li><p>1 : Calculate PV power based on the installed PV peak power in kWp</p></li>
</ul>
</p></li>
<li><p><strong>area</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – PV unit installation area in m^2 for <cite>method=0</cite>.</p></li>
<li><p><strong>peak_power</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – PV peak power installation in kWp for <cite>method=1</cite>.</p></li>
<li><p><strong>eta_noct</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Electrical efficiency at NOCT conditions (without unit) for <cite>method=0</cite>.
NOCT conditions: See manufacturer’s data sheets or
Duffie, Beckman - Solar Engineering of Thermal Processes (4th ed.), page 759</p></li>
<li><p><strong>radiation_noct</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Nominal solar radiation at NOCT conditions (in W/m^2)
NOCT conditions: See manufacturer’s data sheets or
Duffie, Beckman - Solar Engineering of Thermal Processes (4th ed.), page 759</p></li>
<li><p><strong>t_cell_noct</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Nominal cell temperature at NOCT conditions (in degree Celsius)
NOCT conditions: See manufacturer’s data sheets or
Duffie, Beckman - Solar Engineering of Thermal Processes (4th ed.), page 759</p></li>
<li><p><strong>t_ambient_noct</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Nominal ambient air temperature at NOCT conditions (in degree Celsius)
NOCT conditions: See manufacturer’s data sheets or
Duffie, Beckman - Solar Engineering of Thermal Processes (4th ed.), page 759</p></li>
<li><p><strong>alpha_noct</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Temperature coefficient at NOCT conditions (without unit)
NOCT conditions: See manufacturer’s data sheets or
Duffie, Beckman - Solar Engineering of Thermal Processes (4th ed.), page 759</p></li>
<li><p><strong>beta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Slope, the angle (in degree) between the plane of the surface in
question and the horizontal. 0 &lt;= beta &lt;= 180. If beta &gt; 90, the
surface faces downwards.</p></li>
<li><p><strong>gamma</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Surface azimuth angle. The deviation of the projection on a
horizontal plane of the normal to the surface from the local
meridian, with zero due south, east negative, and west positive.
-180 &lt;= gamma &lt;= 180</p></li>
<li><p><strong>tau_alpha</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Optical properties of the PV unit. Product of absorption and
transmission coeffients.
According to Duffie, Beckman - Solar Engineering of Thermal
Processes (4th ed.), page 758, this value is typically close to 0.9</p></li>
<li><p><strong>force_renewables</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)"><em>bool</em></a><em>, </em><em>optional</em>) – <cite>True</cite> if generation may not be reduced for optimization purposes.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>The following constraint is added for removing the bounds from EE:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[\begin{split}p_{el} &amp;=&amp; -p_{el\_supply}, &amp; \quad \text{if force_renewables} \\
0 \geq p_{el} &amp;\geq&amp; -p_{el\_supply} , &amp; \quad \text{else}\end{split}\]</div>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.get_objective" title="pycity_scheduling.classes.photovoltaic.Photovoltaic.get_objective"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_objective</span></code></a>([coeff])</p></td>
<td><p>Objective function of the Photovoltaic.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.populate_model" title="pycity_scheduling.classes.photovoltaic.Photovoltaic.populate_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">populate_model</span></code></a>(model[, mode])</p></td>
<td><p>Add entity block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.update_model" title="pycity_scheduling.classes.photovoltaic.Photovoltaic.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Update block parameters and bounds.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.photovoltaic.Photovoltaic.get_objective">
<code class="sig-name descname">get_objective</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">coeff</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.get_objective" title="Permalink to this definition">¶</a></dt>
<dd><p>Objective function of the Photovoltaic.</p>
<p>Return the objective function of the photovoltaic weighted
with <cite>coeff</cite>. Depending on <cite>self.force_renewables</cite> leave objective
function empty or build quadratic objective function to minimize
discrepancy between available power and produced power.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>coeff</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Coefficient for the objective function.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Objective function.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>ExpressionBase</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.photovoltaic.Photovoltaic.populate_model">
<code class="sig-name descname">populate_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">model</span></em>, <em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">'convex'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.populate_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add entity block to pyomo ConcreteModel.</p>
<p>Places the block with the name of the entity in the ConcreteModel.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>model</strong> (<em>pyomo.ConcreteModel</em>) – </p></li>
<li><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul>
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : May use integer variables</p></li>
</ul>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.photovoltaic.Photovoltaic.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.photovoltaic.Photovoltaic.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Update block parameters and bounds.</p>
<p>Set parameters and bounds according to the current situation of the
device according to the previous schedule and the current forecasts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specifies which set of constraints to use.</p>
<ul class="simple">
<li><p><cite>convex</cite>  : Use linear constraints</p></li>
<li><p><cite>integer</cite>  : Use integer variables representing discrete control decisions</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.prices">
<span id="pycity-scheduling-classes-prices-module"></span><h2>pycity_scheduling.classes.prices module<a class="headerlink" href="#module-pycity_scheduling.classes.prices" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
2626
2627
2628
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.prices.Prices">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.prices.</code><code class="sig-name descname">Prices</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">timer</span></em>, <em class="sig-param"><span class="n">da_prices</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">tou_prices</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">co2_prices</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">feedin_factor</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.prices.Prices" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.prices.Prices</span></code></p>
<p>Extension of pyCity_base class Prices for scheduling purposes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>timer</strong> (<a class="reference internal" href="#pycity_scheduling.classes.timer.Timer" title="pycity_scheduling.classes.timer.Timer"><em>Timer</em></a>) – Timer instance for generating needed prices.</p></li>
<li><p><strong>da_prices</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Day-ahead prices for each timestep in the <cite>simu_horizon</cite>
in [ct/kWh].</p></li>
<li><p><strong>tou_prices</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Time-of-use prices for each timestep in the <cite>simu_horizon</cite>
in [ct/kWh].</p></li>
<li><p><strong>co2_prices</strong> (<em>array_like</em><em>, </em><em>optional</em>) – CO2 emissions for each timestep in the <cite>simu_horizon</cite> in [g/kWh].</p></li>
<li><p><strong>feedin_factor</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a><em>, </em><em>optional</em>) – Factor which is multiplied to the prices for feed-in revenue.
Should be in [0,1], as prices for feed-in are usually lower than
for consumption.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>If prices are loaded automatically, the simulation period must lie within a single year.</p></li>
<li><p>CO2 emissions and day-ahead prices are currently available for the year 2015 only.</p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Attributes</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>co2_price_cache</strong></dt><dd></dd>
<dt><strong>da_price_cache</strong></dt><dd></dd>
<dt><strong>tou_price_cache</strong></dt><dd></dd>
<dt><strong>tou_price_cache_year</strong></dt><dd></dd>
</dl>
</dd>
</dl>
<dl class="py attribute">
<dt id="pycity_scheduling.classes.prices.Prices.co2_price_cache">
<code class="sig-name descname">co2_price_cache</code><em class="property"> = None</em><a class="headerlink" href="#pycity_scheduling.classes.prices.Prices.co2_price_cache" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="pycity_scheduling.classes.prices.Prices.da_price_cache">
<code class="sig-name descname">da_price_cache</code><em class="property"> = None</em><a class="headerlink" href="#pycity_scheduling.classes.prices.Prices.da_price_cache" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="pycity_scheduling.classes.prices.Prices.tou_price_cache">
<code class="sig-name descname">tou_price_cache</code><em class="property"> = None</em><a class="headerlink" href="#pycity_scheduling.classes.prices.Prices.tou_price_cache" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="pycity_scheduling.classes.prices.Prices.tou_price_cache_year">
<code class="sig-name descname">tou_price_cache_year</code><em class="property"> = None</em><a class="headerlink" href="#pycity_scheduling.classes.prices.Prices.tou_price_cache_year" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.space_cooling">
<span id="pycity-scheduling-classes-space-cooling-module"></span><h2>pycity_scheduling.classes.space_cooling module<a class="headerlink" href="#module-pycity_scheduling.classes.space_cooling" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
2701
2702
2703
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
RWTH Aachen University</p>
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:</p>
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.</p>
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<dl class="py class">
<dt id="pycity_scheduling.classes.space_cooling.SpaceCooling">
<em class="property">class </em><code class="sig-prename descclassname">pycity_scheduling.classes.space_cooling.</code><code class="sig-name descname">SpaceCooling</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">environment</span></em>, <em class="sig-param"><span class="n">method</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">loadcurve</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">living_area</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">specific_demand</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">profile_type</span><span class="o">=</span><span class="default_value">'HEF'</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.space_cooling.SpaceCooling" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling" title="pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling"><code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_scheduling.classes.thermal_entity_cooling.ThermalEntityCooling</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">pycity_base.classes.demand.space_cooling.SpaceCooling</span></code></p>
<p>Extension of pyCity_base class SpaceCooling for scheduling purposes.</p>
<p>As for all uncontrollable loads, the <cite>p_th_schedule</cite> contains the forecast
of the load.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>environment</strong> (<em>Environment object</em>) – Common to all other objects. Includes time and weather instances</p></li>
<li><p><strong>method</strong> (<em>integer</em><em>, </em><em>optional</em>) – <ul>
<li><p><cite>0</cite> : Provide load curve directly</p></li>
<li><p><cite>1</cite> : Use thermal standard load profile (not implemented yet!)</p></li>
</ul>
</p></li>
<li><p><strong>loadcurve</strong> (<em>Array-like</em><em>, </em><em>optional</em>) – Load curve for all investigated time steps
Requires <cite>method=0</cite></p></li>
<li><p><strong>living_area</strong> (<em>Float</em><em>, </em><em>optional</em>) – Living area of the apartment in m^2
Requires <cite>method=1</cite></p></li>
<li><p><strong>specific_demand</strong> (<em>Float</em><em>, </em><em>optional</em>) – Specific thermal demand of the building in kWh/(m^2 a)
Requires <cite>method=1</cite></p></li>
<li><p><strong>profile_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – Thermal SLP profile name
Requires <cite>method=1</cite>
- <cite>HEF</cite> : Single family household
- <cite>HMF</cite> : Multi family household
- <cite>GBA</cite> : Bakeries
- <cite>GBD</cite> : Other services
- <cite>GBH</cite> : Accomodations
- <cite>GGA</cite> : Restaurants
- <cite>GGB</cite> : Gardening
- <cite>GHA</cite> : Retailers
- <cite>GHD</cite> : Summed load profile business, trade and services
- <cite>GKO</cite> : Banks, insurances, public institutions
- <cite>GMF</cite> : Household similar businesses
- <cite>GMK</cite> : Automotive
- <cite>GPD</cite> : Paper and printing
- <cite>GWA</cite> : Laundries</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
<ul class="simple">
<li><p>The following constraint is added for removing the bounds from the TEC:</p></li>
</ul>
<div class="math notranslate nohighlight">
\[p_{th\_cool} = load\_curve\]</div>
<p class="rubric">Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.new_schedule" title="pycity_scheduling.classes.space_cooling.SpaceCooling.new_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">new_schedule</span></code></a>(schedule)</p></td>
<td><p>Create a new schedule with default values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.reset" title="pycity_scheduling.classes.space_cooling.SpaceCooling.reset"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code></a>([schedule])</p></td>
<td><p>Reset all values of specified schedule.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.update_model" title="pycity_scheduling.classes.space_cooling.SpaceCooling.update_model"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_model</span></code></a>([mode])</p></td>
<td><p>Add device block to pyomo ConcreteModel.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.update_schedule" title="pycity_scheduling.classes.space_cooling.SpaceCooling.update_schedule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_schedule</span></code></a>()</p></td>
<td><p>Update the schedule with the scheduling model solution.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="pycity_scheduling.classes.space_cooling.SpaceCooling.new_schedule">
<code class="sig-name descname">new_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.new_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new schedule with default values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Name of new schedule.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.space_cooling.SpaceCooling.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">schedule</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Reset all values of specified schedule.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>schedule</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – <p>Specify which schedule to reset.</p>
<ul class="simple">
<li><p><cite>None</cite> : Resets all schedules</p></li>
<li><p>’default’ : Resets normal schedule</p></li>
<li><p>’ref’ : Resets reference schedule</p></li>
</ul>
</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.space_cooling.SpaceCooling.update_model">
<code class="sig-name descname">update_model</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mode</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.update_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Add device block to pyomo ConcreteModel.</p>
<p>Set variable bounds to equal the given demand, as pure space cooling does
not provide any flexibility.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>mode</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em>, </em><em>optional</em>) – </p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="pycity_scheduling.classes.space_cooling.SpaceCooling.update_schedule">
<code class="sig-name descname">update_schedule</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pycity_scheduling.classes.space_cooling.SpaceCooling.update_schedule" title="Permalink to this definition">¶</a></dt>
<dd><p>Update the schedule with the scheduling model solution.</p>
<p>Retrieve the solution from the scheduling model and write it to the
schedule. The model must be optimal. The time / position of the
solution in the schedule is determined by <cite>self.timer.current_timestep</cite>.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-pycity_scheduling.classes.space_heating">
<span id="pycity-scheduling-classes-space-heating-module"></span><h2>pycity_scheduling.classes.space_heating module<a class="headerlink" href="#module-pycity_scheduling.classes.space_heating" title="Permalink to this headline">¶</a></h2>
<p>The pycity_scheduling framework</p>
Sebastian Schwarz's avatar
Sebastian Schwarz committed
2839
2840
2841
<p>Copyright (C) 2020,
Institute for Automation of Complex Power Systems (ACS),
E.ON Energy Research Center (E.ON ERC),
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940