Conversion class

Conversion components convert commodities into each other.

Conversion class description:

class conversion.Conversion(esM, name, physicalUnit, commodityConversionFactors, hasCapacityVariable=True, capacityVariableDomain='continuous', capacityPerPlantUnit=1, linkedConversionCapacityID=None, hasIsBuiltBinaryVariable=False, bigM=None, operationRateMax=None, operationRateFix=None, tsaWeight=1, locationalEligibility=None, capacityMin=None, capacityMax=None, partLoadMin=None, sharedPotentialID=None, linkedQuantityID=None, capacityFix=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)[source]

A Conversion component converts commodities into each other.

Last edited: November 12 2020
@author: FINE Developer Team (FZJ IEK-3)

__init__(esM, name, physicalUnit, commodityConversionFactors, hasCapacityVariable=True, capacityVariableDomain='continuous', capacityPerPlantUnit=1, linkedConversionCapacityID=None, hasIsBuiltBinaryVariable=False, bigM=None, operationRateMax=None, operationRateFix=None, tsaWeight=1, locationalEligibility=None, capacityMin=None, capacityMax=None, partLoadMin=None, sharedPotentialID=None, linkedQuantityID=None, capacityFix=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)[source]

Constructor for creating an Conversion class instance. Capacities are 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:

Parameters:
  • physicalUnit (string) – reference physical unit of the plants to which maximum capacity limitations, cost parameters and the operation time series refer to.
  • commodityConversionFactors (dictionary, assigns commodities (string) to a conversion factors (float, pandas.Series or pandas.DataFrame)) –

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

Default arguments:

Parameters:
  • linkedConversionCapacityID (string) – if specifies, indicates that all conversion components with the same ID have to have the same capacity.
    * the default value is None
  • operationRateMax (None or 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.) – if specified, indicates a maximum operation rate for each location and each time 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 physicalUnit of the plant for each time step.
    * the default value is None
  • operationRateFix (None or 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.) – if specified, indicates a fixed operation rate for each location and each time 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 physicalUnit of the plant for each time step.
    * the default value is None
  • tsaWeight (positive (>= 0) float) – weight with which the time series of the component should be considered when applying time series aggregation.
    * the default value is 1
  • opexPerOperation (positive (>=0) float or Pandas Series with positive (>=0) values. The indices of the series have to equal the in the energy system model specified locations.) – 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).
    * the default value is 0
addToEnergySystemModel(esM)[source]

Function for adding a conversion component to the given energy system model

Parameters:esM (EnergySystemModel class instance) – EnergySystemModel instance representing the energy system in which the component should be modeled.
setTimeSeriesData(hasTSA)[source]

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

Parameters:hasTSA (boolean) – states whether a time series aggregation is requested (True) or not (False).
getDataForTimeSeriesAggregation()[source]

Function for getting the required data if a time series aggregation is requested.

setAggregatedTimeSeriesData(data)[source]

Function for determining the aggregated maximum rate and the aggregated fixed operation rate.

Parameters:data (Pandas DataFrame) – Pandas DataFrame with the clustered time series data of the conversion component

Inheritance diagram:

Inheritance diagram of Conversion

ConversionModel class description:

class conversion.ConversionModel[source]

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.

declareLinkedCapacityDict(pyM)[source]

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

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

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

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.
declareVariables(esM, pyM, relaxIsBuiltBinary)[source]

Declare design and operation variables

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

Ensure that all Conversion components with the same linkedConversionCapacityID have the same capacity

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

Declare time independent and dependent constraints

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.
getSharedPotentialContribution(pyM, key, loc)[source]

Get contributions to shared location potential.

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]

Get contribution to a commodity balance.

\text{C}^{comp,comm}_{loc,p,t} =  \text{conversionFactor}^{comp}_{comm} \cdot op_{loc,p,t}^{comp,op}

getObjectiveFunctionContribution(esM, pyM)[source]

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

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

Set the optimal values of the components.

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.
getOptimalValues(name='all')[source]

Return optimal values of the components.

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


* the default value is ‘all’ :type name: string

Returns:a dictionary with the optimal values of the components
Return type:dict

Inheritance diagram:

Inheritance diagram of ConversionModel