Methods - EnergyModelsBase
Index
EnergyModelsBase.check_node
EnergyModelsBase.check_node_data
EnergyModelsBase.constraints_capacity
EnergyModelsBase.constraints_flow_in
EnergyModelsBase.constraints_flow_out
EnergyModelsBase.constraints_opex_var
EnergyModelsBase.create_node
EnergyModelsBase.inputs
EnergyModelsBase.outputs
EnergyModelsBase.variables_node
Extension methods
EnergyModelsBase.variables_node
— Functionvariables_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 electrolyzern
is operating in operational periodt
.elect_prev_use[n, t]
is the total use of the electrolyzern
in all previous operational periods up to operational periodt
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 electrolyzern
in all previous investment periods up to investment periodt_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 electrolyzern
in investment periodt_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 electrolyzern
in representative periodt_rp
, declared if theTimeStructure
includesRepresentativePeriods
. 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 electrolyzern
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 electrolyzern
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
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 reformern
is in stateoff
in operational periodt
.ref_start_b[n, t]
is a binary variable which is 1 if reformern
is in statestart-up
in operational periodt
.ref_on_b[n, t]
is a binary variable which is 1 if reformern
is in stateon
in operational periodt
.ref_shut_b[n, t]
is a binary variable which is 1 if reformern
is in stateshutdown
in operational periodt
.
EnergyModelsBase.create_node
— FunctionEMB.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
constraints_usage
,constraints_data
for allnode_data(n)
,constraints_flow_in
,constraints_flow_out
,constraints_capacity
, andconstraints_opex_var
.
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
Constraint methods
EnergyModelsBase.constraints_capacity
— FunctionEMB.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.
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.
EnergyModelsBase.constraints_flow_in
— FunctionEMB.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.
EnergyModelsBase.constraints_flow_out
— FunctionEMB.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
.
EnergyModelsBase.constraints_opex_var
— FunctionEMB.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.
Check methods
EnergyModelsBase.check_node
— FunctionEMB.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 aStrategicPeriod
as outlined in the functionEMB.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 fieldstack_replacement
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functionEMB.check_fixed_opex()
.The field
stack_lifetime
is required to be non-negative.
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 aStrategicPeriod
as outlined in the functionEMB.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 theCommitParameters
of the fieldsstartup
,shutdown
, andoff
is required to be non-negative.The field
time
of theCommitParameters
of the fieldsstartup
,shutdown
, andoff
is required to be non-negative and accessible through aStrategicPeriod
, orRepresentativeperiod
as outlined in the functioncheck_commitment_profile
.The field
rate_limit
is required to be in the range [0,1].
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 fieldcapacity
in the type in the fieldcharge
is required to be non-negative. - The
TimeProfile
of the fieldcapacity
in the type in the fieldlevel
is required to be non-negative`. - The
TimeProfile
of the fieldfixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functioncheck_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 theAbstractStorageParameters
charge
and `level cannot violate the value.
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 fieldcapacity
in the type in the fieldcharge
is required to be non-negative. - The
TimeProfile
of the fieldcapacity
in the type in the fieldlevel
is required to be non-negative`. - The
TimeProfile
of the fieldfixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functioncheck_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 theAbstractStorageParameters
charge
and `level cannot violate the value. - The values of the fields
p_min
,p_charge
, andp_max
are required to be positive. - The values of the fields
p_min
andp_charge
must be smaller thanp_max
. - The value of the field
p_charge
must be smaller thanp_min
.
EnergyModelsBase.check_node_data
— FunctionEMB.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
Field extraction methods
EnergyModelsBase.inputs
— Functioninputs(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.
EnergyModelsBase.outputs
— Functionoutputs(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.