Skip to content

Commit

Permalink
Merge pull request #298 from UU-ER/option-to-skip-result-writing
Browse files Browse the repository at this point in the history
Option to skip result writing (+ minor bug fixes)
  • Loading branch information
julia1071 authored Oct 4, 2024
2 parents 02f9334 + 8b925db commit f0fc2e8
Show file tree
Hide file tree
Showing 20 changed files with 139 additions and 151 deletions.
14 changes: 7 additions & 7 deletions adopt_net0/components/networks/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Network(ModelComponent):
- ``para_size_min``: Min Size (for each arc)
- ``para_size_max``: Max Size (for each arc)
- ``para_size_initial``, var_size, var_capex: for existing networks
- ``para_capex_gamma``: :math:`{\gamma}_1, {\gamma}_2, {\gamma}_3, {\gamma}_4` for
- ``para_capex_gamma``: :math:`{\\gamma}_1, {\\gamma}_2, {\\gamma}_3, {\\gamma}_4` for
CAPEX calculation (annualized from given data on up-front CAPEX, lifetime and
discount rate)
- ``para_opex_variable``: Variable OPEX
Expand Down Expand Up @@ -98,12 +98,12 @@ class Network(ModelComponent):
* Flow losses:
.. math::
loss = flow * {\mu} * D
loss = flow * {\\mu} * D
* Flow constraints:
.. math::
S * minTransport \leq flow \leq S
S * minTransport \\leq flow \\leq S
* Consumption at sending and receiving node:
Expand All @@ -119,7 +119,7 @@ class Network(ModelComponent):
based on the existing size.
.. math::
CAPEX_{arc} = {\gamma}_1 + {\gamma}_2 * S + {\gamma}_3 * distance + {\gamma}_4 * S * distance
CAPEX_{arc} = {\\gamma}_1 + {\\gamma}_2 * S + {\\gamma}_3 * distance + {\\gamma}_4 * S * distance
* Variable OPEX:
Expand All @@ -143,7 +143,7 @@ class Network(ModelComponent):
S_{nodeFrom, nodeTo} = S_{nodeTo, nodeFrom}
.. math::
flow_{nodeFrom, nodeTo} = 0 \lor flow_{nodeTo, nodeFrom} = 0
flow_{nodeFrom, nodeTo} = 0 \\lor flow_{nodeTo, nodeFrom} = 0
- CAPEX calculation of whole network as a sum of CAPEX of all arcs. For
bi-directional networks, each arc is only considered once, regardless of the
Expand All @@ -158,10 +158,10 @@ class Network(ModelComponent):
- Total inflow and outflow as a sum for each node:
.. math::
outflow_{node} = \sum_{nodeTo \in sendsto_{node}} flow_{node, nodeTo}
outflow_{node} = \\sum_{nodeTo \\in sendsto_{node}} flow_{node, nodeTo}
.. math::
inflow_{node} = \sum_{nodeFrom \in receivesFrom_{node}} flow_{nodeFrom, node} - losses_{nodeFrom, node}
inflow_{node} = \\sum_{nodeFrom \\in receivesFrom_{node}} flow_{nodeFrom, node} - losses_{nodeFrom, node}
- Energy consumption of other carriers at each node.
Expand Down
22 changes: 11 additions & 11 deletions adopt_net0/components/technologies/genericTechnologies/conv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Conv1(Technology):
Technology with full input an output substitution
This technology type resembles a technology with full input and output substitution,
i.e. :math:`\sum(output) = f(\sum(inputs))`
i.e. :math:`\\sum(output) = f(\\sum(inputs))`
Three different performance function fits are possible.
**Constraint declarations:**
Expand All @@ -23,45 +23,45 @@ class Conv1(Technology):
For size_based_on == 'input' it holds:
.. math::
\sum(Input_{t, car}) \leq S
\\sum(Input_{t, car}) \\leq S
For size_based_on == 'output' it holds:
.. math::
\sum(Output_{t, car}) \leq S
\\sum(Output_{t, car}) \\leq S
- It is possible to limit the maximum input of a carrier. This needs to be
specified in the technology JSON files.
Then it holds:
.. math::
Input_{t, car} <= max_in_{car} * \sum(Input_{t, car})
Input_{t, car} <= max_in_{car} * \\sum(Input_{t, car})
- ``performance_function_type == 1``: Linear through origin. Note that if
min_part_load is larger than 0, the technology cannot be turned off.
.. math::
\sum(Output_{t, car}) == {\\alpha}_1 \sum(Input_{t, car})
\\sum(Output_{t, car}) == {\\alpha}_1 \\sum(Input_{t, car})
.. math::
\min_part_load * S \leq {\\alpha}_1 \sum(Input_{t, car})
min_part_load * S \\leq {\\alpha}_1 \\sum(Input_{t, car})
- ``performance_function_type == 2``: Linear with minimal partload (makes big-m
transformation required). If the technology is in on, it holds:
.. math::
\sum(Output_{t, car}) = {\\alpha}_1 \sum(Input_{t, car}) + {\\alpha}_2
\\sum(Output_{t, car}) = {\\alpha}_1 \\sum(Input_{t, car}) + {\\alpha}_2
.. math::
\sum(Input_{car}) \geq Input_{min} * S
\\sum(Input_{car}) \\geq Input_{min} * S
If the technology is off, input and output is set to 0:
.. math::
\sum(Output_{t, car}) = 0
\\sum(Output_{t, car}) = 0
.. math::
\sum(Input_{t, car}) = 0
\\sum(Input_{t, car}) = 0
If the technology has a standby-power, the input of the standy-by power carrier
is:
Expand All @@ -84,7 +84,7 @@ class Conv1(Technology):
- Additionally, ramping rates of the technology can be constrained.
.. math::
-rampingrate \leq \sum(Input_{t, car}) - \sum(Input_{t-1, car}) \leq rampingrate
-rampingrate \\leq \\sum(Input_{t, car}) - \\sum(Input_{t-1, car}) \\leq rampingrate
"""

Expand Down
18 changes: 9 additions & 9 deletions adopt_net0/components/technologies/genericTechnologies/conv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,46 @@ class Conv2(Technology):
This technology type resembles a technology with full input substitution,
but different performance functions for the respective output carriers,
i.e. :math:`output_{car} = f_{car}(\sum(inputs))`. Three different performance
i.e. :math:`output_{car} = f_{car}(\\sum(inputs))`. Three different performance
function fits are possible.
**Constraint declarations:**
- Size constraints are formulated on the input.
.. math::
\sum(Input_{t, car}) \leq S
\\sum(Input_{t, car}) \\leq S
- It is possible to limit the maximum input of a carrier. This needs to be specified in the technology JSON files.
Then it holds:
.. math::
Input_{t, car} <= max_in_{car} * \sum(Input_{t, car})
Input_{t, car} <= max_in_{car} * \\sum(Input_{t, car})
- ``performance_function_type == 1``: Linear through origin, i.e.:
.. math::
Output_{t, car} == {\\alpha}_{1, car} \sum(Input_{t, car})
Output_{t, car} == {\\alpha}_{1, car} \\sum(Input_{t, car})
.. math::
\min_part_load * S \leq {\\alpha}_1 \sum(Input_{t, car})
min_part_load * S \\leq {\\alpha}_1 \\sum(Input_{t, car})
- ``performance_function_type == 2``: Linear with minimal partload (makes big-m transformation required). If the
technology is in on, it holds:
.. math::
Output_{t, car} = {\\alpha}_{1, car} \sum(Input_{t, car}) + {\\alpha}_{2, car}
Output_{t, car} = {\\alpha}_{1, car} \\sum(Input_{t, car}) + {\\alpha}_{2, car}
.. math::
\sum(Input_{car}) \geq Input_{min} * S
\\sum(Input_{car}) \\geq Input_{min} * S
If the technology is off, input and output is set to 0:
.. math::
Output_{t, car} = 0
.. math::
\sum(Input_{t, car}) = 0
\\sum(Input_{t, car}) = 0
If the technology has a standby-power, the input of the standy-by power carrier
is:
Expand All @@ -80,7 +80,7 @@ class Conv2(Technology):
- Additionally, ramping rates of the technology can be constrained.
.. math::
-rampingrate \leq \sum(Input_{t, car}) - \sum(Input_{t-1, car}) \leq rampingrate
-rampingrate \\leq \\sum(Input_{t, car}) - \\sum(Input_{t-1, car}) \\leq rampingrate
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Conv3(Technology):
- Size constraints are formulated on the input.
.. math::
Input_{t, maincarrier} \leq S
Input_{t, maincarrier} \\leq S
- The ratios of inputs are fixed and given as:
Expand All @@ -47,7 +47,7 @@ class Conv3(Technology):
Output_{t, car} = {\\alpha}_{1, car} Input_{t, maincarrier}
.. math::
\min_part_load * S \leq {\\alpha}_1 Input_{t, maincarrier}
min_part_load * S \\leq {\\alpha}_1 Input_{t, maincarrier}
- ``performance_function_type == 2``: Linear with minimal partload. If the
technology is in on, it holds:
Expand All @@ -58,7 +58,7 @@ class Conv3(Technology):
Output_{t, car} = {\\alpha}_{1, car} Input_{t, maincarrier} + {\\alpha}_{2, car}
.. math::
Input_{maincarrier} \geq Input_{min} * S
Input_{maincarrier} \\geq Input_{min} * S
- If the technology is off, input and output are set to 0:
Expand All @@ -83,7 +83,7 @@ class Conv3(Technology):
- Additionally, ramping rates of the technology can be constrained.
.. math::
-rampingrate \leq Input_{t, main-car} - Input_{t-1, car} \leq rampingrate
-rampingrate \\leq Input_{t, main-car} - Input_{t-1, car} \\leq rampingrate
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Conv4(Technology):
Technology with no inputs
This technology type resembles a technology with fixed output ratios and no
inputs, i.e., :math:`output_{car} \leq S`. This technology is useful for
inputs, i.e., :math:`output_{car} \\leq S`. This technology is useful for
modelling a technology for which you do not care about the inputs, i.e., you do not
wish to construct and solve an energy balance for the input carriers.
Two different performance function fits are possible.
Expand All @@ -24,7 +24,7 @@ class Conv4(Technology):
- Size constraints are formulated on the output.
.. math::
Output_{t, maincarrier} \leq S
Output_{t, maincarrier} \\leq S
- The ratios of outputs are fixed and given as:
Expand All @@ -40,7 +40,7 @@ class Conv4(Technology):
When the technology is on:
.. math::
Output_{maincarrier} \geq Output_{min} * S
Output_{maincarrier} \\geq Output_{min} * S
When the technology is off, output is set to 0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ class Sink(Technology):
- Size constraint:
.. math::
E_{t} \leq S
E_{t} \\leq S
- Maximal injection rate:
.. math::
Input_{t, maincar} \leq injCapacity
Input_{t, maincar} \\leq injCapacity
- Maximal injection capacity:
.. math::
injCapacity \leq injRateMax
injCapacity \\leq injRateMax
- Storage level calculation:
Expand All @@ -63,7 +63,7 @@ class Sink(Technology):
output).
.. math::
-rampingrate \leq Input_{t, maincar} - Input_{t-1, maincar} \leq rampingrate
-rampingrate \\leq Input_{t, maincar} - Input_{t-1, maincar} \\leq rampingrate
"""

Expand Down
12 changes: 6 additions & 6 deletions adopt_net0/components/technologies/genericTechnologies/stor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class Stor(Technology):
- Size constraint:
.. math::
E_{t} \leq S
E_{t} \\leq S
- Maximal charging and discharging:
.. math::
Input_{t} \leq Input_{max}
Input_{t} \\leq Input_{max}
.. math::
Output_{t} \leq Output_{max}
Output_{t} \\leq Output_{max}
- Storage level calculation:
Expand All @@ -76,7 +76,7 @@ class Stor(Technology):
Thus:
.. math::
Input_{max} = \gamma_{charging} * S
Input_{max} = \\gamma_{charging} * S
- If in 'Flexibility' the "power_energy_ratio == flexratio", then the
capacity of the charging and discharging power is a variable in the
Expand Down Expand Up @@ -119,10 +119,10 @@ class Stor(Technology):
output).
.. math::
-rampingrate \leq Input_{t, maincar} - Input_{t-1, maincar} \leq rampingrate
-rampingrate \\leq Input_{t, maincar} - Input_{t-1, maincar} \\leq rampingrate
.. math::
-rampingrate \leq \sum(Output_{t, car}) - \sum(Output_{t-1, car}) \leq
-rampingrate \\leq \\sum(Output_{t, car}) - \\sum(Output_{t-1, car}) \\leq
rampingrate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class CCPP(Technology):
Input_{H2, t} + Input_{NG, t} = Input_{tot, t}
.. math::
Input_{H2, t} \leq in_{H2max} Input_{tot, t}
Input_{H2, t} \\leq in_{H2max} Input_{tot, t}
- Turbines on:
.. math::
N_{on, t} \leq S
N_{on, t} \\leq S
- If technology is on:
Expand All @@ -110,20 +110,20 @@ class CCPP(Technology):
Output_{th,t} = {\\epsilon} Input_{tot, t} - Output_{el,t}
.. math::
Input_{min} * N_{on, t} \leq Input_{tot, t} \leq Input_{max} * N_{on, t}
Input_{min} * N_{on, t} \\leq Input_{tot, t} \\leq Input_{max} * N_{on, t}
- If the technology is off, input and output is set to 0:
.. math::
\sum(Output_{t, car}) = 0
\\sum(Output_{t, car}) = 0
.. math::
\sum(Input_{t, car}) = 0
\\sum(Input_{t, car}) = 0
- Additionally, ramping rates of the technology can be constraint.
.. math::
-rampingrate \leq \sum(Input_{t, car}) - \sum(Input_{t-1, car}) \leq rampingrate
-rampingrate \\leq\\sum(Input_{t, car}) -\\sum(Input_{t-1, car}) \\leq rampingrate
"""

Expand Down
Loading

0 comments on commit f0fc2e8

Please sign in to comment.