EnergyModelsBase.EnergyModelsBaseModule

Main module for EnergyModelsBase a framework for building flexible energy system models.

It exports several types and associated functions for accessing fields. In addition, all required functions for creaeting and running the model are exported.

You can find the exported types and functions below or on the pages Constraint functions and Data functions.

EnergyModelsBase.CaptureEnergyEmissionsType

Capture the energy usage related emissions, but not the process emissions. Does not require emissions as input, but can be supplied.

Fields

  • emissions::Dict{ResourceEmit, T}: emissions per unit produced.

  • co2_capture::Float64 is the CO₂ capture rate.

EnergyModelsBase.CaptureProcessEmissionsType

Capture the process emissions, but not the energy usage related emissions.

Fields

  • emissions::Dict{ResourceEmit, T}: emissions per unit produced.

  • co2_capture::Float64 is the CO₂ capture rate.

EnergyModelsBase.CaptureProcessEnergyEmissionsType

Capture both the process emissions and the energy usage related emissions.

Fields

  • emissions::Dict{ResourceEmit, T}: emissions per unit produced.

  • co2_capture::Float64 is the CO₂ capture rate.

EnergyModelsBase.DataType

Abstract type used to define concrete struct containing the package specific elements to add to the composite type defined in this package.

EnergyModelsBase.DirectType

Direct <: Link

A direct link between two nodes.

Fields

  • id is the name/identifier of the link.

  • from::Node is node from which there is flow into the link.

  • to::Node is node to which there is flow out of the link.

  • formulation::Formulation is the used formulation of links. If not specified, a Linear link is assumed.

EnergyModelsBase.EmissionsEnergyType

No capture, no process emissions are present. Does not require co2_capture or emissions as input, but accepts it and will ignore it, if provided.

EnergyModelsBase.EmissionsProcessType

No capture, but process emissions are present. Does not require co2_capture as input, but accepts it and will ignore it, if provided.

Fields

  • emissions::Dict{ResourceEmit, T}: emissions per unit produced.
EnergyModelsBase.GenAvailabilityType

A reference Availability node.

Fields

  • id is the name/identifier of the node.

  • inputs::Vector{<:Resource} are the input Resources.

  • output::Vector{<:Resource} are the output Resources.

A constructor is provided so that only a single array can be provided with the fields:

  • id is the name/identifier of the node.

  • 𝒫::Vector{<:Resource} are the Resources.

EnergyModelsBase.GenAvailabilityMethod

Legacy constructor for a GenAvailability. This version will be discontinued in the near future and replaced with the new implementation of data.

See the documentation for further information.

EnergyModelsBase.OperationalModelType

Operational Energy Model without investments.

Fields

  • emission_limit::Dict{<:ResourceEmit, <:TimeProfile} is a dictionary with individual emission limits as TimeProfile for each emission resource ResourceEmit.

  • emission_price::Dict{<:ResourceEmit, <:TimeProfile} are the prices for the different emissions types considered.

  • co2_instance is a ResourceEmit and corresponds to the type used for CO₂.

EnergyModelsBase.OperationalModelMethod

Legacy constructor for an OperationalModel without emission prices. This version will be discontinued in the near future and replaced with the new implementation with an emission price.

See the documentation for further information regarding the introduction of an emission price.

EnergyModelsBase.RefNetworkNodeType

A reference NetworkNode node.

Fields

  • id is the name/identifier of the node.

  • cap::TimeProfile is the installed capacity.

  • opex_var::TimeProfile is the variational operational costs per energy unit produced.

  • opex_fixed::TimeProfile is the fixed operational costs.

  • input::Dict{<:Resource, <:Real} are the input Resources with conversion value Real.

  • output::Dict{<:Resource, <:Real} are the generated Resources with conversion value Real.

  • data::Vector{Data} is the additional data (e.g. for investments). The field data is conditional through usage of a constructor.

EnergyModelsBase.RefSinkType

A reference Sink node.

This node corresponds to a demand given by the field cap.

Fields

  • id is the name/identifier of the node.

  • cap::TimeProfile is the Demand.

  • penalty::Dict{Any, TimeProfile} are penalties for surplus or deficits. Requires the fields :surplus and :deficit.

  • input::Dict{<:Resource, <:Real} are the input Resources with conversion value Real.

  • data::Vector{Data} is the additional data (e.g. for investments). The field data is conditional through usage of a constructor.

EnergyModelsBase.RefSinkMethod

Legacy constructor for a RefSink node with [process] emissions. This version will be discontinued in the near future and replaced with the new implementation of data.

See the documentation for further information. In this case, the emission data can be implemented by the new EmissionsData type EmissionsProcess

EnergyModelsBase.RefSourceType

A reference Source node.

Fields

  • id is the name/identifier of the node.

  • cap::TimeProfile is the installed capacity.

  • opex_var::TimeProfile is the variational operational costs per energy unit produced.

  • opex_fixed::TimeProfile is the fixed operational costs.

  • output::Dict{<:Resource, <:Real} are the generated Resources with conversion value Real.

  • data::Vector{Data} is the additional data (e.g. for investments). The field data is conditional through usage of a constructor.

EnergyModelsBase.RefSourceMethod

Legacy constructor for a RefSource node with emissions. This version will be discontinued in the near future and replaced with the new implementation of data.

See the documentation for further information. In this case, the emission data can be implemented by the new EmissionsData type EmissionsProcess

EnergyModelsBase.RefStorageType

A reference Storage node.

This node is designed to store either a ResourceCarrier or a ResourceEmit. It is designed as a composite type to automatically distinguish between these two.

Fields

  • id is the name/identifier of the node.

  • rate_cap::TimeProfile is the installed rate capacity, that is e.g. power or mass flow.

  • stor_cap::TimeProfile is the installed storage capacity, that is e.g. energy or mass.

  • opex_var::TimeProfile is the variational operational costs per energy unit stored.

  • opex_fixed::TimeProfile is the fixed operational costs.

  • stor_res::T is the stored Resource.

  • input::Dict{<:Resource, <:Real} are the input Resources with conversion value Real.

  • output::Dict{<:Resource, <:Real} are the generated Resources with conversion value Real. Only relevant for linking and the stored Resource.

  • data::Vector{<:Data} is the additional data (e.g. for investments). The field data is conditional through usage of a constructor.

EnergyModelsBase.ResourceEmitType

Resources that can can be emitted (e.g., CO₂, CH₄, NOₓ).

These resources can be included as resources that are emitted, e.g, in the variable $\texttt{emissions\_strategic}$.

Fields

  • id is the name/identifyer of the resource.

  • co2_int::T is the the CO₂ intensity, e.g., t/MWh.

EnergyModelsBase.RefNetworkMethod

Legacy constructor for a RefNetwork node. This version will be discontinued in the near future. its new name is given by RefNetworkNode.

EnergyModelsBase.RefNetworkEmissionsMethod

Legacy constructor for a RefNetworkEmissions node. This version will be discontinued in the near future and replaced with the new implementation of data and the application of RefNetworkNode.

See the documentation for further information. In this case, the emission data can be implemented by the new EmissionsData type CaptureEnergyEmissions.

EnergyModelsBase.RefStorageEmissionsMethod

Legacy constructor for a RefStorageEmissions. This version will be discontinued in the near future and replaced with the new version of RefStorage.

See the documentation for further information. In this case, the key difference is that it uses now a parametric type instead of a standard composite type to differentiate between the storage of ResourceCarrier or ResourceEmit

EnergyModelsBase.capacityMethod
capacity(n::Node, t)

Returns the capacity of a node n at operational period t. In the case of a Storage node, the capacity is returned as NamedTuple with the fields level and rate.

EnergyModelsBase.capacityMethod
capacity(n::Node)

Returns the capacity of a node n as TimeProfile. In the case of a Storage node, the capacity is returned as NamedTuple with the fields level and rate.

EnergyModelsBase.check_dataMethod
check_data(case, modeltype)

Check if the case data is consistent. Use the @assert_or_log macro when testing. Currently only checking node data.

EnergyModelsBase.check_nodeMethod
check_node(n, 𝒯, modeltype::EnergyModel)

Check that the fields of a Node corresponds to required structure.

EnergyModelsBase.collect_typesMethod
collect_types(types_list)

Return a Dict of all the give types_list and their supertypes. The keys in the dictionary are the types, and their corresponding value is the number in the type hierarchy.

E.g., Node is at the top and will thus have the value 1. Types just below Node will have value 2, and so on.

EnergyModelsBase.constraints_capacityMethod
constraints_capacity(m, n::Node, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the maximum capacity of a generic Node. This function serves as fallback option if no other function is specified for a Node.

EnergyModelsBase.constraints_capacityMethod
constraints_capacity(m, n::Sink, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the maximum capacity of a generic Sink. This function serves as fallback option if no other function is specified for a Sink.

EnergyModelsBase.constraints_capacityMethod
constraints_capacity(m, n::Storage, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the maximum level of a generic Storage. This function serves as fallback option if no other function is specified for a Storage.

EnergyModelsBase.constraints_capacity_installedMethod
constraints_capacity_installed(m, n, 𝒯::TimeStructure, modeltype::EnergyModel)

In general, it is prefered to have the capacity as a function of a variable given with a value of 1 in the field n.Cap.

EnergyModelsBase.constraints_dataMethod
constraints_data(m, n::Node, 𝒯, 𝒫, modeltype, data::Data)

Fallback option when data is specified, but it is not desired to add the constraints through this function. This is, e.g., the case for EnergyModelsInvestments as the capacity constraint has to be replaced

EnergyModelsBase.constraints_dataMethod
constraints_data(m, n::Node, 𝒯, 𝒫, modeltype, data::DataEmissions)

Constraints functions for calculating both the emissions and amount of CO₂ captured in the process.

There exist several configurations:

  • EmissionsEnergy: Only energy usage related emissions.

  • EmissionsProcess: Both process and energy usage related emissions.

  • CaptureEnergyEmissions: Capture of energy usage related emissions, can include process emissions.

  • CaptureProcessEmissions: Capture of process emissions.

  • CaptureProcessEnergyEmissions: Capture of both process and energy usage related

emissions.

EnergyModelsBase.constraints_emissionsMethod
constraints_emissions(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)

Create constraints for the emissions accounting for both operational and strategic periods.

EnergyModelsBase.constraints_flow_inMethod
constraints_flow_in(m, n, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the inlet flow to a generic Node. This function serves as fallback option if no other function is specified for a Node.

EnergyModelsBase.constraints_flow_inMethod
constraints_flow_in(m, n::Storage, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the inlet flow to a generic Storage. This function serves as fallback option if no other function is specified for a Storage.

EnergyModelsBase.constraints_flow_outMethod
constraints_flow_out(m, n, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the outlet flow from a generic Node. This function serves as fallback option if no other function is specified for a Node.

EnergyModelsBase.constraints_levelMethod
constraints_level(m, n::Storage, 𝒯, 𝒫, modeltype::EnergyModel)

Function for creating the level constraint for a reference storage node with a ResourceCarrier resource.

EnergyModelsBase.constraints_level_auxMethod
constraints_level_aux(m, n::RefStorage{S}, 𝒯, 𝒫, modeltype::EnergyModel) where {S<:ResourceCarrier}

Function for creating the Δ constraint for the level of a reference storage node with a ResourceCarrier resource.

EnergyModelsBase.constraints_level_auxMethod
constraints_level_aux(m, n::RefStorage{S}, 𝒯, 𝒫, modeltype::EnergyModel) where {S<:ResourceEmit}

Function for creating the Δ constraint for the level of a reference storage node with a ResourceEmit resource.

EnergyModelsBase.constraints_level_spMethod
constraints_level_sp(
    m,
    n::RefStorage{S},
    t_inv::TS.StrategicPeriod{T, RepresentativePeriods{U, T, SimpleTimes{T}}},
    𝒫,
    modeltype::EnergyModel
    ) where {S<:ResourceCarrier, T, U}

Function for creating the level constraint for a reference storage node with a ResourceCarrier resource when the operational TimeStructure is given as RepresentativePeriods.

EnergyModelsBase.constraints_level_spMethod
constraints_level_sp(
    m,
    n::RefStorage{S},
    t_inv::TS.StrategicPeriod{T, RepresentativePeriods{U, T, SimpleTimes{T}}},
    𝒫,
    modeltype::EnergyModel
    ) where {S<:ResourceEmit, T, U}

Function for creating the level constraint for a reference storage node with a ResourceEmit resource when the operational TimeStructure is given as RepresentativePeriods.

EnergyModelsBase.constraints_level_spMethod
constraints_level_sp(
    m,
    n::RefStorage{S},
    t_inv::TS.StrategicPeriod{T, U},
    𝒫,
    modeltype::EnergyModel
    ) where {S<:ResourceCarrier, T, U<:SimpleTimes}

Function for creating the level constraint for a reference storage node with a ResourceCarrier resource when the operational TimeStructure is given as SimpleTimes.

EnergyModelsBase.constraints_level_spMethod
constraints_level_sp(
    m,
    n::RefStorage{S},
    t_inv::TS.StrategicPeriod{T, U},
    𝒫,
    modeltype::EnergyModel
    ) where {S<:ResourceEmit, T, U<:SimpleTimes}

Function for creating the level constraint for a reference storage node with a ResourceEmit resource when the operational TimeStructure is given as SimpleTimes.

EnergyModelsBase.constraints_nodeMethod
constraints_node(m, 𝒩, 𝒯, 𝒫, ℒ, modeltype::EnergyModel)

Create link constraints for each n ∈ 𝒩 depending on its type and calling the function create_node(m, n, 𝒯, 𝒫) for the individual node constraints.

Create constraints for fixed OPEX.

EnergyModelsBase.constraints_opex_fixedMethod
constraints_opex_fixed(m, n::Node, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the fixed OPEX of a generic Node. This function serves as fallback option if no other function is specified for a Node.

EnergyModelsBase.constraints_opex_fixedMethod
constraints_opex_fixed(m, n::Sink, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the fixed OPEX of a generic Sink. This function serves as fallback option if no other function is specified for a Sink.

EnergyModelsBase.constraints_opex_fixedMethod
constraints_opex_fixed(m, n::Storage, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the fixed OPEX of a generic Storage. This function serves as fallback option if no other function is specified for a Storage.

EnergyModelsBase.constraints_opex_fixedMethod
constraints_opex_fixed(m, n::Storage, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the fixed OPEX of a generic Storage. This function serves as fallback option if no other function is specified for a Storage.

EnergyModelsBase.constraints_opex_varMethod
constraints_opex_var(m, n::Node, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the variable OPEX of a generic Node. This function serves as fallback option if no other function is specified for a Node.

EnergyModelsBase.constraints_opex_varMethod
constraints_opex_var(m, n::Sink, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the variable OPEX of a generic Sink. This function serves as fallback option if no other function is specified for a Sink.

EnergyModelsBase.constraints_opex_varMethod
constraints_opex_var(m, n::Storage, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the variable OPEX of a generic Storage. This function serves as fallback option if no other function is specified for a Storage.

EnergyModelsBase.constraints_opex_varMethod
constraints_opex_var(m, n::RefStorage{T}, 𝒯ᴵⁿᵛ, modeltype::EnergyModel) where {T<:ResourceEmit}

Function for creating the constraint on the variable OPEX of a RefStorage{ResourceEmit}.

EnergyModelsBase.create_linkMethod
create_link(m, 𝒯, 𝒫, l, formulation::Formulation)

Set the constraints for a simple Link (input = output). Can serve as fallback option for all unspecified subtypes of Link.

EnergyModelsBase.create_modelMethod
create_model(case, modeltype::EnergyModel)

Create the model and call all required functions based on provided modeltype and case data.

EnergyModelsBase.create_nodeMethod
create_node(m, n::Availability, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a Availability. Can serve as fallback option for all unspecified subtypes of Availability.

Availability nodes can be seen as routing nodes. It is not necessary to have more than one available node except if one wants to include as well transport between different Availability nodes with associated costs (not implemented at the moment).

EnergyModelsBase.create_nodeMethod
create_node(m, n::NetworkNode, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a NetworkNode. Can serve as fallback option for all unspecified subtypes of NetworkNode.

EnergyModelsBase.create_nodeMethod
create_node(m, n::Sink, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a Sink. Can serve as fallback option for all unspecified subtypes of Sink.

EnergyModelsBase.create_nodeMethod
create_node(m, n::Source, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a Source. Can serve as fallback option for all unspecified subtypes of Source.

EnergyModelsBase.create_nodeMethod
create_node(m, n::Storage, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a Storage. Can serve as fallback option for all unspecified subtypes of Storage.

EnergyModelsBase.emission_limitMethod
emission_limit(model::EnergyModel, p::ResourceEmit, t_inv::TS.StrategicPeriod)

Returns the emission limit of EnergyModel model and ResourceEmit p in strategic period period t_inv.

EnergyModelsBase.emission_limitMethod
emission_limit(model::EnergyModel, p::ResourceEmit)

Returns the emission limit of EnergyModel model and ResourceEmit p as TimeProfile.

EnergyModelsBase.emission_limitMethod
emission_limit(model::EnergyModel)

Returns the emission limit of EnergyModel model as dictionary with TimeProfiles for each ResourceEmit.

EnergyModelsBase.emission_priceMethod
emission_price(model::EnergyModel, p::ResourceEmit, t_inv::TS.StrategicPeriod)

Returns the emission price of EnergyModel model and ResourceEmit p in strategic period t_inv. If no emission price is specified for the ResourceEmit p, the function returns 0

EnergyModelsBase.emission_priceMethod
emission_price(model::EnergyModel, p::ResourceEmit)

Returns the emission price of EnergyModel model and ResourceEmit p as TimeProfile. If no emission price is specified for the ResourceEmit p, the function returns 0

EnergyModelsBase.emission_priceMethod
emission_price(model::EnergyModel)

Returns the emission price of EnergyModel model as dictionary with TimeProfiles for each ResourceEmit.

EnergyModelsBase.has_inputMethod
has_input(n::Node)

Return logic whether the node is an input node, i.e., Sink and NetworkNode nodes.

EnergyModelsBase.has_outputMethod
has_output(n::Node)

Return logic whether the node is an output node, i.e., Source and NetworkNode nodes.

EnergyModelsBase.inputsMethod
inputs(n::Node, p::Resource)

Returns the value of an input resource p of a node n.

EnergyModelsBase.inputsMethod
inputs(n::Node)

Returns the input resources of a node n. These resources are specified via the field input.

EnergyModelsBase.multipleMethod
multiple(t_inv, t)

Provide a simplified function for returning the combination of the functions duration(t) * multiplestrat(tinv, t) * probability(t)

EnergyModelsBase.node_subFunction
nodes_sub(𝒩::Array{<:Node}, sub/subs)

Return nodes that are of type sub/subs for a given Array ::Array{<:Node}.

EnergyModelsBase.nodes_inputMethod
nodes_input(𝒩::Array{<:Node}, sub)

Return nodes that have an input, i.e., Sink and NetworkNode nodes.

EnergyModelsBase.nodes_not_avMethod
nodes_not_av(𝒩::Array{<:Node})

Return nodes that are not Availability nodes for a given Array ::Array{<:Node}.

EnergyModelsBase.nodes_not_subFunction
nodes_not_sub(𝒩::Array{<:Node}, sub)

Return nodes that are not of type sub for a given Array ::Array{<:Node}.

EnergyModelsBase.objectiveMethod
objective(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)

Create the objective for the optimization problem for a given modeltype.

EnergyModelsBase.outputsMethod
outputs(n::Node)

Returns the output resources of a node n. These resources are specified via the field output.

EnergyModelsBase.process_emissionsMethod
process_emissions(data::EmissionsData{T}, p:ResourceEmit, t)

Returns the the process emissions of resource p in the data at operational period t. If there are no process emissions, it returns a value of 0.

EnergyModelsBase.process_emissionsMethod
process_emissions(data::EmissionsData{T}, p::ResourceEmit)

Returns the the process emissions of resource p in the data as TimeProfile. If the process emissions are provided as Float64, it returns a FixedProfile(x). If there are no process emissions, it returns a FixedProfile(0).

EnergyModelsBase.res_emMethod
res_em(𝒫::Array{<:Resource})

Returns all emission resources for a

  • a given array ::Array{<:Resource}.The output is in this case an Array{<:Resource}
  • a given dictionary ::Dict.The output is in this case a dictionary Dict with the correct fields
EnergyModelsBase.res_notMethod
res_not(𝒩::Array{<:Resource}, res_inst)

Return all resources that are not res_inst for

  • a given array ::Array{<:Resource}.The output is in this case an Array{<:Resource}
  • a given dictionary ::Dict.The output is in this case a dictionary Dict with the correct fields
EnergyModelsBase.res_subFunction
res_sub(𝒫::Array{<:Resource}, sub = ResourceEmit)

Return resources that are of type sub for a given Array ::Array{Resource}.

EnergyModelsBase.run_modelMethod
run_model(case::Dict, model::EnergyModel, optimizer)

Take the case data as a dictionary and the model and build and optimize the model. Returns the solved JuMP model.

The dictionary requires the keys:

  • :nodes::Vector{Node}
  • :links::Vector{Link}
  • :products::Vector{Resource}
  • :T::TimeStructure
EnergyModelsBase.sort_typesMethod
sort_types(types_list::Dict)

Sort the result of collect_types and return a vector where a supertype comes before all its subtypes.

EnergyModelsBase.variables_capacityMethod
variables_capacity(m, 𝒩, 𝒯, modeltype::EnergyModel)

Creation of different capacity variables for nodes 𝒩ⁿᵒᵗ that are neither Storage nor Availability nodes. These variables are:

  • :cap_use - use of a technology node in each operational period
  • :cap_inst - installed capacity in each operational period in terms of either :flow_in

or :flow_out (depending on node n ∈ 𝒩)

Creation of different storage variables for Storage nodes 𝒩ˢᵗᵒʳ. These variables are:

  • :stor_level - storage level at the end of each operational period
  • :stor_level_Δ_op - storage level change in each operational period
  • :stor_level_Δ_rp - storage level change in each representative period
  • :stor_rate_use - storage rate use in each operational period
  • :stor_cap_inst - installed capacity for storage in each operational period, constrained

in the operational case to n.stor_cap

  • :stor_rate_inst - installed rate for storage, e.g. power in each operational period,

constrained in the operational case to n.rate_cap

EnergyModelsBase.variables_capexMethod
variables_capex(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)

Declaration of the CAPEX variables of the model for each investment period 𝒯ᴵⁿᵛ ∈ 𝒯. Empty for operational models but required for multiple dispatch in investment model.

EnergyModelsBase.variables_emissionMethod
variables_emission(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)

Declaration of emission variables per technology node with emissions n ∈ 𝒩ᵉᵐ and emission resource 𝒫ᵉᵐ ∈ 𝒫.

The emission variables are differentiated in:

  • :emissions_node - emissions of a node in an operational period,
  • :emissions_total - total emissions in an operational period, and
  • :emissions_strategic - total strategic emissions, constrained to an upper limit based on the field emission_limit of the EnergyModel.
EnergyModelsBase.variables_flowMethod
variables_flow(m, 𝒩, 𝒯, 𝒫, ℒ, modeltype::EnergyModel)

Declaration of the individual input (:flow_in) and output (:flow_out) flowrates for each technological node n ∈ 𝒩 and link l ∈ ℒ (:link_in and :link_out).

EnergyModelsBase.variables_nodeMethod

" variables_node(m, 𝒩ˢᵘᵇ::Vector{<:Node}, 𝒯, modeltype::EnergyModel)

Default fallback method when no function is defined for a node type.

EnergyModelsBase.variables_nodeMethod
variables_node(m, 𝒩ˢⁱⁿᵏ::Vector{<:Sink}, 𝒯, modeltype::EnergyModel)

Declaration of both surplus (:sink_surplus) and deficit (:sink_deficit) variables for Sink nodes 𝒩ˢⁱⁿᵏ to quantify when there is too much or too little energy for satisfying the demand.

EnergyModelsBase.variables_nodesMethod
variables_nodes(m, 𝒩, 𝒯, modeltype::EnergyModel)

Loop through all node types and create variables specific to each type. This is done by calling the method variables_node on all nodes of each type.

The node type representing the widest cathegory will be called first. That is, variables_node will be called on a Node before it is called on NetworkNode-nodes.

EnergyModelsBase.variables_opexMethod
variables_opex(m, 𝒩, 𝒯, 𝒫, modeltype::EnergyModel)

Declaration of the OPEX variables (:opex_var and :opex_fixed) of the model for each period 𝒯ᴵⁿᵛ ∈ 𝒯. Variable OPEX can be non negative to account for revenue streams.

EnergyModelsBase.@assert_or_logMacro
assert_or_log(ex, msg)

Macro that extends the behaviour of the @assert macro. The switch ASSERTS_AS_LOG, controls if the macro should act as a logger or a normal @assert. This macro is designed to be used to check whether the data provided is consistent.