Internal functions
Index
EnergyModelsGeography.check_area
EnergyModelsGeography.check_mode
EnergyModelsGeography.check_mode_default
EnergyModelsGeography.check_transmission
EnergyModelsGeography.compute_trans_in
EnergyModelsGeography.compute_trans_out
EnergyModelsGeography.connected_nodes
EnergyModelsGeography.constraints_capacity
EnergyModelsGeography.constraints_capacity_installed
EnergyModelsGeography.constraints_emission
EnergyModelsGeography.constraints_opex_fixed
EnergyModelsGeography.constraints_opex_var
EnergyModelsGeography.constraints_trans_balance
EnergyModelsGeography.constraints_trans_loss
EnergyModelsGeography.create_area
EnergyModelsGeography.create_model
EnergyModelsGeography.create_transmission_mode
EnergyModelsGeography.emissions
EnergyModelsGeography.emit_resources
EnergyModelsGeography.export_resources
EnergyModelsGeography.extract_resources
EnergyModelsGeography.import_resources
EnergyModelsGeography.is_bidirectional
EnergyModelsGeography.trans_sub
EnergyModelsGeography.variables_trans_mode
Extension functions
EnergyModelsGeography.create_area
— Functioncreate_area(m, a::Area, 𝒯, ℒᵗʳᵃⁿˢ, modeltype)
Set all constraints for an Area
. Can serve as fallback option for all unspecified subtypes of Area
.
create_area(m, a::LimitedExchangeArea, 𝒯, ℒᵗʳᵃⁿˢ, modeltype)
When the area is a LimitedExchangeArea
, we limit the export of the specified limit resources p
to the providewd value.
EnergyModelsGeography.create_model
— Functioncreate_model(case::Dict, modeltype::EnergyModel, m::JuMP.Model; check_timeprofiles::Bool=true)
Create the model and call all required functions. This method is a deprecated method and should no longer be called.
EnergyModelsGeography.create_transmission_mode
— Functioncreate_transmission_mode(m, tm::TransmissionMode, 𝒯, modeltype::EnergyModel)
Set all constraints for a TransmissionMode
.
Serves as a fallback option for unspecified subtypes of TransmissionMode
.
Called constraint functions
Constraint functions
EnergyModelsGeography.constraints_capacity
— Functionconstraints_capacity(m, tm::TransmissionMode, 𝒯::TimeStructure, modeltype::EnergyModel)
constraints_capacity(m, tm::PipeMode, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the maximum capacity of a generic TransmissionMode
and PipeMode
.
These functions serve as fallback option if no other method is specified for a specific TransmissionMode
.
If you create a new method for this function, it is crucial to call within said function the function constraints_capacity_installed(m, tm, 𝒯, modeltype)
if you want to include investment options.
constraints_capacity(m, tm::PipeLinepackSimple, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the maximum capacity of a PipeLinepackSimple
.
The difference is given by the inclusion of the linepack storage level constraint.
EnergyModelsGeography.constraints_capacity_installed
— Methodconstraints_capacity_installed(m, tm::TransmissionMode, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the installed capacity of a TransmissionMode
.
This function serves as fallback option if no other method is specified for a specific TransmissionMode
.
This function should only be used to dispatch on the modeltype for providing investments. If you create new capacity variables, it is beneficial to include as well a method for this function and the corresponding transmission mode types.
EnergyModelsGeography.constraints_emission
— Functionconstraints_emission(m, tm::TransmissionMode, 𝒯, modeltype::EnergyModel)
Function for creating the constraints on the emissions of a generic TransmissionMode
tm
.
This function serves as fallback option if no other function is specified for a TransmissionMode
.
EnergyModelsGeography.constraints_opex_fixed
— Functionconstraints_opex_fixed(m, tm::TransmissionMode, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)
Function for creating the constraint on the fixed OPEX of a generic TransmissionMode
.
This function serves as fallback option if no other function is specified for a TransmissionMode
.
EnergyModelsGeography.constraints_opex_var
— Functionconstraints_opex_var(m, tm::TransmissionMode, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)
Function for creating the constraint on the variable OPEX of a generic TransmissionMode
.
This function serves as fallback option if no other function is specified for a TransmissionMode
.
EnergyModelsGeography.constraints_trans_balance
— Functionconstraints_trans_balance(m, tm::TransmissionMode, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the transmission balance for a generic TransmissionMode
.
This function serves as fallback option if no other function is specified for a TransmissionMode
.
constraints_trans_balance(m, tm::PipeLinepackSimple, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the transmission balance for a PipeLinepackSimple
.
EnergyModelsGeography.constraints_trans_loss
— Functionconstraints_trans_loss(m, tm::TransmissionMode, 𝒯::TimeStructure, modeltype::EnergyModel)
constraints_trans_loss(m, tm::PipeMode, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the transmission loss of a generic TransmissionMode
and PipeMode
These functions serve as fallback option if no other function is specified for a TransmissionMode
. If you plan to use the methods, it is necessary that the function loss
is either declared for your TransmissionMode
or you provide alternatively a new method.
Compute functions
EnergyModelsGeography.compute_trans_in
— Functioncompute_trans_in(m, t, p, tm::TransmissionMode)
compute_trans_in(m, t, p, tm::PipeMode)
Return the amount of resource p
going into transmission mode tm
in operational period t
.
The function is declared for both a generic TransmissionMode
and for a PipeMode
.
EnergyModelsGeography.compute_trans_out
— Functioncompute_trans_out(m, t, p, tm::TransmissionMode)
compute_trans_out(m, t, p, tm::PipeMode)
Return the amount of resource p
going out of transmission mode tm
in operational period t
.
The function is declared for both a generic TransmissionMode
and for a PipeMode
.
Variable creation functions
EnergyModelsGeography.variables_trans_mode
— Functionvariables_trans_mode(m, 𝒯, ℳˢᵘᵇ::Vector{<:TransmissionMode}, modeltype::EnergyModel)
Default fallback method when no function is defined for a TransmissionMode
type. It introduces the variables that are required in all TransmissionMode
s.
These variables are:
:trans_loss
- loss during transmission:trans_loss_neg
- negative loss during transmission, helper variable if bidirectional transport is possible:trans_loss_pos
- positive loss during transmission, helper variable if bidirectional transport is possible
variables_trans_mode(m, 𝒯, ℳᴸᴾ::Vector{<:PipeLinepackSimple}, modeltype::EnergyModel)
When the node vector is a Vector{<:PipeLinepackSimple}
, we declare the variable :linepack_stor_level
to account for the energy stored through line packing.
Check functions
EnergyModelsGeography.check_area
— Functioncheck_area(a::Area, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
Check that the fields of an Area
corresponds to required structure.
EnergyModelsGeography.check_transmission
— Functioncheck_transmission(l::Transmission, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
Check that the fields of a Transmission
corridor corresponds to required structure.
EnergyModelsGeography.check_mode
— Functioncheck_mode(tm::TransmissionMode, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
check_mode(tm::Union{RefDynamic, RefStatic}, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
check_mode(tm::PipeSimple, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
check_mode(tm::PipeLinepackSimple, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
Check that the fields of a TransmissionMode
corresponds to required structure.
Checks RefDynamic
and RefStatic
- The field
trans_cap
is required to be non-negative. - The field
trans_loss
is required to be in the range $[0, 1]$. - The field
fixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functioncheck_fixed_opex
. - The field
directions
must be 1 or 2.
Checks PipeSimple
- All checks included in the subroutine
check_mode_default
.
Checks PipeLinepackSimple
- All checks included in the subroutine
check_mode_default
. - The field
energy_share
is required to be non-negative.
EnergyModelsGeography.check_mode_default
— Functioncheck_mode_default(tm::PipeMode, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
Subroutine that can be utilized in other packages for incorporating the standard tests for a PipeMode
node.
Checks
- The field
consumption_rate
is required to be non-negative. - The field
trans_cap
is required to be non-negative. - The field
trans_loss
is required to be in the range $[0, 1]$. - The field
fixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functioncheck_fixed_opex
.
Identification functions
EnergyModelsGeography.extract_resources
— Functionextract_resources(ℒᵗʳᵃⁿˢ, resource_method)
Return the resources transported/consumed by the transmission corridors in ℒᵗʳᵃⁿˢ
.
EnergyModelsGeography.export_resources
— Functionexport_resources(ℒᵗʳᵃⁿˢ, a::Area)
Return the resources exported from area a
on the transmission corridors in ℒᵗʳᵃⁿˢ
.
EnergyModelsGeography.import_resources
— Functionimport_resources(ℒᵗʳᵃⁿˢ, a::Area)
Return the resources imported into area a
on the transmission corridors in ℒᵗʳᵃⁿˢ
.
EnergyModelsGeography.emit_resources
— Functionemit_resources(m::TransmissionMode)
Returns the types of emissions associated with transmission mode tm
.
EnergyModelsGeography.emissions
— Functionemissions(tm::TransmissionMode, p::ResourceEmit)
emissions(tm::TransmissionMode, p::ResourceEmit, t)
Returns the emission of transmission mode tm
of a specific resource p
as TimeProfile
or in operational period t
.
None of the provided TransmissionMode
s include emissions. If you plan to include emissions, you have to both create a new TransmissionMode
and dispatch on this function.
EnergyModelsGeography.is_bidirectional
— Functionis_bidirectional(tm::TransmissionMode)
is_bidirectional(tm::PipeMode)
Checks whether transmission mode tm
is bidirectional. By default, it checks whether the the function directions
returns the value 2.
PipeMode
s return false.
EnergyModelsGeography.trans_sub
— Functiontrans_sub(ℒᵗʳᵃⁿˢ, a::Area)
Return connected transmission corridors for a given area a
.
Utility functions
EnergyModelsGeography.connected_nodes
— Functionconnected_nodes(n::EMB.Node, ℒ::Vector{<:Link}, nodes::Vector{EMB.Node})
Returns a vector of all unique nodes connected to node n
through links ℒ
. The corresponding links are also returned.
Arguments
n::EMB.Node
is the node from which the connections are evaluated.ℒ::Vector{<:Link}
is a vector of links that should be evaluated.nodes::Vector{EMB.Node}
is a vector of nodes that should not be included.