Case description
EnergyModelsBase
data is included in a case. The case was previously declared as a dictionary, but is moved from Version 0.10 to a type for improved flexibility. The following page explains the concepts of the case type.
Index
EnergyModelsBase.AbstractCase
EnergyModelsBase.AbstractElement
EnergyModelsBase.Case
EnergyModelsBase.get_couplings
EnergyModelsBase.get_elements_vec
EnergyModelsBase.get_links
EnergyModelsBase.get_nodes
EnergyModelsBase.get_products
EnergyModelsBase.get_time_struct
Elements
All types in EnergyModelsBase
that require mathemeatical constraints are considered as elements. Elements allow for the incorporations of mathematical constraints. EnergyModelsBase
includes two types of AbstractElement
s, nodes and links. Node
s convert, store, supply or demand resources. They do not possess any direct connections. The connections are incorporated through Link
s which transport resources between different nodes.
EnergyModelsBase.AbstractElement
— Typeabstract type AbstractElement
Abstract elements correspond to the core types of EnergyModelsBase
that form components of an energy system.
Introduced elements
Node
s correspond to technologies that convert energy or mass as defined through the introducedResource
s.Link
s transport theResource
s between different nodes.
It is possible to introduce new elements. These elements can introduce also new variables and constraints.
Case type
The case type is used as input to EnergyModelsBase
models. It contains all information for building a model using the create_model
function.
The fields of the case dictionary correspond to:
T::TimeStructure
is the time structure for which the model should be constructed. Time structures are created using the theTimeStruct
package.EnergyModelsBase
supports all time structures included inTimeStruct
. However, storage balances may violate the upper and lower bound when the time structure includes `OperationalScenarios. In general, it is preferable to utilize either aTwoLevel
orTwoLevelTree
to properly calculate the operational costs and the emissions.products::Vector{<:Resource}
is a vector of all considered resources in the analysis. In theory, it is not necessary that this vector includes all resources, although it must include all instances ofResourceEmit
.elements::Vector{Vector}
is a vector of the vectors ofAbstractElement
s of the analysis, as described above. ThisVector{Vector}
can be extended with additional types for which variables and constraints should be introduced.Type requirement The elements must be provided as
elements::Vector{Vector}
. This implies that if you only want to include a singleAbstractElement
, e.g., only aVector{<:Node}
, you must add an additional empty vector of anAbstractElement
, e.g.,Link
Otherwise, it is not possible to create a case.couplings::Vector{Vector{Function}}
is a vector of vector of functions. The couplings include connections between two distinctiveAbstractElement
types. Coupling implies in this context that twoAbstractElement
type, i.e.,Link
andNode
have common constraints.EnergyModelsBase
provides as potential functionsget_nodes
andget_links
in the coupling. In this case, the Vector would be given as[[get_nodes, get_links]]
.
EnergyModelsBase.AbstractCase
— Typeabstract type AbstractCase
An AbstractCase
is a description of a case to be used within EnergyModelsBase
. It is only required to create a new subtype if you plan to incorporate a new create_model
function.
EnergyModelsBase.Case
— Typestruct Case <: AbstractCase
Type representing a case in EnergyModelsBase
. It replaces the previously used dictionary for providing the input to a model.
Fields
T::TimeStructure
is the time structure of the model.products::Vector{<:Resource}
are the resources that should be incorporated into the model.Tip It must containt all
ResourceEmit
inEnergyModelsBase
, but it is not necessary that theResourceCarrier
are included. It is however advisable to include all resources.elements::Vector{Vector}
are the vectors ofAbstractElement
that should be included in the analysis. It must contain at least vectors of nodes and links for an analysis to be useful.couplings::Vector{Vector{Function}}
are the couplings between the individual function element types. These elements are represented through a corresponding function, e.g.,get_nodes
orget_links
.misc::Dict
is a dictionary that can be utilized for providing additional high level data in the existing format in the case of a new function for case creation. It is conditional through the application of a constructor.
EnergyModelsBase
requires the coupling of links and nodes. Hence, as a default approach, it adds the coupling
couplings = [[get_nodes, get_links]]
in an external constructor if the couplings are not specified.
Functions for accessing different information
EnergyModelsBase.get_time_struct
— Functionget_time_struct(case::Case)
Returns the time structure of the Case case
.
EnergyModelsBase.get_products
— Functionget_products(case::Case)
Returns the vector of products of the Case case
.
EnergyModelsBase.get_elements_vec
— Functionget_elements_vec(case::Case)
Returns the vector of element vectors of the Case case
.
EnergyModelsBase.get_couplings
— Functionget_couplings(case::Case)
Returns the vector of coupling vectors of the Case case
.
EnergyModelsBase.get_nodes
— Functionget_nodes(case::Case)
get_nodes(𝒳ᵛᵉᶜ::Vector{Vector})
Returns the vector of nodes of the Case case
or the vector of elements vectors 𝒳ᵛᵉᶜ.
EnergyModelsBase.get_links
— Functionget_links(case::Case)
get_links(𝒳ᵛᵉᶜ::Vector{Vector})
Returns the vector of links of the Case case
or the vector of elements vectors 𝒳ᵛᵉᶜ.