Flow, Series, Var

  • File name: flowSeriesVar.py

  • Last edited: 2020-06-14

  • Created by: Stefan Bruche (TU Berlin)

The instances of the Flow class are required to add commodities and the associated variables to the modeled components and to create the component interconnections. The Series and Var classes are used to introduce time-series data and additional variables to the pyomo model instance.

Flow

class aristopy.flowSeriesVar.Flow(commodity, link=None, var_name='commodity_name', **kwargs)[source]

A Flow represents a connection point of the inlet or the outlet of a component. The Flow has a single commodity that is entering or leaving the component. Additionally, information on the variable name of the commodity inside the component can be provided (default: use the name of the commodity) and the linking component (source or destination of the Flow) can be stated.

Parameters
  • commodity (str) – Name (identifier) of the commodity

  • link (str, or None) – Component name of the connected Flow source or destination needs to be stated on one or both sides of the Flow
    Default: None

  • var_name (str) – Variable name of the Flow commodity as used inside the component, e.g. for scripting of user expressions.
    Default: ‘commodity_name’ => i.e. use name of the commodity

Series

class aristopy.flowSeriesVar.Series(name, data, weighting_factor=1.0)[source]

The Series class is used to add time series data to the model. Time series data can be required in the Source class to implement data for keyword arguments ‘commodity_rate_min’,´’commodity_rate_max’, ‘commodity_rate_fix’. Additionally, they might be needed to a add time- dependent commodity cost or revenues, or generally for scripting of user expressions (added via ‘time_series_data’ argument).

Parameters
  • name (str) – Name (identifier) of the time series data instance. Can be used for scripting of user expressions.

  • data (list, dict, numpy array, pandas Series) – Time series data

  • weighting_factor – Weighting factor to use for the clustering
    Default: 1.0

  • weighting_factor – float or int

Var (Variable)

class aristopy.flowSeriesVar.Var(name, domain='NonNegativeReals', has_time_set=True, alternative_set=None, ub=None, lb=None, init=None)[source]

Class to manually add pyomo variables to a component (via argument “additional_vars”), or the main model container (ConcreteModel: model) of the EnergySystem instance (via function “add_variable”).

Parameters
  • name (str) – Name (identifier) of the added variable

  • domain (str) – A super-set of the values the variable can take on. Possible values are: ‘Reals’, ‘NonNegativeReals’, ‘Binary’.
    Default: ‘NonNegativeReals’

  • has_time_set (bool) – Is True if the time set of the EnergySystem instance is also a set of the added variable.
    Default: True

  • alternative_set – Alternative variable sets can be added here via iterable Python objects (e.g. list)
    Default: None

  • ub (float or int) – Upper variable bound.
    Default: None

  • lb (float or int) – Lower variable bound.
    Default: None

  • init – A function or Python object that provides starting values for the added variable.
    Default: None