Methods - EnergyModelsBase
Index
EnergyModelsBase.constraints_coupleEnergyModelsBase.constraints_elementsEnergyModelsBase.emissions_operationalEnergyModelsBase.get_elements_vecEnergyModelsBase.get_linksEnergyModelsBase.get_nodesEnergyModelsBase.get_productsEnergyModelsBase.objective_operationalEnergyModelsBase.previous_levelEnergyModelsBase.variables_capacityEnergyModelsBase.variables_capexEnergyModelsBase.variables_elementEnergyModelsBase.variables_emissionEnergyModelsBase.variables_flowEnergyModelsBase.variables_opex
Extension methods
EnergyModelsBase.objective_operational — FunctionEMB.objective_operational(m, 𝒱::Vector{<:FutureValue}, 𝒯ᴵⁿᵛ::TS.AbstractStratPers, modeltype::EnergyModel)Create JuMP expressions indexed over the investment periods 𝒯ᴵⁿᵛ for different elements. The expressions correspond to the operational expenses of the different elements. The expressions are not discounted and do not take the duration of the investment periods into account.
By default, objective expressions are included for:
𝒳 = 𝒱::Vector{<:FutureValue}. In the case of a vector ofFutureValue, the method returns the sum of the future value types as extracted through the functionget_future_value_expression.
EnergyModelsBase.emissions_operational — FunctionEMB.emissions_operational(m, 𝒱::Vector{<:FutureValue}, 𝒫ᵉᵐ, 𝒯, modeltype::EnergyModel)Create JuMP expressions indexed over the operational periods 𝒯 for different elements. The expressions correspond to the total emissions of a given type.
By default, emissions expressions are included for:
𝒳 = 𝒱::Vector{<:FutureValue}. In the case of a vector ofFutureValue, the method returns a value of 0 for all operational periods and emission resources.
EnergyModelsBase.constraints_elements — FunctionEMB.constraints_elements(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒫, 𝒯, modeltype::EnergyModel)Loop through all entries of the elements vector and call a subfunction for creating the internal constraints of the entries of the elements vector.
FutureValue- the subfunction iscreate_future_value.
EnergyModelsBase.constraints_couple — FunctionEMB.constraints_couple(m, 𝒱::Vector{<:FutureValue}, 𝒫, 𝒯, modeltype::EnergyModel)
EMB.constraints_couple(m, 𝒱::Vector{<:FutureValue}, 𝒩::Vector{<:EMB.Node}, 𝒫, 𝒯, modeltype::EnergyModel)
EMB.constraints_couple(m, 𝒩::Vector{<:EMB.Node}, 𝒱::Vector{<:FutureValue}, 𝒫, 𝒯, modeltype::EnergyModel)Creates the couple constraints for FutureValue elements.
The current implementation creates couplings for the sub-types StorageValueCuts and TypeFutureValue by calling the function create_future_value_couple.
- If you only use
StorageValueCuts, it is sufficient to add coupling constraints
through adding [get_future_value] to the couplings of the case type.
- If you only use
TypeFutureValue, it is sufficient to add coupling constraints
through adding [get_future_value, get_nodes] to the couplings of the case type.
- If you utilize both types, you must add both type of couplings.
EnergyModelsBase.previous_level — FunctionEMB.previous_level(
m,
n::Storage{RecedingAccumulating},
prev_pers::PreviousPeriods{<:NothingPeriod, Nothing, Nothing},
cyclic_pers::CyclicPeriods,
modeltype::EnergyModel,
)When the previous operational and representative period are Nothing and the storage node has the parameter type RecedingAccumulating, the function returns the initial level value (defined externally at the data field through an AbstractInitData object).
Variable methods
EnergyModelsBase.variables_capacity — FunctionEMB.variables_capacity(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)Declaration of functions to add capacity variables for FutureValue elements.
No variables are added.
EnergyModelsBase.variables_flow — FunctionEMB.variables_flow(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)Declaration of functions to add flow variables for FutureValue elements.
No variables are added
EnergyModelsBase.variables_opex — FunctionEMB.variables_opex(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)Declaration of functions to add OPEX variables for FutureValue elements.
future_value[𝒱]variables for allFutureValuein the model reflecting the value of the storages at the end of the optimization period.
EnergyModelsBase.variables_capex — FunctionEMB.variables_capex(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒯, modeltype::EnergyModel)Declaration of functions to add CAPEX variables for FutureValue elements.
No variables are added
EnergyModelsBase.variables_element — FunctionEMB.variables_element(m, 𝒱::Vector{<:FutureValue}, 𝒯, modeltype::EnergyModel)Default fallback method for a vector of elements if no other method is defined for a given vector type.
EnergyModelsBase.variables_emission — FunctionEMB.variables_emission(m, 𝒱::Vector{<:FutureValue}, 𝒳ᵛᵉᶜ, 𝒫, 𝒯, modeltype::EnergyModel)Declaration of functions to add emission variables for FutureValue elements.
No variables are added
Functions for accessing different information
The following functions are introduced for UpdateCase types. They extract the updated value.
EnergyModelsBase.get_products — FunctionEMB.get_products(𝒰::UpdateCase)Method for the EnergyModelsBase function to extract the new Resources of the individual ProductSub types.
This element vector can be directly utilized for the field elements of a Case.
EnergyModelsBase.get_elements_vec — FunctionEMB.get_elements_vec(𝒰::UpdateCase)Method for the EnergyModelsBase function to extract the new vector of element vectors 𝒳ᵛᵉᶜ of UpdateCase 𝒰.
This element vector can be directly utilized for the field elements of a Case.
EnergyModelsBase.get_nodes — FunctionEMB.get_nodes(𝒰::UpdateCase)Method for the EnergyModelsBase function to extract the new Nodes of the individual NodeSub types of UpdateCase 𝒰.
This element vector can be directly utilized for the field elements of a Case.
EnergyModelsBase.get_links — FunctionEMB.get_links(𝒰::UpdateCase)Method for the EnergyModelsBase function to extract the new Links of the individual LinkSub types of UpdateCase 𝒰.
This element vector can be directly utilized for the field elements of a Case.