Internals - EnergyModelsGeography extension

Index

EnergyModelsRecedingHorizon

Types

The following types are introduced for providing initial data for TransmissionModes. Only PipeLinepackSimple supports at the moment initial data.

EMGExt.TransInitDataType
TransInitData{T} <: AbstractInitData

Initialization data type for TransmissionMode. It follows the same structure as the standard InitData, that is it is using a single value for a given variable. Multiple variables can be initialized simultaneously.

It is required as the indexing is different for TransmissionModes compared to Nodes, Links, or Areas.

Fields

  • init_val_dict::Dict{Symbol,T} is a dictionary with the variable symbol as key and the value in the beginning of the analysis as value.
source
EMGExt.TransInitDataPathType
struct TransInitDataPath <: AbstractInitDataPath

Internal type for paths pointing towards TransInitData.

Fields

  • idx::Int is the index of the mode within the associated Transmission corridor.
  • key::Symbol is the key in the TransInitData (and correspondingly in the JuMP model).
source

The following functions are included for extracting the values from a TransmissionMode and initial data type:

EnergyModelsRecedingHorizon.data_initMethod
EMRH.data_init(a::Area)
EMRH.data_init(l::Transmission)
EMRH.data_init(tm::TransmissionMode)

Returns initialization data for Transmission corridor l or TransmissionMode tm. In the case of a Transmission corridor, it returns all initialization data as Vector.

In the case of an Area a, it returns nothing.

source

In addition, we provide a new method for the identification of initial data:

EnergyModelsRecedingHorizon.has_initMethod
EMRH.has_init(a::Area)
EMRH.has_init(l::Transmission)
EMRH.has_init(tm::TransmissionMode)

Checks whether the Transmission corridor l or TransmissionMode tm has initialization data.

In the case of an Area a, it returns false.

source

The following types are introduced for the resetting of the fields

EMGExt.AreaSubType
mutable struct AreaSub{T<:Area} <: AbstractSub

AbstractSub for Areas.

Fields

  • new::T is the new instance after resetting its values.
  • org::T is the original instance before resetting its values.
  • resets::Vector{<:AbstractReset} are AbstractReset types for the given Area.
source

Internal methods

EnergyModelsRecedingHorizon._find_update_pathsMethod
EMRH._find_update_paths(field::Vector{T}, current_path::Vector{Any}, all_paths::Vector{Any}) where {T<:TransmissionMode}
EMRH._find_update_paths(field::T, current_path::Vector{Any}, all_paths::Vector{Any}) where {T<:TransmissionMode}
EMRH._find_update_paths(field::TransInitData, current_path::Vector{Any}, all_paths::Vector{Any})

The function _find_update_paths requires new methods for the geography extension as

  1. TransmissionModes are not included in the default methods and
  2. TransInitData requires a separate method for the given path.
source
EnergyModelsRecedingHorizon.update_init_data!Method
EMRH.update_init_data!(m, ri::AbstractReset, l::Transmission, idp::TransInitDataPath, opers_implᵣₕ)

Updates the initial values of Transmission corridor l for the AbstractReset ri with the value specified by the key of the TransInitDataPath idp.

The mode for the variable is identified through the field idx of TransInitDataPath.

source

EnergyModelsGeography

Constraint functions

EnergyModelsGeography.constraints_capacity_installedFunction
EMG.constraints_capacity_installed(m, tm::TransmissionMode, 𝒯::TimeStructure, modeltype::RecHorEnergyModel)

When modeltype is a receding horizon model, the function utilizes constraints instead of the function JuMP.fix for constraining the capacity as it is not possible to fix to a POI parameter.

Fixed variables

Fixing variables is not possible if the parameter is a POI parameter. It is instead necessary to utilize constraints. Improved speed can be achieved by calling

# before the constraint
MOI.set(m, POI.ConstraintsInterpretation(), POI.ONLY_BOUNDS)
# and
MOI.set(m, POI.ConstraintsInterpretation(), POI.ONLY_CONSTRAINTS)
# after the constraint.
source

constraints_capacity_installed only receives a new method if ParametricOptInterface is loaded.

Functions for accessing fields

The following functions are introduced for UpdateCase types. They extract the updated value.

EnergyModelsGeography.get_areasFunction
get_areas(𝒰::UpdateCase)

Method for the equivalent EnergyModelsGeography function to extract the new Areas of the individual AreaSub types of UpdateCase 𝒰.

This element vector can be directly utilized for the field elements of a Case.

source
EnergyModelsGeography.get_transmissionsFunction
get_transmissions(𝒰::UpdateCase)

Method for the equivalent EnergyModelsGeography function to extract the new Transmission corridors of the individual TransmissionSub types of UpdateCase 𝒰.

This element vector can be directly utilized for the field elements of a Case.

source

ParametricOptInterface

POIExt._update_parameter!Method
POIExt._update_parameter!(m, res_type::InitReset{EMGExt.TransInitDataPath}, opers::Vector)

Update the parameter value for a given InitReset{EMGExt.TransInitDataPath} to the provided value of the InitReset type.

source