Methods - EnergyModelsBase

Index

Extension methods

EnergyModelsBase.variables_nodeFunction
variables_node(m, 𝒩ˢᵗᵒʳ::Vector{<:AbstractElectrolyzer}, 𝒯, modeltype::EnergyModel)

Creates the following additional variables for ALL electrolyzer nodes:

  • elect_on_b[n, t] is binary variable which is 1 if electrolyzer n is operating in operational period t.
  • elect_prev_use[n, t] is the total use of the electrolyzer n in all previous operational periods up to operational period t since the last stack replacement. The value is provided in 1000 operational periods duration to avoid a too large matrix range.
  • elect_prev_use_sp[n, t_inv] is the total use of the electrolyzer n in all previous investment periods up to investment period t_inv since the last stack replacement. The value is provided in 1000 operational periods duration to avoid a too large matrix range.
  • elect_use_sp[n, t_inv] is the total time of usage of electrolyzer n in investment period t_inv. The value is provided in 1000 operational periods duration to avoid a too large matrix range.
  • elect_use_rp[n, t_rp] is the total time of usage of electrolyzer n in representative period t_rp, declared if the TimeStructure includes RepresentativePeriods. The value is provided in 1000 operational periods duration to avoid a too large matrix range.
  • elect_stack_replace_b[n, tinv] is a binary variable to indicate if electrolyzer n has stack replacement (value of 1) in investment period `tinv`. In this case, the efficiency penalty is reset to 0.
  • elect_efficiency_penalty[n, t] is a coefficient that accounts for drop in efficiency of electrolyzer n in operational period due to degradation in the electrolyzer. It starts at 1 and is reset to 1 at the beginning of the investment period with stack replacement
source
EMB.variables_node(m, 𝒩ʳᵉᶠ::Vector{Reformer}, 𝒯, modeltype::EnergyModel)

Creates the following additional variables for ALL reformer nodes:

  • ref_off_b[n, t] is a binary variable which is 1 if reformer n is in state off in operational period t.
  • ref_start_b[n, t] is a binary variable which is 1 if reformer n is in state start-up in operational period t.
  • ref_on_b[n, t] is a binary variable which is 1 if reformer n is in state on in operational period t.
  • ref_shut_b[n, t] is a binary variable which is 1 if reformer n is in state shutdown in operational period t.
source
EnergyModelsBase.create_nodeFunction
EMB.create_node(m, n::AbstractElectrolyzer, 𝒯, 𝒫,  modeltype::EnergyModel)

Set all constraints for an AbstractElectrolyzer. Can serve as fallback option for all unspecified subtypes of AbstractElectrolyzer.

It differs from the function for a standard RefNetworkNode node through both calling additional functions as well as for calculations within the function.

Called constraint functions

source
EMB.create_node(m, n::Reformer, 𝒯, 𝒫, modeltype::EnergyModel)

Set all constraints for a Reformer.

It differs from the function for a standard RefNetworkNode node through both calling additional functions as well as for calculations within the function.

Called constraint functions

source

Constraint methods

EnergyModelsBase.constraints_capacityFunction
EMB.constraints_capacity(
    m,
    n::AbstractHydrogenNetworkNode,
    𝒯::TimeStructure,
    var,
    modeltype::EnergyModel
)

Function for creating operational limits of an AbstractHydrogenNetworkNode.

The operational limits limit the capacity usage of the electrolyzer node between a minimimum and maximum load based on the installed capacity.

TODO:

  • Consider the application of the upper bound only for systems in which the efficiency is given by a piecewise linear function to account for the increased energy demand at loads above the nominal capacity.
source
EMB.constraints_capacity(
    m,
    n::AbstractH2Storage,
    𝒯::TimeStructure,
    modeltype::EnergyModel
)

Function for creating the constraints on the :stor_level, :stor_charge_use, and :stor_discharge_use variables for a AbstractH2Storage node.

The discharge :stor_discharge_use is limited by the installed charging capacity stor_charge_inst and the multiplier discharge_charge due to the limitations given by the physical integrity of the storage vessel and/or the injection connection.

The installed charge capacity :stor_charge_inst times its field level_charge has an upper bound given by the installed storage capacity stor_level_inst. In the case of operational models, this is checked while in the case of investment models, it is constrained.

source
EnergyModelsBase.constraints_flow_inFunction
EMB.constraints_flow_in(m, n::HydrogenStorage, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the inlet flow to a HydrogenStorage node.

It differs from the reference description by considering the dependency of the compression power on the storage level.

This is achieved through calling the subfunction energy_curve for the different breakpoints in the compression curve.

source
EnergyModelsBase.constraints_flow_outFunction
EMB.constraints_flow_out(m, n::Electrolyzer, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the outlet flow from an Electrolyzer node. It differs from the reference description by taking into account stack degradation through the variable :elect_efficiency_penalty.

source
EnergyModelsBase.constraints_opex_varFunction
EMB.constraints_opex_var(m, n::Reformer, 𝒯ᴵⁿᵛ, modeltype::EnergyModel)

Function for creating the constraint on the variable OPEX of a Reformer node. It differs from the reference description through the incorporation of additional costs in each state of the node.

source

Check methods

EnergyModelsBase.check_nodeFunction
EMB.check_node(n::AbstractElectrolyzer, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)

This method checks that an AbstractElectrolyzer node is valid.

It reuses the standard checks of a NetworkNode node through calling the function EMB.check_node_default, but adds an additional check on the data.

Checks

  • The field cap is required to be non-negative.

  • The value of the field fixed_opex is required to be non-negative and accessible through a StrategicPeriod as outlined in the function EMB.check_fixed_opex().

  • The values of the dictionary input are required to be non-negative.

  • The values of the dictionary output are required to be non-negative.

    • The lower limit on capacity utilization is required ot be non-negative while the upper

    limit is required to be larger or equal than the lower limit as described in the check_load_lim()

  • The field degradation_rate is required to be in the range [0,1).

  • The TimeProfile of the field stack_replacement is required to be non-negative and accessible through a StrategicPeriod as outlined in the function EMB.check_fixed_opex().

  • The field stack_lifetime is required to be non-negative.

source
EMB.check_node(n::AbstractReformer, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)

This method checks that an AbstractReformer node is valid.

It reuses the standard checks of a NetworkNode node through calling the function EMB.check_node_default, but adds an additional check on the data.

Checks

  • The field cap is required to be non-negative.

  • The value of the field fixed_opex is required to be non-negative and accessible through a StrategicPeriod as outlined in the function EMB.check_fixed_opex().

  • The values of the dictionary input are required to be non-negative.

  • The values of the dictionary output are required to be non-negative.

  • The lower limit on capacity utilization is required ot be non-negative while the upper limit is required to be larger or equal than the lower limit as described in the check_load_lim()

  • The field opex of the CommitParameters of the fields startup, shutdown, and off is required to be non-negative.

  • The field time of the CommitParameters of the fields startup, shutdown, and off is required to be non-negative and accessible through a StrategicPeriod, or Representativeperiod as outlined in the function check_commitment_profile.

  • The field rate_limit is required to be in the range [0,1].

source
EMB.check_node(n::SimpleHydrogenStorage, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)

This method checks that a SimpleHydrogenStorage node is valid.

It reuses the standard checks of a Storage node through calling the function EMB.check_node_default, but adds an additional check on the data.

Checks

  • The TimeProfile of the field capacity in the type in the field charge is required to be non-negative.
  • The TimeProfile of the field capacity in the type in the field level is required to be non-negative`.
  • The TimeProfile of the field fixed_opex is required to be non-negative and accessible through a StrategicPeriod as outlined in the function check_fixed_opex for the chosen composite type.
  • The values of the dictionary input are required to be non-negative.
  • The values of the dictionary output are required to be non-negative.
  • The value of the field discharge_charge is required to be positive.
  • The value of the field level_charge is required to be positive. The provided capacities in the AbstractStorageParameters charge and `level cannot violate the value.
source
EMB.check_node(n::HydrogenStorage, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)

This method checks that a HydrogenStorage node is valid.

It reuses the standard checks of a Storage node through calling the function EMB.check_node_default, but adds an additional check on the data.

Checks

  • The TimeProfile of the field capacity in the type in the field charge is required to be non-negative.
  • The TimeProfile of the field capacity in the type in the field level is required to be non-negative`.
  • The TimeProfile of the field fixed_opex is required to be non-negative and accessible through a StrategicPeriod as outlined in the function check_fixed_opex for the chosen composite type.
  • The values of the dictionary input are required to be non-negative.
  • The values of the dictionary output are required to be non-negative.
  • The value of the field discharge_charge is required to be positive.
  • The value of the field level_charge is required to be positive. The provided capacities in the AbstractStorageParameters charge and `level cannot violate the value.
  • The values of the fields p_min, p_charge, and p_max are required to be positive.
  • The values of the fields p_min and p_charge must be smaller than p_max.
  • The value of the field p_charge must be smaller than p_min.
source
EnergyModelsBase.check_node_dataFunction
EMB.check_node_data(n::HydrogenStorage, data::InvestmentData, 𝒯, modeltype::AbstractInvestmentModel, check_timeprofiles::Bool)

As HydrogenStorage nodes cannot utilize investments at the time being, a separate function is required

Checks

  • No investment data is allowed
source

Field extraction methods

EnergyModelsBase.inputsFunction
inputs(n::HydrogenStorage)
inputs(n::HydrogenStorage, p::Resource)

When the node n is a HydrogenStorage, the function returns either both the stored and the electricity resource or a value of 1, if a resource p is specified.

source
EnergyModelsBase.outputsFunction
outputs(n::HydrogenStorage)
outputs(n::HydrogenStorage, p::Resource)

When the node n is a HydrogenStorage, the function returns either the stored resource or a value of 1, if a resource p is specified.

source