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.AbstractCaseEnergyModelsBase.AbstractElementEnergyModelsBase.CaseEnergyModelsBase.element_dataEnergyModelsBase.get_couplingsEnergyModelsBase.get_elements_vecEnergyModelsBase.get_linksEnergyModelsBase.get_nodesEnergyModelsBase.get_productsEnergyModelsBase.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 AbstractElements, nodes and links. Nodes convert, store, supply or demand resources. They do not possess any direct connections. The connections are incorporated through Links which transport resources between different nodes.
EnergyModelsBase.AbstractElement — Typeabstract type AbstractElementAbstract elements correspond to the core types of EnergyModelsBase that form components of an energy system.
Introduced elements
EnergyModelsBase allows for the potential of extension data which can be extracted through
EnergyModelsBase.element_data — Functionelement_data(x::AbstractElement)Returns the ExtensionData array of AbstractElement x. The function requires the specification of a new method for each AbstractElement.
It is implemented in EnergyModelsBase for
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::TimeStructureis the time structure for which the model should be constructed. Time structures are created using the theTimeStructpackage.EnergyModelsBasesupports 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 aTwoLevelorTwoLevelTreeto 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 ofAbstractElements 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.,LinkOtherwise, 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 distinctiveAbstractElementtypes. Coupling implies in this context that twoAbstractElementtype, i.e.,LinkandNodehave common constraints.EnergyModelsBaseprovides as potential functionsget_nodesandget_linksin the coupling. In this case, the Vector would be given as[[get_nodes, get_links]].
EnergyModelsBase.AbstractCase — Typeabstract type AbstractCaseAn 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 <: AbstractCaseType representing a case in EnergyModelsBase. It replaces the previously used dictionary for providing the input to a model.
Fields
T::TimeStructureis the time structure of the model.products::Vector{<:Resource}are the resources that should be incorporated into the model.Tip It must contain all
ResourceEmits inEnergyModelsBase, but it is not necessary that theResourceCarrierare included. It is however advisable to include all resources.elements::Vector{Vector}are the vectors ofAbstractElementthat should be included in the analysis. It must contain at least the 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_nodesorget_links.misc::Dictis 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.
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 𝒳ᵛᵉᶜ.