Source and Sink

  • File name: sourceSink.py

  • Last edited: 2020-06-14

  • Created by: Stefan Bruche (TU Berlin)

Sources and sinks are responsible for the transportation of commodities across the system boundary into and out of the EnergySystem instance. The Sink class inherits from the Source class. Both have the same input parameters with only one exception: The Sink has an “inlet” instead of an “outlet” attribute.

Source

class aristopy.sourceSink.Source(ensys, name, outlet, basic_variable='outlet_variable', has_existence_binary_var=False, has_operation_binary_var=False, time_series_data=None, scalar_params=None, additional_vars=None, user_expressions=None, capacity=None, capacity_min=None, capacity_max=None, capex_per_capacity=0, capex_if_exist=0, opex_per_capacity=0, opex_if_exist=0, opex_operation=0, commodity_rate_min=None, commodity_rate_max=None, commodity_rate_fix=None, commodity_cost=0, commodity_revenues=0, **kwargs)[source]

Initialize an instance of the Source class.

Note

See the documentation of the Component class for a description of all keyword arguments and inherited methods.

Parameters
  • commodity_rate_min (int, or float, or aristopy Series, or None) – Scalar value or time series that provides a minimal value (lower bound) for the basic variable (typically, Sink inlet commodity, or Source outlet commodity) for every time step.
    Default: None

  • commodity_rate_max (int, or float, or aristopy Series, or None) – Scalar value or time series that provides a maximal value (upper bound) for the basic variable (typically, Sink inlet commodity, or Source outlet commodity) for every time step.
    Default: None

  • commodity_rate_fix (int, or float, or aristopy Series, or None) – Scalar value or time series that provides a fixed value for the basic variable (typically, Sink inlet commodity, or Source outlet commodity) for every time step.
    Default: None

  • commodity_cost (int, or float, or aristopy Series) – Incurred costs for the use / expenditure of the basic variable. Keyword argument takes scalar values or time series data (Note: scalar values provide the same functionality like keyword argument ‘opex_operation’).
    Default: 0

  • commodity_revenues (int, or float, or aristopy Series) – Accruing revenues associated with the allocation of the basic variable. Keyword argument takes scalar values or time series data.
    Default: 0

declare_component_constraints(ensys, model)[source]

Method to declare all component constraints.

The following constraint methods are inherited from the Component class and are not documented in this sub-class:

Method is not intended for public access!

Parameters
  • ensys – Instance of the EnergySystem class

  • model – Pyomo ConcreteModel of the EnergySystem instance

con_operation_limit(model)[source]

The basic variable of a component is limited by its nominal capacity. This usually means, the operation (main commodity) of a sink / source (MWh) is limited by its nominal power (MW) multiplied with the number of hours per time step. E.g.:
Q[p, t] <= CAP * dt

Method is not intended for public access!

con_commodity_rate_min(model)[source]

The basic variable of a component needs to have a minimal value of “commodity_rate_min” in every time step. (Without correction with “hours_per_time_step” because it should already be included in the time series). E.g.:
Q[p, t] >= op_rate_min[p, t]

Method is not intended for public access!

con_commodity_rate_max(model)[source]

The basic variable of a component can have a maximal value of “commodity_rate_max” in every time step. (Without correction with “hours_per_time_step” because it should already be included in the time series). E.g.:
Q[p, t] <= op_rate_max[p, t]

Method is not intended for public access!

con_commodity_rate_fix(model)[source]

The basic variable of a component needs to have a value of “commodity_rate_fix” in every time step. (Without correction with “hours_per_time_step” because it should already be included in the time series). E.g.:
Q[p, t] == op_rate_fix[p, t]

Method is not intended for public access!

get_objective_function_contribution(ensys, model)[source]

Calculate the objective function contributions of the component and add the values to the component dictionary “comp_obj_dict”.

Method is not intended for public access!

Parameters
  • ensys – Instance of the EnergySystem class

  • model – Pyomo ConcreteModel of the EnergySystem instance

serialize()[source]

This method collects all relevant input data and optimization results from the Component instance, and returns them in an ordered dictionary.

Returns

OrderedDict

Sink

class aristopy.Sink(ensys, name, inlet, basic_variable='inlet_variable', has_existence_binary_var=False, has_operation_binary_var=False, time_series_data=None, scalar_params=None, additional_vars=None, user_expressions=None, capacity=None, capacity_min=None, capacity_max=None, capex_per_capacity=0, capex_if_exist=0, opex_per_capacity=0, opex_if_exist=0, opex_operation=0, commodity_rate_min=None, commodity_rate_max=None, commodity_rate_fix=None, commodity_cost=0, commodity_revenues=0)[source]

Initialize an instance of the Sink class.

The Sink class inherits from the Source class. Both have the same input parameters with only one exception: The Sink has an “inlet” instead of an “outlet” attribute.

Note

See the documentation of the Component class and the Source class for a description of all keyword arguments and inherited methods.