Result

Here, we describe the optimization result.

Types

The optimization results are provided in an OptResult struct:

CapacityExpansion.OptResultType
  OptResult{status::Symbol,
            objective::Float64,
            variables::Dict{String,Any},
            sets::Dict{String,Dict{String,Array}},
            config::Dict{String,Any},
            info::Dict{String,Any}}

The result of an optimized model is organized as an OptResult struct:

  • status: Symbol about the solution status of the model in normal cases :OPTIMAL
  • objective: Value of the objective function
  • variables: Dictionary with each variables in form of OptVariable structs as entries. For details on indexing the OptVariables see the OptVariable documentation
  • sets: Dictionary with each set as an entry
  • config: The configuration of the model setup - for more detail see tye run_opt documentation that sets the config up
  • info: Holds information about the model. E.g. info["model"] contains the exact equations used in the model.

Sets

The sets are setup as a dictionary and organized as set[tech_name][tech_group]=[elements...], where:

  • tech_name is the name of the dimension like e.g. tech, or node
  • tech_group is the name of a group of elements within each dimension like e.g. ["all", "generation"]. The group 'all' always contains all elements of the dimension
  • [elements...] is the Array with the different elements like ["pv", "wind", "gas"]
namedescription
linestransmission lines connecting the nodes
nodesspacial energy system nodes
techgeneration, conversion, storage, and transmission technologies
carriercarrier that an energy balance is calculated for electricity, hydrogen...
impactimpact categories like EUR or USD, CO 2 − eq., ...
accountfixed costs for installation and yearly expenses, variable costs
infrastructinfrastructure status being either new or existing
time Knumeration of the representative periods
time T periodnumeration of the time intervals within a period
time T pointnumeration of the time points within a period
time I periodnumeration of the time invervals of the full input data periods
time I pointnumeration of the time points of the full input data periods
dir transmissiondirection of the flow uniform with or opposite to the lines direction

Variables

nametypedimensionsunitdescription
COSTcv[account,impact,tech]EUR/USD, LCA-categoriesCosts
CAPdv[tech,infrastruct,node]MWCapacity
GENov[tech,carrier,t,k,node]MWGeneration
SLACKsv[carrier,t,k,node]MWPower gap, not provided by installed CAP
LLsv[carrier]MWhLoastLoad Generation gap, not provided by installed CAP
LEsv[impact]LCA-categoriesLoastEmission Amount of emissions that installed CAP crosses the Emission constraint
INTRASTORov[tech,carrier,t,k,node]MWhStorage level within a period
INTERSTORov[tech,carrier,i,node]MWhStorage level between periods of the full time series
FLOWov[tech,carrier,dir,t,k,line]MWFlow over transmission line
TRANSov[tech,infrastruct,lines]MWmaximum capacity of transmission lines
source

Equations

Note

The model tracks how it is setup and which equations are used. This can help you to understand the models exact configuration without looking up the source code.

The information of the model setup can be checked out the following way:

result = run_opt(ts_clust_data,cep_data,optimizer;descriptor="Model Name")
result.info["model"]
19-element Array{String,1}:
 "Model Name"                                                                                                                                                                       
 "Variable COST[account, impact, tech] in EUR CO2 "                                                                                                                                 
 "Variable CAP[tech_n, infrastruct, nodes] ≥ 0 in MW"                                                                                                                               
 "Variable GEN[tech_power, carrier, t, k, node] in MW"                                                                                                                              
 "COST['var',impact,tech] = (1) ⋅ Σ_{t,k,node}GEN[carrier_input,t,k,node]⋅ ts_weights[k] ⋅ ts_deltas[t,k]⋅ var_costs[tech,impact] ∀ impact, tech_demand"                            
 "COST['cap_fix',impact,tech] = Σ_{t,k}(ts_weights ⋅ ts_deltas[t,k])/8760h ⋅ Σ_{node}CAP[tech,'new',node] ⋅ cap_costs[tech,impact] ∀ impact, tech_demand"                           
 "GEN[tech, carrier t, k, node] = (-1) ⋅ Σ_{infrastruct} CAP[tech,infrastruct,node] * ts[tech-node,t,k] ∀ node, tech_demand, t, k"                                                  
 "COST['var',impact,tech] = (1) ⋅ Σ_{t,k,node}GEN[carrier_output,t,k,node]⋅ ts_weights[k] ⋅ ts_deltas[t,k]⋅ var_costs[tech,impact] ∀ impact, tech_non_dispatchable_generation"      
 "COST['cap_fix',impact,tech] = Σ_{t,k}(ts_weights ⋅ ts_deltas[t,k])/8760h ⋅ Σ_{node}CAP[tech,'new',node] ⋅ cap_costs[tech,impact] ∀ impact, tech_non_dispatchable_generation"      
 "0 ≤ GEN[tech, carrier t, k, node] ≤ Σ_{infrastruct}CAP[tech,infrastruct,node]*ts[tech-node,t,k] ∀ node, tech_generation{non_dispatchable}, t, k"                                  
 "COST['var',impact,tech] = (1) ⋅ Σ_{t,k,node}GEN[carrier_output,t,k,node]⋅ ts_weights[k] ⋅ ts_deltas[t,k]⋅ var_costs[tech,impact] ∀ impact, tech_dispatchable_generation"          
 "COST['cap_fix',impact,tech] = Σ_{t,k}(ts_weights ⋅ ts_deltas[t,k])/8760h ⋅ Σ_{node}CAP[tech,'new',node] ⋅ cap_costs[tech,impact] ∀ impact, tech_dispatchable_generation"          
 "0 ≤ GEN[tech, carrier t, k, node] ≤ Σ_{infrastruct} CAP[tech,infrastruct,node] ∀ node, tech_dispatchable_generation, t, k"                                                        
 "CAP[tech, 'ex', node] = existing infrastructure ∀ node, tech ∈ tech_group_ex"                                                                                                     
 "CAP[tech, 'ex', node] = 0  ∀ node, tech ∉ tech_group_ex"                                                                                                                          
 "∑_{infrastuct} CAP[tech, infrastruct, node] <= limit infrastructure ∀ tech_n, node"                                                                                               
 "Σ_{tech,node}GEN[tech, carriert,k,node] + SLACK[carrier,t,k,node] = 0 ∀ t,k"                                                                                                      
 "Σ_{tech,node}GEN[tech, carriert,k,node] = 0 ∀ t,k"                                                                                                                                
 "min Σ_{account,tech}COST[account,'EUR',tech] + Σ_{node,carrier_ll} LL[carrier,node] ⋅ lost_load_cost[carrier]) +  Σ_{impact_le} LE[impact] ⋅ lost_emission_cost[impact] st. above"

Variables in Result

All variables are provided as dense OptVariable structs and can be indexed as explained in Data Types. The variables can be of different type as explained in Variables. The different groups of variables can be extracted from the OptResult based on the variable_type:

CapacityExpansion.get_cep_variablesFunction
get_cep_variables(opt_result::OptResult, variable_type::String)

The variables can be of different type. The different groups of variables can be extracted from the OptResult based on the variable_type: Returns all variables which types match the String variable_type

source
CapacityExpansion.get_cep_design_variablesFunction
get_cep_design_variables(opt_result::OptResult)

Returns all design variables in this opt_result matching the type "dv" Additionally you can add capacity factors, which scale the design variables by multiplying it with the value in the Dict

source

The extraction of design variables is e.g. necessary for a Second stage operational validation step, which validates the energy system design on a different time series.

Printing information about the result

The function text_limit_emission allows to print an information about all the emission limits applied: