Component class

The Component class holds the basic data of a component and provides functions for adding the component to an EnergySystemModel class instance and clustering and specifying time series data. The ComponentModel class on the other hand specifies basic sets, variables, constraints and output functions for a collection of components.

Component class description:

class 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)[source]

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.

__init__(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)[source]

Constructor for creating an Component class instance.

Required arguments:

Parameters:
  • esM (EnergySystemModel instance from the FINE package) – energy system model to which the component should be added. Used for unit checks.

  • name (string) – 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).

  • hasCapacityVariable (boolean) –

    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.

Default arguments:

Parameters:
  • capacityVariableDomain (string ('continuous' or 'discrete')) – 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.
    * the default value is ‘continuous’

  • capacityPerPlantUnit (strictly positive float) – 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.
    * the default value is 1

  • hasIsBuiltBinaryVariable (boolean) –

    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).
    * the default value is False

  • bigM (None or strictly positive float) – 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • partLoadMin – if specified, indicates minimal part load of component.

  • sharedPotentialID (string) – 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%.
    * the default value is None

  • linkedQuantityID (string) – 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)
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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.
    * the default value is None

  • 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}


    * the default value is 0

  • 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}


    * the default value is 0

  • 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}


    * the default value is 0

  • 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}


    * the default value is 0

  • 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”.
    * the default value is 0, i.e. the problem is not quadratic.

  • 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.
    * the default value is 0.08

  • 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.
    * the default value is 10

  • 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.
    * the default value is None

  • yearlyFullLoadHoursMin – if specified, indicates the minimun yearly full load hours.
    * the default value is None

  • yearlyFullLoadHoursMax – if specified, indicates the maximum yearly full load hours.
    * the default value is None

  • 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.
    * the default value is None

  • modelingClass (a class inheriting from ComponentModeling) – to the Component connected modeling class.
    * the default value is ModelingClass

  • 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.

addToEnergySystemModel(esM)[source]

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

Parameters:

esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

prepareTSAInput(rate, rateName, rateWeight, weightDict, data, ip)[source]

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.

Parameters:
  • rate (Pandas DataFrame or None) – a fixed/maximum/minimum operation time series or None

  • rateName (string) – name of the time series (to ensure uniqueness if a component has multiple relevant time series)

  • rateWeight (positive float (>=0)) – weight of the time series in the clustering process

  • weightDict (dict) – dictionary to which the weight is added

  • data (list of Pandas DataFrames) – list to which the formatted data is added

  • ip (int) – investment period of transformation path analysis.

Returns:

data

Return type:

Pandas DataFrame

getTSAOutput(rate, rateName, data, ip)[source]

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

Parameters:
  • rate (Pandas DataFrame or None) – Full (unclustered) time series data or None

  • rateName (string) – name of the time series (to ensure uniqueness if a component has multiple relevant time series)

  • data (Pandas DataFrame) – Pandas DataFrame with the clustered time series data of all components in the energy system

  • ip (int) – investment period of transformation path analysis.

Returns:

reformatted data or None

Return type:

Pandas DataFrame

abstract setTimeSeriesData(hasTSA)[source]

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).

Parameters:

hasTSA (boolean) – indicates if time series aggregation should be considered for modeling

abstract getDataForTimeSeriesAggregation(ip)[source]

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.

Parameters:

ip (int) – investment period of transformation path analysis.

abstract setAggregatedTimeSeriesData(data, ip)[source]

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

Parameters:
  • data (Pandas DataFrame) – time series data

  • ip (int) – investment period of transformation path analysis.

abstract checkProcessedDataSets()[source]

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). Check aggregated time series data after applying time series aggregation. If all entries of dictionary are None the parameter itself is set to None.

Inheritance diagram:

Inheritance diagram of Component

ComponentModel class description:

class component.ComponentModel[source]

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.

declareCommissioningVarSet(pyM, esM)[source]

Declare set for commisioning 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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareDesignVarSet(pyM, esM)[source]

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareLocationComponentSet(pyM)[source]

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declarePathwaySets(pyM, esM)[source]

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareContinuousDesignVarSet(pyM)[source]

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareDiscreteDesignVarSet(pyM)[source]

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declareDesignDecisionVarSet(pyM)[source]

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareOpVarSet(esM, pyM)[source]

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

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declareOpConstrSet1(pyM, constrSetName, rateMax, rateFix)[source]

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(pyM, constrSetName, rateFix)[source]

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

declareOpConstrSet3(pyM, constrSetName, rateMax)[source]

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

declareOpConstrSet4(pyM, constrSetName, rateMin)[source]

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

declareOpConstrSetMinPartLoad(pyM, constrSetName)[source]

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

declareOperationModeSets(pyM, constrSetName, rateMax, rateFix, rateMin=None)[source]

Declare operating mode sets.

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • constrSetName (string) – name of the constraint set.

  • rateMax (string) – attribute of the considered component which stores the maximum operation rate data.

  • rateMax – attribute of the considered component which stores the minimum operation rate data.

  • rateFix (string) – attribute of the considered component which stores the fixed operation rate data.

declareYearlyFullLoadHoursMinSet(pyM)[source]

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

declareYearlyFullLoadHoursMaxSet(pyM)[source]

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

declareCapacityVars(pyM)[source]

Declare capacity variables.

\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

\text{cap}^{comp}_{loc} = \text{capFix}^{comp}_{loc}

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareCommissioningVars(pyM, esM)[source]

Declare commissioning variable for capacity development of component.

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareDecommissioningVars(pyM, esM)[source]

Declare decommissioning variable for capacity development of component.

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

declareRealNumbersVars(pyM)[source]

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declareIntNumbersVars(pyM)[source]

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declareBinaryDesignDecisionVars(pyM, relaxIsBuiltBinary)[source]

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

bin^{comp}_{loc} = \text{binFix}^{comp}_{loc}

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

declareOperationVars(pyM, esM, opVarName, opRateFixName='processedOperationRateFix', opRateMaxName='processedOperationRateMax', isOperationCommisYearDepending=False, relevanceThreshold=None)[source]

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, the variables are fixed with operationRateFix, i.e. the operation [commodityUnit*h] is equal to a time series.

op^{comp,opType}_{loc,p,t} = \text{opRateFix}^{comp,opType}_{loc,p,t}

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

op^{comp,opType}_{loc,p,t} \leq \text{opRateMax}^{comp,opType}_{loc,p,t}

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • relevanceThreshold (float (>=0) or None) – Force operation parameters to be 0 if values are below the relevance threshold.
    * the default value is None

  • isOperationCommisYearDepending (str) – defines weather the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, variates over the transformation pathway

declareOperationBinaryVars(pyM, opVarBinName)[source]

Declare operation Binary variables. Discrete decicion between on and off.

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

capToNbReal(pyM)[source]

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

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

capToNbInt(pyM)[source]

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

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

bigM(pyM)[source]

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

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

capacityMinDec(pyM)[source]

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.

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

capacityFix(pyM, esM)[source]

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

cap^{comp}_{(loc_1,loc_2),ip} = \text{capFix}^{comp}_{(loc_1,loc_2)}

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

designBinFix(pyM)[source]

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

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

designDevelopmentConstraint(pyM, esM)[source]

Link the capacity development between investment periods.

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

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.

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

stockCapacityConstraint(pyM, esM)[source]

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.

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

stockCommissioningConstraint(pyM, esM)[source]

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

decommissioningConstraint(pyM, esM)[source]

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

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

operationMode1(pyM, esM, constrName, constrSetName, opVarName, factorName=None, isStateOfCharge=False, isOperationCommisYearDepending=False)[source]

Define operation mode 1. The operation [commodityUnit*h] is limited by the installed capacity in:

  • [commodityUnit*h] (for storages) or in

  • [commodityUnit] multiplied by the hours per time step (else).

An additional factor can limited the operation further.

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

operationMode2(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateFix', isStateOfCharge=False, isOperationCommisYearDepending=False)[source]

Define operation mode 2. The operation [commodityUnit*h] is equal to the installed capacity multiplied with a time series in:

  • [commodityUnit*h] (for storages) or in

  • [commodityUnit] multiplied by the hours per time step (else).

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(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateMax', isStateOfCharge=False, isOperationCommisYearDepending=False, relevanceThreshold=None)[source]

Define operation mode 3. The operation [commodityUnit*h] is limited by an installed capacity multiplied with a time series in:

  • [commodityUnit*h] (for storages) or in

  • [commodityUnit] multiplied by the hours per time step (else).

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

Parameters:

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

operationMode4(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateMin', isStateOfCharge=False, isOperationCommisYearDepending=False, relevanceThreshold=None)[source]

Define operation mode 4. The operation [commodityUnit*h] is limited by an installed capacity multiplied with a time series in:

  • [commodityUnit*h] (for storages) or in

  • [commodityUnit] multiplied by the hours per time step (else).

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

Parameters:

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

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

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

Parameters:

pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

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

Limit the annual full load hours to a minimum value.

Parameters:
  • esM (esM - EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • constrName (str) – name for the constraint in esM.pyM

  • constrSetName (str) – name of the constraint set

  • opVarName (str) – name of the operation variables

  • isOperationCommisYearDepending (str) – defines weather the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, variates over the transformation pathway

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

Limit the annual full load hours to a maximum value.

Parameters:
  • esM (esM - EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • constrName (str) – name for the constraint in esM.pyM

  • constrSetName (str) – name of the constraint set

  • opVarName (str) – name of the operation variables

  • isOperationCommisYearDepending (str) – defines weather the operation variable is depending on the year of commissioning of the component. E.g. relevant if the commodity conversion, for example the efficiency, variates over the transformation pathway

abstract declareSets(esM, pyM)[source]

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

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

abstract declareVariables(esM, pyM, relevanceThreshold)[source]

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

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • relevanceThreshold (float (>=0) or None) – Force operation parameters to be 0 if values are below the relevance threshold.
    * the default value is None

abstract declareComponentConstraints(esM, pyM)[source]

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

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

abstract hasOpVariablesForLocationCommodity(esM, loc, commod)[source]

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

Parameters:
  • esM (esM - EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • loc (string) – name of the regarded location (locations are defined in the EnergySystemModel instance)

  • commod – name of the regarded commodity (commodities are defined in the EnergySystemModel instance)

  • commod – string

abstract getCommodityBalanceContribution(pyM, commod, loc, ip, p, t)[source]

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

getObjectiveFunctionContribution(esM, pyM)[source]

Get contribution to the objective function.

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

getSharedPotentialContribution(pyM, key, loc, ip)[source]

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

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

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

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

  • factorNames (list of strings) – 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).

  • varName (string) – String of the variable that has to be multiplied within the equation (e.g. ‘cap’ for capacity variable).

  • divisorName (string) – 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.
    * the default value is “”.

  • QPfactorNames (list of strings) – Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. [‘processedQPcostScale’])

  • QPdivisorNames (list of strings) – Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. [‘QPbound’])

  • getOptValue

    Boolean that defines the output of the function:

    • True: Return the optimal cost values.

    • False: Return the cost equation.


    * the default value is False.

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

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

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

Required arguments:

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (EnergySystemModel instance from the FINE package) – energy system model containing general information.

  • factorNames (list of strings) – 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).

  • varName (string) – String of the variable that has to be multiplied within the equation (e.g. ‘cap’ for capacity variable).

  • loc (string) – String of the location for which the equation should be set up.

  • compName (string) – String of the component name for which the equation should be set up.

Default arguments:

Parameters:
  • ip (int) – investment period

  • divisorName (string) – 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.
    * the default value is ‘’.

  • QPfactorNames (list of strings) – Strings of the parameters that have to be multiplied when quadratic programming is used. (e.g. [‘processedQPcostScale’])

  • QPdivisorNames (list of strings) – Strings of the parameters that have to be used as divisors when quadratic programming is used. (e.g. [‘QPbound’])

  • getOptValue

    Boolean that defines the output of the function:

    • True: Return the optimal value.

    • False: Return the equation.


    * the default value is False.

getEconomicsOperation(pyM, esM, fncType, factorNames, varName, dictName, getOptValue=False, getOptValueCostType='TAC')[source]

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:

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (esM - EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the components should be modeled.

  • fncType (string) – Function type, either “TD” or “TimeSeries”

  • factorNames (list of strings) – 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).

  • varName (string) – String of the variable that has to be multiplied within the equation (e.g. ‘op’ for operation variable).

  • dictName (string) – String of the variable set (e.g. ‘operationVarDict’)

Default arguments:

Parameters:
  • getOptValue

    Boolean that defines the output of the function:

    • True: Return the optimal value.

    • False: Return the equation.


    * the default value is False.

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

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

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:

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • esM (esM - EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the components should be modeled.

  • fncType (string) – Function type, either “TD” or “TimeSeries

  • 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).

  • varName (string) – String of the variable that has to be multiplied within the equation (e.g. ‘op’ for operation variable).

  • dictName (string) – String of the variable set (e.g. ‘operationVarDict’)

  • loc (string) – String of the location for which the equation should be set up.

  • compName (string) – String of the component name for which the equation should be set up.

  • ip (int) – investment period of transformation path analysis.

Default arguments:

Parameters:

getOptValue

Boolean that defines the output of the function:

  • True: Return the optimal value.

  • False: Return the equation.


* the default value is False.

setOptimalValues(esM, pyM, indexColumns, plantUnit, unitApp='')[source]

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

Parameters:
  • esM (EnergySystemModel instance) – EnergySystemModel instance representing the energy system in which the components are modeled.

  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.

  • ip (int) – investment period of transformation path analysis.

  • indexColumns (set) – 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.

  • plantUnit (string) – 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).

Default arguments

Parameters:

unitApp (string) – string which appends the capacity unit in the optimization summary. For example, for the StorageModel class, the parameter is set to ‘*h’.
* the default value is ‘’.

Returns:

summary of the optimized values.

Return type:

pandas DataFrame

getOptimalValues(name='all', ip=0)[source]

Return optimal values of the components.

Parameters:
  • name (string) –

    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.

  • ip (int) – investment period of transformation path analysis.
    * the default value is 0

Returns:

a dictionary with the optimal values of the components

Return type:

dict

Inheritance diagram:

Inheritance diagram of ComponentModel