Transmission class

Transmission components transmit commodities between locations.

Transmission class description:

class transmission.Transmission(esM, name, commodity, losses=0, distances=None, hasCapacityVariable=True, capacityVariableDomain='continuous', capacityPerPlantUnit=1, hasIsBuiltBinaryVariable=False, bigM=None, operationRateMax=None, operationRateFix=None, tsaWeight=1, locationalEligibility=None, capacityMin=None, capacityMax=None, partLoadMin=None, sharedPotentialID=None, linkedQuantityID=None, capacityFix=None, commissioningMin=None, commissioningMax=None, commissioningFix=None, isBuiltFix=None, investPerCapacity=0, investIfBuilt=0, opexPerOperation=0, opexPerCapacity=0, opexIfBuilt=0, QPcostScale=0, interestRate=0.08, economicLifetime=10, technicalLifetime=None, floorTechnicalLifetime=True, balanceLimitID=None, pathwayBalanceLimitID=None, stockCommissioning=None)[source]

A Transmission component can transmit a commodity between locations of the energy system.

__init__(esM, name, commodity, losses=0, distances=None, hasCapacityVariable=True, capacityVariableDomain='continuous', capacityPerPlantUnit=1, hasIsBuiltBinaryVariable=False, bigM=None, operationRateMax=None, operationRateFix=None, tsaWeight=1, locationalEligibility=None, capacityMin=None, capacityMax=None, partLoadMin=None, sharedPotentialID=None, linkedQuantityID=None, capacityFix=None, commissioningMin=None, commissioningMax=None, commissioningFix=None, isBuiltFix=None, investPerCapacity=0, investIfBuilt=0, opexPerOperation=0, opexPerCapacity=0, opexIfBuilt=0, QPcostScale=0, interestRate=0.08, economicLifetime=10, technicalLifetime=None, floorTechnicalLifetime=True, balanceLimitID=None, pathwayBalanceLimitID=None, stockCommissioning=None)[source]

Constructor for creating an Transmission class instance. The Transmission component specific input arguments are described below. The general component input arguments are described in the Component class.

Required arguments:

Parameters:

commodity (string) – to the component related commodity.

Default arguments:

Parameters:
  • losses (positive float (0 <= float <= 1) or Pandas DataFrame with positive values (0 <= float <= 1). The row and column indices of the DataFrame have to equal the in the energy system model specified locations.) –

    relative losses per lengthUnit (lengthUnit as specified in the energy system model) in percentage of the commodity flow. This loss factor can capture simple linear losses

    trans_{in, ij} = (1 - \text{losses} \cdot \text{distances}) \cdot trans_{out, ij}

    (with trans being the commodity flow at a certain point in time and i and j being locations in the energy system). The losses can either be given as a float or a Pandas DataFrame with location specific values.
    * the default value is 0

  • distances (positive float (>= 0) or Pandas DataFrame with positive values (>= 0). The row and column indices of the DataFrame have to equal the in the energy system model specified locations.) – distances between locations given in the lengthUnit (lengthUnit as specified in the energy system model).
    * the default value is None

  • operationRateMax – if specified, indicates a maximum operation rate for all possible connections (both directions) of the transmission component at each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the transmitted commodity (before considering losses) during one time step.
    * the default value is None

  • operationRateFix – if specified, indicates a fixed operation rate for all possible connections (both directions) of the transmission component at each time step, if required also for each investment period, by a positive float. If hasCapacityVariable is set to True, the values are given relative to the installed capacities (i.e. a value of 1 indicates a utilization of 100% of the capacity). If hasCapacityVariable is set to False, the values are given as absolute values in form of the commodityUnit, referring to the transmitted commodity (before considering losses) during one time step.
    * 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 – describes the cost for one unit of the operation. The cost which is directly proportional to the operation of the component is obtained by multiplying the opexPerOperation parameter with the annual sum of the operational time series of the components. The opexPerOperation can either be given as a float or a Pandas DataFrame with location specific values or a dictionary per investment period with one of the previous options. The cost unit in which the parameter is given has to match the one specified in the energy system model (e.g. Euro, Dollar, 1e6 Euro). The value has to match the unit costUnit/operationUnit (e.g. Euro/kWh, Dollar/kWh).
    * the default value is 0

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

  • pathwayBalanceLimitID (string) – similar to balanceLimitID just as restriction over the entire pathway.
    * the default value is None

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

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

Parameters:

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

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

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

checkProcessedDataSets()[source]

Check processed 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 Transmission

TransmissionModel class description:

class transmission.TransmissionModel[source]

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

declareSets(esM, pyM)[source]

Declare sets: design variable sets, operation variable set and operation mode sets.

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, relevanceThreshold)[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.

  • relaxIsBuiltBinary – states if the optimization problem should be solved as a relaxed LP to get the lower bound of the problem.
    * the default value is False

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

symmetricalCapacity(pyM)[source]

Ensure that the capacity between location_1 and location_2 is the same as the one between location_2 and location_1.

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

Parameters:

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

operationMode1_2dim(pyM, esM, constrName, constrSetName, opVarName)[source]

Declare the constraint that the operation [commodityUnit*hour] is limited by the installed capacity [commodityUnit] multiplied by the hours per time step. Since the flow should either go in one direction or the other, the limitation can be enforced on the sum of the forward and backward flow over the line. This leads to one of the flow variables being set to zero if a basic solution is obtained during optimization.

op^{comp,op}_{(loc_1,loc_2),ip,p,t} + op^{op}_{(loc_2,loc_1),ip,p,t} \leq \tau^{hours} \cdot \text{cap}^{comp}_{(loc_{in},loc_{out})}

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 component should be modeled.

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.

hasOpVariablesForLocationCommodity(esM, loc, commod)[source]

Check if the commodity´s transfer between a given location and the other locations of the energy system model is eligible.

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, ip, p, t)[source]

Get contribution to a commodity balance.

\begin{eqnarray*}
\text{C}^{comp,comm}_{loc,ip,p,t} = & & \underset{\substack{(loc_{in},loc_{out}) \in \ \mathcal{L}^{tans}: loc_{in}=loc}}{ \sum } \left(1-\eta_{(loc_{in},loc_{out})} \cdot I_{(loc_{in},loc_{out})} \right) \cdot op^{comp,op}_{(loc_{in},loc_{out}),ip,p,t} \\
& - & \underset{\substack{(loc_{in},loc_{out}) \in \ \mathcal{L}^{tans}:loc_{out}=loc}}{ \sum } op^{comp,op}_{(loc_{in},loc_{out}),ip,p,t}
\end{eqnarray*}

getBalanceLimitContribution(esM, pyM, ID, ip, loc, timeSeriesAggregation, componentNames)[source]

Get contribution to balanceLimitConstraint (Further read in EnergySystemModel). Sum of the operation time series of a Transmission component is used as the balanceLimit contribution:

  • If commodity is transferred out of region a negative sign is used.

  • If commodity is transferred into region a positive sign is used and losses are considered.

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

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.

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

  • ID – ID of the regarded balanceLimitConstraint

  • ID – string

  • timeSeriesAggregation (boolean) –

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

    1. the full time series (False) or

    2. clustered time series data (True).

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

  • componentNames (list) – Names of components which contribute to the balance limit

getObjectiveFunctionContribution(esM, pyM)[source]

Get contribution to the objective function.

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.

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', ip=0)[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 TransmissionModel