Internals - EnergyModelsInvestment extensions

Index

Types

EMIExt.InvestmentModelType
InvestmentModel <: EMB.InvestmentModel

Internal type for InvestmentModel. The introduction of an internal type is necessary as extensions do not allow to export functions or types.

source
EMIExt.SingleInvDataType
SingleInvData <: EMB.SingleInvData

Internal type for SingleInvData. The introduction of an internal type is necessary as extensions do not allow to export functions or types.

source
EMIExt.StorageInvDataType
StorageInvData <: EMB.StorageInvData

Internal type for StorageInvData. The introduction of an internal type is necessary as extensions do not allow to export functions or types.

source
EnergyModelsInvestments.BinaryInvestmentMethod

When 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.

source
EnergyModelsInvestments.ContinuousInvestmentMethod

When 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.

source
EnergyModelsInvestments.DiscreteInvestmentMethod

When 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.

source
EnergyModelsInvestments.FixedInvestmentMethod

When 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.

source
EnergyModelsInvestments.PeriodLifeMethod

When 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.

source
EnergyModelsInvestments.RollingLifeMethod

When 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.

source
EnergyModelsInvestments.SemiContinuousInvestmentMethod

When 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.

source
EnergyModelsInvestments.SemiContinuousOffsetInvestmentMethod

When 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.

source
EnergyModelsInvestments.StudyLifeMethod

When 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.

source

Methods

EMIExt.check_inv_dataMethod
check_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 a StrategicProfile, it will check that the profile is in accordance with the TimeStructure
    • TimeProfiles in InvestmentData cannot include OperationalProfile, RepresentativeProfile, or ScenarioProfile as this is not allowed through indexing on the TimeProfile.
  • The field :min_add has to be less than :max_add if the investment mode is given by ContinuousInvestment or SemiContiInvestment.
  • Existing capacity cannot be larger than :max_inst capacity in the beginning. If NoStartInvData is used, it also checks that the the TimeProfile capacity_profile is not including OperationalProfile, RepresentativeProfile, or ScenarioProfile to avoid indexing problems.
source
EnergyModelsBase.InvDataMethod
EMB.InvData(;kwargs)

Internal method for InvData. The introduction of an internal method is necessary as extensions do not allow to export functions or types.

source
EnergyModelsBase.check_node_dataMethod
EMB.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.
source
EnergyModelsBase.check_node_dataMethod
EMB.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 be StorageInvData.
  • For each individual investment field all checks incorporated in the function check_inv_data.
source
EnergyModelsBase.constraints_capacity_installedMethod
EMB.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.

source
EnergyModelsBase.constraints_capacity_installedMethod
EMB.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.

source
EnergyModelsBase.objectiveMethod
EMB.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.

source
EnergyModelsBase.variables_capexMethod
EMB.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

source
EnergyModelsInvestments.has_investmentMethod
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.

source