Public interface
Area
A geographical Area
consist of a location and a connection to a local energy system via a specialized Availability
node called GeoAvailability
. The specialized Availability
node is required to modify the energy/mass balance to allow for imports and exports. Constraints related to the area keep track of a resource's export and import to the local system and exchange with other areas. Multiple dispatch is used on the Area
type for imposing specific constraints. Hence, other restrictions can be applied on a area level, such as electricity generation reserves, CO₂ emission limits or resource limits (wind power, natural gas etc.).
Area
types
The following types are inmplemented:
EnergyModelsGeography.Area
— TypeDeclaration of the general type for areas.
EnergyModelsGeography.RefArea
— TypeRefArea <: Area
A RefArea
is an area representation with no additional constraints on energy/mass exchange.
Fields
id
is the name/identifier of the area.name
is the name of the area.lon::Real
is the longitudinal position of the area.lat::Real
is the latitudinal position of the area.node::Availability
is theAvailability
node routing different resources within an area.
EnergyModelsGeography.LimitedExchangeArea
— TypeLimitedExchangeArea <: Area
A LimitedExchangeArea
is an area in which the export is limited in each individual operational period for the provided resources. This can be necessary when an area is coupled with multiple other areas and the total export capacity should be restricted.
Fields
id
is the name/identifier of the area.name
is the name of the area.lon::Real
is the longitudinal position of the area.lat::Real
is the latitudinal position of the area.node::Availability
is theAvailability
node routing different resources within an area.limit::Dict{<:EMB.Resource, <:TimeProfile}
is the amount of a resource that can be exchanged with other areas
EnergyModelsGeography.GeoAvailability
— TypeGeoAvailability <: EMB.Availability
A geography Availability
node for substituion of the general Availability
node. A GeoAvailability
is required if transmission should be included between individual Area
s due to a changed mass balance.
Fields
id
is the name/identifier of the node.input::Array{<:Resource}
are the inputResource
s with conversion valueReal
. The latter are not relevant but included for consistency with other formulations.output::Array{<:Resource}
are the generatedResource
s with conversion valueReal
. The latter are not relevant but included for consistency with other formulations.
Functions for accessing fields of Area
types
The following functions are defined for accessing fields from an Area
:
EnergyModelsGeography.name
— Functionname(a::Area)
Returns the name of area a
.
EnergyModelsGeography.availability_node
— Functionavailability_node(a::Area)
Returns the availability node of an Area
a
.
EnergyModelsGeography.limit_resources
— Functionlimit_resources(a::LimitedExchangeArea)
Returns the limited resources of a LimitedExchangeArea
a
. All other resources are considered unlimited.
EnergyModelsGeography.exchange_limit
— Functionexchange_limit(a::LimitedExchangeArea)
Returns the limits of the exchange resources in area a
.
exchange_limit(a::LimitedExchangeArea, p::Resource)
Returns the limit of exchange resource p
in area a
a TimeProfile
.
exchange_limit(a::LimitedExchangeArea, p::Resource, t)
Returns the limit of exchange resource p
in area a
at time period t
.
EnergyModelsGeography.exchange_resources
— Functionexchange_resources(ℒ, a::Area)
Return the resources exchanged (import and export) from area a on the transmission corridors in ℒ.
EnergyModelsGeography.getnodesinarea
— Functiongetnodesinarea(a::Area, links)
Return a vector with all the nodes connected to the central availability node of an area.
Fields
a::Area
.links
is a vector of all links in the model.
Transmission
Transmission
occurs on specified transmission corridors from
one area to
another. On each corridor, there can exist several TransmissionMode
s that are transporting resources using a range of technologies.
It is important to consider the from
and to
Area
when specifying a Transmission
corridor. The chosen direction has an influence on whether the variables $\texttt{trans\_in}[m, t]$ and $\texttt{trans\_out}[m, t]$ are positive or negative for exports in the case of bidirectional transport. This is also explained on the page Optimization variables.
Transmission
types
EnergyModelsGeography.Transmission
— TypeA Transmission
corridor.
A geographic corridor where TransmissionModes
are used to transport resources.
Fields
from::Area
is the area resources are transported from.to::Area
is the area resources are transported to.modes::Vector{<:Transmission}
are the transmission modes that are available.
Functions for accessing fields of Transmission
types
The following functions are defined for accessing fields from a Transmission
as well as finding a subset of Transmission
corridors:
EnergyModelsGeography.modes
— Functionmodes(l::Transmission)
Return an array of the transmission modes for a transmission corridor l.
modes(ℒ::Vector{::Transmission})
Return an array of all transmission modes present in the different transmission corridors.
EnergyModelsGeography.modes_sub
— Functionmodes_sub(ℳ::Vector{<:TransmissionMode}, string::String)
Returns all transmission modes that include in the name the string
.
modes_sub(ℳ::Vector{<:TransmissionMode}, string_array::Array{String})
Returns all transmission modes that include in the name all entries of the array string_array
.
modes_sub(l::Transmission, mode_type::TransmissionMode)
Return an array containing all TransmissionMode
s of type type
in Transmission
corridor l
.
modes_sub(ℒᵗʳᵃⁿˢ::Vector{<:Transmission}, mode_type::TransmissionMode)
Return an array containing all TransmissionMode
s of type type
in Transmission
s ℒ
.
modes_sub(l::Transmission, p::Resource)
Return an array containing all TransmissionMode
s that transport the resource p
in Transmission
corridor l
.
modes_sub(ℒᵗʳᵃⁿˢ::Vector{<:Transmission}, p::Resource)
Return an array containing all TransmissionMode
s that transport the resource p
in Transmission
s ℒ
.
EnergyModelsGeography.corr_from
— Functioncorr_from(from::String, ℒᵗʳᵃⁿˢ)
Returns all transmission corridors that orginate in the Area
with the name from
.
corr_from(from::Area, ℒᵗʳᵃⁿˢ)
Returns all transmission corridors that orginate in Area
from
.
EnergyModelsGeography.corr_to
— Functioncorr_to(to::String, ℒᵗʳᵃⁿˢ)
Returns all transmission corridors that end in the Area
with the name to
.
corr_to(to::Area, ℒᵗʳᵃⁿˢ)
Returns all transmission corridors that end in Area
to
.
EnergyModelsGeography.corr_from_to
— Functioncorr_from_to(from::String, to::String, ℒᵗʳᵃⁿˢ)
Returns the transmission corridor that orginate in the Area
with the id from
and end in the Area
with the id to
.
corr_from_to(from::Area, to::Area, ℒᵗʳᵃⁿˢ)
Returns the transmission corridor that orginate in the Area
with the id from
and end in the Area
with the id to
.
EnergyModelsGeography.modes_of_dir
— Functionmodes_of_dir(ℒ, dir::Int)
Return the transmission modes of dir directions
for transmission modes ℳ
.
modes_of_dir(l, dir::Int)
Return the transmission modes of dir directions
for transmission corridor l
`.
TransmissionMode
TransmissionMode
describes how resources are transported, for example by dynamic transmission modes on ship, truck or railway (represented generically by RefDynamic
, although not implemented in the current version) or by static transmission modes on overhead power lines or gas pipelines (respresented generically by RefStatic
). TransmissionMode
s includes capacity limits (trans_cap
), losses (trans_loss
) and directions (directions
) for the generic transmission modes RefDynamic
and RefStatic
. More specialized TransmissionModes
such as subtypes of the abstract type PipeMode
can convert one inlet
resource to another outlet
resource. This approach can be used for representing a static pressure drop within a pipeline. The PipeMode
can be consuming
another resource such as electricity for compressors at a consumption_rate
in order to transport natural gas or hydrogen. The consumption_rate
is in this situation proportional to the transport of the inlet
resource. All TransmissionMode
s can also include both fixed (opex_fixed
) and variable (opex_var
) operational expenditures (OPEX).
All parameters of the implemented TransmissionMode
s are relative (based on usage, opex_var
and trans_loss
, or the installed capacity, opex_fixed
). They are independent of the distance. The reasoning for this approach is that it allows the modeller to have a non-linear, distance dependent OPEX or loss function for providing the input to the model.
TransmissionMode
types
The following TransmissionMode
s are implemented and exported:
EnergyModelsGeography.TransmissionMode
— TypeDeclaration of the general type for transmission mode transporting resources between areas.
EnergyModelsGeography.RefStatic
— TypeRefStatic <: TransmissionMode
A reference static TransmissionMode
.
Generic representation of static transmission modes, such as overhead power lines or pipelines.
Fields
id::String
is the name/identifier of the transmission mode.resource::Resource
is the resource that is transported.trans_cap::Real
is the capacity of the transmission mode.trans_loss::Real
is the loss of the transported resource during transmission, modelled as a ratio.opex_var::TimeProfile
is the variable operating expense per energy unit transported.opex_fixed::TimeProfile
is the fixed operating expense per installed capacity.directions
is the number of directions the resource can be transported, 1 is unidirectional (A->B) or 2 is bidirectional (A<->B).data::Vector{Data}
is the additional data (e.g. for investments). The fielddata
is conditional through usage of a constructor.
EnergyModelsGeography.RefDynamic
— TypeRefDynamic <: TransmissionMode
A reference dynamic TransmissionMode
.
Generic representation of dynamic transmission modes, using for example truck, ship or railway transport.
Fields
id::String
is the name/identifier of the transmission mode.resource::Resource
is the resource that is transported.trans_cap::TimeProfile
is the capacity of the transmission mode.trans_loss::TimeProfile
is the loss of the transported resource during transmission, modelled as a ratio.opex_var::TimeProfile
is the variable operating expense per energy unit transported.opex_fixed::TimeProfile
is the fixed operating expense per installed capacity.directions
is the number of directions the resource can be transported, 1 is unidirectional (A->B) or 2 is bidirectional (A<->B).data::Vector{Data}
is the additional data (e.g. for investments). The fielddata
is conditional through usage of a constructor.
EnergyModelsGeography.PipeMode
— TypePipeMode <: TransmissionMode
TransmissionMode
mode for additional variable potential.
EnergyModelsGeography.PipeSimple
— TypePipeSimple <: PipeMode
This TransmissionMode
allows for altering the transported Resource
.
A usage of this could e.g. be by defining a subtype struct of Resource
with the field 'pressure'. This PipelineMode can then take SomeSubtype<:Resource
with pressure p₁ at the inlet, and pressure p₂ at the outlet.
This type also supports consuming resources proportionally to the volume of transported Resource
(at the inlet). This could be used for modeling the power needed for operating the pipeline.
Pipeline transport using PipeSimple
is assumed to be unidirectional. It is not possible to use PipeSimple
for bidirectional transport as the consuming resource would in this case be consumed at the wrong Area
.
Fields
id::String
is the identifier used in printed output.inlet::Resource
is theResource
going into transmission.outlet::Resource
is theResource
going out of the outlet of the transmission.consuming::Resource
is theResource
the transmission consumes by operating.consumption_rate::Real
the rate of which the resourcePipeline.consuming
is consumed, as a ratio of the volume of the resource going into the inlet, i.e.:`consumption_rate` = consumed volume / inlet volume (per operational period)
trans_cap::Real
is the capacity of the transmission mode.trans_loss::Real
is the loss of the transported resource during transmission, modelled as a ratio.opex_var::TimeProfile
is the variable operating expense per energy unit transported.opex_fixed::TimeProfile
is the fixed operating expense per installed capacity.data::Array{<:Data}
is the additional data (e.g. for investments). The fielddata
is conditional through usage of a constructor.
EnergyModelsGeography.PipeLinepackSimple
— TypePipeLinepackSimple <: PipeMode
Pipeline model with linepacking implemented as simple storage function.
Fields (additional to PipeSimple
)
id::String
is the identifier used in printed output.inlet::Resource
is theResource
going into transmission.outlet::Resource
is theResource
going out of the outlet of the transmission.consuming::Resource
is theResource
the transmission consumes by operating.consumption_rate::Real
the rate of which the resourcePipeline.consuming
is consumed, as a ratio of the volume of the resource going into the inlet, i.e.:`consumption_rate` = consumed volume / inlet volume (per operational period)
trans_cap::Real
is the capacity of the transmission mode.trans_loss::Real
is the loss of the transported resource during transmission, modelled as a ratio.opex_var::TimeProfile
is the variable operating expense per energy unit transported.opex_fixed::TimeProfile
is the fixed operating expense per installed capacity.energy_share::Float64
is the storage energy capacity relative to pipeline capacity.data::Array{<:Data}
is the additional data (e.g. for investments). The fielddata
is conditional through usage of a constructor.
Functions for accessing fields of TransmissionMode
types
The following functions are defined and exported for accessing fields from a TransmissionMode
:
EnergyModelsGeography.map_trans_resource
— Functionmap_trans_resource(tm)
Returns the transported resource for a given TransmissionMode.
EnergyModelsGeography.loss
— Functionloss(tm::TransmissionMode)
Returns the loss of transmission mode tm
as TimeProfile
.
loss(tm::TransmissionMode, t)
Returns the loss of transmission mode tm
at time period t
.
EnergyModelsGeography.directions
— Functiondirections(tm::TransmissionMode)
Returns the directions of transmission mode tm
.
EnergyModelsGeography.consumption_rate
— Functionconsumption_rate(tm::PipeMode)
Returns the consumption rate of pipe mode tm
as TimeProfile
.
consumption_rate(tm::PipeMode, t)
Returns the consumption rate of pipe mode tm
at time period t
.
EnergyModelsGeography.energy_share
— Functionenergy_share(tm::PipeLinepackSimple)
Returns the energy share of PipeLinepackSimple tm
.
Investment data
InvestmentData
types
Transmission mode investments utilize the same investment data type (SingleInvData
) as investments in node capacities.
Legacy constructors
We provide a legacy constructor, TransInvData
, that uses the same input as in version 0.5.x. If you want to adjust your model to the latest changes, please refer to the section Update your model to the latest version of EnergyModelsInvestments.
EnergyModelsGeography.TransInvData
— FunctionTransInvData(;
capex_trans::TimeProfile,
trans_max_inst::TimeProfile,
trans_max_add::TimeProfile,
trans_min_add::TimeProfile,
inv_mode::Investment = ContinuousInvestment(),
trans_start::Union{Real, Nothing} = nothing,
trans_increment::TimeProfile = FixedProfile(0),
capex_trans_offset::TimeProfile = FixedProfile(0),
)
Legacy constructor for a InvData
.
The new storage descriptions allows now for a reduction in functions which is used to make EnergModelsInvestments
less dependent on EnergyModelsBase
.
The core changes to the existing structure is the move of the required parameters to the type Investment (e.g., the minimum and maximum added capacity is only required for investment mdodes that require these parameters) as well as moving the lifetime
to the type [LifetimeMode
], when required.
See the documentation for further information regarding how you can translate your existing model to the new model.