Methods - EnergyModelsBase
Index
EnergyModelsBase.capacity
EnergyModelsBase.check_elements
EnergyModelsBase.check_time_structure
EnergyModelsBase.constraints_couple
EnergyModelsBase.constraints_elements
EnergyModelsBase.create_node
EnergyModelsBase.emissions_operational
EnergyModelsBase.has_emissions
EnergyModelsBase.has_opex
EnergyModelsBase.inputs
EnergyModelsBase.objective_operational
EnergyModelsBase.opex_fixed
EnergyModelsBase.opex_var
EnergyModelsBase.outputs
EnergyModelsBase.variables_capacity
EnergyModelsBase.variables_capex
EnergyModelsBase.variables_element
EnergyModelsBase.variables_elements
EnergyModelsBase.variables_emission
EnergyModelsBase.variables_flow
EnergyModelsBase.variables_opex
Extension methods
EnergyModelsBase.create_node
— FunctionEMB.create_node(m, n::GeoAvailability, 𝒯, 𝒫, modeltype::EnergyModel)
Set all constraints for a GeoAvailability
. The energy balance is handled in the function constraints_couple
.
Hence, no constraints are added in this function.
EnergyModelsBase.objective_operational
— FunctionEMB.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 functionhas_opex
returns true.𝒳 = 𝒜::Vector{<:Area}
. In the case of a vector of areas, the method returns a value of 0 for all investment periods.
EnergyModelsBase.emissions_operational
— FunctionEMB.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 functionhas_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.
EnergyModelsBase.constraints_elements
— FunctionEMB.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
]:
Area
- the subfunction iscreate_area
.Transmission
- the subfunction iscreate_transmission_mode
and called for allTransmissionMode
s withinℒᵗʳᵃⁿˢ
.
EnergyModelsBase.constraints_couple
— FunctionEMB.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 Area
s.
Variable methods
EnergyModelsBase.variables_capacity
— FunctionEMB.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 TransmissionMode
s must be extracted now in each package
The capacity variables are only created for TransmissionMode
s and not Transmission
corridors. The created variable is
trans_cap[tm, t]
is the installed capacity of transmission modetm
in operational periodt
.
No variables are added
EnergyModelsBase.variables_flow
— FunctionEMB.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:
The capacity variables are only created for TransmissionMode
s and not Transmission
corridors. The created variables are
trans_in[tm, t]
is the flow into modetm
in operational periodt
. The inflow resources of transmission modem
are extracted using the functioninputs
.trans_out[tm, t]
is the flow from modetm
in operational periodt
. The outflow resources of transmission modem
are extracted using the functionoutputs
.
area_exchange[a, t, p]
is the exchange of resourcep
by areaa
in operational periodt
. The exchange resources are extracted using the functionexchange_resources
EnergyModelsBase.variables_opex
— FunctionEMB.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.
The operational expenses variables are only created for TransmissionMode
s 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 noden
in investment periodt_inv
. The values can be negative to account for revenue streamstrans_opex_fixed[tm, t_inv]
are the fixed operating expenses of noden
in investment periodt_inv
.
No variables are added
EnergyModelsBase.variables_capex
— MethodEMB.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.
EnergyModelsBase.variables_elements
— FunctionEMB.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
.
EnergyModelsBase.variables_element
— Functionvariables_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.
EnergyModelsBase.variables_emission
— FunctionEMB.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.
emissions_trans[tm, t, p_em]
emissions ofResourceEmit
of transmission modetm
in operational periodt
. The variable is fixed to 0 forResourceEmit
that are not within the vector returned by the functionemit_resources
.
No variables are added
Field extraction methods
EnergyModelsBase.capacity
— Functioncapacity(tm::TransmissionMode)
capacity(tm::TransmissionMode, t)
Returns the capacity of transmission mode tm
as TimeProfile
or in operational period t
.
EnergyModelsBase.inputs
— Functioninputs(tm::TransmissionMode)
inputs(tm::PipeMode)
Returns the input resources of transmission mode tm
.
EnergyModelsBase.outputs
— Functionoutputs(tm::TransmissionMode)
outputs(tm::PipeMode)
Returns the output resources of transmission mode tm
.
EnergyModelsBase.opex_fixed
— Functionopex_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
.
EnergyModelsBase.opex_var
— Functionopex_var(tm::TransmissionMode)
opex_var(tm::TransmissionMode, t)
Returns the variable OPEX of transmission mode tm
as TimeProfile
or in operational period t
.
Identification methods
EnergyModelsBase.has_opex
— Functionhas_opex(tm::TransmissionMode)
Checks whether transmission mode tm
has operational expenses.
By default, all transmission modes have operational expenses.
EnergyModelsBase.has_emissions
— Functionhas_emissions(tm::TransmissionMode)
Returns whether there are emissions associated with transmission mode tm
. The default behaviour is no emissions.
Check methods
EnergyModelsBase.check_elements
— FunctionEMB.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)
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
- that the node returned by the function
availability_node
is within the Node vector, - that the availability node is a
GeoAvailability
node, and - the exchange resources are within the resources of the
GeoAvailability
node.
All transmission corridors are checked through the functions
check_transmission
to identify problematic input,check_time_structure
to identify time profiles at the highest level that are not equivalent to the provided timestructure.
The individual transmission modes of a corridorare checked through the functions
check_mode
to identify problematic input andcheck_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
.
EnergyModelsBase.check_time_structure
— FunctionEMB.check_time_structure(tm::TransmissionMode, 𝒯)
Check that all fields of a TransmissionMode
that are of type TimeProfile
correspond to the time structure 𝒯
.