EnergyModelsInvestments.EnergyModelsInvestmentsModule

Main module for EnergyModelsInvestments.

This module implements functionalities allowing to run investment analysis.

It is in its current version extending EnergyModelsBase and cannot be used as a stand-alone module.

The extension EMIGeoExt includes furthermore the investment options for transmission modes as described in EnergyModelsGeography.

EnergyModelsInvestments.AbstractInvestmentModelType

An abstract investment model type.

This abstract model type should be used when creating additional EnergyModel types that should utilize investments. An example for additional types is given by the inclusion of, e.g., SDDP.

EnergyModelsInvestments.InvDataType

Extra data for investing in technologies.

Define the structure for the additional parameters passed to the technology structures defined in other packages. It uses the macro Base.@kwdef to use keyword arguments and default values. Hence, the name of the parameters have to be specified.

Fields

  • capex_cap::TimeProfile Capital expenditure for the capacity in a strategic period.

  • cap_max_inst::TimeProfile Maximum possible installed capacity of the technology in a strategic period.

  • cap_max_add::TimeProfile Maximum capacity addition in a strategic period.

  • cap_min_add::TimeProfile Minimum capacity addition in a strategic period.

  • inv_mode::Investment = ContinuousInvestment() Type of the investment: BinaryInvestment, DiscreteInvestment, ContinuousInvestment, SemiContinuousInvestment, or FixedInvestment.

  • cap_start::Union{Real, Nothing} = nothing Starting capacity in first period. If nothing is given, it is set by start_cap() to the capacity cap of the node in the first strategic period.

  • cap_increment::TimeProfile = FixedProfile(0) Capacity increment used in the case of DiscreteInvestment.

  • life_mode::LifetimeMode = UnlimitedLife() Type of handling of the lifetime: UnlimitedLife, StudyLife, PeriodLife or RollingLife

  • lifetime::TimeProfile = FixedProfile(0) Duration/lifetime of the technology invested in each period.

EnergyModelsInvestments.InvDataStorageType

Extra data for investing in storages.

Define the structure for the additional parameters passed to the technology structures defined in other packages. It uses the macro Base.@kwdef to use keyword arguments and default values. Hence, the name of the parameters have to be specified.

The parameters are separated between rate_ and stor_. The rate_ parameters refer to rate components (power, flow, ...) for instance, charging and discharging power of batteries, while the stor_ refers to a volumetric component (energy, volume, mass...), for instance storage capacity of a battery.

Fields

  • capex_rate::TimeProfile Capital expenditure for storage rate, here investment costs of the technology rate in each period.

  • rate_max_inst::TimeProfile Maximum possible installed rate of the technology in each period.

  • rate_max_add::TimeProfile Maximum rate addition in a strategic period.

  • rate_min_add::TimeProfile Minimum rate addition in a strategic period.

  • capex_stor::TimeProfile Capital expenditure, here investment costs of the technology storage volume in each strategic period.

  • stor_max_inst::TimeProfile Maximum possible installed storage volume of the technology in each strategic period.

  • stor_max_add::TimeProfile Maximum storage volume addition in one period from the previous.

  • stor_min_add::TimeProfile Minimum storage volume addition in one period from the previous.

  • inv_mode::Investment = ContinuousInvestment() Type of the investment: BinaryInvestment, DiscreteInvestment, ContinuousInvestment, SemiContinuousInvestment or FixedInvestment.

  • rate_start::Union{Real, Nothing} = nothing Starting rate in first period. If nothing is given, it is set by start_cap() to the capacity rate_cap of the node in the first strategic period.

  • stor_start::Union{Real, Nothing} = nothing Starting storage volume in first period. If nothing is provided, it is set by start_cap() to the capacity stor_cap of the node in the first strategic period.

  • rate_increment::TimeProfile = FixedProfile(0) Rate increment used in the case of DiscreteInvestment

  • stor_increment::TimeProfile = FixedProfile(0) Storage volume increment used in the case of DiscreteInvestment

  • life_mode::LifetimeMode = UnlimitedLife() Type of handling of the lifetime: UnlimitedLife, StudyLife, PeriodLife, or RollingLife

  • lifetime::TimeProfile = FixedProfile(0) Duration/lifetime of the technology invested in each period.

EnergyModelsInvestments.InvestmentModelType

A concrete basic investment model type based on the standard OperationalModel as declared in EnergyModelsBase. The concrete basic investment model is similar to an OperationalModel, but allows for investments and additional discounting of future years.

Fields

  • emission_limit::Dict{<:ResourceEmit, <:TimeProfile} are the emission caps for the different emissions types considered.

  • emission_price::Dict{<:ResourceEmit, <:TimeProfile} are the prices for the different emissions types considered.

  • co2_instance is a ResourceEmit and corresponds to the type used for CO₂.

  • r is the discount rate in the investment optimization.

EnergyModelsInvestments.PeriodLifeType

The investment is considered to last only for the strategic period. The excess lifetime is considered in the rest value. If the lifetime is lower than the length of the period, reinvestment is considered as well.

EnergyModelsInvestments.RollingLifeType

The investment is rolling to the next strategic periods and it is retired at the end of its lifetime or the end of the previous strategic period if its lifetime ends between two periods.

EnergyModelsInvestments.StudyLifeType

The investment lasts for the whole study period with adequate reinvestments at the end of the lifetime and considering the rest value.

EnergyModelsInvestments.TransInvDataType

Extra data for investing in transmission.

Define the structure for the additional parameters passed to the technology structures defined in other packages. It uses the macro Base.@kwdef to use keyword arguments and default values. Hence, the name of the parameters have to be specified.

Fields

  • capex_trans::TimeProfile Capital expenditure for the transmission capacity, here investment costs of the transmission in each period.

  • trans_max_inst::TimeProfile Maximum possible installed transmission capacity in each period.

  • trans_max_add::TimeProfile Maximum transmission capacity addition in one period from the previous.

  • trans_min_add::TimeProfile Minimum transmission capacity addition in one period from the previous.

  • inv_mode::Investment = ContinuousInvestment() Type of the investment: BinaryInvestment, DiscreteInvestment, ContinuousInvestment, SemiContinuousInvestment or FixedInvestment.

  • trans_start::Union{Real, Nothing} = nothing Starting transmission capacity in first period. If nothing is given, it is set by getstartcap() to the capacity trans_cap of the transmission.

  • trans_increment::TimeProfile = FixedProfile(0) Transmission capacity increment used in the case of DiscreteInvestment

EnergyModelsBase.constraints_capacity_installedMethod
EMB.constraints_capacity_installed(m, n::EMB.Node, 𝒯, modeltype::AbstractInvestmentModel

Set capacity-related constraints for nodes 𝒩 for investment time structure 𝒯:

  • bounds
  • binary for BinaryInvestment
  • link capacity variables
EnergyModelsBase.constraints_capacity_installedMethod
constraints_capacity_installed(m, n::Storage, 𝒯::TimeStructure, modeltype::AbstractInvestmentModel)

Set storage-related constraints for nodes 𝒩ˢᵗᵒʳ for investment time structure 𝒯:

  • bounds
  • binary for BinaryInvestment
  • link storage variables
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.

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:

  • :capex_cap - CAPEX costs for a technology
  • :cap_invest_b - binary variable whether investments in capacity are happening
  • :cap_remove_b - binary variable whether investments in capacity are removed
  • :cap_current - installed capacity for storage in each strategic period
  • :cap_add - added capacity
  • :cap_rem - removed capacity

Additional variables for investment in storage:

  • :capex_stor - CAPEX costs for increases in the capacity of a storage
  • :stor_cap_invest_b - binary variable whether investments in capacity are happening
  • :stor_cap_remove_b - binary variable whether investments in capacity are removed
  • :stor_cap_current - installed capacity for storage in each strategic period
  • :stor_cap_add - added capacity
  • :stor_cap_rem - removed capacity
  • :capex_rate - CAPEX costs for increases in the rate of a storage
  • :stor_rate_invest_b - binary variable whether investments in rate are happening
  • :stor_rate_remove_b - binary variable whether investments in rate are removed
  • :stor_rate_current - installed rate for storage in each strategic period
  • :stor_rate_add - added rate
  • :stor_rate_rem - removed rate
EnergyModelsInvestments.check_dataMethod
check_data(case, modeltype)

Check if the case data is consistent. Use the @assertorlog macro when testing. Currently only checking node data.

EnergyModelsInvestments.check_investment_dataMethod
check_investment_data(n, 𝒯)

Performs various checks on investment data:

  • min_add has to be less than max_add in investments data.
  • Existing capacity can not be larger than max_installed capacity in the beginning.
  • TimeProfiles cannot include OperationalProfile, RepresentativeProfile, or ScenarioProfile
EnergyModelsInvestments.max_addMethod
max_add(n::Storage, t_inv)

Returns the maximum allowed added capacity of Storage node n in investment period t_inv.

EnergyModelsInvestments.min_addMethod
min_add(n::Storage, t_inv)

Returns the minimum allowed added capacity of Storage node n in investment period t_inv.

EnergyModelsInvestments.set_capacity_costMethod
set_capacity_cost(m, n, 𝒯, t_inv, modeltype)

Set the capex_cost based on the technology investment cost, and strategic period length to include the needs for reinvestments and the rest value. It implements different versions of the lifetime implementation:

  • UnlimitedLife: The investment life is not limited. The investment costs do not consider any reinvestment or rest value.
  • StudyLife: The investment last for the whole study period with adequate reinvestments at end of lifetime and rest value.
  • PeriodLife: The investment is considered to last only for the strategic period. the excess lifetime is considered in the rest value.
  • RollingLife: The investment is rolling to the next strategic periods and it is retired at the end of its lifetime or the end of the previous sp if its lifetime ends between two sp.
EnergyModelsInvestments.set_capex_valueMethod
set_capex_value(years, lifetime, r)

Calculate the discounted values used in the lifetime calculations, when the LifetimeMode is given by PeriodLife and StudyLife.

Arguments

  • years:: the remaining years for calculating the discounted value. The years are

depending on the considered LifetimeMode, using remaining(t_inv, 𝒯) for StudyLife and duration(t_inv) for PeriodLife.

  • lifetime: the lifetime of the node.
  • r: the discount rate.
EnergyModelsInvestments.start_capMethod
start_cap(m, n, t, stcap, modeltype)

Returns the starting capacity of the node in the first investment period. If no starting capacity is provided in InvestmentData (default = Nothing), then use the provided capacity from the field Cap.