Internals - EnergyModelsInvestment extensions
Index
EMIExt.InvestmentModel
EMIExt.SingleInvData
EMIExt.StorageInvData
EnergyModelsInvestments.BinaryInvestment
EnergyModelsInvestments.ContinuousInvestment
EnergyModelsInvestments.DiscreteInvestment
EnergyModelsInvestments.FixedInvestment
EnergyModelsInvestments.PeriodLife
EnergyModelsInvestments.RollingLife
EnergyModelsInvestments.SemiContinuousInvestment
EnergyModelsInvestments.SemiContinuousOffsetInvestment
EnergyModelsInvestments.StudyLife
EMIExt.check_inv_data
EnergyModelsBase.InvData
EnergyModelsBase.InvDataStorage
EnergyModelsBase.check_node_data
EnergyModelsBase.check_node_data
EnergyModelsBase.constraints_capacity_installed
EnergyModelsBase.constraints_capacity_installed
EnergyModelsBase.objective
EnergyModelsBase.variables_capex
EnergyModelsInvestments.has_investment
EnergyModelsInvestments.has_investment
EnergyModelsInvestments.investment_data
EnergyModelsInvestments.investment_data
EnergyModelsInvestments.investment_data
Types
EMIExt.InvestmentModel
— TypeInvestmentModel <: EMB.InvestmentModel
Internal 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.SingleInvData
Internal 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.StorageInvData
Internal type for StorageInvData
. The introduction of an internal type is necessary as extensions do not allow to export functions or types.
EnergyModelsInvestments.BinaryInvestment
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
— MethodWhen 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
EMIExt.check_inv_data
— Methodcheck_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
TimeProfile
is aStrategicProfile
, it will check that the profile is in accordance with theTimeStructure
TimeProfile
s inInvestmentData
cannot includeOperationalProfile
,RepresentativeProfile
, orScenarioProfile
as this is not allowed through indexing on theTimeProfile
.
- If the
- The field
:min_add
has to be less than:max_add
if the investment mode is given byContinuousInvestment
orSemiContiInvestment
. - Existing capacity cannot be larger than
:max_inst
capacity in the beginning. IfNoStartInvData
is used, it also checks that the theTimeProfile
capacity_profile
is not includingOperationalProfile
,RepresentativeProfile
, orScenarioProfile
to avoid indexing problems.
EnergyModelsBase.InvData
— MethodEMB.InvData(;kwargs)
Internal method for InvData
. The introduction of an internal method is necessary as extensions do not allow to export functions or types.
EnergyModelsBase.InvDataStorage
— MethodInvDataStorage(;kwargs)
Internal method for InvDataStorage
. The introduction of an internal method is necessary as extensions do not allow to export functions or types.
EnergyModelsBase.check_node_data
— MethodEMB.check_node_data(
n::EMB.Node,
data::InvestmentData,
𝒯,
modeltype::AbstractInvestmentModel,
check_timeprofiles::Bool
)
Performs various checks on investment data for standard nodes.
Checks
- Each node can only have a single
InvestmentData
. - All checks incorporated in the function
check_inv_data
.
EnergyModelsBase.check_node_data
— MethodEMB.check_node_data(
n::Storage,
data::InvestmentData,
𝒯,
modeltype::AbstractInvestmentModel,
check_timeprofiles::Bool,
)
Performs various checks on investment data for standard nodes. It is similar to the standard check nodes functions, but adds checks on
Checks
- Each node can only have a single
InvestmentData
. - The
InvestmentData
must beStorageInvData
. - For each individual investment field all checks incorporated in the function
check_inv_data
.
EnergyModelsBase.constraints_capacity_installed
— MethodEMB.constraints_capacity_installed(
m,
n::EMB.Node,
𝒯::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 type. This is implemented for Storage
nodes.
EnergyModelsBase.constraints_capacity_installed
— MethodEMB.constraints_capacity_installed(
m,
n::Storages,
𝒯::TimeStructure,
modeltype::AbstractInvestmentModel,
)
When the modeltype is an investment model and the node is a Storage
node, 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.objective
— MethodEMB.objective(m, 𝒩, 𝒯, 𝒫, modeltype::AbstractInvestmentModel)
Create objective function overloading the default from EMB for AbstractInvestmentModel
.
Maximize Net Present Value from investments (CAPEX) and operations (OPEX and emission costs)
TODO:
Consider adding contributions from
- revenue (as positive variable, adding positive)
- maintenance based on usage (as positive variable, adding negative)
These variables would need to be introduced through the package SparsVariables
.
Both are not necessary, as it is possible to include them through the OPEX values, but it would be beneficial for a better separation and simpler calculations from the results.
EnergyModelsBase.variables_capex
— MethodEMB.variables_capex(m, 𝒩, 𝒯, 𝒫, modeltype::AbstractInvestmentModel)
Create variables for the capital costs for the invesments in storage and technology nodes.
Additional variables for investment in capacity:
:cap_capex
- CAPEX costs for a technology:cap_current
- installed capacity for storage in each strategic period:cap_add
- added capacity:cap_rem
- removed capacity:cap_invest_b
- binary variable whether investments in capacity are happening:cap_remove_b
- binary variable whether investments in capacity are removed
Additional variables for investment in storage:
:stor_level_capex
- CAPEX costs for increases in the capacity of a storage:stor_level_current
- installed capacity for storage in each strategic period:stor_level_add
- added capacity:stor_level_rem
- removed capacity:stor_level_invest_b
- binary variable whether investments in capacity are happening:stor_level_remove_b
- binary variable whether investments in capacity are removed:stor_charge_capex
- CAPEX costs for increases in the rate of a storage:stor_charge_current
- installed rate for storage in each strategic period:stor_charge_add
- added rate:stor_charge_rem
- removed rate:stor_charge_invest_b
- binary variable whether investments in rate are happening:stor_charge_remove_b
- binary variable whether investments in rate are removed
EnergyModelsInvestments.has_investment
— MethodEMI.has_investment(n::EMB.Node)
For a given Node n
, checks that it contains the required investment data.
EnergyModelsInvestments.has_investment
— MethodEMI.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
— MethodEMI.investment_data(inv_data::SingleInvData)
Return the investment data of the investment data SingleInvData
.
EnergyModelsInvestments.investment_data
— MethodEMI.investment_data(element, field::Symbol)
Return the investment data of the type element
of the capacity field
.
EnergyModelsInvestments.investment_data
— MethodEMI.investment_data(n::EMB.Node)
Return the investment data of the Node n
.