Skip to content

Commit

Permalink
Adhere to Black
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Dec 17, 2024
1 parent 7d85cf7 commit 0588563
Showing 1 changed file with 111 additions and 111 deletions.
222 changes: 111 additions & 111 deletions src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,117 +44,117 @@

class GenericStorage(Node):
r"""
Component `GenericStorage` to model with basic characteristics of storages.
The GenericStorage is designed for one input and one output.
Parameters
----------
nominal_capacity : numeric, :math:`E_{nom}` or
:class:`oemof.solph.options.Investment` object
Absolute nominal capacity of the storage, fixed value or
object describing parameter of investment optimisations.
invest_relation_input_capacity : numeric (iterable or scalar) or None, :math:`r_{cap,in}`
Ratio between the investment variable of the input Flow and the
investment variable of the storage:
:math:`\dot{E}_{in,invest} = E_{invest} \cdot r_{cap,in}`
invest_relation_output_capacity : numeric (iterable or scalar) or None, :math:`r_{cap,out}`
Ratio between the investment variable of the output Flow and the
investment variable of the storage:
:math:`\dot{E}_{out,invest} = E_{invest} \cdot r_{cap,out}`
invest_relation_input_output : numeric (iterable or scalar) or None, :math:`r_{in,out}`
Ratio between the investment variable of the output Flow and the
investment variable of the input flow. This ratio used to fix the
flow investments to each other.
Values < 1 set the input flow lower than the output and > 1 will
set the input flow higher than the output flow. If None no relation
will be set:
:math:`\dot{E}_{in,invest} = \dot{E}_{out,invest} \cdot r_{in,out}`
initial_storage_level : numeric, :math:`c(-1)`
The relative storage content in the timestep before the first
time step of optimization (between 0 and 1).
Note: When investment mode is used in a multi-period model,
`initial_storage_level` is not supported.
Storage output is forced to zero until the storage unit is invested in.
balanced : boolean
Couple storage level of first and last time step.
(Total inflow and total outflow are balanced.)
loss_rate : numeric (iterable or scalar)
The relative loss of the storage content per hour.
fixed_losses_relative : numeric (iterable or scalar), :math:`\gamma(t)`
Losses per hour that are independent of the storage content but
proportional to nominal storage capacity.
Note: Fixed losses are not supported in investment mode.
fixed_losses_absolute : numeric (iterable or scalar), :math:`\delta(t)`
Losses per hour that are independent of storage content and independent
of nominal storage capacity.
Note: Fixed losses are not supported in investment mode.
inflow_conversion_factor : numeric (iterable or scalar), :math:`\eta_i(t)`
The relative conversion factor, i.e. efficiency associated with the
inflow of the storage.
outflow_conversion_factor : numeric (iterable or scalar), :math:`\eta_o(t)`
see: inflow_conversion_factor
min_storage_level : numeric (iterable or scalar), :math:`c_{min}(t)`
The normed minimum storage content as fraction of the
nominal storage capacity or the capacity that has been invested into
(between 0 and 1).
To set different values in every time step use a sequence.
max_storage_level : numeric (iterable or scalar), :math:`c_{max}(t)`
see: min_storage_level
storage_costs : numeric (iterable or scalar), :math:`c_{storage}(t)`
Cost (per energy) for having energy in the storage, starting from
time point :math:`t_{1}`.
lifetime_inflow : int, :math:`n_{in}`
Determine the lifetime of an inflow; only applicable for multi-period
models which can invest in storage capacity and have an
invest_relation_input_capacity defined
lifetime_outflow : int, :math:`n_{in}`
Determine the lifetime of an outflow; only applicable for multi-period
models which can invest in storage capacity and have an
invest_relation_output_capacity defined
Notes
-----
The following sets, variables, constraints and objective parts are created
* :py:class:`~oemof.solph.components._generic_storage.GenericStorageBlock`
(if no Investment object present)
* :py:class:`~oemof.solph.components._generic_storage.GenericInvestmentStorageBlock`
(if Investment object present)
Examples
--------
Basic usage examples of the GenericStorage with a random selection of
attributes. See the Flow class for all Flow attributes.
>>> from oemof import solph
>>> my_bus = solph.buses.Bus('my_bus')
>>> my_storage = solph.components.GenericStorage(
... label='storage',
... nominal_capacity=1000,
... inputs={my_bus: solph.flows.Flow(nominal_capacity=200, variable_costs=10)},
... outputs={my_bus: solph.flows.Flow(nominal_capacity=200)},
... loss_rate=0.01,
... initial_storage_level=0,
... max_storage_level = 0.9,
... inflow_conversion_factor=0.9,
... outflow_conversion_factor=0.93)
>>> my_investment_storage = solph.components.GenericStorage(
... label='storage',
... nominal_capacity=solph.Investment(ep_costs=50),
... inputs={my_bus: solph.flows.Flow()},
... outputs={my_bus: solph.flows.Flow()},
... loss_rate=0.02,
... initial_storage_level=None,
... invest_relation_input_capacity=1/6,
... invest_relation_output_capacity=1/6,
... inflow_conversion_factor=1,
... outflow_conversion_factor=0.8)
Component `GenericStorage` to model with basic characteristics of storages.
The GenericStorage is designed for one input and one output.
Parameters
----------
nominal_capacity : numeric, :math:`E_{nom}` or
:class:`oemof.solph.options.Investment` object
Absolute nominal capacity of the storage, fixed value or
object describing parameter of investment optimisations.
invest_relation_input_capacity : numeric (iterable or scalar) or None, :math:`r_{cap,in}`
Ratio between the investment variable of the input Flow and the
investment variable of the storage:
:math:`\dot{E}_{in,invest} = E_{invest} \cdot r_{cap,in}`
invest_relation_output_capacity : numeric (iterable or scalar) or None, :math:`r_{cap,out}`
Ratio between the investment variable of the output Flow and the
investment variable of the storage:
:math:`\dot{E}_{out,invest} = E_{invest} \cdot r_{cap,out}`
invest_relation_input_output : numeric (iterable or scalar) or None, :math:`r_{in,out}`
Ratio between the investment variable of the output Flow and the
investment variable of the input flow. This ratio used to fix the
flow investments to each other.
Values < 1 set the input flow lower than the output and > 1 will
set the input flow higher than the output flow. If None no relation
will be set:
:math:`\dot{E}_{in,invest} = \dot{E}_{out,invest} \cdot r_{in,out}`
initial_storage_level : numeric, :math:`c(-1)`
The relative storage content in the timestep before the first
time step of optimization (between 0 and 1).
Note: When investment mode is used in a multi-period model,
`initial_storage_level` is not supported.
Storage output is forced to zero until the storage unit is invested in.
balanced : boolean
Couple storage level of first and last time step.
(Total inflow and total outflow are balanced.)
loss_rate : numeric (iterable or scalar)
The relative loss of the storage content per hour.
fixed_losses_relative : numeric (iterable or scalar), :math:`\gamma(t)`
Losses per hour that are independent of the storage content but
proportional to nominal storage capacity.
Note: Fixed losses are not supported in investment mode.
fixed_losses_absolute : numeric (iterable or scalar), :math:`\delta(t)`
Losses per hour that are independent of storage content and independent
of nominal storage capacity.
Note: Fixed losses are not supported in investment mode.
inflow_conversion_factor : numeric (iterable or scalar), :math:`\eta_i(t)`
The relative conversion factor, i.e. efficiency associated with the
inflow of the storage.
outflow_conversion_factor : numeric (iterable or scalar), :math:`\eta_o(t)`
see: inflow_conversion_factor
min_storage_level : numeric (iterable or scalar), :math:`c_{min}(t)`
The normed minimum storage content as fraction of the
nominal storage capacity or the capacity that has been invested into
(between 0 and 1).
To set different values in every time step use a sequence.
max_storage_level : numeric (iterable or scalar), :math:`c_{max}(t)`
see: min_storage_level
storage_costs : numeric (iterable or scalar), :math:`c_{storage}(t)`
Cost (per energy) for having energy in the storage, starting from
time point :math:`t_{1}`.
lifetime_inflow : int, :math:`n_{in}`
Determine the lifetime of an inflow; only applicable for multi-period
models which can invest in storage capacity and have an
invest_relation_input_capacity defined
lifetime_outflow : int, :math:`n_{in}`
Determine the lifetime of an outflow; only applicable for multi-period
models which can invest in storage capacity and have an
invest_relation_output_capacity defined
Notes
-----
The following sets, variables, constraints and objective parts are created
* :py:class:`~oemof.solph.components._generic_storage.GenericStorageBlock`
(if no Investment object present)
* :py:class:`~oemof.solph.components._generic_storage.GenericInvestmentStorageBlock`
(if Investment object present)
Examples
--------
Basic usage examples of the GenericStorage with a random selection of
attributes. See the Flow class for all Flow attributes.
>>> from oemof import solph
>>> my_bus = solph.buses.Bus('my_bus')
>>> my_storage = solph.components.GenericStorage(
... label='storage',
... nominal_capacity=1000,
... inputs={my_bus: solph.flows.Flow(nominal_capacity=200, variable_costs=10)},
... outputs={my_bus: solph.flows.Flow(nominal_capacity=200)},
... loss_rate=0.01,
... initial_storage_level=0,
... max_storage_level = 0.9,
... inflow_conversion_factor=0.9,
... outflow_conversion_factor=0.93)
>>> my_investment_storage = solph.components.GenericStorage(
... label='storage',
... nominal_capacity=solph.Investment(ep_costs=50),
... inputs={my_bus: solph.flows.Flow()},
... outputs={my_bus: solph.flows.Flow()},
... loss_rate=0.02,
... initial_storage_level=None,
... invest_relation_input_capacity=1/6,
... invest_relation_output_capacity=1/6,
... inflow_conversion_factor=1,
... outflow_conversion_factor=0.8)
""" # noqa: E501

def __init__(
Expand Down

0 comments on commit 0588563

Please sign in to comment.