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

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.AbstractElementType
abstract type AbstractElement

Abstract elements correspond to the core types of EnergyModelsBase that form components of an energy system.

Introduced elements

  • Nodes correspond to technologies that convert energy or mass as defined through the introduced Resources.
  • Links transport the Resources between different nodes.
Additional AbstractElement

It is possible to introduce new elements. These elements can introduce also new variables and constraints.

source

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:

  1. T::TimeStructure is the time structure for which the model should be constructed. Time structures are created using the the TimeStruct package. EnergyModelsBase supports all time structures included in TimeStruct. However, storage balances may violate the upper and lower bound when the time structure includes `OperationalScenarios. In general, it is preferable to utilize either a TwoLevel or TwoLevelTree to properly calculate the operational costs and the emissions.

  2. 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 of ResourceEmit.

  3. elements::Vector{Vector} is a vector of the vectors of AbstractElements of the analysis, as described above. This Vector{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 single AbstractElement, e.g., only a Vector{<:Node}, you must add an additional empty vector of an AbstractElement, e.g., Link Otherwise, it is not possible to create a case.

  4. couplings::Vector{Vector{Function}} is a vector of vector of functions. The couplings include connections between two distinctive AbstractElement types. Coupling implies in this context that two AbstractElement type, i.e., Link and Node have common constraints. EnergyModelsBase provides as potential functions get_nodes and get_links in the coupling. In this case, the Vector would be given as [[get_nodes, get_links]].

EnergyModelsBase.AbstractCaseType
abstract 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.

source
EnergyModelsBase.CaseType
struct 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 in EnergyModelsBase, but it is not necessary that the ResourceCarrier are included. It is however advisable to include all resources.

  • elements::Vector{Vector} are the vectors of AbstractElement 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 or get_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.
Couplings

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.

source
EnergyModelsBase.get_nodesFunction
get_nodes(case::Case)
get_nodes(𝒳ᵛᵉᶜ::Vector{Vector})

Returns the vector of nodes of the Case case or the vector of elements vectors 𝒳ᵛᵉᶜ.

source
EnergyModelsBase.get_linksFunction
get_links(case::Case)
get_links(𝒳ᵛᵉᶜ::Vector{Vector})

Returns the vector of links of the Case case or the vector of elements vectors 𝒳ᵛᵉᶜ.

source