oemof.solph.Flow

Flow

solph version of oemof.network.Edge

class oemof.solph.flows._flow.Flow(nominal_value=None, variable_costs=0, min=None, max=None, fix=None, positive_gradient_limit=None, negative_gradient_limit=None, full_load_time_max=None, full_load_time_min=None, integer=False, bidirectional=False, investment=None, nonconvex=None, summed_max=None, summed_min=None, custom_attributes=None)[source]

Bases: oemof.network.network.Edge

Defines a flow between two nodes.

Keyword arguments are used to set the attributes of this flow. Parameters which are handled specially are noted below. For the case where a parameter can be either a scalar or an iterable, a scalar value will be converted to a sequence containing the scalar value at every index. This sequence is then stored under the paramter’s key.

Parameters:
  • nominal_value (numeric, \(P_{nom}\)) – The nominal value of the flow. If this value is set the corresponding optimization variable of the flow object will be bounded by this value multiplied with min(lower bound)/max(upper bound).
  • variable_costs (numeric (iterable or scalar), default: 0, \(c\)) – The costs associated with one unit of the flow per hour. The costs for each timestep (\(P_t \cdot c \cdot \delta(t)\)) will be added to the objective expression of the optimization problem.
  • max (numeric (iterable or scalar), \(f_{max}\)) – Normed maximum value of the flow. The flow absolute maximum will be calculated by multiplying nominal_value with max
  • min (numeric (iterable or scalar), \(f_{min}\)) – Normed minimum value of the flow (see max).
  • fix (numeric (iterable or scalar), \(f_{fix}\)) – Normed fixed value for the flow variable. Will be multiplied with the nominal_value to get the absolute value.
  • positive_gradient_limit (numeric (iterable, scalar or None)) – the normed upper bound on the positive difference (flow[t-1] < flow[t]) of two consecutive flow values.
  • negative_gradient_limit (numeric (iterable, scalar or None)) – the normed upper bound on the negative difference (flow[t-1] > flow[t]) of two consecutive flow values.
  • full_load_time_max (numeric, \(t_{full\_load,max}\)) – Upper bound on the summed flow expressed as the equivalent time that the flow would have to run at full capacity to yield the same sum. The value will be multiplied with the nominal_value to get the absolute limit.
  • full_load_time_min (numeric, \(t_{full\_load,min}\)) – Lower bound on the summed flow expressed as the equivalent time that the flow would have to run at full capacity to yield the same sum. The value will be multiplied with the nominal_value to get the absolute limit.
  • integer (boolean) – Set True to bound the flow values to integers.
  • investment (Investment) – Object indicating if a nominal_value of the flow is determined by the optimization problem. Note: This will refer all attributes to an investment variable rather than to the nominal_value. The nominal_value should not be set (or set to None) if an investment object is used.
  • nonconvex (NonConvex) – If a nonconvex flow object is added here, the flow constraints will be altered significantly as the mathematical model for the flow will be different, i.e. constraint etc. from NonConvexFlowBlock will be used instead of SimpleFlowBlock.

Notes

See SimpleFlowBlock for the variables, constraints and objective parts, that are created for a Flow object.

Examples

Creating a fixed flow object:

>>> f = Flow(nominal_value=2, fix=[10, 4, 4], variable_costs=5)
>>> f.variable_costs[2]
5
>>> f.fix[2]
4

Creating a flow object with time-depended lower and upper bounds:

>>> f1 = Flow(min=[0.2, 0.3], max=0.99, nominal_value=100)
>>> f1.max[1]
0.99

SimpleFlow

Creating sets, variables, constraints and parts of the objective function for Flow objects with neither nonconvex nor investment options.

class oemof.solph.flows._simple_flow_block.SimpleFlowBlock(*args, **kwargs)[source]

Bases: pyomo.core.base.block.ScalarBlock

Flow block with definitions for standard flows.

See Flow class for all parameters of the Flow.

_create_constraints()[source]

Creates all constraints for standard flows.

The following constraints are created, if the appropriate attribute of the Flow (see Flow) object is set:

  • Flow.full_load_time_max is not None (full_load_time_max_constr):
    \[\sum_t P(t) \cdot \tau \leq F_{max} \cdot P_{nom}\]
  • Flow.full_load_time_min is not None (full_load_time_min_constr):
    \[\sum_t P(t) \cdot \tau \geq F_{min} \cdot P_{nom}\]
  • Flow.negative_gradient is not None (negative_gradient_constr):
    \[P(t-1) - P(t) \geq ve_n(t)\]
  • Flow.positive_gradient is not None (positive_gradient_constr):
    \[P(t) - P(t-1) \geq ve_p(t)\]
  • Flow.integer is True
    \[P(t) = i(t)\]
_create_variables(group)[source]

Creates all variables for standard flows.

All Flow objects are indexed by a starting and ending node \((i, o)\), which is omitted in the following for the sake of convenience. The creation of some variables depend on the values of Flow attributes. The following variables are created:

  • \(P(t)\)

    Actual flow value (created in Model). The variable is bound to: \(f_\mathrm{min}(t) \cdot P_\mathrm{nom} \le P(t) \le f_\mathrm{max}(t) \cdot P_\mathrm{nom}\).

    If Flow.fix is not None the variable is bound to \(P(t) = f_\mathrm{fix}(t) \cdot P_\mathrm{nom}\).

  • \(\dot{P}_{down}\) (Flow.negative_gradient is not None)

    Difference of a flow in consecutive timesteps if flow is reduced. The variable is bound to: \(0 \ge ve_n \ge ve_n^{max}\).

  • \(\dot{P}_{up}\) (Flow.positive_gradient is not None)

    Difference of a flow in consecutive timesteps if flow is increased. The variable is bound to: \(0 \ge ve_p \ge ve_p^{max}\).

_create_sets(group)[source]

Creates all sets for standard flows.

_objective_expression()[source]

Objective expression for all standard flows with fixed costs and variable costs.

Depending on the attributes of the Flow object the following parts of the objective function are created:

  • Flow.variable_costs is not None:
    \[\sum_{(i,o)} \sum_t P(t) \cdot c_{var}(i, o, t)\]

Note

See the Flow class for the definition of all parameters from the “List of Parameters above.

InvestmentFlow

Creating sets, variables, constraints and parts of the objective function for Flow objects with investment but without nonconvex option.

class oemof.solph.flows._investment_flow_block.InvestmentFlowBlock(*args, **kwargs)[source]

Bases: pyomo.core.base.block.ScalarBlock

Block for all flows with Investment being not None.

_create_constraints()[source]

Creates all constraints for standard flows.

Depending on the attributes of the InvestmentFlowBlock and SimpleFlowBlock, different constraints are created. The following constraint is created for all InvestmentFlowBlock:

Upper bound for the flow value
\[P(t) \le ( P_{invest} + P_{exist} ) \cdot f_{max}(t)\]

Depeding on the attribute nonconvex, the constraints for the bounds of the decision variable \(P_{invest}\) are different:

  • nonconvex = False
\[P_{invest, min} \le P_{invest} \le P_{invest, max}\]
  • nonconvex = True
\[\begin{split}& P_{invest, min} \cdot Y_{invest} \le P_{invest}\\ & P_{invest} \le P_{invest, max} \cdot Y_{invest}\\\end{split}\]

For all InvestmentFlowBlock (independent of the attribute nonconvex), the following additional constraints are created, if the appropriate attribute of the SimpleFlowBlock (see oemof.solph.network.SimpleFlowBlock) is set:

  • fix is not None

    Actual value constraint for investments with fixed flow values

\[P(t) = ( P_{invest} + P_{exist} ) \cdot f_{fix}(t)\]
  • min != 0

    Lower bound for the flow values

\[P(t) \geq ( P_{invest} + P_{exist} ) \cdot f_{min}(t)\]
  • full_load_time_max is not None

    Upper bound for the sum of all flow values (e.g. maximum full load hours)

\[\sum_t P(t) \cdot \tau(t) \leq ( P_{invest} + P_{exist} ) \cdot t_{full\_load, min}\]
  • full_load_time_min is not None

    Lower bound for the sum of all flow values (e.g. minimum full load hours)

\[\sum_t P(t) \cdot \tau(t) \geq ( P_{invest} + P_{exist} ) \cdot t_{full\_load, min}\]
_create_variables(_)[source]

Creates all variables for investment flows.

All InvestmentFlowBlock are indexed by a starting and ending node \((i, o)\), which is omitted in the following for the sake of convenience. The following variables are created:

  • \(P(t)\)

    Actual flow value (created in oemof.solph.models.BaseModel).

  • \(P_{invest}\)

    Value of the investment variable, i.e. equivalent to the nominal value of the flows after optimization.

  • \(Y_{invest}\)

Binary variable for the status of the investment, if nonconvex is True.

_create_sets(group)[source]

Creates all sets for investment flows.

_objective_expression()[source]

Objective expression for flows with investment attribute of type class:.Investment. The returned costs are fixed, variable and investment costs.

The part of the objective function added by the InvestmentFlowBlock also depends on whether a convex or nonconvex InvestmentFlowBlock is selected. The following parts of the objective function are created:

  • nonconvex = False

    \[P_{invest} \cdot c_{invest,var}\]
  • nonconvex = True

\[\begin{split}P_{invest} \cdot c_{invest,var} + c_{invest,fix} \cdot Y_{invest}\\\end{split}\]

See oemof.solph.options.Investment for all parameters of the Investment class.

See oemof.solph.network.SimpleFlowBlock for all parameters of the SimpleFlowBlock class.

The total value of all costs of all InvestmentFlowBlock can be retrieved calling om.InvestmentFlowBlock.investment_costs.expr().

Note

In case of a nonconvex investment flow (nonconvex=True), the existing flow capacity \(P_{exist}\) needs to be zero.

Note

See also Flow, SimpleFlowBlock and Investment

NonConvexFlow

Creating sets, variables, constraints and parts of the objective function for Flow objects with nonconvex but without investment options.

class oemof.solph.flows._non_convex_flow_block.NonConvexFlowBlock(*args, **kwargs)[source]

Bases: pyomo.core.base.block.ScalarBlock

_create_constraints()[source]

The following constraints are created:

_status_nominal_constraint()[source]
\[\begin{split}P_{max,status}(t) = Y_{status}(t) \cdot P_{nom}, \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
_minimum_flow_constraint()[source]
\[\begin{split}P(t) \geq min(i, o, t) \cdot P_{nom} \ \cdot Y_{status}(t), \\ \forall (i, o) \in \textrm{NONCONVEX_FLOWS}, \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
_maximum_flow_constraint()[source]
\[\begin{split}P(t) \leq max(i, o, t) \cdot P_{nom} \ \cdot status(t), \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall (i, o) \in \textrm{NONCONVEX_FLOWS}.\end{split}\]
_shared_constraints_for_non_convex_flows()[source]
_startup_constraint()[source]
\[\begin{split}Y_{startup}(t) \geq Y_{status}(t) - Y_{status}(t-1) \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall \textrm{STARTUPFLOWS}.\end{split}\]
_max_startup_constraint()[source]
\[\begin{split}\sum_{t \in \textrm{TIMESTEPS}} Y_{startup}(t) \leq \ N_{start}(i,o)\\ \forall (i,o) \in \textrm{MAXSTARTUPFLOWS}.\end{split}\]
_shutdown_constraint()[source]
\[\begin{split}Y_{shutdown}(t) \geq Y_{status}(t-1) - Y_{status}(t) \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall \textrm{SHUTDOWNFLOWS}.\end{split}\]
_max_shutdown_constraint()[source]
\[\begin{split}\sum_{t \in \textrm{TIMESTEPS}} Y_{startup}(t) \leq \ N_{shutdown}(i,o)\\ \forall (i,o) \in \textrm{MAXSHUTDOWNFLOWS}.\end{split}\]
_min_uptime_constraint()[source]
\[\begin{split}(Y_{status}(t)-Y_{status}(t-1)) \cdot t_{up,minimum} \\ \leq \sum_{n=0}^{t_{up,minimum}-1} Y_{status}(t+n) \\ \forall t \in \textrm{TIMESTEPS} | \\ t \neq \{0..t_{up,minimum}\} \cup \ \{t\_max-t_{up,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINUPTIMEFLOWS}. \\ \\ Y_{status}(t) = Y_{status,0} \\ \forall t \in \textrm{TIMESTEPS} | \\ t = \{0..t_{up,minimum}\} \cup \ \{t\_max-t_{up,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINUPTIMEFLOWS}.\end{split}\]
_min_downtime_constraint()[source]
\[\begin{split}(Y_{status}(t-1) - Y_{status}(t)) \ \cdot t_{down,minimum} \\ \leq t_{down,minimum} \ - \sum_{n=0}^{t_{down,minimum}-1} Y_{status}(t+n) \\ \forall t \in \textrm{TIMESTEPS} | \\ t \neq \{0..t_{down,minimum}\} \cup \ \{t\_max-t_{down,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINDOWNTIMEFLOWS}. \\ \\ Y_{status}(t) = Y_{status,0} \\ \forall t \in \textrm{TIMESTEPS} | \\ t = \{0..t_{down,minimum}\} \cup \ \{t\_max-t_{down,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINDOWNTIMEFLOWS}.\end{split}\]
positive_gradient_constraint
\[\begin{split}P(t) \cdot Y_{status}(t) - P(t-1) \cdot Y_{status}(t-1) \leq \ \dot{P}_{up}(t), \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
negative_gradient_constraint
\[\begin{split}P(t-1) \cdot Y_{status}(t-1) - P(t) \cdot Y_{status}(t) \leq \ \dot{P}_{down}(t), \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
_create_variables()[source]
\(Y_{status}\) (binary) om.NonConvexFlowBlock.status:
Variable indicating if flow is >= 0
\(P_{max,status}\) Status_nominal (continuous)
Variable indicating if flow is >= 0
_variables_for_non_convex_flows()[source]
\(Y_{startup}\) (binary) NonConvexFlowBlock.startup:
Variable indicating startup of flow (component) indexed by STARTUPFLOWS
\(Y_{shutdown}\) (binary) NonConvexFlowBlock.shutdown:
Variable indicating shutdown of flow (component) indexed by SHUTDOWNFLOWS
\(\dot{P}_{up}\) (continuous)
NonConvexFlowBlock.positive_gradient: Variable indicating the positive gradient, i.e. the load increase between two consecutive timesteps, indexed by POSITIVE_GRADIENT_FLOWS
\(\dot{P}_{down}\) (continuous)
NonConvexFlowBlock.negative_gradient: Variable indicating the negative gradient, i.e. the load decrease between two consecutive timesteps, indexed by NEGATIVE_GRADIENT_FLOWS
_create_sets(group)[source]

The following sets are created: (-> see basic sets at Model )

NONCONVEX_FLOWS
A set of flows with the attribute nonconvex of type options.NonConvex.
_sets_for_non_convex_flows(group)[source]

Creates all sets for non-convex flows.

MIN_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute min being not None in the first timestep.
ACTIVITYCOSTFLOWS
A subset of set NONCONVEX_FLOWS with the attribute activity_costs being not None.
INACTIVITYCOSTFLOWS
A subset of set NONCONVEX_FLOWS with the attribute inactivity_costs being not None.
STARTUPFLOWS
A subset of set NONCONVEX_FLOWS with the attribute maximum_startups or startup_costs being not None.
MAXSTARTUPFLOWS
A subset of set STARTUPFLOWS with the attribute maximum_startups being not None.
SHUTDOWNFLOWS
A subset of set NONCONVEX_FLOWS with the attribute maximum_shutdowns or shutdown_costs being not None.
MAXSHUTDOWNFLOWS
A subset of set SHUTDOWNFLOWS with the attribute maximum_shutdowns being not None.
MINUPTIMEFLOWS
A subset of set NONCONVEX_FLOWS with the attribute minimum_uptime being not None.
MINDOWNTIMEFLOWS
A subset of set NONCONVEX_FLOWS with the attribute minimum_downtime being not None.
POSITIVE_GRADIENT_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute positive_gradient being not None.
NEGATIVE_GRADIENT_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute negative_gradient being not None.
_objective_expression()[source]

The following terms are to the cost function:

_startup_costs()[source]
\[\sum_{i, o \in STARTUPFLOWS} \sum_t Y_{startup}(t) \ \cdot c_{startup}\]
_shutdown_costs()[source]
\[\sum_{SHUTDOWNFLOWS} \sum_t Y_{shutdown}(t) \ \cdot c_{shutdown}\]
_activity_costs()[source]
\[\sum_{ACTIVITYCOSTFLOWS} \sum_t Y_{status}(t) \ \cdot c_{activity}\]
_inactivity_costs()[source]
\[\sum_{INACTIVITYCOSTFLOWS} \sum_t (1 - Y_{status}(t)) \ \cdot c_{inactivity}\]

Parameters are defined in Flow.

InvestNonConvexFlow

Creating sets, variables, constraints and parts of the objective function for Flow objects with both Nonconvex and Investment options.

class oemof.solph.flows._invest_non_convex_flow_block.InvestNonConvexFlowBlock(*args, **kwargs)[source]

Bases: oemof.solph.flows._non_convex_flow_block.NonConvexFlowBlock

_create_constraints()[source]
_shared_constraints_for_non_convex_flows()
_startup_constraint()
\[\begin{split}Y_{startup}(t) \geq Y_{status}(t) - Y_{status}(t-1) \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall \textrm{STARTUPFLOWS}.\end{split}\]
_max_startup_constraint()
\[\begin{split}\sum_{t \in \textrm{TIMESTEPS}} Y_{startup}(t) \leq \ N_{start}(i,o)\\ \forall (i,o) \in \textrm{MAXSTARTUPFLOWS}.\end{split}\]
_shutdown_constraint()
\[\begin{split}Y_{shutdown}(t) \geq Y_{status}(t-1) - Y_{status}(t) \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall \textrm{SHUTDOWNFLOWS}.\end{split}\]
_max_shutdown_constraint()
\[\begin{split}\sum_{t \in \textrm{TIMESTEPS}} Y_{startup}(t) \leq \ N_{shutdown}(i,o)\\ \forall (i,o) \in \textrm{MAXSHUTDOWNFLOWS}.\end{split}\]
_min_uptime_constraint()
\[\begin{split}(Y_{status}(t)-Y_{status}(t-1)) \cdot t_{up,minimum} \\ \leq \sum_{n=0}^{t_{up,minimum}-1} Y_{status}(t+n) \\ \forall t \in \textrm{TIMESTEPS} | \\ t \neq \{0..t_{up,minimum}\} \cup \ \{t\_max-t_{up,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINUPTIMEFLOWS}. \\ \\ Y_{status}(t) = Y_{status,0} \\ \forall t \in \textrm{TIMESTEPS} | \\ t = \{0..t_{up,minimum}\} \cup \ \{t\_max-t_{up,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINUPTIMEFLOWS}.\end{split}\]
_min_downtime_constraint()
\[\begin{split}(Y_{status}(t-1) - Y_{status}(t)) \ \cdot t_{down,minimum} \\ \leq t_{down,minimum} \ - \sum_{n=0}^{t_{down,minimum}-1} Y_{status}(t+n) \\ \forall t \in \textrm{TIMESTEPS} | \\ t \neq \{0..t_{down,minimum}\} \cup \ \{t\_max-t_{down,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINDOWNTIMEFLOWS}. \\ \\ Y_{status}(t) = Y_{status,0} \\ \forall t \in \textrm{TIMESTEPS} | \\ t = \{0..t_{down,minimum}\} \cup \ \{t\_max-t_{down,minimum}..t\_max\} , \\ \forall (i,o) \in \textrm{MINDOWNTIMEFLOWS}.\end{split}\]
positive_gradient_constraint
\[\begin{split}P(t) \cdot Y_{status}(t) - P(t-1) \cdot Y_{status}(t-1) \leq \ \dot{P}_{up}(t), \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
negative_gradient_constraint
\[\begin{split}P(t-1) \cdot Y_{status}(t-1) - P(t) \cdot Y_{status}(t) \leq \ \dot{P}_{down}(t), \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
_minimum_invest_constraint()[source]
\[P_{invest, min} \le P_{invest}\]
_maximum_invest_constraint()[source]
\[P_{invest} \le P_{invest, max}\]
_minimum_flow_constraint()
\[\begin{split}P(t) \geq min(i, o, t) \cdot P_{nom} \ \cdot Y_{status}(t), \\ \forall (i, o) \in \textrm{NONCONVEX_FLOWS}, \\ \forall t \in \textrm{TIMESTEPS}.\end{split}\]
_maximum_flow_constraint()
\[\begin{split}P(t) \leq max(i, o, t) \cdot P_{nom} \ \cdot status(t), \\ \forall t \in \textrm{TIMESTEPS}, \\ \forall (i, o) \in \textrm{NONCONVEX_FLOWS}.\end{split}\]
_linearised_investment_constraints()[source]

The resulting constraint is equivalent to

\[status\_nominal(i,o,t) = Y_{status}(t) \cdot P_{invest}.\]

However, \(status\) and \(invest\) are variables (binary and continuous, respectively). Thus, three constraints are created which combination is equivalent.

_linearised_investment_constraint_1()[source]
\[status\_nominal(i,o,t) \leq Y_{status}(t) \cdot P_{invest, max}\quad (1)\]
_linearised_investment_constraint_2()[source]
\[status\_nominal(i,o,t) \leq P_{invest}\quad (2)\]
_linearised_investment_constraint_3()[source]
\[status\_nominal(i,o,t) \geq P_{invest} - (1 - Y_{status}(t)) \cdot P_{invest, max}\quad (3)\]

The following cases may occur:

  • Case \(status = 0\)
    \[\begin{split}(1) \Rightarrow status\_nominal = 0,\\ (2) \Rightarrow \text{ trivially fulfilled},\\ (3) \Rightarrow \text{ trivially fulfilled}.\end{split}\]
  • Case \(status = 1\)
    \[\begin{split}(1) \Rightarrow \text{ trivially fulfilled},\\ (2) \Rightarrow status\_nominal \leq P_{invest},\\ (3) \Rightarrow status\_nominal \geq P_{invest}.\end{split}\]

    So, in total \(status\_nominal = P_{invest}\), which is the desired result.

_create_variables()[source]
Status variable (binary) om.InvestNonConvexFlowBlock.status:
Variable indicating if flow is >= 0 indexed by FLOWS
:math::P_{invest} InvestNonConvexFlowBlock.invest
Value of the investment variable, i.e. equivalent to the nominal value of the flows after optimization.
:math::status_nominal(i,o,t) (non-negative real number)
New paramater representing the multiplication of P_{invest} (from the <class ‘oemof.solph.flows.InvestmentFlow’>) and status(i,o,t) (from the <class ‘oemof.solph.flows.NonConvexFlow’>) used for the constraints on the minimum and maximum flow constraints.
_variables_for_non_convex_flows()
\(Y_{startup}\) (binary) NonConvexFlowBlock.startup:
Variable indicating startup of flow (component) indexed by STARTUPFLOWS
\(Y_{shutdown}\) (binary) NonConvexFlowBlock.shutdown:
Variable indicating shutdown of flow (component) indexed by SHUTDOWNFLOWS
\(\dot{P}_{up}\) (continuous)
NonConvexFlowBlock.positive_gradient: Variable indicating the positive gradient, i.e. the load increase between two consecutive timesteps, indexed by POSITIVE_GRADIENT_FLOWS
\(\dot{P}_{down}\) (continuous)
NonConvexFlowBlock.negative_gradient: Variable indicating the negative gradient, i.e. the load decrease between two consecutive timesteps, indexed by NEGATIVE_GRADIENT_FLOWS
_create_sets(group)[source]

Creates all sets for investment non-convex flows.

INVEST_NON_CONVEX_FLOWS
A set of flows with the attribute nonconvex of type options.NonConvex and the attribute invest of type options.Invest.
_sets_for_non_convex_flows(group)

Creates all sets for non-convex flows.

MIN_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute min being not None in the first timestep.
ACTIVITYCOSTFLOWS
A subset of set NONCONVEX_FLOWS with the attribute activity_costs being not None.
INACTIVITYCOSTFLOWS
A subset of set NONCONVEX_FLOWS with the attribute inactivity_costs being not None.
STARTUPFLOWS
A subset of set NONCONVEX_FLOWS with the attribute maximum_startups or startup_costs being not None.
MAXSTARTUPFLOWS
A subset of set STARTUPFLOWS with the attribute maximum_startups being not None.
SHUTDOWNFLOWS
A subset of set NONCONVEX_FLOWS with the attribute maximum_shutdowns or shutdown_costs being not None.
MAXSHUTDOWNFLOWS
A subset of set SHUTDOWNFLOWS with the attribute maximum_shutdowns being not None.
MINUPTIMEFLOWS
A subset of set NONCONVEX_FLOWS with the attribute minimum_uptime being not None.
MINDOWNTIMEFLOWS
A subset of set NONCONVEX_FLOWS with the attribute minimum_downtime being not None.
POSITIVE_GRADIENT_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute positive_gradient being not None.
NEGATIVE_GRADIENT_FLOWS
A subset of set NONCONVEX_FLOWS with the attribute negative_gradient being not None.
_objective_expression()[source]

Objective expression for nonconvex investment flows.

If nonconvex.startup_costs is set by the user:
\[\sum_{i, o \in STARTUPFLOWS} \sum_t startup(i, o, t) \ \cdot c_{startup}\]
If nonconvex.shutdown_costs is set by the user:
\[\sum_{i, o \in SHUTDOWNFLOWS} \sum_t shutdown(i, o, t) \ \cdot c_{shutdown}\]
\[P_{invest} \cdot c_{invest,var}\]