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, isBuiltFix=None, investPerCapacity=0, investIfBuilt=0, opexPerCapacity=0, opexIfBuilt=0, QPcostScale=0, interestRate=0.08, economicLifetime=10, technicalLifetime=None, yearlyFullLoadHoursMin=None, yearlyFullLoadHoursMax=None)[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, isBuiltFix=None, investPerCapacity=0, investIfBuilt=0, opexPerCapacity=0, opexIfBuilt=0, QPcostScale=0, interestRate=0.08, economicLifetime=10, technicalLifetime=None, yearlyFullLoadHoursMin=None, yearlyFullLoadHoursMax=None)[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 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 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 then 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
  • 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 built capacities of the component (in the physicalUnit of the component) with the investPerCapacity factor. 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))


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


    * 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 capacity of the component at a location with the opexPerCapacity factor. 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))


    * the default value is 0

  • opexIfBuilt

    a capacity-independent annual operational cost which only arises in a location if a component is built at that location. 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).


    * 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 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 default value is 10
  • technicalLifetime – technical lifetime of the component which is considered for computing the stocks.
    * the default value is None
  • yearlyFullLoadHoursMin – if specified, indicates the maximum yearly full load hours.
    * the default value is None
  • yearlyFullLoadHoursMax – if specified, indicates the maximum yearly full load hours.
    * the default value is None
  • modelingClass (a class inheriting from ComponentModeling) – to the Component connected modeling class.
    * the default value is ModelingClass
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(rateFix, rateMax, rateName, rateWeight, weightDict, data)[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:
  • rateFix (Pandas DataFrame or None) – a fixed operation time series or None
  • rateMax (Pandas DataFrame of None) – a maximum 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
Returns:

data

Return type:

Pandas DataFrame

getTSAOutput(rate, rateName, data)[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
Returns:

reformatted data or None

Return type:

Pandas DataFrame

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
getDataForTimeSeriesAggregation()[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.

setAggregatedTimeSeriesData(data)[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

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.

declareDesignVarSet(pyM)[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.
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.
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.
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.
declareOperationBinarySet(pyM)[source]

Declare operation related sets for binary decicion variables (operation variables) in the pyomo object for a modeling class. This reflects an on/off decision for the regarding component.

Parameters: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, rateFix)[source]

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

declareOpConstrSet5(pyM, constrSetName, rateMax)[source]

Declare set of locations and components for which hasCapacityVariable is set to False and a maximum 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, partLoadMin=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.
  • 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}

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
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 [-].

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
declareOperationVars(pyM, opVarName)[source]

Declare operation variables.

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
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.
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} \geq cap^{comp}_{loc}

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.

\text{capMin}^{comp}_{loc} \cdot bin^{comp}_{loc} \leq  cap^{comp}_{loc}

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
capacityFix(pyM)[source]

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

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

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
designBinFix(pyM)[source]

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

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

Parameters:pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
operationMode1(pyM, esM, constrName, constrSetName, opVarName, factorName=None, isStateOfCharge=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,p,t} \leq \tau^{hours} \cdot \text{opFactor}^{opType} \cdot cap^{comp}_{loc}

operationMode2(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateFix', isStateOfCharge=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,p,t} \leq \tau^{hours} \cdot \text{opRateMax}^{comp,opType}_{loc,p,t} \cdot cap^{comp}_{loc}

operationMode3(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateMax', isStateOfCharge=False)[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,p,t} = \tau^{hours} \cdot \text{opRateFix}^{comp,opType}_{loc,p,t} \cdot cap^{comp}_{loc}

operationMode4(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateFix')[source]

Define operation mode 4. The operation [commodityUnit*h] is equal to a time series in.

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

operationMode5(pyM, esM, constrName, constrSetName, opVarName, opRateName='processedOperationRateMax')[source]

Define operation mode 4. The operation [commodityUnit*h] is limited by a time series.

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

additionalMinPartLoad(pyM, esM, constrName, constrSetName, opVarName, opVarBinName, capVarName)[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)[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.
yearlyFullLoadHoursMax(pyM, esM)[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.
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.
declareVariables(esM, pyM)[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.
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.
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
getCommodityBalanceContribution(pyM, commod, loc, 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]

Abstract method which has to be implemented by subclasses (otherwise a NotImplementedError raises). 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)[source]

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

getLocEconomicsTD(pyM, esM, factorNames, varName, loc, compName, getOptValue=False)[source]

Set time-dependent equation specified for one component in one location or one connection between two 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.
  • 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).
  • loc (string) – String of the location or of the connection between two locations (e.g. for transmission components) 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:getOptValue – Boolean that defines the output of the function: - True: Return the optimal value. - False: Return the equation.
* the default value is False.
getLocEconomicsTI(pyM, factorNames, varName, loc, compName, divisorName='', QPfactorNames=[], QPdivisorNames=[], getOptValue=False)[source]

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

Required arguments:

Parameters:
  • pyM (pyomo ConcreteModel) – pyomo ConcreteModel which stores the mathematical formulation of the model.
  • factorNames (list of strings) – Strings of the parameters that have to be multiplied within the equation. (e.g. [‘investPerCapacity’] 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:
  • 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. [‘QPcostScale’])
  • 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.
getEconomicsTI(pyM, factorNames, varName, divisorName='', QPfactorNames=[], QPdivisorNames=[], getOptValue=False)[source]

Set time-independent 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.
  • factorNames (list of strings) – Strings of the parameters that have to be multiplied within the equation. (e.g. [‘investPerCapacity’] 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. [‘QPcostScale’])
  • 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.
getEconomicsTD(pyM, esM, factorNames, varName, dictName, getOptValue=False)[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.
  • 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.
getLocEconomicsTimeSeries(pyM, esM, factorName, varName, loc, compName, 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.
  • 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.

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.
getEconomicsTimeSeries(pyM, esM, factorName, varName, dictName, getOptValue=False)[source]

Adds 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 all considered time steps.

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

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.
  • 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')[source]

Return optimal values of the components.

Parameters:name – name of the variables of which the optimal values should be returned:
  • ‘capacityVariablesOptimum’,
  • ‘isBuiltVariablesOptimum’,
  • ‘operationVariablesOptimum’,
  • ‘all’ or another input: all variables are returned.

Inheritance diagram:

Inheritance diagram of ComponentModel