LinearOptimalPowerFlow class

Linear optimal power flow components are transmission components which additionally consider linear optimal power flow equations.

LinearOptimalPowerFlow class description:

class lopf.LinearOptimalPowerFlow(esM, name, commodity, reactances, 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, 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, stockCommissioning=None, floorTechnicalLifetime=True)[source]

A LinearOptimalPowerFlow component shows the behavior of a Transmission component but additionally models a linearized power flow (i.e. for AC lines). The LinearOptimalPowerFlow class inherits from the Transmission class.

__init__(esM, name, commodity, reactances, 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, 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, stockCommissioning=None, floorTechnicalLifetime=True)[source]

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

Required arguments:

Parameters:

reactances (Pandas DataFrame.) – reactances for DC power flow modeling (of AC lines) given as a Pandas DataFrame. The row and column indices of the DataFrame have to equal the in the energy system model specified locations.

Inheritance diagram:

Inheritance diagram of LinearOptimalPowerFlow

LOPFModel class description:

class lopf.LOPFModel[source]

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

initPhaseAngleVarSet(pyM)[source]

Declare phase angle variable set in the pyomo object for for each node.

Parameters:

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

declareSets(esM, pyM)[source]

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

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

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

declarePhaseAngleVariables(pyM)[source]

Declare phase angle variables.

Parameters:

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

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

Declare design and operation variables.

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

  • pyM (pyomo Concrete Model) – 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

powerFlowDC(pyM)[source]

Ensure that the flow between two locations is equal to the difference between the phase angle variables at these locations divided by the reactance of the line between these locations.

Parameters:

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

basePhaseAngle(pyM)[source]

Declare the constraint that the reference phase angle is set to zero for all time steps.

Parameters:

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

declareComponentConstraints(esM, pyM)[source]

Declare time independent and dependent constraints.

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

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

setOptimalValues(esM, pyM)[source]

Set the optimal values of the components.

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

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

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:

  • ’capacityVariables’,

  • ’isBuiltVariables’,

  • ’_operationVariablesOptimum’,

  • ’phaseAngleVariablesOptimum’,

  • ’all’ or another input: all variables are returned.

Inheritance diagram:

Inheritance diagram of LOPFModel