Methods - EnergyModelsBase
Index
EnergyModelsBase.check_nodeEnergyModelsBase.check_node_dataEnergyModelsBase.constraints_capacityEnergyModelsBase.constraints_flow_inEnergyModelsBase.constraints_flow_outEnergyModelsBase.constraints_opex_varEnergyModelsBase.create_nodeEnergyModelsBase.inputsEnergyModelsBase.outputsEnergyModelsBase.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 electrolyzernis operating in operational periodt.elect_prev_use[n, t]is the total use of the electrolyzernin all previous operational periods up to operational periodtsince 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 electrolyzernin all previous investment periods up to investment periodt_invsince 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 electrolyzernin 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 electrolyzernin representative periodt_rp, declared if theTimeStructureincludesRepresentativePeriods. 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 electrolyzernhas 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 electrolyzernin 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 reformernis in stateoffin operational periodt.ref_start_b[n, t]is a binary variable which is 1 if reformernis in statestart-upin operational periodt.ref_on_b[n, t]is a binary variable which is 1 if reformernis in stateonin operational periodt.ref_shut_b[n, t]is a binary variable which is 1 if reformernis in stateshutdownin 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_datafor 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
capis required to be non-negative.The value of the field
fixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the functionEMB.check_fixed_opex().The values of the dictionary
inputare required to be non-negative.The values of the dictionary
outputare 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_rateis required to be in the range [0,1).The
TimeProfileof the fieldstack_replacementis required to be non-negative and accessible through aStrategicPeriodas outlined in the functionEMB.check_fixed_opex().The field
stack_lifetimeis 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
capis required to be non-negative.The value of the field
fixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the functionEMB.check_fixed_opex().The values of the dictionary
inputare required to be non-negative.The values of the dictionary
outputare 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
opexof theCommitParametersof the fieldsstartup,shutdown, andoffis required to be non-negative.The field
timeof theCommitParametersof the fieldsstartup,shutdown, andoffis required to be non-negative and accessible through aStrategicPeriod, orRepresentativeperiodas outlined in the functioncheck_commitment_profile.The field
rate_limitis 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
TimeProfileof the fieldcapacityin the type in the fieldchargeis required to be non-negative. - The
TimeProfileof the fieldcapacityin the type in the fieldlevelis required to be non-negative`. - The
TimeProfileof the fieldfixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the functioncheck_fixed_opexfor the chosen composite type. - The values of the dictionary
inputare required to be non-negative. - The values of the dictionary
outputare required to be non-negative. - The value of the field
discharge_chargeis required to be positive. - The value of the field
level_chargeis required to be positive. The provided capacities in theAbstractStorageParameterschargeand `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
TimeProfileof the fieldcapacityin the type in the fieldchargeis required to be non-negative. - The
TimeProfileof the fieldcapacityin the type in the fieldlevelis required to be non-negative`. - The
TimeProfileof the fieldfixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the functioncheck_fixed_opexfor the chosen composite type. - The values of the dictionary
inputare required to be non-negative. - The values of the dictionary
outputare required to be non-negative. - The value of the field
discharge_chargeis required to be positive. - The value of the field
level_chargeis required to be positive. The provided capacities in theAbstractStorageParameterschargeand `level cannot violate the value. - The values of the fields
p_min,p_charge, andp_maxare required to be positive. - The values of the fields
p_minandp_chargemust be smaller thanp_max. - The value of the field
p_chargemust 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.