Methods - EnergyModelsBase

Index

Extension methods

EnergyModelsBase.objective_operationalFunction
EMB.objective_operational(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒯ᴵⁿᵛ::TS.AbstractStratPers, modeltype::EnergyModel)
EMB.objective_operational(m, 𝒜::Vector{<:Area}, 𝒯ᴵⁿᵛ::TS.AbstractStratPers, modeltype::EnergyModel)

Create JuMP expressions indexed over the investment periods 𝒯ᴵⁿᵛ for different elements. The expressions correspond to the operational expenses of the different elements. The expressions are not discounted and do not take the duration of the investment periods into account.

By default, objective expressions are included for:

  • 𝒳 = ℒᵗʳᵃⁿˢ::Vector{Transmission}. In the case of a vector of transmission corridors, the method returns the sum of the variable and fixed OPEX for all modes whose method of the function has_opex returns true.
  • 𝒳 = 𝒜::Vector{<:Area}. In the case of a vector of areas, the method returns a value of 0 for all investment periods.
source
EnergyModelsBase.emissions_operationalFunction
EMB.emissions_operational(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒫ᵉᵐ, 𝒯, modeltype::EnergyModel)

Create JuMP expressions indexed over the operational periods 𝒯 for different elements. The expressions correspond to the total emissions of a given type.

By default, emissions expressions are included for:

  • 𝒳 = ℒᵗʳᵃⁿˢ::Vector{Transmission}. In the case of a vector of transmission coriddors, the function returns the sum of the emissions of all modes whose method of the function has_emissions returns true.
  • 𝒳 = 𝒜::Vector{<:Area}. In the case of a vector of areas, the method returns returns a value of 0 for all operational periods and emission resources.
source
EnergyModelsBase.constraints_elementsFunction
EMB.constraints_elements(m, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒫, 𝒯, modeltype::EnergyModel)
EMB.constraints_elements(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒫, 𝒯, modeltype::EnergyModel)

Loop through all entries of the elements vector and call a subfunction for creating the internal constraints of the entries of the elements vector.

EnergyModelsGeography provides the user with two element types, Area and [Trasnmission]:

source
EnergyModelsBase.constraints_coupleFunction
EMB.constraints_couple(m, 𝒜::Vector{<:Area}, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒫, 𝒯, modeltype::EnergyModel)
EMB.constraints_couple(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒜::Vector{<:Area}, 𝒫, 𝒯, modeltype::EnergyModel)

Create the new couple constraints in EnergyModelsGeography.

The couple constraints are utilizing the variables :flow_in and :flow_out in combination with :area_exchange for solving the energy balance on an Area level for the respective GeoAvailability node.

The couple is achieved through the variable :area_exchange which is is calculated through the functions compute_trans_in and compute_trans_out.

As a consequence, each Area can be coupled with multiple Transmission corridors but each Transmission corridor can only be coupled to two Areas.

source

Variable methods

EnergyModelsBase.variables_capacityFunction
EMB.variables_capacity(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)
EMB.variables_capacity(m, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)

Declaration of different capacity variables for the element type introduced in EnergyModelsGeography. Due to the design of the package, the individual TransmissionModes must be extracted now in each package

Transmission variables

The capacity variables are only created for TransmissionModes and not Transmission corridors. The created variable is

  • trans_cap[tm, t] is the installed capacity of transmission mode tm in operational period t.
Area variables

No variables are added

source
EnergyModelsBase.variables_flowFunction
EMB.variables_flow(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)
EMB.variables_flow(m, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)

Declaration of flow OPEX variables for the element types introduced in EnergyModelsGeography. EnergyModelsGeography introduces two elements for an energy system, and hence, provides the user with two individual methods:

Transmission variables

The capacity variables are only created for TransmissionModes and not Transmission corridors. The created variables are

  • trans_in[tm, t] is the flow into mode tm in operational period t. The inflow resources of transmission mode m are extracted using the function inputs.
  • trans_out[tm, t] is the flow from mode tm in operational period t. The outflow resources of transmission mode m are extracted using the function outputs.
Area variables
  • area_exchange[a, t, p] is the exchange of resource p by area a in operational period t. The exchange resources are extracted using the function exchange_resources
source
EnergyModelsBase.variables_opexFunction
EMB.variables_opex(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)
EMB.variables_opex(m, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)

Declaration of different OPEX variables for the element types introduced in EnergyModelsGeography. Although EnergyModelsGeography introduces two elements, only ℒᵗʳᵃⁿˢ::Vector{Transmission} requires operational expense variables.

Transmission variables

The operational expenses variables are only created for TransmissionModes and not Transmission corridors. The OPEX variables are furthermore only created for nodes, if the function has_opex(tm::TransmissionMode) has received an additional method for a given mode m returning the value true. By default, this corresponds to all modes.

  • trans_opex_var[tm, t_inv] are the variable operating expenses of node n in investment period t_inv. The values can be negative to account for revenue streams
  • trans_opex_fixed[tm, t_inv] are the fixed operating expenses of node n in investment period t_inv.
Area variables

No variables are added

source
EnergyModelsBase.variables_capexMethod
EMB.variables_capex(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)
EMB.variables_capex(m, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)

Create variables for the capital costs for the investments in transmission. Empty function to allow for multiple dispatch in the EnergyModelsInvestment package.

source
EnergyModelsBase.variables_elementsFunction
EMB.variables_elements(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)

Loop through all TransmissionMode types present in ℒᵗʳᵃⁿˢ::Vector{Transmission} and create variables specific to each type. This is done by calling the method variables_trans_mode on all modes of each type.

The TransmissionMode type representing the widest category will be called first. That is, variables_trans_mode will be called on a TransmissionMode before it is called on PipeMode.

source
EnergyModelsBase.variables_elementFunction
variables_element(m, 𝒜ˢᵘᵇ::Vector{<:Area}, 𝒯, modeltype::EnergyModel)

Default fallback method for a vector of elements if no other method is defined for a given vector type.

source
EnergyModelsBase.variables_emissionFunction
EMB.variables_emission(m, ℒᵗʳᵃⁿˢ::Vector{Transmission}, 𝒳ᵛᵉᶜ, 𝒫, 𝒯, modeltype::EnergyModel)

Declaration of an emission variables for the element types introduced in EnergyModelsGeography. Although EnergyModelsGeography introduces two elements, only ℒᵗʳᵃⁿˢ::Vector{Transmission} requires an emission variable.

Declation of variables for the modeling of transmission emissions. These variables are only created for transmission modes where emissions are included. All emission resources that are not included for a type are fixed to a value of 0.

Transmission variables
  • emissions_trans[tm, t, p_em] emissions of ResourceEmit of transmission mode tm in operational period t. The variable is fixed to 0 for ResourceEmit that are not within the vector returned by the function emit_resources.
Area variables

No variables are added

source

Field extraction methods

EnergyModelsBase.capacityFunction
capacity(tm::TransmissionMode)
capacity(tm::TransmissionMode, t)

Returns the capacity of transmission mode tm as TimeProfile or in operational period t.

source
EnergyModelsBase.opex_fixedFunction
opex_fixed(tm::TransmissionMode)
opex_fixed(tm::TransmissionMode, t_inv)

Returns the variable OPEX of transmission mode tm as TimeProfile or in strategic period t_inv.

source
EnergyModelsBase.opex_varFunction
opex_var(tm::TransmissionMode)
opex_var(tm::TransmissionMode, t)

Returns the variable OPEX of transmission mode tm as TimeProfile or in operational period t.

source

Identification methods

EnergyModelsBase.has_opexFunction
has_opex(tm::TransmissionMode)

Checks whether transmission mode tm has operational expenses.

By default, all transmission modes have operational expenses.

source
EnergyModelsBase.has_emissionsFunction
has_emissions(tm::TransmissionMode)

Returns whether there are emissions associated with transmission mode tm. The default behaviour is no emissions.

source

Check methods

EnergyModelsBase.check_elementsFunction
EMB.check_elements(log_by_element, 𝒜::Vector{<:Area}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
EMB.check_elements(log_by_element, ℒᵗʳᵃⁿˢ::Vector{<:Tranmission}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
Area methods

All areas are checked through the functions

  • check_area to identify problematic input,
  • check_time_structure to identify time profiles at the highest level that are not equivalent to the provided timestructure.

In addition, all areas are directly checked

Transmission methods

All transmission corridors are checked through the functions

The individual transmission modes of a corridorare checked through the functions

  • check_mode to identify problematic input and
  • check_time_structure to identify time profiles at the highest level that are not equivalent to the provided timestructure.

In addition, all transmission corridors are directly checked to have in the fields :from and :to nodes that are present in the Area vector as extracted through the function get_areas.

source
EnergyModelsBase.check_time_structureFunction
EMB.check_time_structure(tm::TransmissionMode, 𝒯)

Check that all fields of a TransmissionMode that are of type TimeProfile correspond to the time structure 𝒯.

source