Internals - EnergyModelsInvestment extension
Index
EMIExt.InvestmentModelEMIExt.SingleInvDataEMIExt.StorageInvDataEnergyModelsInvestments.BinaryInvestmentEnergyModelsInvestments.ContinuousInvestmentEnergyModelsInvestments.DiscreteInvestmentEnergyModelsInvestments.FixedInvestmentEnergyModelsInvestments.PeriodLifeEnergyModelsInvestments.RollingLifeEnergyModelsInvestments.SemiContinuousInvestmentEnergyModelsInvestments.SemiContinuousOffsetInvestmentEnergyModelsInvestments.StudyLifeEMIExt.check_inv_dataEnergyModelsBase.check_link_dataEnergyModelsBase.check_node_dataEnergyModelsBase.constraints_capacity_installedEnergyModelsBase.objective_investEnergyModelsBase.variables_ext_dataEnergyModelsInvestments.has_investmentEnergyModelsInvestments.investment_data
Extension
Types
EMIExt.InvestmentModel — TypeInvestmentModel <: EMB.InvestmentModelInternal type for InvestmentModel. The introduction of an internal type is necessary as extensions do not allow to export functions or types.
EMIExt.SingleInvData — TypeSingleInvData <: EMB.SingleInvDataInternal type for SingleInvData. The introduction of an internal type is necessary as extensions do not allow to export functions or types.
EMIExt.StorageInvData — TypeStorageInvData <: EMB.StorageInvDataInternal type for StorageInvData. The introduction of an internal type is necessary as extensions do not allow to export functions or types.
Functions
EMIExt.check_inv_data — Functioncheck_inv_data(
inv_data::AbstractInvData,
capacity_profile::TimeProfile,
𝒯,
message::String,
check_timeprofiles::Bool,
)Performs various checks on investment data introduced within EnergyModelsInvestments
Checks
- For each field with
TimeProfile:- If the
TimeProfileis aStrategicProfile, it will check that the profile is in accordance with theTimeStructure TimeProfiles inInvestmentDatacannot includeOperationalProfile,RepresentativeProfile, orScenarioProfileas this is not allowed through indexing on theTimeProfile.
- If the
- The field
:min_addhas to be less than:max_addif the investment mode is given byContinuousInvestmentorSemiContiInvestment. - Existing capacity cannot be larger than
:max_instcapacity in the beginning. IfNoStartInvDatais used, it also checks that the theTimeProfilecapacity_profileis not includingOperationalProfile,RepresentativeProfile, orScenarioProfileto avoid indexing problems.
EnergyModelsBase
Methods
EnergyModelsBase.variables_ext_data — MethodEMB.variables_ext_data(m, _::Type{SingleInvData}, 𝒩ᴵⁿᵛ::Vector{<:EMB.Node}, 𝒯, 𝒫, modeltype::AbstractInvestmentModel)
EMB.variables_ext_data(m, _::Type{StorageInvData}, 𝒩ᴵⁿᵛ::Vector{<:EMB.Node}, 𝒯, 𝒫, modeltype::AbstractInvestmentModel)
EMB.variables_ext_data(m, _::Type{SingleInvData}, 𝒩ᴵⁿᵛ::Vector{<:Link}, 𝒯, 𝒫, modeltype::AbstractInvestmentModel)Declaration of different capital expenditures (CAPEX) variables for the element types introduced in EnergyModelsBase. CAPEX variables are only introduced for elements that have in investments as identified through the function EMI.has_investment. All investment variables are declared for all investment periods.
EnergyModelsBase introduces two elements for an energy system, and hence, provides the user with two individual methods for both 𝒩::Vector{<:EMB.Node} and 𝒩::Vector{<:Link}.
The individual capacities require the same variable although with different names. Hence, **prefix** should be replaced in the following to
capfor all nodes with investments except forStorageandAvailabilitynodes,stor_levelfor the storage level capacity ofStoragenodes,stor_chargefor the charge capacity ofStoragenodes,stor_dischargefor the discharge capacity ofStoragenodes, andlink_capfor [Link]s.
The individual variables are then given by:
**prefix**_capexare the capital expenditures in nodenin investment periodt_inv. The CAPEX variable take into account the invested capacity.**prefix**_currentis the capacity of nodenin investment periodt_inv. It is introduced in addition tocap_instto simplify the model design.**prefix**_addare the additions in the installed capacity of nodenin investment periodt_inv. Capacity additions are occuring at the beginning of an investment period.**prefix**_remare the reduction in the installed capacity of nodenin investment periodt_inv. Capacity reductions are occuring at the end of an investment period.**prefix**_invest_bis an auxiliary variable used in some investment modes for the additions in capacities.**prefix**_remove_bis an auxiliary variable used in some investment modes for the reduction of capacities.
EnergyModelsBase.objective_invest — MethodEMB.objective_invest(m, 𝒳, 𝒯ᴵⁿᵛ::TS.AbstractStratPers, modeltype::EnergyModel)Create JuMP expressions indexed over the investment periods 𝒯ᴵⁿᵛ for different elements. The expressions correspond to the investments into the different elements. They are not discounted and do not take the duration of the investment periods into account.
By default, objective expressions are included for:
𝒳 = 𝒩::Vector{<:Node}. In the case of a vector of nodes, the function returns the sum of the capital expenditures for all nodes whose method of the functionhas_investmentreturns true. In the case ofStoragenodes, all capacity investments are considired𝒳 = 𝒩::Vector{<:Link}. In the case of a vector of links, the function returns the sum of the capital expenditures for all links whose method of the functionhas_investmentreturns true.
EnergyModelsBase.constraints_capacity_installed — Methodconstraints_capacity_installed(m, n::Node, 𝒯::TimeStructure, modeltype::AbstractInvestmentModel)
constraints_capacity_installed(m, n::Storage, 𝒯::TimeStructure, modeltype::AbstractInvestmentModel)
constraints_capacity_installed(m, l::Link, 𝒯::TimeStructure, modeltype::AbstractInvestmentModel)When the modeltype is an investment model, the function introduces the related constraints for the capacity expansion. The investment mode and lifetime mode are used for adding constraints.
The default function only accepts nodes with SingleInvData. If you have several capacities for investments, you have to dispatch specifically on the node or link type. This is implemented for Storage nodes where the function introduces the related constraints for the capacity expansions for the fields :charge, :level, and :discharge. This requires the utilization of the StorageInvData investment type, in which the investment mode and lifetime mode are used for adding constraints for each capacity.
EnergyModelsBase.check_node_data — MethodEMB.check_node_data(n::EMB.Node, data::InvestmentData, 𝒯, modeltype::AbstractInvestmentModel, check_timeprofiles::Bool)
EMB.check_node_data(n::Storage, data::InvestmentData, 𝒯, modeltype::AbstractInvestmentModel, check_timeprofiles::Bool)Performs various checks on investment data for standard and Storage nodes.
Checks for standard nodes
- Each node can only have a single
InvestmentData. - All checks incorporated in the function
check_inv_data.
Checks for Storage nodes
- Each node can only have a single
InvestmentData. - The
InvestmentDatamust beStorageInvData. - For each individual investment field all checks incorporated in the function
check_inv_data.
EnergyModelsBase.check_link_data — MethodEMB.check_link_data(l::Link, data::InvestmentData, 𝒯, modeltype::AbstractInvestmentModel, check_timeprofiles::Bool)Performs various checks on investment data for Links.
Checks for standard nodes
- Each link can only have a single
InvestmentData. - All checks incorporated in the function
check_inv_data.
EnergyModelsInvestments
Constructors
The following constructors are only relevant for the legacy constructors introduced within the extension. They do not provide any additional information.
EnergyModelsInvestments.BinaryInvestment — TypeWhen the field cap is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.ContinuousInvestment — TypeWhen the fields min_add and max_add are not included, it is assumed that their values are FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.DiscreteInvestment — TypeWhen the field increment is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.FixedInvestment — TypeWhen the field cap is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.PeriodLife — TypeWhen the field lifetime is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.RollingLife — TypeWhen the field lifetime is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.SemiContinuousInvestment — TypeWhen the fields min_add and max_add are not included, it is assumed that their values are FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.SemiContinuousOffsetInvestment — TypeWhen the fields min_add, max_add, and capex_offset are not included, it is assumed that their values are FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
EnergyModelsInvestments.StudyLife — TypeWhen the field lifetime is not included, it is assumed that its value is FixedProfile(0). This behavior is only for allowing the legacy constructor to work, while it will be removed in the near future.
Methods
EnergyModelsInvestments.has_investment — FunctionEMI.has_investment(n::EMB.Node)For a given Node n, checks that it contains the required investment data.
EMI.has_investment(l::Link)For a given Link l, checks that it contains the required investment data.
EMI.has_investment(n::Storage, field::Symbol)For a given Storage node, checks that it contains investments for the field field, that is :charge, :level, or :discharge.
EnergyModelsInvestments.investment_data — FunctionEMI.investment_data(inv_data::SingleInvData)Return the investment data of the investment data SingleInvData.
EMI.investment_data(n::EMB.Node)
EMI.investment_data(l::Link)
EMI.investment_data(n::EMB.Node, field::Symbol)
EMI.investment_data(l::Link, field::Symbol)Return the InvestmentData of the Node n or Link l. It will return an error if the if the Node n or Link l does not have investment data.
If field is specified, it returns the InvData for the corresponding capacity.