Skip to content

Components

Components can be added to an EnergySystemModel class to model the behavior of the energy system. All components have to inherit from the Component class. There are five basic component classes:

  • Source and Sink (inherits from Source) classes + the SourceSinkModel class
  • Conversion class + ConversionModel class
  • Transmission class + TransmissionModel class
  • Storage class + StorageModel class

From these basic component classes, further subclasses can be defined.

Component Base Class

component

Classes:

  • Component

    The Component class includes the general methods and arguments for the components which are add-able to

  • ComponentModel

    The ComponentModel class provides the general methods used for modeling the components.

Component

Component(
    esM,
    name,
    dimension,
    hasCapacityVariable,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerCapacity=0,
    opexIfBuilt=0,
    QPcostScale=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    yearlyFullLoadHoursMin=None,
    yearlyFullLoadHoursMax=None,
    stockCommissioning=None,
    floorTechnicalLifetime=True,
    pwlcfParameters=None,
)

The Component class includes the general methods and arguments for the components which are add-able to the energy system model (e.g. storage component, source component, transmission component). Every of these components inherits from the Component class.

Create an instance of the Component class.

Required arguments:

:param esM: energy system model to which the component should be added. Used for unit checks. :type esM: EnergySystemModel instance from the FINE package

:param name: name of the component. Has to be unique (i.e. no other components with that name can already exist in the EnergySystemModel instance to which the component is added). :type name: string

:param hasCapacityVariable: specifies if the component should be modeled with a capacity or not. Examples:

* An electrolyzer has a capacity given in GW_electric -> hasCapacityVariable is True.
* In the energy system, biogas can, from a model perspective, be converted into methane (and then
  used in conventional power plants which emit CO2) by getting CO2 from the environment. Thus,
  using biogas in conventional power plants is, from a balance perspective, CO2 free. This
  conversion is purely theoretical and does not require a capacity -> hasCapacityVariable
  is False.
* A electricity cable has a capacity given in GW_electric -> hasCapacityVariable is True.
* If the transmission capacity of a component is unlimited -> hasCapacityVariable is False.
* A wind turbine has a capacity given in GW_electric -> hasCapacityVariable is True.
* Emitting CO2 into the environment is not per se limited by a capacity ->
  hasCapacityVariable is False.

:type hasCapacityVariable: boolean

Default arguments:

:param capacityVariableDomain: describes the mathematical domain of the capacity variables, if they are specified. By default, the domain is specified as 'continuous' and thus declares the variables as positive (>=0) real values. The second input option that is available for this parameter is 'discrete', which declares the variables as positive (>=0) integer values. |br| * the default value is 'continuous' :type capacityVariableDomain: string ('continuous' or 'discrete')

:param capacityPerPlantUnit: capacity of one plant of the component (in the specified physicalUnit of the plant). The default is 1, thus the number of plants is equal to the installed capacity. This parameter should be specified when using a 'discrete' capacityVariableDomain. It can be specified when using a 'continuous' variable domain. |br| * the default value is 1 :type capacityPerPlantUnit: dict of strictly positive float or strictly positive float

:param hasIsBuiltBinaryVariable: specifies if binary decision variables should be declared for

* each eligible location of the component, which indicates if the component is built at that location or
  not (dimension=1dim).
* each eligible connection of the transmission component, which indicates if the component is built
  between two locations or not (dimension=2dim).

The binary variables can be used to enforce one-time investment cost or capacity-independent
annual operation cost. If a minimum capacity is specified and this parameter is set to True,
the minimum capacities are only considered if a component is built (i.e. if a component is built
at that location, it has to be built with a minimum capacity of XY GW, otherwise it is set to 0 GW).
|br| * the default value is False

:type hasIsBuiltBinaryVariable: boolean

:param bigM: the bigM parameter is only required when the hasIsBuiltBinaryVariable parameter is set to True. In that case, it is set as a strictly positive float, otherwise it can remain a None value. If not None and the ifBuiltBinaryVariables parameter is set to True, the parameter enforces an artificial upper bound on the maximum capacities which should, however, never be reached. The value should be chosen as small as possible but as large as necessary so that the optimal values of the designed capacities are well below this value after the optimization. |br| * the default value is None :type bigM: None or strictly positive float

:param locationalEligibility:

* Pandas Series that indicates if a component can be built at a location (=1) or not (=0)
  (dimension=1dim) or
* Pandas Series or DataFrame that indicates if a component can be built between two
  locations (=1) or not (=0) (dimension=2dim).

If not specified and a maximum or fixed capacity or time series is given, the parameter will be
set based on these inputs. If the parameter is specified, a consistency check is done to ensure
that the parameters indicate the same locational eligibility. If the parameter is not specified,
and also no other of the parameters is specified, it is assumed that the component is eligible in
each location and all values are set to 1.
This parameter is the key part for ensuring small built times of the optimization problem by avoiding the
declaration of unnecessary variables and constraints.
|br| * the default value is None

:type locationalEligibility:

* None or
* Pandas Series with values equal to 0 and 1. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with values equal to 0 and 1. The column and row indices of the DataFrame have
  to equal the in the energy system model specified locations.

:param capacityMin: if specified, indicates the minimum capacities. The type of this parameter depends on the dimension of the component: If dimension=1dim, it has to be a Pandas Series. If dimension=2dim, it has to be a Pandas Series or DataFrame. If binary decision variables are declared, capacityMin is only used if the component is built. |br| * the default value is None :type capacityMin:

* None or
* float or
* int or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations. or
* Dict with investment periods as keys and one of the options above as values.

:param capacityMax: if specified, indicates the maximum capacities. The type of this parameter depends on the dimension of the component: If dimension=1dim, it has to be a Pandas Series. If dimension=2dim, it has to be a Pandas Series or DataFrame. |br| * the default value is None :type capacityMax:

* None or
* float or
* int or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations. or
* Dict with investment periods as keys and one of the options above as values.

:param partLoadMin: If specified, it defines the lowest relative operation rate a component must maintain during operation. To still allow the component to be completely turned off, a binary variable is introduced for each time step. This enables the model to choose between zero operation or operation at or above the specified minimum load. Note: Adding these binary variables turns the problem into a MILP, which can significantly increase computational time. |br| * the default value is None :type partLoadMin: * None or * Float value in range ]0;1] * Dict with keys of investment periods and float values in range ]0;1]

:param sharedPotentialID: if specified, indicates that the component has to share its maximum potential capacity with other components (e.g. due to space limitations). The shares of how much of the maximum potential is used have to add up to less than 100%. |br| * the default value is None :type sharedPotentialID: string

:param linkedQuantityID: if specified, indicates that the components with the same ID are built with the same number. (e.g. if a vehicle with an engine is built also a storage needs to be built) |br| * the default value is None :type linkedQuantityID: string

:param capacityFix: if specified, indicates the fixed capacities. The type of this parameter depends on the dimension of the component: * If dimension=1dim, it has to be a Pandas Series. * If dimension=2dim, it has to be a Pandas Series or DataFrame. |br| * the default value is None :type capacityFix: * None or * float or * int or * Pandas Series with positive (>=0) values. The indices of the series have to equal the in the energy system model specified locations (dimension=1dim) or connections between these locations in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or * Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have to equal the in the energy system model specified locations. or * Dict with investment periods as keys and one of the options above as values.

:param commissioningMin: if specified, indicates the minimum commissioning for the respective investment period. The type of this parameter depends on the dimension of the component: * If dimension=1dim, it has to be a Pandas Series. * If dimension=2dim, it has to be a Pandas Series or DataFrame. If binary decision variables are declared, commissioningMin is only used if the component is built. |br| * the default value is None :type commissioningMin:

* None or
* float or
* int or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations. or
* Dict with investment periods as keys and one of the options above as values.

:param commissioningMax: if specified, indicates the maximum commissioning for the respective investment period. The type of this parameter depends on the dimension of the component: * If dimension=1dim, it has to be a Pandas Series. * If dimension=2dim, it has to be a Pandas Series or DataFrame. |br| * the default value is None :type commissioningMax:

* None or
* float or
* int or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations. or
* Dict with investment periods as keys and one of the options above as values.

:param commissioningFix: if specified, indicates the fixed commissioning for the respective investment period. The type of this parameter depends on the dimension of the component: * If dimension=1dim, it has to be a Pandas Series. * If dimension=2dim, it has to be a Pandas Series or DataFrame. |br| * the default value is None :type commissioningFix: * None or * float or * int or * Pandas Series with positive (>=0) values. The indices of the series have to equal the in the energy system model specified locations (dimension=1dim) or connections between these locations in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or * Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have to equal the in the energy system model specified locations. or * Dict with investment periods as keys and one of the options above as values.

:param isBuiltFix: if specified, indicates fixed decisions in which or between which locations the component is built (i.e. sets the isBuilt binary variables). The type of this parameter depends on the dimension of the component: * If dimension=1dim, it has to be a Pandas Series. * If dimension=2dim, it has to be a Pandas Series or DataFrame. |br| * the default value is None :type isBuiltFix: * None or * Pandas Series with values equal to 0 and 1. The indices of the series have to equal the in the energy system model specified locations (dimension=1dim) or connections between these locations in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or * Pandas DataFrame with values equal to 0 and 1. The row and column indices of the DataFrame have to equal the in the energy system model specified locations.

:param investPerCapacity: describes the investment costs for one unit of the capacity. The invest of a component is obtained by multiplying the commissioned capacities of the component (in the physicalUnit of the component) with the investPerCapacity factor and is distributed over the components technical lifetime. The value has to match the unit costUnit/physicalUnit (e.g. Euro/kW). The investPerCapacity can either be given as

* a float or a Pandas Series with location specific values (dimension=1dim). The cost unit in which the
  parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar,
  1e6 Euro). The value has to match the unit
  costUnit/physicalUnit (e.g. Euro/kW, 1e6 Euro/GW) or
* a float or a Pandas Series or DataFrame with location specific values (dimension=2dim). The cost unit
  in which the parameter is given has to match the one specified in the energy system model divided by
  the specified lengthUnit (e.g. Euro/m, Dollar/m, 1e6 Euro/km). The value has to match the unit
  costUnit/(lengthUnit * physicalUnit) (e.g. Euro/(kW * m), 1e6 Euro/(GW * km))
* a dictionary with years as keys (past years which had stock commissioning and investment periods which
  will be optimized) and one of the two options above as values.
  e.g. {2020: 1000, 2025: 800, 2030: 750}

|br| * the default value is 0

:type investPerCapacity:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.
* Dict with years as keys (past years with stock commissioning and investment periods which will be
  optimized) and one of the two options above as values.

:param investIfBuilt: a capacity-independent invest which only arises in a location if a component is built at that location. The investIfBuilt can either be given as

* a float or a Pandas Series with location specific values (dimension=1dim). The cost unit in which
  the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar,
  1e6 Euro) or
* a float or a Pandas Series or DataFrame with location specific values (dimension=2dim). The cost unit
  in which the parameter is given has to match the one specified in the energy system model divided by
  the specified lengthUnit (e.g. Euro/m, Dollar/m, 1e6 Euro/km)
* a dictionary with years as keys (past years which had stock commissioning and investment periods which
  will be optimized) and one of the two options above as values.
  e.g. {2020: 1000, 2025: 800, 2030: 750}

|br| * the default value is 0

:type investIfBuilt:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.
* Dict with years as keys (past years with stock commissioning and investment periods which will be
  optimized) and one of the two options above as values.

:param opexPerCapacity: describes the operational cost for one unit of capacity. The annual operational cost, which are only a function of the capacity of the component (in the physicalUnit of the component) and not of the specific operation itself, are obtained by multiplying the commissioned capacity of the component at a location with the opexPerCapacity factor and is distributed over the components technical lifetime. The opexPerCapacity factor can either be given as

* a float or a Pandas Series with location specific values (dimension=1dim). The cost unit in which the
  parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar,
  1e6 Euro). The value has to match the unit
  costUnit/physicalUnit (e.g. Euro/kW, 1e6 Euro/GW)  or
* a float or a Pandas Series or DataFrame with location specific values (dimension=2dim). The cost unit
  in which the parameter is given has to match the one specified in the energy system model divided by
  the specified lengthUnit (e.g. Euro/m, Dollar/m, 1e6 Euro/km). The value has to match the unit
  costUnit/(lengthUnit * physicalUnit) (e.g. Euro/(kW * m), 1e6 Euro/(GW * km))
* a dict with years as keys (past years which had stock commissioning and investment periods which
  will be optimized) and one of the two options above as value.
  e.g. {2020: 1000, 2025: 800, 2030: 750}

|br| * the default value is 0

:type opexPerCapacity:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.
* Dict with years as keys (past years with stock commissioning and investment periods which will be
  optimized) and one of the two options above as values.

:param opexIfBuilt: a capacity-independent annual operational cost which only arises in a location if a component is commissioned at that location. The costs are than distributed over the components technical lifetime.The opexIfBuilt can either be given as

* a float or a Pandas Series with location specific values (dimension=1dim) . The cost unit in which
  the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar,
  1e6 Euro) or
* a float or a Pandas Series or DataFrame with location specific values (dimension=2dim). The cost unit
  in which the parameter is given has to match the one specified in the energy system model divided by
  the specified lengthUnit (e.g. Euro/m, Dollar/m, 1e6 Euro/km).
* a dict with years as keys (past years which had stock commissioning and investment periods which
  will be optimized) and one of the two options above as value.
  e.g. {2020: 1000, 2025: 800, 2030: 750}

|br| * the default value is 0

:type opexIfBuilt:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.
* Dict with years as keys (past years with stock commissioning and investment periods which will be
  optimized) and one of the two options above as values.

:param QPcostScale: describes the absolute deviation of the minimum or maximum cost value from the average or weighted average cost value. For further information see Lopion et al. (2019): "Cost Uncertainties in Energy System Optimization Models: A Quadratic Programming Approach for Avoiding Penny Switching Effects". |br| * the default value is 0, i.e. the problem is not quadratic. :type QPcostScale:

* float between 0 and 1
* Pandas Series with positive (0 <= QPcostScale <= 1) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (0 <= QPcostScale <= 1) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.
* Dict with years as keys (past years with stock commissioning and investment period which will be
  optimized) and one of the options above as value

:param interestRate: interest rate which is considered for computing the annuities of the invest of the component (depreciates the invests over the economic lifetime). A value of 0.08 corresponds to an interest rate of 8%. The interest rate is currently constant for all investment periods. Warning: The interest must be greater than 0 if annuityPerpetuity is used in the energy system model. |br| * the default value is 0.08 :type interestRate:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.

:param economicLifetime: economic lifetime of the component which is considered for computing the annuities of the invest of the component (aka depreciation time). The economic lifetime is currently constant over the pathway of investment periods. |br| * the default value is 10 :type economicLifetime:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.

:param technicalLifetime: technical lifetime of the component which is considered for computing the stocks. The technical lifetime is currently constant over the pathway of investment periods. |br| * the default value is None :type technicalLifetime:

* None or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim) or
* Pandas DataFrame with positive (>=0) values. The row and column indices of the DataFrame have
  to equal the in the energy system model specified locations.

:param yearlyFullLoadHoursMin: if specified, indicates the minimum yearly full load hours. |br| * the default value is None :type yearlyFullLoadHoursMin:

* None or
* Float with positive (>=0) value or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim).
* Dict with years as keys and one of the two options above as values.

:param yearlyFullLoadHoursMax: if specified, indicates the maximum yearly full load hours. |br| * the default value is None :type yearlyFullLoadHoursMax:

* None or
* Float with positive (>=0) value or
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the
  energy system model specified locations (dimension=1dim) or connections between these locations
  in the format of 'loc1' + '_' + 'loc2' (dimension=2dim).
* Dict with years as keys and one of the two options above as values.

:param stockCommissioning: if specified, indictates historical commissioned capacities. The parameter describes, how much capacity was commissioned per location in which past investment period. The past investment period is not part of the optimized investment periods.

* e.g. if startYear is 2020:
  {2016:pandas.series(index=["loc1","loc2"],data=[4,3]).
  2018: pandas.series(index=["loc1","loc2"],data=[1,2])}
* e.g. if startYear is 0:
  {-4:pandas.series(index=["loc1","loc2"],data=[4,3]).
  -2: pandas.series(index=["loc1","loc2"],data=[1,2])}

Warning: Commissioning years older than the technical lifetime from startYear will be ignored.
|br| * the default value is None

:type stockCommissioning:

* None or
* Dict with past years as keys and pandas.Series with index of locations as values

:param modelingClass: to the Component connected modeling class. |br| * the default value is ModelingClass :type modelingClass: a class inheriting from ComponentModeling

:param floorTechnicalLifetime: if a technical lifetime is not a multiple of the interval, this parameters decides if the technical lifetime is floored to the interval or ceiled to the next interval, by default True. The costs will then be applied to the corrected interval.

:param pwlcfParameters: parameters used for piecewise linear cost function module. Can be used to approximate non-linear cost functions for endogenous technology learning (etl) or economies of scale (eos). Enables a standardized endogenous technological learning approach with a fixed learning rate. In that case, the learning is conducted in each investment period and connected throughout. Alternatively enables an economies of scale approach. In that case, the cost scaling is indepent in each investment period.

Example: For etl, the cost reduce with the total cumulative installed capacity via a learning curve approach which is linearized.
pwlcfParameters = {
    "etlParameters": {
        "initCost": 1,
        "learningRate": 0.18,
        "initCapacity": 10,
        "maxCapacity": 50,
        "noSegments": 4,
    }
Example: For eos, the cost of a specific component (at one location and in one investment period) decreases with increased plant size.
pwlcfParameters = {
    "eosParameters": pd.DataFrame(data=np.array([[0,1,2,3],[0,1000, 1800, 2400],[0, 10, 18, 24]]).T, columns=["capacity", "totalInvest", "totalOpex"])
}

:type pwlcfParameters: dict

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Get

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Set

  • setTimeSeriesData

    Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Sets

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation abstractmethod

getDataForTimeSeriesAggregation(ip)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Get all time series data of a component for time series aggregation.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData abstractmethod

setAggregatedTimeSeriesData(data, ip)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Set aggregated time series data after applying time series aggregation.

:param data: time series data :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData abstractmethod

setTimeSeriesData(hasTSA)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Sets the time series data of a component (either the full time series if hasTSA is false or the aggregated time series if hasTSA is True).

:param hasTSA: indicates if time series aggregation should be considered for modeling :type hasTSA: boolean

ComponentModel

ComponentModel()

The ComponentModel class provides the general methods used for modeling the components. Every model class of the several component technologies inherits from the ComponentModel class. Within the ComponentModel class, general valid sets, variables and constraints are declared.

Create a ComponentModel class instance.

Methods:

additionalMinPartLoad

additionalMinPartLoad(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opVarBinName,
    capVarName,
    isOperationCommisYearDepending=False,
)

Set, if applicable, the minimal part load of a component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

bigM

bigM(pyM)

Enforce the consideration of the binary design variables of a component.

.. math::

\\text{M}^{comp} \\cdot bin^{comp}_{loc,ip} \\geq commis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

binaryOperation

binaryOperation(
    pyM,
    constrName,
    constrSetName,
    binaryParameterName,
    opVarName,
    opVarBinName,
    isOperationCommisYearDepending=False,
)

Create binary operation constraints for component operation.

Defines two constraints linking a continuous operation variable to its corresponding binary variable using the Big-M formulation. Handles both standard and commissioning year-dependent cases.

The binaryOperation1 constraint is used to force the binary variable to one if the continuous variable is greater than zero.

The binaryOperation2 constraint ensures that the continuous variable is greater than zero whenever the binary variable is one. This is used for the upTimeMin and downTimeMin feature.

capToNbInt

capToNbInt(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbInt^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

capToNbReal

capToNbReal(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbReal^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

capacityMinDec

capacityMinDec(pyM)

Enforce the consideration of minimum capacities for components with design decision variables.

Minimal capacity which needs to be reached for every investment period with commissioning. As the commisBinVar is coupled with commissioning var, constraint only sets minimal Capacity if component is commissioned. Therefore decommissioning of the component is possible without any constraints.

.. math::

\\text{capMin}^{comp}_{loc} \\cdot commisBin^{comp}_{loc,ip} \\leq  cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinOpVarSet

declareBinOpVarSet(
    esM,
    pyM,
    binaryOperationParameter=["partLoadMin"],
    binaryOperationSetName="operationBinVarSet",
)

Declare binary operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinaryDesignDecisionVars

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)

Declare binary variables [-] indicating if a component is considered at a location or not [-].

If a isBuiltFix parameter is given, the bounds are set to enforce

.. math:: bin^{comp}{loc} = \text{binFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareCapacityVars

declareCapacityVars(pyM)

Declare capacity variables.

.. math::

\\text{capMin}^{comp}_{loc} \\leq cap^{comp}_{loc} \\leq \\text{capMax}^{comp}_{loc}

If a capacityFix parameter is given, the bounds are set to enforce

.. math:: \text{cap}^{comp}{loc} = \text{capFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVarSet

declareCommissioningVarSet(pyM, esM)

Declare set for commissioning variables in the pyomo object for a modeling class.

The commissioning variable must be set for past investment periods (stock commissioning) and future/optimized investment periods

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVars

declareCommissioningVars(pyM, esM)

Declare commissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareComponentConstraints abstractmethod

declareComponentConstraints(esM, pyM)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Declare constraints of components in the componentModel class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareContinuousDesignVarSet

declareContinuousDesignVarSet(pyM)

Declare set for continuous number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDecommissioningVars

declareDecommissioningVars(pyM, esM)

Declare decommissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignDecisionVarSet

declareDesignDecisionVarSet(pyM)

Declare set for design decision variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignVarSet

declareDesignVarSet(pyM, esM)

Declare set for capacity variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDiscreteDesignVarSet

declareDiscreteDesignVarSet(pyM)

Declare set for discrete number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareIntNumbersVars

declareIntNumbersVars(pyM)

Declare variables representing the (discrete/integer) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLocationComponentSet

declareLocationComponentSet(pyM)

Declare set with location and component in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpConstrSet1

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpConstrSet2

declareOpConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpConstrSet3

declareOpConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpConstrSet4

declareOpConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpConstrSetMinPartLoad

declareOpConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpVarSet

declareOpVarSet(esM, pyM)

Declare operation related sets (operation variables and mapping sets) in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationBinaryVars

declareOperationBinaryVars(
    pyM,
    opVarBinName="op_bin",
    opBinSetName="operationBinVarSet",
)

Declare binary operation variables.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationModeSets

declareOperationModeSets(
    pyM, constrSetName, rateMax, rateFix, rateMin=None
)

Declare operating mode sets.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrSetName: name of the constraint set. :type constrSetName: string

:param rateMax: attribute of the considered component which stores the maximum operation rate data. :type rateMax: string

:param rateMax: attribute of the considered component which stores the minimum operation rate data. :type rateMax: string

:param rateFix: attribute of the considered component which stores the fixed operation rate data. :type rateFix: string

declareOperationVars

declareOperationVars(
    pyM,
    esM,
    opVarName,
    opRateFixName="processedOperationRateFix",
    opRateMaxName="processedOperationRateMax",
    isOperationCommisYearDepending=False,
    flexibleConversion=False,
    relevanceThreshold=None,
)

Declare operation variables.

The following operation modes are directly handled during variable creation as bounds instead of constraints.

operation mode 4: If operationRateFix is given for components without a capacity variable, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

.. math:: op^{comp,opType}{loc,p,t} = \text{opRateFix}^{comp,opType}

operation mode 5: If operationRateMax is given for components without a capacity variable, the variables are bounded by operationRateMax, i.e. the operation [commodityUnit*h] is limited by a time series.

.. math:: op^{comp,opType}{loc,p,t} \leq \text{opRateMax}^{comp,opType}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

declarePathwaySets

declarePathwaySets(pyM, esM)

Declare set for capacity development in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareRealNumbersVars

declareRealNumbersVars(pyM)

Declare variables representing the (continuous) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareSets abstractmethod

declareSets(esM, pyM)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Declare sets of components and constraints in the componentModel class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareVariables abstractmethod

declareVariables(esM, pyM, relevanceThreshold)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Declare variables of components in the componentModel class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

declareYearlyFullLoadHoursMaxSet

declareYearlyFullLoadHoursMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursMinSet

declareYearlyFullLoadHoursMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

decommissioningConstraint

decommissioningConstraint(pyM, esM)

Declase the decommissioning after the technical lifetime from investment period of commissioning.

.. math::

decommis^{comp}_{loc,ip} = commis^{comp}_{loc,ip-\\mathrm{ipTechnicalLifetime}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

designBinFix

designBinFix(pyM)

Set, if applicable, the installed capacities of a component.

.. math::

bin^{comp}_{(loc_1,loc_2),ip} = \\text{binFix}^{comp}_{(loc_1,loc_2)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

designDevelopmentConstraint

designDevelopmentConstraint(pyM, esM)

Link the capacity development between investment periods.

For stochastic: The capacity design must be equal between the different years.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip}

For the development pathway, the capacity of an investment period is composed of the capacity of the previous investment periods and the commissioning and decommissioning in the current investment period.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

getCommodityBalanceContribution abstractmethod

getCommodityBalanceContribution(
    pyM, commod, loc, ip, p, t
)

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Get contribution to a commodity balance.

getEconomicsDesign

getEconomicsDesign(
    pyM,
    esM,
    factorNames,
    lifetimeAttr,
    varName,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set design dependent cost equations for the individual components. The equations will be set for all components of a modeling class and all locations.

Required arguments

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is "". :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal cost values.
- False: Return the cost equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total anualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getEconomicsOperation

getEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    dictName,
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step. In case of a two-dimensional component (e.g. a transmission component), the equations will be set for all possible connections between the defined locations.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries" :type fncType: string

:param factorNames: Strings of the time-dependent parameters that have to be multiplied within the equation. (e.g. ['opexPerOperation'] to multiply the operation variable with the costs for each operation). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total annualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getLocEconomicsDesign

getLocEconomicsDesign(
    pyM,
    esM,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
)

Set time-independent equation specified for one component in one location in one investment period.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

Default arguments:

:param ip: investment period :type ip: int

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is ''. :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getLocEconomicsOperation

getLocEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    getOptValue=False,
)

Set time-dependent cost functions for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries :type fncType: string

:param factorName: String of the time-dependent parameter that have to be multiplied within the equation. (e.g. 'commodityCostTimeSeries' to multiply the operation variable with the costs for each operation). :type factorNames: string

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

:param ip: investment period of transformation path analysis. :type ip: int

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getObjectiveFunctionContribution

getObjectiveFunctionContribution(esM, pyM)

Get contribution to the objective function.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

getOptimalValues

getOptimalValues(name='all', ip=0)

Return optimal values of the components.

:param name: name of the variables of which the optimal values should be returned:

* 'capacityVariablesOptimum',
* 'isBuiltVariablesOptimum',
* 'operationVariablesOptimum',
* 'commissioningVariablesOptimum'
* 'decommissioningVariablesOptimum'
* 'all' or another input: all variables are returned.

:type name: string

:param ip: investment period of transformation path analysis. |br| * the default value is 0 :type ip: int

:returns: a dictionary with the optimal values of the components :rtype: dict

getSharedPotentialContribution

getSharedPotentialContribution(pyM, key, loc, ip)

Get the share which the components of the modeling class have on a shared maximum potential at a location.

hasOpVariablesForLocationCommodity abstractmethod

hasOpVariablesForLocationCommodity(esM, loc, commod)

Check if operation variables exist in the modeling class at a location which are connected to a commodity.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param loc: name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param commod: name of the regarded commodity (commodities are defined in the EnergySystemModel instance) :param commod: string

operationMode1

operationMode1(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    factorName=None,
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 1. The operation [commodityUnith] is limited by the installed capacity in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n An additional factor can limited the operation further.

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opFactor}^{opType} \\cdot cap^{comp}_{loc,ip}

operationMode2

operationMode2(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateFix",
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 2.

The operation [commodityUnith] is equal to the installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opRateMax}^{comp,opType}_{loc,ip,p,t} \\cdot cap^{comp}_{loc,ip}

operationMode3

operationMode3(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMax",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 3.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationMode4

operationMode4(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMin",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 4.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

setOptimalValues

setOptimalValues(
    esM, pyM, indexColumns, plantUnit, unitApp=""
)

Set the optimal values for the considered components and return a summary of them. The function is called after optimization was successful and an optimal solution was found. Each sub class of the component class calls this function for setting the common optimal values, e.g. investment and maintenance costs proportional to optimal capacity expansion.

Required arguments

:param esM: EnergySystemModel instance representing the energy system in which the components are modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param ip: investment period of transformation path analysis. :type ip: int

:param indexColumns: set of strings with the columns indices of the summary. The indices represent the locations or connections between the locations are used to call the optimal values of the variables of the components in the model class. :type indexColumns: set

:param plantUnit: attribute of the component that describes the unit of the plants to which maximum capacity limitations, cost parameters and the operation time series refer to. Depending on the considered component, possible inputs are "commodityUnit" (e.g. for transmission components) or "physicalUnit" (e.g. for conversion components). :type plantUnit: string

Default arguments

:param unitApp: string which appends the capacity unit in the optimization summary. For example, for the StorageModel class, the parameter is set to '\*h'. |br| * the default value is ''. :type unitApp: string

:return: summary of the optimized values. :rtype: pandas DataFrame

stockCapacityConstraint

stockCapacityConstraint(pyM, esM)

Set the stock capacity constraint. The stock capacity is the sum of the stock commissioning, which do not exceed its technical lifetime.

For stochastic, the stock of past investment periods is not only valid for ip=0 but for all investment periods. .. math::

cap^{comp}_{loc,ip} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,0}

For capacity development, the stock is only considered for the first investment periods.

.. math::

cap^{comp}_{loc,0} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,0} - decommis^{comp}_{loc,0}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

stockCommissioningConstraint

stockCommissioningConstraint(pyM, esM)

Set commissioning variable for past investment periods. For past investment periods, where no stock commissioning is specified the commissioning variable is set to zero.

yearlyFullLoadHoursMax

yearlyFullLoadHoursMax(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a maximum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

yearlyFullLoadHoursMin

yearlyFullLoadHoursMin(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a minimum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

Source and Sink

sourceSink

Classes:

  • Sink

    A Sink component can transfer a commodity over the energy system boundary out of the system.

  • Source

    A Source component can transfer a commodity over the energy system boundary into the system.

  • SourceSinkModel

    A SourceSinkModel class instance will be instantly created if a Source class instance or a Sink class instance is

Sink

Sink(
    esM,
    name,
    commodity,
    hasCapacityVariable,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    operationRateMin=None,
    operationRateMax=None,
    operationRateFix=None,
    tsaWeight=1,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerOperation=0,
    commodityCost=0,
    commodityRevenue=0,
    commodityCostTimeSeries=None,
    commodityRevenueTimeSeries=None,
    opexPerCapacity=0,
    opexIfBuilt=0,
    QPcostScale=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    balanceLimitID=None,
    pathwayBalanceLimitID=None,
    stockCommissioning=None,
    floorTechnicalLifetime=True,
)

Bases: Source

A Sink component can transfer a commodity over the energy system boundary out of the system.

Create a Sink class instance.

The Sink class inherits from the Source class. They coincide with the input parameters (see Source class for the parameter description) and differ in the sign parameter, which is equal to -1 for Sink objects and +1 for Source objects.

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Get the required data if a time series aggregation is requested.

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Determine the aggregated maximum rate and the aggregated fixed operation rate.

  • setTimeSeriesData

    Set the maximum operation rate, fixed operation rate, and cost or revenue time series depending on whether a time series analysis is requested or not.

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation

getDataForTimeSeriesAggregation(ip)

Get the required data if a time series aggregation is requested.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData

setAggregatedTimeSeriesData(data, ip)

Determine the aggregated maximum rate and the aggregated fixed operation rate.

:param data: Pandas DataFrame with the clustered time series data of the source component :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData

setTimeSeriesData(hasTSA)

Set the maximum operation rate, fixed operation rate, and cost or revenue time series depending on whether a time series analysis is requested or not.

:param hasTSA: states whether a time series aggregation is requested (True) or not (False). :type hasTSA: boolean

Source

Source(
    esM,
    name,
    commodity,
    hasCapacityVariable,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    operationRateMin=None,
    operationRateMax=None,
    operationRateFix=None,
    tsaWeight=1,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerOperation=0,
    commodityCost=0,
    commodityRevenue=0,
    commodityCostTimeSeries=None,
    commodityRevenueTimeSeries=None,
    opexPerCapacity=0,
    opexIfBuilt=0,
    QPcostScale=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    yearlyFullLoadHoursMin=None,
    yearlyFullLoadHoursMax=None,
    balanceLimitID=None,
    pathwayBalanceLimitID=None,
    stockCommissioning=None,
    floorTechnicalLifetime=True,
    pwlcfParameters=None,
)

Bases: Component

A Source component can transfer a commodity over the energy system boundary into the system.

Create a Source class instance. The Source component specific input arguments are described below. The general component input arguments are described in the Component class.

.. note:: The Sink class inherits from the Source class and is initialized with the same parameter set.

Required arguments:

:param commodity: to the component related commodity. :type commodity: string

:param hasCapacityVariable: specifies if the component should be modeled with a capacity or not.

Examples: * A wind turbine has a capacity given in GW_electric -> hasCapacityVariable is True. * Emitting CO2 into the environment is not per se limited by a capacity -> hasCapacityVariable is False.

:type hasCapacityVariable: boolean

Default arguments: :param operationRateMin: if specified, indicates a minimum operation rate for each location and each time, if required also for each investment period, if step by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit for each time step. |br| * the default value is None :type operationRateMin:

* None
* Pandas DataFrame with positive (>= 0) entries. The row indices have
  to match the in the energy system model specified time steps. The column indices have to equal the
  in the energy system model specified locations. The data in ineligible locations are set to zero.
* a dict

:param operationRateMax: if specified, indicates a maximum operation rate for each location and each time, if required also for each investment period, if step by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit for each time step. |br| * the default value is None :type operationRateMax:

* None
* Pandas DataFrame with positive (>= 0) entries. The row indices have
  to match the in the energy system model specified time steps. The column indices have to equal the
  in the energy system model specified locations. The data in ineligible locations are set to zero.
* a dictionary with investment periods as keys and one of the two options above as values

:param operationRateFix: if specified, indicates a fixed operation rate for each location and each time, if required also for each investment period, step by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit for each time step. |br| * the default value is None :type operationRateFix:

* None
* Pandas DataFrame with positive (>=0) per investment period. The row indices have
  to match the in the energy system model specified time steps. The column indices have to equal the
  in the energy system model specified locations. The data in ineligible locations are set to zero.
* a dictionary with investment periods as keys and one of the two options above as values

:param commodityCostTimeSeries: if specified, indicates commodity cost rates for each location and each time step, if required also for each investment period, by a positive float. The values are given as specific values relative to the commodityUnit for each time step. |br| * the default value is None :type commodityCostTimeSeries:

* None
* Pandas DataFrame with positive (>= 0) entries. The row indices have
  to match the in the energy system model specified time steps. The column indices have to equal the
  in the energy system model specified locations. The data in ineligible locations are set to zero.
* a dictionary with investment periods as keys and one of the two options above as values

:param commodityRevenueTimeSeries: if specified, indicates commodity revenue rate for each location and each time step, if required also for each investment period, by a positive float. The values are given as specific values relative to the commodityUnit for each time step. |br| * the default value is None :type commodityRevenueTimeSeries:

* None
* Pandas DataFrame with positive (>= 0) entries. The row indices
  have to match the in the energy system model specified time steps. The column indices have to equal
  the in the energy system model specified locations. The data in ineligible locations are set to zero.
* a dictionary with investment periods as keys and one of the two options above as values

:param tsaWeight: weight with which the time series of the component should be considered when applying time series aggregation. |br| * the default value is 1 :type tsaWeight: positive (>= 0) float

:param opexPerOperation: describes the cost for one unit of the operation. The cost which is directly proportional to the operation of the component is obtained by multiplying the opexPerOperation parameter with the annual sum of the operational time series of the components. The opexPerOperation can either be given as a float or a Pandas Series with location specific values or a dictionary per investment period with one of the previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). |br| * the default value is 0 :type opexPerOperation:

* positive (>=0) float
* Pandas Series with positive (>=0) values. The indices of the series have to equal the in the energy system model specified locations.
* a dictionary with investment periods as keys and one of the two options above as values.

:param commodityCost: describes the cost value of one operation´s unit of the component. The cost which is directly proportional to the operation of the component is obtained by multiplying the commodityCost parameter with the annual sum of the time series of the components. The commodityCost can either be given as a float or a Pandas Series with location specific values or a dictionary per investment period with one of the two previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro).

Example: * In a national energy system, natural gas could be purchased from another country with a certain cost.

|br| * the default value is 0

:type commodityCost:

* positive (>=0) float
* Pandas Series with positive (>=0).The indices of the series have to equal the in the energy system model specified locations.
* a dictionary with investment periods as keys and one of the two options above as values.

:param commodityRevenue: describes the revenue of one operation´s unit of the component. The revenue which is directly proportional to the operation of the component is obtained by multiplying the commodityRevenue parameter with the annual sum of the time series of the components. The commodityRevenue can either be given as a float or a Pandas Series with location specific values or a dictionary per investment period with one of the two previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro).

Example: * Modeling a PV electricity feed-in tariff for a household

|br| * the default value is 0

:type commodityRevenue:

* positive (>=0) float
* Pandas Series with positive (>=0). The indices of the series have to equal the in the energy system model specified locations.
* a dictionary with investment periods as keys and one of the two options above as values.

:param balanceLimitID: ID for the respective balance limit (out of the balance limits introduced in the esM). Should be specified if the respective component of the SourceSinkModel is supposed to be included in the balance analysis. If the commodity is transported out of the region, it is counted as a negative, if it is imported into the region it is considered positive. |br| * the default value is None :type balanceLimitID: string

:param pathwayBalanceLimitID: similar to balanceLimitID just as restriction over the entire pathway. |br| * the default value is None :type pathwayBalanceLimitID: string

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Get the required data if a time series aggregation is requested.

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Determine the aggregated maximum rate and the aggregated fixed operation rate.

  • setTimeSeriesData

    Set the maximum operation rate, fixed operation rate, and cost or revenue time series depending on whether a time series analysis is requested or not.

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation

getDataForTimeSeriesAggregation(ip)

Get the required data if a time series aggregation is requested.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData

setAggregatedTimeSeriesData(data, ip)

Determine the aggregated maximum rate and the aggregated fixed operation rate.

:param data: Pandas DataFrame with the clustered time series data of the source component :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData

setTimeSeriesData(hasTSA)

Set the maximum operation rate, fixed operation rate, and cost or revenue time series depending on whether a time series analysis is requested or not.

:param hasTSA: states whether a time series aggregation is requested (True) or not (False). :type hasTSA: boolean

SourceSinkModel

SourceSinkModel()

Bases: ComponentModel

A SourceSinkModel class instance will be instantly created if a Source class instance or a Sink class instance is initialized. It is used for the declaration of the sets, variables and constraints which are valid for the Source/Sink class instance. These declarations are necessary for the modeling and optimization of the energy system model. The SourceSinkModel class inherits from the ComponentModel class.

Create a SourceSinkModel class instance.

Methods:

additionalMinPartLoad

additionalMinPartLoad(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opVarBinName,
    capVarName,
    isOperationCommisYearDepending=False,
)

Set, if applicable, the minimal part load of a component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

bigM

bigM(pyM)

Enforce the consideration of the binary design variables of a component.

.. math::

\\text{M}^{comp} \\cdot bin^{comp}_{loc,ip} \\geq commis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

binaryOperation

binaryOperation(
    pyM,
    constrName,
    constrSetName,
    binaryParameterName,
    opVarName,
    opVarBinName,
    isOperationCommisYearDepending=False,
)

Create binary operation constraints for component operation.

Defines two constraints linking a continuous operation variable to its corresponding binary variable using the Big-M formulation. Handles both standard and commissioning year-dependent cases.

The binaryOperation1 constraint is used to force the binary variable to one if the continuous variable is greater than zero.

The binaryOperation2 constraint ensures that the continuous variable is greater than zero whenever the binary variable is one. This is used for the upTimeMin and downTimeMin feature.

capToNbInt

capToNbInt(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbInt^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

capToNbReal

capToNbReal(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbReal^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

capacityMinDec

capacityMinDec(pyM)

Enforce the consideration of minimum capacities for components with design decision variables.

Minimal capacity which needs to be reached for every investment period with commissioning. As the commisBinVar is coupled with commissioning var, constraint only sets minimal Capacity if component is commissioned. Therefore decommissioning of the component is possible without any constraints.

.. math::

\\text{capMin}^{comp}_{loc} \\cdot commisBin^{comp}_{loc,ip} \\leq  cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinOpVarSet

declareBinOpVarSet(
    esM,
    pyM,
    binaryOperationParameter=["partLoadMin"],
    binaryOperationSetName="operationBinVarSet",
)

Declare binary operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinaryDesignDecisionVars

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)

Declare binary variables [-] indicating if a component is considered at a location or not [-].

If a isBuiltFix parameter is given, the bounds are set to enforce

.. math:: bin^{comp}{loc} = \text{binFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareCapacityVars

declareCapacityVars(pyM)

Declare capacity variables.

.. math::

\\text{capMin}^{comp}_{loc} \\leq cap^{comp}_{loc} \\leq \\text{capMax}^{comp}_{loc}

If a capacityFix parameter is given, the bounds are set to enforce

.. math:: \text{cap}^{comp}{loc} = \text{capFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVarSet

declareCommissioningVarSet(pyM, esM)

Declare set for commissioning variables in the pyomo object for a modeling class.

The commissioning variable must be set for past investment periods (stock commissioning) and future/optimized investment periods

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVars

declareCommissioningVars(pyM, esM)

Declare commissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareComponentConstraints

declareComponentConstraints(esM, pyM)

Declare time independent and dependent constraints.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareContinuousDesignVarSet

declareContinuousDesignVarSet(pyM)

Declare set for continuous number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDecommissioningVars

declareDecommissioningVars(pyM, esM)

Declare decommissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignDecisionVarSet

declareDesignDecisionVarSet(pyM)

Declare set for design decision variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignVarSet

declareDesignVarSet(pyM, esM)

Declare set for capacity variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDiscreteDesignVarSet

declareDiscreteDesignVarSet(pyM)

Declare set for discrete number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareIntNumbersVars

declareIntNumbersVars(pyM)

Declare variables representing the (discrete/integer) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLocationComponentSet

declareLocationComponentSet(pyM)

Declare set with location and component in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpConstrSet1

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpConstrSet2

declareOpConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpConstrSet3

declareOpConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpConstrSet4

declareOpConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpConstrSetMinPartLoad

declareOpConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpVarSet

declareOpVarSet(esM, pyM)

Declare operation related sets (operation variables and mapping sets) in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationBinaryVars

declareOperationBinaryVars(
    pyM,
    opVarBinName="op_bin",
    opBinSetName="operationBinVarSet",
)

Declare binary operation variables.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationModeSets

declareOperationModeSets(
    pyM, constrSetName, rateMax, rateFix, rateMin=None
)

Declare operating mode sets.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrSetName: name of the constraint set. :type constrSetName: string

:param rateMax: attribute of the considered component which stores the maximum operation rate data. :type rateMax: string

:param rateMax: attribute of the considered component which stores the minimum operation rate data. :type rateMax: string

:param rateFix: attribute of the considered component which stores the fixed operation rate data. :type rateFix: string

declareOperationVars

declareOperationVars(
    pyM,
    esM,
    opVarName,
    opRateFixName="processedOperationRateFix",
    opRateMaxName="processedOperationRateMax",
    isOperationCommisYearDepending=False,
    flexibleConversion=False,
    relevanceThreshold=None,
)

Declare operation variables.

The following operation modes are directly handled during variable creation as bounds instead of constraints.

operation mode 4: If operationRateFix is given for components without a capacity variable, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

.. math:: op^{comp,opType}{loc,p,t} = \text{opRateFix}^{comp,opType}

operation mode 5: If operationRateMax is given for components without a capacity variable, the variables are bounded by operationRateMax, i.e. the operation [commodityUnit*h] is limited by a time series.

.. math:: op^{comp,opType}{loc,p,t} \leq \text{opRateMax}^{comp,opType}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

declarePathwaySets

declarePathwaySets(pyM, esM)

Declare set for capacity development in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareRealNumbersVars

declareRealNumbersVars(pyM)

Declare variables representing the (continuous) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareSets

declareSets(esM, pyM)

Declare sets and dictionaries: design variable sets, operation variable set, operation mode sets and linked commodity limitation dictionary.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareVariables

declareVariables(
    esM, pyM, relaxIsBuiltBinary, relevanceThreshold
)

Declare design and operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relaxIsBuiltBinary: states if the optimization problem should be solved as a relaxed LP to get the lower bound of the problem. |br| * the default value is False :type declaresOptimizationProblem: boolean

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

declareYearlyFullLoadHoursMaxSet

declareYearlyFullLoadHoursMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursMinSet

declareYearlyFullLoadHoursMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

decommissioningConstraint

decommissioningConstraint(pyM, esM)

Declase the decommissioning after the technical lifetime from investment period of commissioning.

.. math::

decommis^{comp}_{loc,ip} = commis^{comp}_{loc,ip-\\mathrm{ipTechnicalLifetime}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

designBinFix

designBinFix(pyM)

Set, if applicable, the installed capacities of a component.

.. math::

bin^{comp}_{(loc_1,loc_2),ip} = \\text{binFix}^{comp}_{(loc_1,loc_2)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

designDevelopmentConstraint

designDevelopmentConstraint(pyM, esM)

Link the capacity development between investment periods.

For stochastic: The capacity design must be equal between the different years.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip}

For the development pathway, the capacity of an investment period is composed of the capacity of the previous investment periods and the commissioning and decommissioning in the current investment period.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

getBalanceLimitContribution

getBalanceLimitContribution(
    esM,
    pyM,
    ID,
    ip,
    timeSeriesAggregation,
    loc,
    componentNames,
)

Get contribution to balanceLimitConstraint (Further read in EnergySystemModel).

Sum of the operation time series of a SourceSink component is used as the balanceLimit contribution:

  • If component is a Source it contributes with a positive sign to the limit. Example: Electricity Purchase
  • A Sink contributes with a negative sign. Example: Sale of electricity

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pym: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pym: pyomo ConcreteModel

:param ip: investment period of transformation path analysis. :type ip: int

:param ID: ID of the regarded balanceLimitConstraint :param ID: string

:param timeSeriesAggregation: states if the optimization of the energy system model should be done with

(a) the full time series (False) or
(b) clustered time series data (True).

:type timeSeriesAggregation: boolean

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param componentNames: Names of components which contribute to the balance limit :type componentNames: list

getCommodityBalanceContribution

getCommodityBalanceContribution(
    pyM, commod, loc, ip, p, t
)

Get contribution to a commodity balance.

    .. math::

\\text{C}^{comp,comm}_{loc,ip,p,t} = - op_{loc,ip,p,t}^{comp,op}  \\text{Sink}

.. math:: \text{C}^{comp,comm}{loc,ip,p,t} = op}^{comp,op} \text{Source

getEconomicsDesign

getEconomicsDesign(
    pyM,
    esM,
    factorNames,
    lifetimeAttr,
    varName,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set design dependent cost equations for the individual components. The equations will be set for all components of a modeling class and all locations.

Required arguments

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is "". :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal cost values.
- False: Return the cost equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total anualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getEconomicsOperation

getEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    dictName,
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step. In case of a two-dimensional component (e.g. a transmission component), the equations will be set for all possible connections between the defined locations.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries" :type fncType: string

:param factorNames: Strings of the time-dependent parameters that have to be multiplied within the equation. (e.g. ['opexPerOperation'] to multiply the operation variable with the costs for each operation). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total annualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getLocEconomicsDesign

getLocEconomicsDesign(
    pyM,
    esM,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
)

Set time-independent equation specified for one component in one location in one investment period.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

Default arguments:

:param ip: investment period :type ip: int

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is ''. :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getLocEconomicsOperation

getLocEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    getOptValue=False,
)

Set time-dependent cost functions for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries :type fncType: string

:param factorName: String of the time-dependent parameter that have to be multiplied within the equation. (e.g. 'commodityCostTimeSeries' to multiply the operation variable with the costs for each operation). :type factorNames: string

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

:param ip: investment period of transformation path analysis. :type ip: int

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getObjectiveFunctionContribution

getObjectiveFunctionContribution(esM, pyM)

Get contribution to the objective function.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pym: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pym: pyomo ConcreteModel

getOptimalValues

getOptimalValues(name='all', ip=0)

Return optimal values of the components.

:param name: name of the variables of which the optimal values should be returned:

* 'capacityVariables',
* 'isBuiltVariables',
* '_operationVariablesOptimum',
* 'all' or another input: all variables are returned.

|br| * the default value is 'all' :type name: string

:param ip: investment period |br| * the default value is 0 :type ip: int

:returns: a dictionary with the optimal values of the components :rtype: dict

getSharedPotentialContribution

getSharedPotentialContribution(pyM, key, loc, ip)

Get the share which the components of the modeling class have on a shared maximum potential at a location.

hasOpVariablesForLocationCommodity

hasOpVariablesForLocationCommodity(esM, loc, commod)

Check if operation variables exist in the modeling class at a location which are connected to a commodity.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param commod: Name of the regarded commodity (commodities are defined in the EnergySystemModel instance) :param commod: string

operationMode1

operationMode1(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    factorName=None,
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 1. The operation [commodityUnith] is limited by the installed capacity in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n An additional factor can limited the operation further.

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opFactor}^{opType} \\cdot cap^{comp}_{loc,ip}

operationMode2

operationMode2(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateFix",
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 2.

The operation [commodityUnith] is equal to the installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opRateMax}^{comp,opType}_{loc,ip,p,t} \\cdot cap^{comp}_{loc,ip}

operationMode3

operationMode3(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMax",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 3.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationMode4

operationMode4(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMin",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 4.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

setOptimalValues

setOptimalValues(esM, pyM)

Set the optimal values of the components.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pym: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pym: pyomo ConcreteModel

:param ip: investment period of transformation path analysis. :type ip: int

stockCapacityConstraint

stockCapacityConstraint(pyM, esM)

Set the stock capacity constraint. The stock capacity is the sum of the stock commissioning, which do not exceed its technical lifetime.

For stochastic, the stock of past investment periods is not only valid for ip=0 but for all investment periods. .. math::

cap^{comp}_{loc,ip} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,0}

For capacity development, the stock is only considered for the first investment periods.

.. math::

cap^{comp}_{loc,0} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,0} - decommis^{comp}_{loc,0}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

stockCommissioningConstraint

stockCommissioningConstraint(pyM, esM)

Set commissioning variable for past investment periods. For past investment periods, where no stock commissioning is specified the commissioning variable is set to zero.

yearlyFullLoadHoursMax

yearlyFullLoadHoursMax(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a maximum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

yearlyFullLoadHoursMin

yearlyFullLoadHoursMin(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a minimum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

Conversion

conversion

Classes:

  • Conversion

    A Conversion component converts commodities into each other.

  • ConversionModel

    A ConversionModel class instance will be instantly created if a Conversion class instance is initialized.

Conversion

Conversion(
    esM,
    name,
    physicalUnit,
    commodityConversionFactors,
    hasCapacityVariable=True,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    linkedConversionCapacityID=None,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    operationRateMin=None,
    operationRateMax=None,
    operationRateFix=None,
    tsaWeight=1,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerOperation=0,
    opexPerCapacity=0,
    opexIfBuilt=0,
    QPcostScale=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    yearlyFullLoadHoursMin=None,
    yearlyFullLoadHoursMax=None,
    stockCommissioning=None,
    floorTechnicalLifetime=True,
    commissioningDependentCcf=False,
    emissionFactors=None,
    flowShares=None,
    pwlcfParameters=None,
    rampUpMax=None,
    rampDownMax=None,
    useTemporalCyclicConstraints=True,
)

Bases: Component

A Conversion component converts commodities into each other.

Create an instance of the Conversion class, with capacities given in the physical unit of the plants.

The Conversion component specific input arguments are described below. The general component input arguments are described in the Component class.

Required arguments:

:param physicalUnit: reference physical unit of the plants to which maximum capacity limitations, cost parameters and the operation time series refer to. :type physicalUnit: string

:param commodityConversionFactors: conversion factors with which commodities are converted into each other with one unit of operation (dictionary). Each commodity which is converted in this component is indicated by a string in this dictionary. The conversion factor related to this commodity is given as a float (constant), pandas.Series or pandas.DataFrame (time-variable). A negative value indicates that the commodity is consumed. A positive value indicates that the commodity is produced. Check unit consistency when specifying this parameter!

Examples: * An electrolyzer converts, simply put, electricity into hydrogen with an electrical efficiency of 70%. The physicalUnit is given as GW_electric, the unit for the 'electricity' commodity is given in GW_electric and the 'hydrogen' commodity is given in GW_hydrogen_lowerHeatingValue -> the commodityConversionFactors are defined as {'electricity':-1,'hydrogen':0.7}. * A fuel cell converts, simply put, hydrogen into electricity with an efficiency of 60%. The physicalUnit is given as GW_electric, the unit for the 'electricity' commodity is given in GW_electric and the 'hydrogen' commodity is given in GW_hydrogen_lowerHeatingValue -> the commodityConversionFactors are defined as {'electricity':1,'hydrogen':-1/0.6}.

If a transformation pathway analysis is performed the conversion factors can also be varied
over the transformation pathway. Therefore, two different options are available:

1. Variation with operation year (for example to incorporate weather changes for a heat pump).

Example: {2020: {'electricity':-1,'heat':pd.Series(data=[2.5, 2.8, 2.5, ...])}, 2025: {'electricity':-1,'heat':pd.Series(data=[2.7, 2.4, 2.9, ...])}, ...} 2. Variation with commissioning and operation year (for example to incorporate efficiency changes dependent on the installation year). Please note that this implementation massively increases the complexity of the optimization problem.

Example: {(2020, 2020): {'electricity':-1,'heat':pd.Series(data=[2.5, 2.8, 2.5, ...])}, (2020, 2025): {'electricity':-1,'heat':pd.Series(data=[2.7, 2.4, 2.9, ...])}, (2025, 2025): {'electricity':-1,'heat':pd.Series(data=[3.7, 3.4, 3.9, ...])}, ...}

If a conversion component can decide between multiple in- or outputs which one to use
(e.g. a chp plant) a flexible conversion component can be specified. This enables the
component to substitute in- or output commodities within a commodity group. To allow
this behavior an additional level needs to be specified:

* A CHP plant can decide between the production of heat or electricity (or a mix of both).
    When electricity is produced the conversion factor is 0.2 and for heat 0.5:
    {'gas': -1, 'out': {electricity: 0.2, heat: 0.5}}

Location-dependent (time-invariant) conversion factors can be provided as pandas.Series
indexed by the energy system model locations.

Example: {'electricity': -1, 'heat': pd.Series({'DE': 0.9, 'FR': 0.8})}

:type commodityConversionFactors:

* dictionary, assigns commodities (string) to a conversion factors
    (float/int, pandas.Series indexed by locations, or pandas.DataFrame
    with locations as columns and time steps as index)
* dictionary with investment periods as key and one of the first option  as value
* dictionary with tuple of (commissioning year, investment period) as key and one
    of the first option above as value

Example: { 2025: {'electricity': -1, 'hydrogen': pd.DataFrame( {'ElectrolyzerLocation': [0.5, 0.6, 0.7, ...], 'IndustryLocation': [1.0, 0.9, 0.8, ...]}, index=esM.totalTimeSteps)}, 2030: {'electricity': -1, 'hydrogen': pd.DataFrame( {'ElectrolyzerLocation': [0.6, 0.7, 0.8, ...], 'IndustryLocation': [0.9, 0.8, 0.7, ...]}, index=esM.totalTimeSteps)} }

Default arguments:

:param linkedConversionCapacityID: if specifies, indicates that all conversion components with the same ID have to have the same capacity. |br| * the default value is None :type linkedConversionCapacityID: string

:param operationRateMin: if specified, indicates a minimum operation rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the physicalUnit of the plant for each time step. |br| * the default value is None :type operationRateMin: * None * pandas DataFrame with positive (>=0). The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param operationRateMax: if specified, indicates a maximum operation rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the physicalUnit of the plant for each time step. |br| * the default value is None :type operationRateMax: * None * pandas DataFrame with positive (>=0). The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param operationRateFix: if specified, indicates a fixed operation rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the physicalUnit of the plant for each time step. |br| * the default value is None :type operationRateFix: * None * Pandas DataFrame with positive (>=0). The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param tsaWeight: weight with which the time series of the component should be considered when applying time series aggregation. |br| * the default value is 1 :type tsaWeight: positive (>= 0) float

:param opexPerOperation: describes the cost for one unit of the operation. The cost which is directly proportional to the operation of the component is obtained by multiplying the opexPerOperation parameter with the annual sum of the operational time series of the components. The opexPerOperation can either be given as a float or a Pandas Series with location specific values. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). |br| * the default value is 0 :type opexPerOperation: * Pandas Series with positive (>=0) entries. The indices of the series have to equal the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param commissioningDependentCcf: specifies if commodity conversion factors are dependent on commissioning or operation year. If set to False, the factors are only dependent on the year of operation and no new operation variables are introduced. If set to True, the factors are dependent on commissioning year and new operation variables are introduced for every commissioning year. |br| * the default value is False :type commissioningDependentCcf:bool

:param emissionFactors: can be used to specify emissions for flexible conversion components. This parameter can only be specified if the component is a flexible conversion component (see explanations on commodity conversion factors above). When specified, the emission factors indicate what emissions are produced when a particular commodity is used by the component. Note: For non-flexible conversion components emissions must be specified as commodity conversion factors.

Example: The CO2 emissions of a power plant are dependent on the type of fuel is used (e.g. coal has
higher emissions than gas): {'co2': {'coal': 3, 'gas': 1}}

:type emissionFactors: dict with emission commodities as key and a dict as value. The inner dict holds the emission factors which are dependent on the utilized commodity.

:param flowShares: can be used to constrain the operation of flexible conversion components (see explanations on commodity conversion factors above). When used, the flow shares must be specified as 'min', 'max', or 'fix' values that limit the commodity specific operation rate of a flexible conversion component relative to the overall rate of that component (e.g. if the flow share max for H2 is set to 0.75 and the overall operation rate is 4 MW, then the H2 operation rate must be smaller or equal to 3 MW). Flow shares can be set up for all, some, or none of the modeled investment periods, and can either apply to all regions (if defined as int) or depend on individual regions (if defined as pandas series). Flow shares must be between 0 and 1 if specified.

Example: In the first investment period in Location1 only a small share of 10 % of the modeled gas heaters
are able to burn hydrogen instead of natural gas. In the second investment period more hydrogen ready
heaters are available and 50% of the heaters can burn hydrogen instead of natural gas (10 % of
those heaters can only burn hydrogen). In Location2 only 5 % can burn hydrogen in first period and 40 % can
burn hydrogen in second period:
flowShares = {
    0: {
        'max': {'hydrogen': pd.Series([0.1, 0.05], index=['loc1', 'loc2'])}
    },
    1: {
        'max': {'hydrogen': pd.Series([0.1, 0.05], index=['loc1', 'loc2'])},
        'min': {'hydrogen': pd.Series([0.1], index=['loc1'])}
    }
}

:type flowShares: dict

:param rampUpMax: A maximum ramping rate to limit the increase in the operation of the component as share of the installed capacity. The maximum ramping is defined per hour and not per hoursPerTimeStep. |br| * the default value is None :type rampUpMax: None or float value in range ]0.0,1.0]

:param rampDownMax: A maximum ramping rate to limit the decrease in the operation of the component as share of the installed capacity. The maximum ramping is defined per hour and not per hoursPerTimeStep. |br| * the default value is None :type rampDownMax: None or float value in range ]0.0,1.0]

:param useTemporalCyclicConstraints: If True, the temporal cyclic constraints are used. This means that the operation of the first time steps are mathematically linked to the operation of the last time steps. |br| * the default value is True :type useTemporalCyclicConstraints: boolean

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Get the required data if a time series aggregation is requested.

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Determine the aggregated maximum rate and the aggregated fixed operation rate.

  • setTimeSeriesData

    Set the maximum operation rate and fixed operation rate depending on whether a time series analysis is requested or not.

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation

getDataForTimeSeriesAggregation(ip)

Get the required data if a time series aggregation is requested.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData

setAggregatedTimeSeriesData(data, ip)

Determine the aggregated maximum rate and the aggregated fixed operation rate.

:param data: Pandas DataFrame with the clustered time series data of the conversion component :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData

setTimeSeriesData(hasTSA)

Set the maximum operation rate and fixed operation rate depending on whether a time series analysis is requested or not.

:param hasTSA: states whether a time series aggregation is requested (True) or not (False). :type hasTSA: boolean

ConversionModel

ConversionModel()

Bases: ComponentModel

A ConversionModel class instance will be instantly created if a Conversion class instance is initialized. It is used for the declaration of the sets, variables and constraints which are valid for the Conversion class instance. These declarations are necessary for the modeling and optimization of the energy system model. The ConversionModel class inherits from the ComponentModel class.

Create a ConversionModel class instance.

Methods:

additionalMinPartLoad

additionalMinPartLoad(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opVarBinName,
    capVarName,
    isOperationCommisYearDepending=False,
)

Set, if applicable, the minimal part load of a component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

bigM

bigM(pyM)

Enforce the consideration of the binary design variables of a component.

.. math::

\\text{M}^{comp} \\cdot bin^{comp}_{loc,ip} \\geq commis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

binaryOperation

binaryOperation(
    pyM,
    constrName,
    constrSetName,
    binaryParameterName,
    opVarName,
    opVarBinName,
    isOperationCommisYearDepending=False,
)

Create binary operation constraints for component operation.

Defines two constraints linking a continuous operation variable to its corresponding binary variable using the Big-M formulation. Handles both standard and commissioning year-dependent cases.

The binaryOperation1 constraint is used to force the binary variable to one if the continuous variable is greater than zero.

The binaryOperation2 constraint ensures that the continuous variable is greater than zero whenever the binary variable is one. This is used for the upTimeMin and downTimeMin feature.

capToNbInt

capToNbInt(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbInt^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

capToNbReal

capToNbReal(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbReal^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

capacityMinDec

capacityMinDec(pyM)

Enforce the consideration of minimum capacities for components with design decision variables.

Minimal capacity which needs to be reached for every investment period with commissioning. As the commisBinVar is coupled with commissioning var, constraint only sets minimal Capacity if component is commissioned. Therefore decommissioning of the component is possible without any constraints.

.. math::

\\text{capMin}^{comp}_{loc} \\cdot commisBin^{comp}_{loc,ip} \\leq  cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinOpVarSet

declareBinOpVarSet(
    esM,
    pyM,
    binaryOperationParameter=["partLoadMin"],
    binaryOperationSetName="operationBinVarSet",
)

Declare binary operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinaryDesignDecisionVars

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)

Declare binary variables [-] indicating if a component is considered at a location or not [-].

If a isBuiltFix parameter is given, the bounds are set to enforce

.. math:: bin^{comp}{loc} = \text{binFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareCapacityVars

declareCapacityVars(pyM)

Declare capacity variables.

.. math::

\\text{capMin}^{comp}_{loc} \\leq cap^{comp}_{loc} \\leq \\text{capMax}^{comp}_{loc}

If a capacityFix parameter is given, the bounds are set to enforce

.. math:: \text{cap}^{comp}{loc} = \text{capFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVarSet

declareCommissioningVarSet(pyM, esM)

Declare set for commissioning variables in the pyomo object for a modeling class.

The commissioning variable must be set for past investment periods (stock commissioning) and future/optimized investment periods

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVars

declareCommissioningVars(pyM, esM)

Declare commissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareComponentConstraints

declareComponentConstraints(esM, pyM)

Declare time independent and dependent constraints.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareContinuousDesignVarSet

declareContinuousDesignVarSet(pyM)

Declare set for continuous number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDecommissioningVars

declareDecommissioningVars(pyM, esM)

Declare decommissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignDecisionVarSet

declareDesignDecisionVarSet(pyM)

Declare set for design decision variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignVarSet

declareDesignVarSet(pyM, esM)

Declare set for capacity variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDiscreteDesignVarSet

declareDiscreteDesignVarSet(pyM)

Declare set for discrete number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareFlexFlowShareConstrSet

declareFlexFlowShareConstrSet(pyM)

Declare set for flow share constraints based on the processed flow shares parameter.

declareIntNumbersVars

declareIntNumbersVars(pyM)

Declare variables representing the (discrete/integer) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLinkedCapacityDict

declareLinkedCapacityDict(pyM)

Declare conversion components with linked capacities and check if the linked components have the same locational eligibility.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLocationComponentSet

declareLocationComponentSet(pyM)

Declare set with location and component in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpCommisConstrSet1

declareOpCommisConstrSet1(
    pyM, constrSetName, rateMax, rateFix, rateMin
)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpCommisConstrSet2

declareOpCommisConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpCommisConstrSet3

declareOpCommisConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpCommisConstrSet4

declareOpCommisConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpCommisConstrSetMinPartLoad

declareOpCommisConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpCommisVarSet

declareOpCommisVarSet(esM, pyM)

Declare the operation set for components that have commodity conversion factors that depend on the year in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpConstrSet1

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpConstrSet2

declareOpConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpConstrSet3

declareOpConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpConstrSet4

declareOpConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpConstrSetMinPartLoad

declareOpConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpFlexVarSets

declareOpFlexVarSets(esM, pyM)

Declare commodity specific operation variable set for flexible conversion components in the pyomo object for a modeling class.

declareOpVarSet

declareOpVarSet(esM, pyM)

Declare operation related sets (operation variables and mapping sets) in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationBinaryVars

declareOperationBinaryVars(
    pyM,
    opVarBinName="op_bin",
    opBinSetName="operationBinVarSet",
)

Declare binary operation variables.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationModeSets

declareOperationModeSets(
    pyM, constrSetName, rateMax, rateFix, rateMin
)

Declare operation mode and commissioning constraint sets.

Extends the parent class implementation and adds multiple commissioning-related constraint sets to the Pyomo model.

declareOperationVars

declareOperationVars(
    pyM,
    esM,
    opVarName,
    opRateFixName="processedOperationRateFix",
    opRateMaxName="processedOperationRateMax",
    isOperationCommisYearDepending=False,
    flexibleConversion=False,
    relevanceThreshold=None,
)

Declare operation variables.

The following operation modes are directly handled during variable creation as bounds instead of constraints.

operation mode 4: If operationRateFix is given for components without a capacity variable, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

.. math:: op^{comp,opType}{loc,p,t} = \text{opRateFix}^{comp,opType}

operation mode 5: If operationRateMax is given for components without a capacity variable, the variables are bounded by operationRateMax, i.e. the operation [commodityUnit*h] is limited by a time series.

.. math:: op^{comp,opType}{loc,p,t} \leq \text{opRateMax}^{comp,opType}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

declarePathwaySets

declarePathwaySets(pyM, esM)

Declare set for capacity development in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareRampingConstraints

declareRampingConstraints(pyM, esM, rampingType)

Set up the ramping contraints.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo Concrete Model

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param rampingType: Type of ramping constraints to set up. Can be either rampDownMax or rampUpMax |br| * the default value is None.

declareRampingVarSets

declareRampingVarSets(esM, pyM)

Declare ramping constraint sets if ramp rates are given.

declareRealNumbersVars

declareRealNumbersVars(pyM)

Declare variables representing the (continuous) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareSets

declareSets(esM, pyM)

Declare sets and dictionaries: design variable sets, operation variable set, operation mode sets and linked components dictionary.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareVariables

declareVariables(
    esM, pyM, relaxIsBuiltBinary, relevanceThreshold
)

Declare design and operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relaxIsBuiltBinary: states if the optimization problem should be solved as a relaxed LP to get the lower bound of the problem. |br| * the default value is False :type declaresOptimizationProblem: boolean

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

declareYearlyFullLoadHoursCommisMaxSet

declareYearlyFullLoadHoursCommisMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursCommisMinSet

declareYearlyFullLoadHoursCommisMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

declareYearlyFullLoadHoursMaxSet

declareYearlyFullLoadHoursMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursMinSet

declareYearlyFullLoadHoursMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

decommissioningConstraint

decommissioningConstraint(pyM, esM)

Declase the decommissioning after the technical lifetime from investment period of commissioning.

.. math::

decommis^{comp}_{loc,ip} = commis^{comp}_{loc,ip-\\mathrm{ipTechnicalLifetime}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

designBinFix

designBinFix(pyM)

Set, if applicable, the installed capacities of a component.

.. math::

bin^{comp}_{(loc_1,loc_2),ip} = \\text{binFix}^{comp}_{(loc_1,loc_2)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

designDevelopmentConstraint

designDevelopmentConstraint(pyM, esM)

Link the capacity development between investment periods.

For stochastic: The capacity design must be equal between the different years.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip}

For the development pathway, the capacity of an investment period is composed of the capacity of the previous investment periods and the commissioning and decommissioning in the current investment period.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

flexConversionConstraint

flexConversionConstraint(pyM, esM)

Declare constraint that ensures that the sum of all flexible operation variables of one component are equal to the overall operation of this component.

flexConversionFlowShareConstraint

flexConversionFlowShareConstraint(pyM)

Declare constraint that applies flow shares for each flexible component.

getCommodityBalanceContribution

getCommodityBalanceContribution(
    pyM, commod, loc, ip, p, t
)

Get contribution to a commodity balance.

.. math::

\\text{C}^{comp,comm}_{loc,ip,p,t} =  \\text{conversionFactor}^{comp}_{comm} \\cdot op_{loc,ip,p,t}^{comp,op}

getEconomicsDesign

getEconomicsDesign(
    pyM,
    esM,
    factorNames,
    lifetimeAttr,
    varName,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set design dependent cost equations for the individual components. The equations will be set for all components of a modeling class and all locations.

Required arguments

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is "". :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal cost values.
- False: Return the cost equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total anualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getEconomicsOperation

getEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    dictName,
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step. In case of a two-dimensional component (e.g. a transmission component), the equations will be set for all possible connections between the defined locations.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries" :type fncType: string

:param factorNames: Strings of the time-dependent parameters that have to be multiplied within the equation. (e.g. ['opexPerOperation'] to multiply the operation variable with the costs for each operation). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total annualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getLocEconomicsDesign

getLocEconomicsDesign(
    pyM,
    esM,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
)

Set time-independent equation specified for one component in one location in one investment period.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

Default arguments:

:param ip: investment period :type ip: int

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is ''. :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getLocEconomicsOperation

getLocEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    getOptValue=False,
)

Set time-dependent cost functions for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries :type fncType: string

:param factorName: String of the time-dependent parameter that have to be multiplied within the equation. (e.g. 'commodityCostTimeSeries' to multiply the operation variable with the costs for each operation). :type factorNames: string

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

:param ip: investment period of transformation path analysis. :type ip: int

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getObjectiveFunctionContribution

getObjectiveFunctionContribution(esM, pyM)

Get contribution to the objective function.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

getOptimalValues

getOptimalValues(name='all', ip=0)

Return optimal values of the components.

:param name: name of the variables of which the optimal values should be returned:

* 'capacityVariables',
* 'isBuiltVariables',
* 'operationVariablesOptimum',
* 'all' or another input: all variables are returned.

|br| * the default value is 'all' :type name: string

:param ip: investment period |br| * the default value is 0 :type ip: int

:returns: a dictionary with the optimal values of the components :rtype: dict

getSharedPotentialContribution

getSharedPotentialContribution(pyM, key, loc, ip)

Get the share which the components of the modeling class have on a shared maximum potential at a location.

getTotalOperationCommissioningDependentOperation

getTotalOperationCommissioningDependentOperation(pyM)

Ensure that the sum of all commissioning dependent operating variables equals the total operating variable of that conversion component for each time step.

hasOpVariablesForLocationCommodity

hasOpVariablesForLocationCommodity(esM, loc, commod)

Check if operation variables exist in the modeling class at a location which are connected to a commodity.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param commod: Name of the regarded commodity (commodities are defined in the EnergySystemModel instance) :param commod: string

interPeriodRamping

interPeriodRamping(esM, pyM, rampingType)

Add inter-period ramping constraints for operation variables. This enforces a maximum allowed change in the dispatch between the last time step of period p–1 and the first time step of period p.

linkedCapacity

linkedCapacity(pyM)

Ensure that all Conversion components with the same linkedConversionCapacityID have the same capacity.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

operationMode1

operationMode1(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    factorName=None,
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 1. The operation [commodityUnith] is limited by the installed capacity in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n An additional factor can limited the operation further.

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opFactor}^{opType} \\cdot cap^{comp}_{loc,ip}

operationMode2

operationMode2(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateFix",
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 2.

The operation [commodityUnith] is equal to the installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opRateMax}^{comp,opType}_{loc,ip,p,t} \\cdot cap^{comp}_{loc,ip}

operationMode3

operationMode3(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMax",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 3.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationMode4

operationMode4(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMin",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 4.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

setOptimalValues

setOptimalValues(esM, pyM)

Set the optimal values of the components.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

stockCapacityConstraint

stockCapacityConstraint(pyM, esM)

Set the stock capacity constraint. The stock capacity is the sum of the stock commissioning, which do not exceed its technical lifetime.

For stochastic, the stock of past investment periods is not only valid for ip=0 but for all investment periods. .. math::

cap^{comp}_{loc,ip} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,0}

For capacity development, the stock is only considered for the first investment periods.

.. math::

cap^{comp}_{loc,0} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,0} - decommis^{comp}_{loc,0}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

stockCommissioningConstraint

stockCommissioningConstraint(pyM, esM)

Set commissioning variable for past investment periods. For past investment periods, where no stock commissioning is specified the commissioning variable is set to zero.

yearlyFullLoadHoursMax

yearlyFullLoadHoursMax(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a maximum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

yearlyFullLoadHoursMin

yearlyFullLoadHoursMin(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a minimum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

Transmission

transmission

Classes:

  • Transmission

    A Transmission component can transmit a commodity between locations of the energy system.

  • TransmissionModel

    Instantly create a TransmissionModel class instance when a Transmission class instance is initialized.

Transmission

Transmission(
    esM,
    name,
    commodity,
    losses=0,
    distances=None,
    hasCapacityVariable=True,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    operationRateMax=None,
    operationRateFix=None,
    tsaWeight=1,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerOperation=0,
    opexPerCapacity=0,
    opexIfBuilt=0,
    QPcostScale=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    floorTechnicalLifetime=True,
    balanceLimitID=None,
    pathwayBalanceLimitID=None,
    stockCommissioning=None,
    pwlcfParameters=None,
)

Bases: Component

A Transmission component can transmit a commodity between locations of the energy system.

Create a Transmission class instance. The Transmission component specific input arguments are described below. The general component input arguments are described in the Component class.

Required arguments:

:param commodity: to the component related commodity. :type commodity: string

Default arguments:

:param losses: relative losses per lengthUnit (lengthUnit as specified in the energy system model) in percentage of the commodity flow. This loss factor can capture simple linear losses

.. math::
    trans_{in, ij} = (1 - \\text{losses} \\cdot \\text{distances}) \\cdot trans_{out, ij}

(with trans being the commodity flow at a certain point in
time and i and j being locations in the energy system). The losses can either be given as a float or a
Pandas DataFrame with location specific values.
|br| * the default value is 0

:type losses: positive float (0 <= float <= 1) or Pandas DataFrame with positive values (0 <= float <= 1). The row and column indices of the DataFrame have to equal the in the energy system model specified locations.

:param distances: distances between locations given in the lengthUnit (lengthUnit as specified in the energy system model). |br| * the default value is None :type distances: positive float (>= 0) or Pandas DataFrame with positive values (>= 0). The row and column indices of the DataFrame have to equal the in the energy system model specified locations.

:param operationRateMax: if specified, indicates a maximum operation rate for all possible connections (both directions) of the transmission component at each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the transmitted commodity (before considering losses) during one time step. |br| * the default value is None :type operationRateMax: * None * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices are combinations of locations (as defined in the energy system model), separated by a underscore (e.g. "location1_location2"). The first location indicates where the commodity is coming from. The second location indicates where the commodity is going too. If a flow is specified from location i to location j, it also has to be specified from j to i. * a dictionary with investment periods as keys and one of the two options above as values.

:param operationRateFix: if specified, indicates a fixed operation rate for all possible connections (both directions) of the transmission component at each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the transmitted commodity (before considering losses) during one time step. |br| * the default value is None :type operationRateFix: * None * Pandas DataFrame with positive (>= 0). The row indices have to match the in the energy system model specified time steps. The column indices are combinations of locations (as defined in the energy system model), separated by a underscore (e.g. "location1_location2"). The first location indicates where the commodity is coming from. The second one location indicates where the commodity is going too. If a flow is specified from location i to location j, it also has to be specified from j to i. * a dictionary with investment periods as keys and one of the two options above as values.

:param tsaWeight: weight with which the time series of the component should be considered when applying time series aggregation. |br| * the default value is 1 :type tsaWeight: positive (>= 0) float

:param opexPerOperation: describes the cost for one unit of the operation. The cost which is directly proportional to the operation of the component is obtained by multiplying the opexPerOperation parameter with the annual sum of the operational time series of the components. The opexPerOperation can either be given as a float or a Pandas DataFrame with location specific values or a dictionary per investment period with one of the previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). The value has to match the unit costUnit/operationUnit (e.g. Euro/kWh, Dollar/kWh). |br| * the default value is 0 :type opexPerOperation: * positive (>=0) float * Pandas DataFrame with positive (>=0).The row and column indices of the DataFrame have to equal the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param balanceLimitID: ID for the respective balance limit (out of the balance limits introduced in the esM). Should be specified if the respective component of the TransmissionModel is supposed to be included in the balance analysis. If the commodity is transported out of the region, it is counted as a negative, if it is imported into the region it is considered positive. |br| * the default value is None :type balanceLimitID: string

:param pathwayBalanceLimitID: similar to balanceLimitID just as restriction over the entire pathway. |br| * the default value is None :type pathwayBalanceLimitID: string

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Get the required data if a time series aggregation is requested.

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Determine the aggregated maximum rate and the aggregated fixed operation rate.

  • setTimeSeriesData

    Set the maximum operation rate and fixed operation rate depending on whether a time series analysis is requested or not.

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation

getDataForTimeSeriesAggregation(ip)

Get the required data if a time series aggregation is requested.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData

setAggregatedTimeSeriesData(data, ip)

Determine the aggregated maximum rate and the aggregated fixed operation rate.

:param data: Pandas DataFrame with the clustered time series data of the conversion component :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData

setTimeSeriesData(hasTSA)

Set the maximum operation rate and fixed operation rate depending on whether a time series analysis is requested or not.

:param hasTSA: states whether a time series aggregation is requested (True) or not (False). :type hasTSA: boolean

TransmissionModel

TransmissionModel()

Bases: ComponentModel

Instantly create a TransmissionModel class instance when a Transmission class instance is initialized. It is used for the declaration of the sets, variables and constraints which are valid for the Transmission class instance. These declarations are necessary for the modeling and optimization of the energy system model. The TransmissionModel class inherits from the ComponentModel class.

Create a TransmissionModel class instance.

Methods:

additionalMinPartLoad

additionalMinPartLoad(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opVarBinName,
    capVarName,
    isOperationCommisYearDepending=False,
)

Set, if applicable, the minimal part load of a component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

bigM

bigM(pyM)

Enforce the consideration of the binary design variables of a component.

.. math::

\\text{M}^{comp} \\cdot bin^{comp}_{loc,ip} \\geq commis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

binaryOperation

binaryOperation(
    pyM,
    constrName,
    constrSetName,
    binaryParameterName,
    opVarName,
    opVarBinName,
    isOperationCommisYearDepending=False,
)

Create binary operation constraints for component operation.

Defines two constraints linking a continuous operation variable to its corresponding binary variable using the Big-M formulation. Handles both standard and commissioning year-dependent cases.

The binaryOperation1 constraint is used to force the binary variable to one if the continuous variable is greater than zero.

The binaryOperation2 constraint ensures that the continuous variable is greater than zero whenever the binary variable is one. This is used for the upTimeMin and downTimeMin feature.

capToNbInt

capToNbInt(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbInt^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

capToNbReal

capToNbReal(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbReal^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

capacityMinDec

capacityMinDec(pyM)

Enforce the consideration of minimum capacities for components with design decision variables.

Minimal capacity which needs to be reached for every investment period with commissioning. As the commisBinVar is coupled with commissioning var, constraint only sets minimal Capacity if component is commissioned. Therefore decommissioning of the component is possible without any constraints.

.. math::

\\text{capMin}^{comp}_{loc} \\cdot commisBin^{comp}_{loc,ip} \\leq  cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinOpVarSet

declareBinOpVarSet(
    esM,
    pyM,
    binaryOperationParameter=["partLoadMin"],
    binaryOperationSetName="operationBinVarSet",
)

Declare binary operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinaryDesignDecisionVars

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)

Declare binary variables [-] indicating if a component is considered at a location or not [-].

If a isBuiltFix parameter is given, the bounds are set to enforce

.. math:: bin^{comp}{loc} = \text{binFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareCapacityVars

declareCapacityVars(pyM)

Declare capacity variables.

.. math::

\\text{capMin}^{comp}_{loc} \\leq cap^{comp}_{loc} \\leq \\text{capMax}^{comp}_{loc}

If a capacityFix parameter is given, the bounds are set to enforce

.. math:: \text{cap}^{comp}{loc} = \text{capFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVarSet

declareCommissioningVarSet(pyM, esM)

Declare set for commissioning variables in the pyomo object for a modeling class.

The commissioning variable must be set for past investment periods (stock commissioning) and future/optimized investment periods

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVars

declareCommissioningVars(pyM, esM)

Declare commissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareComponentConstraints

declareComponentConstraints(esM, pyM)

Declare time independent and dependent constraints.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareContinuousDesignVarSet

declareContinuousDesignVarSet(pyM)

Declare set for continuous number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDecommissioningVars

declareDecommissioningVars(pyM, esM)

Declare decommissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignDecisionVarSet

declareDesignDecisionVarSet(pyM)

Declare set for design decision variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignVarSet

declareDesignVarSet(pyM, esM)

Declare set for capacity variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDiscreteDesignVarSet

declareDiscreteDesignVarSet(pyM)

Declare set for discrete number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareIntNumbersVars

declareIntNumbersVars(pyM)

Declare variables representing the (discrete/integer) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLocationComponentSet

declareLocationComponentSet(pyM)

Declare set with location and component in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpConstrSet1

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpConstrSet2

declareOpConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpConstrSet3

declareOpConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpConstrSet4

declareOpConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpConstrSetMinPartLoad

declareOpConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpVarSet

declareOpVarSet(esM, pyM)

Declare operation related sets (operation variables and mapping sets) in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationBinaryVars

declareOperationBinaryVars(
    pyM,
    opVarBinName="op_bin",
    opBinSetName="operationBinVarSet",
)

Declare binary operation variables.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationModeSets

declareOperationModeSets(
    pyM, constrSetName, rateMax, rateFix, rateMin=None
)

Declare operating mode sets.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrSetName: name of the constraint set. :type constrSetName: string

:param rateMax: attribute of the considered component which stores the maximum operation rate data. :type rateMax: string

:param rateMax: attribute of the considered component which stores the minimum operation rate data. :type rateMax: string

:param rateFix: attribute of the considered component which stores the fixed operation rate data. :type rateFix: string

declareOperationVars

declareOperationVars(
    pyM,
    esM,
    opVarName,
    opRateFixName="processedOperationRateFix",
    opRateMaxName="processedOperationRateMax",
    isOperationCommisYearDepending=False,
    flexibleConversion=False,
    relevanceThreshold=None,
)

Declare operation variables.

The following operation modes are directly handled during variable creation as bounds instead of constraints.

operation mode 4: If operationRateFix is given for components without a capacity variable, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

.. math:: op^{comp,opType}{loc,p,t} = \text{opRateFix}^{comp,opType}

operation mode 5: If operationRateMax is given for components without a capacity variable, the variables are bounded by operationRateMax, i.e. the operation [commodityUnit*h] is limited by a time series.

.. math:: op^{comp,opType}{loc,p,t} \leq \text{opRateMax}^{comp,opType}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

declarePathwaySets

declarePathwaySets(pyM, esM)

Declare set for capacity development in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareRealNumbersVars

declareRealNumbersVars(pyM)

Declare variables representing the (continuous) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareSets

declareSets(esM, pyM)

Declare sets: design variable sets, operation variable set and operation mode sets.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareVariables

declareVariables(
    esM, pyM, relaxIsBuiltBinary, relevanceThreshold
)

Declare design and operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relaxIsBuiltBinary: states if the optimization problem should be solved as a relaxed LP to get the lower bound of the problem. |br| * the default value is False :type declaresOptimizationProblem: boolean

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

declareYearlyFullLoadHoursMaxSet

declareYearlyFullLoadHoursMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursMinSet

declareYearlyFullLoadHoursMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

decommissioningConstraint

decommissioningConstraint(pyM, esM)

Declase the decommissioning after the technical lifetime from investment period of commissioning.

.. math::

decommis^{comp}_{loc,ip} = commis^{comp}_{loc,ip-\\mathrm{ipTechnicalLifetime}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

designBinFix

designBinFix(pyM)

Set, if applicable, the installed capacities of a component.

.. math::

bin^{comp}_{(loc_1,loc_2),ip} = \\text{binFix}^{comp}_{(loc_1,loc_2)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

designDevelopmentConstraint

designDevelopmentConstraint(pyM, esM)

Link the capacity development between investment periods.

For stochastic: The capacity design must be equal between the different years.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip}

For the development pathway, the capacity of an investment period is composed of the capacity of the previous investment periods and the commissioning and decommissioning in the current investment period.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

getBalanceLimitContribution

getBalanceLimitContribution(
    esM,
    pyM,
    ID,
    ip,
    loc,
    timeSeriesAggregation,
    componentNames,
)

Get contribution to balanceLimitConstraint (Further read in EnergySystemModel).

Sum of the operation time series of a Transmission component is used as the balanceLimit contribution:

  • If commodity is transferred out of region a negative sign is used.
  • If commodity is transferred into region a positive sign is used and losses are considered.

Sum of the operation time series of a Transmission component is used as the balanceLimit contribution:

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pym: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pym: pyomo ConcreteModel

:param ip: investment period of transformation path analysis. :type ip: int

:param ID: ID of the regarded balanceLimitConstraint :param ID: string

:param timeSeriesAggregation: states if the optimization of the energy system model should be done with

(a) the full time series (False) or
(b) clustered time series data (True).

:type timeSeriesAggregation: boolean

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param componentNames: Names of components which contribute to the balance limit :type componentNames: list

getCommodityBalanceContribution

getCommodityBalanceContribution(
    pyM, commod, loc, ip, p, t
)

Get contribution to a commodity balance.

.. math:: :nowrap:

\\begin{eqnarray*}
\\text{C}^{comp,comm}_{loc,ip,p,t} = & & \\underset{\\substack{(loc_{in},loc_{out}) \\in \\ \\mathcal{L}^{tans}: loc_{in}=loc}}{ \\sum } \\left(1-\\eta_{(loc_{in},loc_{out})} \\cdot I_{(loc_{in},loc_{out})} \\right) \\cdot op^{comp,op}_{(loc_{in},loc_{out}),ip,p,t} \\\\
    & - & \\underset{\\substack{(loc_{in},loc_{out}) \\in \\ \\mathcal{L}^{tans}:loc_{out}=loc}}{ \\sum } op^{comp,op}_{(loc_{in},loc_{out}),ip,p,t}
\\end{eqnarray*}

getEconomicsDesign

getEconomicsDesign(
    pyM,
    esM,
    factorNames,
    lifetimeAttr,
    varName,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set design dependent cost equations for the individual components. The equations will be set for all components of a modeling class and all locations.

Required arguments

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is "". :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal cost values.
- False: Return the cost equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total anualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getEconomicsOperation

getEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    dictName,
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step. In case of a two-dimensional component (e.g. a transmission component), the equations will be set for all possible connections between the defined locations.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries" :type fncType: string

:param factorNames: Strings of the time-dependent parameters that have to be multiplied within the equation. (e.g. ['opexPerOperation'] to multiply the operation variable with the costs for each operation). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total annualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getLocEconomicsDesign

getLocEconomicsDesign(
    pyM,
    esM,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
)

Set time-independent equation specified for one component in one location in one investment period.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

Default arguments:

:param ip: investment period :type ip: int

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is ''. :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getLocEconomicsOperation

getLocEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    getOptValue=False,
)

Set time-dependent cost functions for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries :type fncType: string

:param factorName: String of the time-dependent parameter that have to be multiplied within the equation. (e.g. 'commodityCostTimeSeries' to multiply the operation variable with the costs for each operation). :type factorNames: string

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

:param ip: investment period of transformation path analysis. :type ip: int

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getObjectiveFunctionContribution

getObjectiveFunctionContribution(esM, pyM)

Get contribution to the objective function.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

getOptimalValues

getOptimalValues(name='all', ip=0)

Return optimal values of the components.

:param name: name of the variables of which the optimal values should be returned:

  • '_capacityVariables',
  • '_isBuiltVariables',
  • '_operationVariablesOptimum',
  • 'all' or another input: all variables are returned.

|br| * the default value is 'all' :type name: string

:returns: a dictionary with the optimal values of the components :rtype: dict

getSharedPotentialContribution

getSharedPotentialContribution(pyM, key, loc, ip)

Get the share which the components of the modeling class have on a shared maximum potential at a location.

hasOpVariablesForLocationCommodity

hasOpVariablesForLocationCommodity(esM, loc, commod)

Check if the commodity´s transfer between a given location and the other locations of the energy system model is eligible.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param commod: Name of the regarded commodity (commodities are defined in the EnergySystemModel instance) :param commod: string

operationMode1

operationMode1(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    factorName=None,
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 1. The operation [commodityUnith] is limited by the installed capacity in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n An additional factor can limited the operation further.

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opFactor}^{opType} \\cdot cap^{comp}_{loc,ip}

operationMode1_2dim

operationMode1_2dim(
    pyM, esM, constrName, constrSetName, opVarName
)

Declare the constraint that the operation [commodityUnit*hour] is limited by the installed capacity [commodityUnit] multiplied by the hours per time step. Since the flow should either go in one direction or the other, the limitation can be enforced on the sum of the forward and backward flow over the line. This leads to one of the flow variables being set to zero if a basic solution is obtained during optimization.

.. math::

op^{comp,op}_{(loc_1,loc_2),ip,p,t} + op^{op}_{(loc_2,loc_1),ip,p,t} \\leq \\tau^{hours} \\cdot \\text{cap}^{comp}_{(loc_{in},loc_{out})}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

operationMode2

operationMode2(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateFix",
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 2.

The operation [commodityUnith] is equal to the installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opRateMax}^{comp,opType}_{loc,ip,p,t} \\cdot cap^{comp}_{loc,ip}

operationMode3

operationMode3(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMax",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 3.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationMode4

operationMode4(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMin",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 4.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

setOptimalValues

setOptimalValues(esM, pyM)

Set the optimal values of the components.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

stockCapacityConstraint

stockCapacityConstraint(pyM, esM)

Set the stock capacity constraint. The stock capacity is the sum of the stock commissioning, which do not exceed its technical lifetime.

For stochastic, the stock of past investment periods is not only valid for ip=0 but for all investment periods. .. math::

cap^{comp}_{loc,ip} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,0}

For capacity development, the stock is only considered for the first investment periods.

.. math::

cap^{comp}_{loc,0} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,0} - decommis^{comp}_{loc,0}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

stockCommissioningConstraint

stockCommissioningConstraint(pyM, esM)

Set commissioning variable for past investment periods. For past investment periods, where no stock commissioning is specified the commissioning variable is set to zero.

symmetricalCapacity

symmetricalCapacity(pyM)

Ensure that the capacity between location_1 and location_2 is the same as the one between location_2 and location_1.

.. math::

cap^{comp}_{(loc_1,loc_2)} = cap^{comp}_{(loc_2,loc_1)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

yearlyFullLoadHoursMax

yearlyFullLoadHoursMax(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a maximum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

yearlyFullLoadHoursMin

yearlyFullLoadHoursMin(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a minimum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

Storage

storage

Classes:

  • Storage

    A Storage component can store a commodity and thus transfers it between time steps.

  • StorageModel

    Instantly create a StorageModel class instance when a Storage class instance is initialized.

Storage

Storage(
    esM,
    name,
    commodity,
    chargeRate=1,
    dischargeRate=1,
    chargeEfficiency=1,
    dischargeEfficiency=1,
    selfDischarge=0,
    cyclicLifetime=None,
    stateOfChargeMin=0,
    stateOfChargeMax=1,
    hasCapacityVariable=True,
    capacityVariableDomain="continuous",
    capacityPerPlantUnit=1,
    hasIsBuiltBinaryVariable=False,
    bigM=None,
    doPreciseTsaModeling=False,
    chargeOpRateMax=None,
    chargeOpRateFix=None,
    chargeTsaWeight=1,
    dischargeOpRateMax=None,
    dischargeOpRateFix=None,
    dischargeTsaWeight=1,
    isPeriodicalStorage=False,
    locationalEligibility=None,
    capacityMin=None,
    capacityMax=None,
    partLoadMin=None,
    sharedPotentialID=None,
    linkedQuantityID=None,
    capacityFix=None,
    commissioningMin=None,
    commissioningMax=None,
    commissioningFix=None,
    isBuiltFix=None,
    investPerCapacity=0,
    investIfBuilt=0,
    opexPerChargeOperation=0,
    opexPerDischargeOperation=0,
    opexPerCapacity=0,
    opexIfBuilt=0,
    interestRate=0.08,
    economicLifetime=10,
    technicalLifetime=None,
    floorTechnicalLifetime=True,
    socOffsetDown=-1,
    socOffsetUp=-1,
    stockCommissioning=None,
    pwlcfParameters=None,
)

Bases: Component

A Storage component can store a commodity and thus transfers it between time steps.

Create a Storage class instance. The Storage component specific input arguments are described below. The general component input arguments are described in the Component class.

Required arguments:

:param commodity: to the component related commodity. :type commodity: string

Default arguments:

:param chargeRate: ratio of the maximum storage inflow (in commodityUnit/hour) to the storage capacity (in commodityUnit).

Example: * A hydrogen salt cavern which can store 133 GWh_H2_LHV can be charged 0.45 GWh_H2_LHV during one hour. The chargeRate thus equals 0.45/133 1/h.

|br| * the default value is 1

:type chargeRate: 0 < float

:param dischargeRate: ratio of the maximum storage outflow (in commodityUnit/hour) to the storage capacity (in commodityUnit).

Example: * A hydrogen salt cavern which can store 133 GWh_H2_LHV can be discharged 0.45 GWh_H2_LHV during one hour. The dischargeRate thus equals 0.45/133.

|br| * the default value is 1

:type dischargeRate: 0 < float

:param chargeEfficiency: defines the efficiency with which the storage can be charged (equals the percentage of the injected commodity that is transformed into stored commodity). Enter 0.98 for 98% etc. |br| * the default value is 1 :type chargeEfficiency: 0 <= float <=1

:param dischargeEfficiency: defines the efficiency with which the storage can be discharged (equals the percentage of the withdrawn commodity that is transformed into stored commodity). Enter 0.98 for 98% etc. |br| * the default value is 1 :type dischargeEfficiency: 0 <= float <=1

:param selfDischarge: percentage of self-discharge from the storage during one hour |br| * the default value is 0 :type selfDischarge: 0 <= float <=1

:param cyclicLifetime: if specified, the total number of full cycle equivalents that are supported by the technology.

Setting this parameter introduces a commissioning-dependent charge operation
variable with one entry per *(loc, compName, commis, ip, p, t)* tuple.
This can significantly increase the number of optimization variables and
constraints, especially for models with many investment periods or long
technical lifetimes, and may noticeably increase solver runtime.

The state of charge is tracked for the total installed capacity, not
per commissioning year. As a result, the optimizer may allocate charge to a
single commissioning year beyond what its commissioned capacity could
physically hold, as long as the aggregate SoC constraint is satisfied.

|br| * the default value is None

:type cyclicLifetime: None or positive float

:param stateOfChargeMin: threshold (percentage) that the state of charge can not drop under |br| * the default value is 0 :type stateOfChargeMax: * 0 <= float <=1 * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param stateOfChargeMax: threshold (percentage) that the state of charge can not exceed |br| * the default value is 1 :type stateOfChargeMax: * 0 <= float <=1 * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param doPreciseTsaModeling: determines whether the state of charge is limited precisely (True) or with a simplified method (False). The error is small if the selfDischarge is small. |br| * the default value is False :type doPreciseTsaModeling: boolean

:param chargeOpRateMax: if specified, indicates a maximum charging rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the charged commodity (before multiplying the charging efficiency) during one time step. |br| * the default value is None :type chargeOpRateMax: * None * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param chargeOpRateFix: if specified, indicates a fixed charging rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the charged commodity (before multiplying the charging efficiency) during one time step. |br| * the default value is None :type chargeOpRateFix: * None * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param chargeTsaWeight: weight with which the chargeOpRate (max/fix) time series of the component should be considered when applying time series aggregation. |br| * the default value is 1 :type chargeTsaWeight: positive (>= 0) float

:param dischargeOpRateMax: if specified, indicates a maximum discharging rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the discharged commodity (after multiplying the discharging efficiency) during one time step. |br| * the default value is None :type dischargeOpRateMax: * None * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param dischargeOpRateFix: if specified, indicates a fixed discharging rate for each location and each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the charged commodity (after multiplying the discharging efficiency) during one time step. |br| * the default value is None :type dischargeOpRateFix: * None * Pandas DataFrame with positive (>= 0) entries. The row indices have to match the in the energy system model specified time steps. The column indices have to match the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param dischargeTsaWeight: weight with which the dischargeOpRate (max/fix) time series of the component should be considered when applying time series aggregation. |br| * the default value is 1 :type dischargeTsaWeight: positive (>= 0) float

:param isPeriodicalStorage: indicates if the state of charge of the storage has to be at the same value after the end of each period. This is especially relevant when using daily periods where short term storage can be restrained to daily cycles. Benefits the run time of the model. |br| * the default value is False :type isPeriodicalStorage: boolean

:param opexPerChargeOperation: describes the cost for one unit of the charge operation. The cost which is directly proportional to the charge operation of the component is obtained by multiplying the opexPerChargeOperation parameter with the annual sum of the operational time series of the components. The opexPerChargeOperation can either be given as a float or a Pandas Series with location specific values or a dictionary per investment period with one of the two previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). |br| * the default value is 0 :type opexPerChargeOperation: positive (>=0) float or Pandas Series with positive (>=0) values or dict of positive (>=0) float or Pandas Series with positive (>=0) values per investment period. The indices of the series have to equal the in the energy system model specified locations.

:param opexPerDischargeOperation: describes the cost for one unit of the discharge operation. The cost which is directly proportional to the discharge operation of the component is obtained by multiplying the opexPerDischargeOperation parameter with the annual sum of the operational time series of the components. The opexPerDischargeOperation can either be given as a float or a Pandas Series with location specific values or a dictionary per investment period with one of the two previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). |br| * the default value is 0 :type opexPerDischargeOperation: * positive (>=0) float * Pandas Series with positive (>=0) values. The indices of the series have to equal the in the energy system model specified locations. * a dictionary with investment periods as keys and one of the two options above as values.

:param socOffsetDown: determines whether the state of charge at the end of a period p has to be equal to the one at the beginning of a period p+1 (socOffsetDown=-1) or if it can be smaller at the beginning of p+1 (socOffsetDown>=0). In the latter case, the product of the parameter socOffsetDown and the actual soc offset is used as a penalty factor in the objective function. |br| * the default value is -1 :type socOffsetDown: float

:param socOffsetUp: determines whether the state of charge at the end of a period p has to be equal to the one at the beginning of a period p+1 (socOffsetUp=-1) or if it can be larger at the beginning of p+1 (socOffsetUp>=0). In the latter case, the product of the parameter socOffsetUp and the actual soc offset is used as a penalty factor in the objective function. |br| * the default value is -1 :type socOffsetUp: float

Methods:

  • addToEnergySystemModel

    Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in

  • getDataForTimeSeriesAggregation

    Get the required data if a time series aggregation is requested.

  • getTSAOutput

    Return a reformatted time series data after applying time series aggregation, if the original time series

  • prepareTSAInput

    Format the time series data of a component to fit the requirements of the time series aggregation package and

  • setAggregatedTimeSeriesData

    Determine the aggregated maximum rate and the aggregated fixed operation rate for charging and discharging.

  • setTimeSeriesData

    Set the maximum operation rate and fixed operation rate for charging and discharging depending on whether a time series analysis is requested or not.

addToEnergySystemModel

addToEnergySystemModel(esM)

Add the component to an EnergySystemModel instance (esM). If the respective component class is not already in the esM, it is added as well.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

getDataForTimeSeriesAggregation

getDataForTimeSeriesAggregation(ip)

Get the required data if a time series aggregation is requested.

:param ip: investment period of transformation path analysis. :type ip: int

getTSAOutput

getTSAOutput(rate, rateName, data, ip)

Return a reformatted time series data after applying time series aggregation, if the original time series data is not None.

:param rate: Full (unclustered) time series data or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param data: Pandas DataFrame with the clustered time series data of all components in the energy system :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

:return: reformatted data or None :rtype: Pandas DataFrame

prepareTSAInput

prepareTSAInput(
    rate, rateName, rateWeight, weightDict, data, ip
)

Format the time series data of a component to fit the requirements of the time series aggregation package and return a list of formatted data.

:param rate: a fixed/maximum/minimum operation time series or None :type rate: Pandas DataFrame or None

:param rateName: name of the time series (to ensure uniqueness if a component has multiple relevant time series) :type rateName: string

:param rateWeight: weight of the time series in the clustering process :type rateWeight: positive float (>=0)

:param weightDict: dictionary to which the weight is added :type weightDict: dict

:param data: list to which the formatted data is added :type data: list of Pandas DataFrames

:param ip: investment period of transformation path analysis. :type ip: int

:return: data :rtype: Pandas DataFrame

setAggregatedTimeSeriesData

setAggregatedTimeSeriesData(data, ip)

Determine the aggregated maximum rate and the aggregated fixed operation rate for charging and discharging.

:param data: Pandas DataFrame with the clustered time series data of the source component :type data: Pandas DataFrame

:param ip: investment period of transformation path analysis. :type ip: int

setTimeSeriesData

setTimeSeriesData(hasTSA)

Set the maximum operation rate and fixed operation rate for charging and discharging depending on whether a time series analysis is requested or not.

:param hasTSA: states whether a time series aggregation is requested (True) or not (False). :type hasTSA: boolean

StorageModel

StorageModel()

Bases: ComponentModel

Instantly create a StorageModel class instance when a Storage class instance is initialized. It is used for the declaration of the sets, variables and constraints which are valid for the Storage class instance. These declarations are necessary for the modeling and optimization of the energy system model. The StorageModel class inherits from the ComponentModel class.

Create a StorageModel class instance.

Methods:

  • additionalMinPartLoad

    Set, if applicable, the minimal part load of a component.

  • bigM

    Enforce the consideration of the binary design variables of a component.

  • binaryOperation

    Create binary operation constraints for component operation.

  • capToNbInt

    Determine the components' capacities from the number of installed units.

  • capToNbReal

    Determine the components' capacities from the number of installed units.

  • capacityMinDec

    Enforce the consideration of minimum capacities for components with design decision variables.

  • chargeOpCommisSum

    Link total charge operation to the sum of commissioning-dependent charge operations (used when cyclic lifetime is set).

  • connectInterPeriodSOC

    Declare the constraint that the state of charge at the end of each period has to be equivalent to the state of

  • connectSOCs

    Declare the constraint for connecting the state of charge with the charge and discharge operation:

  • cyclicLifetime

    Declare the commissioning-dependent constraint limiting total lifetime charge throughput (used when cyclic lifetime is set).

  • cyclicState

    Declare the constraint for connecting the states of charge: the state of charge at the beginning of a period

  • declareBinOpVarSet

    Declare binary operation variables.

  • declareBinaryDesignDecisionVars

    Declare binary variables [-] indicating if a component is considered at a location or not [-].

  • declareCapacityVars

    Declare capacity variables.

  • declareCommissioningVarSet

    Declare set for commissioning variables in the pyomo object for a modeling class.

  • declareCommissioningVars

    Declare commissioning variable for capacity development of component.

  • declareComponentConstraints

    Declare time independent and dependent constraints.

  • declareContinuousDesignVarSet

    Declare set for continuous number of installed components in the pyomo object for a modeling class.

  • declareDecommissioningVars

    Declare decommissioning variable for capacity development of component.

  • declareDesignDecisionVarSet

    Declare set for design decision variables in the pyomo object for a modeling class.

  • declareDesignVarSet

    Declare set for capacity variables in the pyomo object for a modeling class.

  • declareDiscreteDesignVarSet

    Declare set for discrete number of installed components in the pyomo object for a modeling class.

  • declareIntNumbersVars

    Declare variables representing the (discrete/integer) number of installed components [-].

  • declareLocationComponentSet

    Declare set with location and component in the pyomo object for a modeling class.

  • declareOpConstrSet1

    Declare set of locations and components for which hasCapacityVariable is set to True and neither the

  • declareOpConstrSet2

    Declare set of locations and components for which hasCapacityVariable is set to True and a fixed

  • declareOpConstrSet3

    Declare set of locations and components for which hasCapacityVariable is set to True and a maximum

  • declareOpConstrSet4

    Declare set of locations and components for which hasCapacityVariable is set to True and a minimum

  • declareOpConstrSetMinPartLoad

    Declare set of locations and components for which partLoadMin is not None.

  • declareOpVarSet

    Declare operation related sets (operation variables and mapping sets) in the pyomo object for a

  • declareOperationBinaryVars

    Declare binary operation variables.

  • declareOperationModeSets

    Declare operating mode sets.

  • declareOperationVars

    Declare operation variables.

  • declarePathwaySets

    Declare set for capacity development in the pyomo object for a modeling class.

  • declareRealNumbersVars

    Declare variables representing the (continuous) number of installed components [-].

  • declareSets

    Declare sets: design variable sets, operation variable set, operation mode sets.

  • declareVariables

    Declare design and operation variables.

  • declareYearlyFullLoadHoursMaxSet

    Declare set of locations and components for which maximum yearly full load hours are given.

  • declareYearlyFullLoadHoursMinSet

    Declare set of locations and components for which minimum yearly full load hours are given.

  • decommissioningConstraint

    Declase the decommissioning after the technical lifetime from investment

  • designBinFix

    Set, if applicable, the installed capacities of a component.

  • designDevelopmentConstraint

    Link the capacity development between investment periods.

  • equalInterSOC

    Declare the constraint that, if periodic storage is selected, the states of charge between periods

  • getCommodityBalanceContribution

    Get contribution to a commodity balance.

  • getEconomicsDesign

    Set design dependent cost equations for the individual components. The equations will be set

  • getEconomicsOperation

    Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class

  • getLocEconomicsDesign

    Set time-independent equation specified for one component in one location in one investment period.

  • getLocEconomicsOperation

    Set time-dependent cost functions for the individual components. The equations will be set for all components

  • getObjectiveFunctionContribution

    Get contribution to the objective function.

  • getOptimalValues

    Return optimal values of the components.

  • getSharedPotentialContribution

    Get the share which the components of the modeling class have on a shared maximum potential at a location.

  • hasOpVariablesForLocationCommodity

    Check if operation variables exist in the modeling class at a location which are connected to a commodity.

  • limitSOCwithSimpleTsa

    Simplified version of the state of charge limitation control.

  • minSOC

    Declare the constraint that the state of charge [commodityUnit*h] has to be larger than the

  • minSOCwithTSAprecise

    Declare the constraint that the state of charge [commodityUnit*h] at each time step cannot be smaller

  • operationMode1

    Define operation mode 1. The operation [commodityUnit*h] is limited by the installed capacity in:\n

  • operationMode2

    Define operation mode 2.

  • operationMode3

    Define operation mode 3.

  • operationMode4

    Define operation mode 4.

  • operationModeSOC

    Declare the constraint that the state of charge [commodityUnit*h] is limited by the installed capacity

  • operationModeSOCwithTSA

    Declare the constraint that the state of charge [commodityUnit*h] is limited by the installed capacity

  • setOptimalValues

    Set the optimal values of the components.

  • stockCapacityConstraint

    Set the stock capacity constraint. The stock capacity is the sum of the stock

  • stockCommissioningConstraint

    Set commissioning variable for past investment periods. For past investment periods,

  • yearlyFullLoadHoursMax

    Limit the annual full load hours to a maximum value.

  • yearlyFullLoadHoursMin

    Limit the annual full load hours to a minimum value.

additionalMinPartLoad

additionalMinPartLoad(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opVarBinName,
    capVarName,
    isOperationCommisYearDepending=False,
)

Set, if applicable, the minimal part load of a component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

bigM

bigM(pyM)

Enforce the consideration of the binary design variables of a component.

.. math::

\\text{M}^{comp} \\cdot bin^{comp}_{loc,ip} \\geq commis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

binaryOperation

binaryOperation(
    pyM,
    constrName,
    constrSetName,
    binaryParameterName,
    opVarName,
    opVarBinName,
    isOperationCommisYearDepending=False,
)

Create binary operation constraints for component operation.

Defines two constraints linking a continuous operation variable to its corresponding binary variable using the Big-M formulation. Handles both standard and commissioning year-dependent cases.

The binaryOperation1 constraint is used to force the binary variable to one if the continuous variable is greater than zero.

The binaryOperation2 constraint ensures that the continuous variable is greater than zero whenever the binary variable is one. This is used for the upTimeMin and downTimeMin feature.

capToNbInt

capToNbInt(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbInt^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

capToNbReal

capToNbReal(pyM)

Determine the components' capacities from the number of installed units.

.. math::

cap^{comp}_{loc} = \\text{capPerUnit}^{comp} \\cdot nbReal^{comp}_{loc}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

capacityMinDec

capacityMinDec(pyM)

Enforce the consideration of minimum capacities for components with design decision variables.

Minimal capacity which needs to be reached for every investment period with commissioning. As the commisBinVar is coupled with commissioning var, constraint only sets minimal Capacity if component is commissioned. Therefore decommissioning of the component is possible without any constraints.

.. math::

\\text{capMin}^{comp}_{loc} \\cdot commisBin^{comp}_{loc,ip} \\leq  cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

chargeOpCommisSum

chargeOpCommisSum(pyM, esM)

Link total charge operation to the sum of commissioning-dependent charge operations (used when cyclic lifetime is set).

For each time step in each investment period, the aggregate charge operation variable equals the sum of commissioning-dependent charge operations over all active commissioning years:

.. math::

op^{comp,charge}_{loc,ip,p,t} = \sum_{commis} op^{comp,charge,commis}_{loc,commis,ip,p,t}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

connectInterPeriodSOC

connectInterPeriodSOC(pyM, esM)

Declare the constraint that the state of charge at the end of each period has to be equivalent to the state of charge of the period before it (minus its self discharge) plus the change in the state of charge which happened during the typical period which was assigned to that period.

.. math:: :nowrap:

\\begin{eqnarray*}
SoC^{inter}_{loc,ip,p+1} - SoC^{inter}_{loc,ip,p} \\cdot \\left( 1 - \\eta^{self-discharge} \\right)^{\\frac{t^{\\text{per period}} \\cdot \\tau^{hours}}{h}}
\\ SoC^{comp}_{loc,ip,map(p),t^{\\text{per period}}} = 0
\\end{eqnarray*}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

connectSOCs

connectSOCs(pyM, esM)

Declare the constraint for connecting the state of charge with the charge and discharge operation: the change in the state of charge between two points in time has to match the values of charging and discharging (considering the efficiencies of these processes) within the time step in between minus the self-discharge of the storage.

.. math:: :nowrap:

\\begin{eqnarray*}
SoC^{comp}_{loc,ip,p,t+1} - \\left( SoC^{comp}_{loc,ip,p,t} \\left( 1 - \\eta^{self-discharge} \\right)^{\\frac{\\tau^{hours}}{h}} + op^{comp,charge}_{loc,ip,p,t} \\eta^{charge} - op^{comp,discharge}_{loc,ip,p,t} / \\eta^{discharge} \\right) = 0
\\end{eqnarray*}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

cyclicLifetime

cyclicLifetime(pyM, esM)

Declare the commissioning-dependent constraint limiting total lifetime charge throughput (used when cyclic lifetime is set).

One constraint per commissioning year commis: the sum of charge operations over all investment periods in which that vintage is still active must not exceed the total cycle budget of the commissioned capacity:

.. math:: :nowrap:

\\begin{eqnarray*}
\\sum_{ip} \\sum_{(p,t)} op^{comp,charge,commis}_{loc,commis,ip,p,t} \\cdot freq_{ip}(p) \\cdot \\frac{\\Delta_{IP}}{\\tau^{years}}
\\leq commis^{comp}_{loc,commis} \\cdot \\left( \\text{SoC}^{max} - \\text{SoC}^{min} \\right) \\cdot t^{\\text{comp,cyclic lifetime}}
\\end{eqnarray*}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

cyclicState

cyclicState(pyM, esM)

Declare the constraint for connecting the states of charge: the state of charge at the beginning of a period has to be the same as the state of charge in the end of that period.

with full temporal resolution

.. math:: SoC^{comp}{loc,ip,0,0} = SoC^{comp}}

with time series aggregation:

.. math:: SoC^{inter}{loc,ip,0} = SoC^{inter}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

declareBinOpVarSet

declareBinOpVarSet(
    esM,
    pyM,
    binaryOperationParameter=["partLoadMin"],
    binaryOperationSetName="operationBinVarSet",
)

Declare binary operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareBinaryDesignDecisionVars

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)

Declare binary variables [-] indicating if a component is considered at a location or not [-].

If a isBuiltFix parameter is given, the bounds are set to enforce

.. math:: bin^{comp}{loc} = \text{binFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareCapacityVars

declareCapacityVars(pyM)

Declare capacity variables.

.. math::

\\text{capMin}^{comp}_{loc} \\leq cap^{comp}_{loc} \\leq \\text{capMax}^{comp}_{loc}

If a capacityFix parameter is given, the bounds are set to enforce

.. math:: \text{cap}^{comp}{loc} = \text{capFix}^{comp}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVarSet

declareCommissioningVarSet(pyM, esM)

Declare set for commissioning variables in the pyomo object for a modeling class.

The commissioning variable must be set for past investment periods (stock commissioning) and future/optimized investment periods

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareCommissioningVars

declareCommissioningVars(pyM, esM)

Declare commissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareComponentConstraints

declareComponentConstraints(esM, pyM)

Declare time independent and dependent constraints.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareContinuousDesignVarSet

declareContinuousDesignVarSet(pyM)

Declare set for continuous number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDecommissioningVars

declareDecommissioningVars(pyM, esM)

Declare decommissioning variable for capacity development of component.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignDecisionVarSet

declareDesignDecisionVarSet(pyM)

Declare set for design decision variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDesignVarSet

declareDesignVarSet(pyM, esM)

Declare set for capacity variables in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareDiscreteDesignVarSet

declareDiscreteDesignVarSet(pyM)

Declare set for discrete number of installed components in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareIntNumbersVars

declareIntNumbersVars(pyM)

Declare variables representing the (discrete/integer) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareLocationComponentSet

declareLocationComponentSet(pyM)

Declare set with location and component in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOpConstrSet1

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and neither the maximum nor the fixed operation rate is given.

declareOpConstrSet2

declareOpConstrSet2(pyM, constrSetName, rateFix)

Declare set of locations and components for which hasCapacityVariable is set to True and a fixed operation rate is given.

declareOpConstrSet3

declareOpConstrSet3(pyM, constrSetName, rateMax)

Declare set of locations and components for which hasCapacityVariable is set to True and a maximum operation rate is given.

declareOpConstrSet4

declareOpConstrSet4(pyM, constrSetName, rateMin)

Declare set of locations and components for which hasCapacityVariable is set to True and a minimum operation rate is given.

declareOpConstrSetMinPartLoad

declareOpConstrSetMinPartLoad(pyM, constrSetName)

Declare set of locations and components for which partLoadMin is not None.

declareOpVarSet

declareOpVarSet(esM, pyM)

Declare operation related sets (operation variables and mapping sets) in the pyomo object for a modeling class.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: EnergySystemModel instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationBinaryVars

declareOperationBinaryVars(
    pyM,
    opVarBinName="op_bin",
    opBinSetName="operationBinVarSet",
)

Declare binary operation variables.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareOperationModeSets

declareOperationModeSets(
    pyM, constrSetName, rateMax, rateFix, rateMin=None
)

Declare operating mode sets.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrSetName: name of the constraint set. :type constrSetName: string

:param rateMax: attribute of the considered component which stores the maximum operation rate data. :type rateMax: string

:param rateMax: attribute of the considered component which stores the minimum operation rate data. :type rateMax: string

:param rateFix: attribute of the considered component which stores the fixed operation rate data. :type rateFix: string

declareOperationVars

declareOperationVars(
    pyM,
    esM,
    opVarName,
    opRateFixName="processedOperationRateFix",
    opRateMaxName="processedOperationRateMax",
    isOperationCommisYearDepending=False,
    flexibleConversion=False,
    relevanceThreshold=None,
)

Declare operation variables.

The following operation modes are directly handled during variable creation as bounds instead of constraints.

operation mode 4: If operationRateFix is given for components without a capacity variable, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

.. math:: op^{comp,opType}{loc,p,t} = \text{opRateFix}^{comp,opType}

operation mode 5: If operationRateMax is given for components without a capacity variable, the variables are bounded by operationRateMax, i.e. the operation [commodityUnit*h] is limited by a time series.

.. math:: op^{comp,opType}{loc,p,t} \leq \text{opRateMax}^{comp,opType}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

declarePathwaySets

declarePathwaySets(pyM, esM)

Declare set for capacity development in the pyomo object for a modeling class.

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

declareRealNumbersVars

declareRealNumbersVars(pyM)

Declare variables representing the (continuous) number of installed components [-].

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareSets

declareSets(esM, pyM)

Declare sets: design variable sets, operation variable set, operation mode sets.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

declareVariables

declareVariables(
    esM, pyM, relaxIsBuiltBinary, relevanceThreshold
)

Declare design and operation variables.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param relaxIsBuiltBinary: states if the optimization problem should be solved as a relaxed LP to get the lower bound of the problem. |br| * the default value is False :type declaresOptimizationProblem: boolean

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

declareYearlyFullLoadHoursMaxSet

declareYearlyFullLoadHoursMaxSet(pyM)

Declare set of locations and components for which maximum yearly full load hours are given.

declareYearlyFullLoadHoursMinSet

declareYearlyFullLoadHoursMinSet(pyM)

Declare set of locations and components for which minimum yearly full load hours are given.

decommissioningConstraint

decommissioningConstraint(pyM, esM)

Declase the decommissioning after the technical lifetime from investment period of commissioning.

.. math::

decommis^{comp}_{loc,ip} = commis^{comp}_{loc,ip-\\mathrm{ipTechnicalLifetime}}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

designBinFix

designBinFix(pyM)

Set, if applicable, the installed capacities of a component.

.. math::

bin^{comp}_{(loc_1,loc_2),ip} = \\text{binFix}^{comp}_{(loc_1,loc_2)}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

designDevelopmentConstraint

designDevelopmentConstraint(pyM, esM)

Link the capacity development between investment periods.

For stochastic: The capacity design must be equal between the different years.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip}

For the development pathway, the capacity of an investment period is composed of the capacity of the previous investment periods and the commissioning and decommissioning in the current investment period.

.. math::

cap^{comp}_{loc,ip+1} =  cap^{comp}_{loc,ip} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

equalInterSOC

equalInterSOC(pyM, esM)

Declare the constraint that, if periodic storage is selected, the states of charge between periods have the same value.

.. math::

SoC^{comp,inter}_{ip,p} = SoC^{comp,inter}_{ip,p+1}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

getCommodityBalanceContribution

getCommodityBalanceContribution(
    pyM, commod, loc, ip, p, t
)

Get contribution to a commodity balance.

.. math::

\\text{C}^{comp,comm}_{loc,ip,p,t} = op^{comp,discharge}_{loc,ip,p,t} - op^{comp,charge}_{loc,ip,p,t}

getEconomicsDesign

getEconomicsDesign(
    pyM,
    esM,
    factorNames,
    lifetimeAttr,
    varName,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set design dependent cost equations for the individual components. The equations will be set for all components of a modeling class and all locations.

Required arguments

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is "". :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal cost values.
- False: Return the cost equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total anualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getEconomicsOperation

getEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    dictName,
    getOptValue=False,
    getOptValueCostType=TAC,
)

Set time-dependent equations for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step. In case of a two-dimensional component (e.g. a transmission component), the equations will be set for all possible connections between the defined locations.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries" :type fncType: string

:param factorNames: Strings of the time-dependent parameters that have to be multiplied within the equation. (e.g. ['opexPerOperation'] to multiply the operation variable with the costs for each operation). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

:param getOptValueCostType: the cost type can either be TAC (total annualized costs) or NPV (net present value) |br| * the default value is None. :type getOptValueCostType: string

getLocEconomicsDesign

getLocEconomicsDesign(
    pyM,
    esM,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    divisorName="",
    QPfactorNames=[],
    QPdivisorNames=[],
    getOptValue=False,
)

Set time-independent equation specified for one component in one location in one investment period.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

:param factorNames: Strings of the parameters that have to be multiplied within the equation. (e.g. ['processedInvestPerCapacity'] to multiply the capacity variable with the investment per each capacity unit). :type factorNames: list of strings

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'cap' for capacity variable). :type varName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

Default arguments:

:param ip: investment period :type ip: int

:param divisorName: String of the variable that is used as a divisor within the equation (e.g. 'CCF'). If the divisorName is an empty string, there is no division within the equation. |br| * the default value is ''. :type divisorName: string

:param QPfactorNames: Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. ['processedQPcostScale']) :type QPfactorNames: list of strings

:param QPdivisorNames: Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. ['QPbound']) :type QPdivisorNames: list of strings

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getLocEconomicsOperation

getLocEconomicsOperation(
    pyM,
    esM,
    fncType,
    factorNames,
    varName,
    loc,
    compName,
    ip,
    getOptValue=False,
)

Set time-dependent cost functions for the individual components. The equations will be set for all components of a modeling class and all locations as well as for each considered time step.

Required arguments:

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the components should be modeled. :type esM: esM - EnergySystemModel class instance

:param fncType: Function type, either "TD" or "TimeSeries :type fncType: string

:param factorName: String of the time-dependent parameter that have to be multiplied within the equation. (e.g. 'commodityCostTimeSeries' to multiply the operation variable with the costs for each operation). :type factorNames: string

:param varName: String of the variable that has to be multiplied within the equation (e.g. 'op' for operation variable). :type varName: string

:param dictName: String of the variable set (e.g. 'operationVarDict') :type dictName: string

:param loc: String of the location for which the equation should be set up. :type loc: string

:param compName: String of the component name for which the equation should be set up. :type compName: string

:param ip: investment period of transformation path analysis. :type ip: int

Default arguments:

:param getOptValue: Boolean that defines the output of the function:

- True: Return the optimal value.
- False: Return the equation.

|br| * the default value is False.

:type getoptValue: boolean

getObjectiveFunctionContribution

getObjectiveFunctionContribution(esM, pyM)

Get contribution to the objective function.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

getOptimalValues

getOptimalValues(name='all', ip=0)

Return optimal values of the components.

:param name: name of the variables of which the optimal values should be returned:

* 'capacityVariables',
* 'isBuiltVariables',
* 'chargeOperationVariablesOptimum',
* 'dischargeOperationVariablesOptimum',
* 'stateOfChargeOperationVariablesOptimum',
* 'all' or another input: all variables are returned.

For optimizations with several years also following values should be returned:
* '_commissioningVariablesOptimum'
* '_decommissioningVariablesOptimum'

|br| * the default value is 'all' :type name: string

:param ip: investment period |br| * the default value is 0 :type ip: int

:returns: a dictionary with the optimal values of the components :rtype: dict

getSharedPotentialContribution

getSharedPotentialContribution(pyM, key, loc, ip)

Get the share which the components of the modeling class have on a shared maximum potential at a location.

hasOpVariablesForLocationCommodity

hasOpVariablesForLocationCommodity(esM, loc, commod)

Check if operation variables exist in the modeling class at a location which are connected to a commodity.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param loc: Name of the regarded location (locations are defined in the EnergySystemModel instance) :type loc: string

:param commod: Name of the regarded commodity (commodities are defined in the EnergySystemModel instance) :param commod: string

limitSOCwithSimpleTsa

limitSOCwithSimpleTsa(pyM, esM)

Simplified version of the state of charge limitation control. The error compared to the precise version is small in cases of small selfDischarge.

.. math:: :nowrap:

\\begin{eqnarray*}
& & \\underline{SoC}^{comp,sup}_{loc,ip,p,t} \\geq \\text{SoC}^{min} \\cdot cap^{comp}_{loc,ip} \\\\
& & \\overline{SoC}^{comp,sup}_{loc,ip,p,t} \\leq \\text{SoC}^{max} \\cdot cap^{comp}_{loc,ip} \\\\
\\text{with } \\\\
& & \\underline{SoC}^{comp,sup}_{loc,ip,p,t} = SoC^{inter}_{loc,ip,p} \\cdot (1 - \\eta^{\\text{self-discharge}})^{\\frac{t^{\\text{per period}} \\cdot \\tau^{hours}}{h}}+ SoC^{min}_{loc,ip,map(p)} \\\\
& &\\overline{SoC}^{comp,sup}_{loc,ip,p,t} = SoC^{inter}_{loc,ip,p} + SoC^{max}_{loc,ip,map(p)}
\\end{eqnarray*}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

minSOC

minSOC(pyM)

Declare the constraint that the state of charge [commodityUnith] has to be larger than the installed capacity [commodityUnith] multiplied with the relative minimum state of charge.

.. math::

SoC^{comp,min} \\cdot cap^{comp}_{loc,ip} \\leq SoC^{comp}_{loc,ip,0,t}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

minSOCwithTSAprecise

minSOCwithTSAprecise(pyM, esM)

Declare the constraint that the state of charge [commodityUnith] at each time step cannot be smaller than the installed capacity [commodityUnith] multiplied with the relative minimum state of charge [-].

.. math::

\\text{SoC}^{min} \\cdot cap^{comp}_{loc,ip} \\leq SoC^{inter}_{loc,ip,p} \\cdot (1 - \\eta^{\\text{self-discharge}})^{\\frac{t \\cdot \\tau^{hours}}{h}} + SoC^{comp}_{loc,ip,map(p),t}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

operationMode1

operationMode1(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    factorName=None,
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 1. The operation [commodityUnith] is limited by the installed capacity in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n An additional factor can limited the operation further.

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opFactor}^{opType} \\cdot cap^{comp}_{loc,ip}

operationMode2

operationMode2(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateFix",
    *,
    isOperationCommisYearDepending=False,
)

Define operation mode 2.

The operation [commodityUnith] is equal to the installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math::

op^{comp,opType}_{loc,ip,p,t} \\leq \\tau^{hours} \\cdot \\text{opRateMax}^{comp,opType}_{loc,ip,p,t} \\cdot cap^{comp}_{loc,ip}

operationMode3

operationMode3(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMax",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 3.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationMode4

operationMode4(
    pyM,
    esM,
    constrName,
    constrSetName,
    opVarName,
    opRateName="processedOperationRateMin",
    *,
    isOperationCommisYearDepending=False,
    relevanceThreshold=None,
)

Define operation mode 4.

The operation [commodityUnith] is limited by an installed capacity multiplied with a time series in:\n * [commodityUnith] (for storages) or in * [commodityUnit] multiplied by the hours per time step (else).\n

.. math:: op^{comp,opType}{loc,ip,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}} \cdot cap^{comp}_{loc,ip

:param relevanceThreshold: Force operation parameters to be 0 if values are below the relevance threshold. |br| * the default value is None :type relevanceThreshold: float (>=0) or None

operationModeSOC

operationModeSOC(pyM, esM)

Declare the constraint that the state of charge [commodityUnith] is limited by the installed capacity [commodityUnith] and the relative maximum state of charge [-].

.. math::

SoC^{comp}_{loc,ip,0,t} \\leq \\text{SoC}^{comp,max} \\cdot cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

operationModeSOCwithTSA

operationModeSOCwithTSA(pyM, esM)

Declare the constraint that the state of charge [commodityUnit*h] is limited by the installed capacity

[commodityUnit*h] and the relative maximum state of charge [-].

.. math::

SoC^{inter}_{loc,ip,p} \\cdot (1 - \\eta^{\\text{self-discharge}})^{\\frac{t \\cdot \\tau^{hours}}{h}} + SoC^{comp}_{loc,ip,map(p),t} \\leq \\text{SoC}^{max} \\cdot cap^{comp}_{loc,ip}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

setOptimalValues

setOptimalValues(esM, pyM)

Set the optimal values of the components.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

stockCapacityConstraint

stockCapacityConstraint(pyM, esM)

Set the stock capacity constraint. The stock capacity is the sum of the stock commissioning, which do not exceed its technical lifetime.

For stochastic, the stock of past investment periods is not only valid for ip=0 but for all investment periods. .. math::

cap^{comp}_{loc,ip} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,ip} - decommis^{comp}_{loc,0}

For capacity development, the stock is only considered for the first investment periods.

.. math::

cap^{comp}_{loc,0} =  stockCap^{comp}_{loc} + commis^{comp}_{loc,0} - decommis^{comp}_{loc,0}

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param esM: energy system model containing general information. :type esM: EnergySystemModel instance from the FINE package

stockCommissioningConstraint

stockCommissioningConstraint(pyM, esM)

Set commissioning variable for past investment periods. For past investment periods, where no stock commissioning is specified the commissioning variable is set to zero.

yearlyFullLoadHoursMax

yearlyFullLoadHoursMax(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a maximum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str

yearlyFullLoadHoursMin

yearlyFullLoadHoursMin(
    pyM,
    esM,
    constrSetName,
    constrName,
    opVarName,
    isOperationCommisYearDepending=False,
)

Limit the annual full load hours to a minimum value.

:param esM: EnergySystemModel instance representing the energy system in which the component should be modeled. :type esM: esM - EnergySystemModel class instance

:param pyM: pyomo ConcreteModel which stores the mathematical formulation of the model. :type pyM: pyomo ConcreteModel

:param constrName: name for the constraint in esM.pyM :type constrName: str

:param constrSetName: name of the constraint set :type constrSetName: str

:param opVarName: name of the operation variables :type opVarName: str

:param isOperationCommisYearDepending: defines whether the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, varies over the transformation pathway :type isOperationCommisYearDepending: str