Result
Here, we describe the optimization result.
Types
The optimization results are provided in an OptResult
struct:
CapacityExpansion.OptResult
— Type OptResult{status::Symbol,
objective::Float64,
variables::Dict{String,Any},
sets::Dict{String,Dict{String,Array}},
opt_config::Dict{String,Any},
opt_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 functionvariables
: Dictionary with each variables in form ofOptVariable
structs as entries. For details on indexing theOptVariables
see theOptVariable
documentationsets
: Dictionary with each set as an entryconfig
: The configuration of the model setup - for more detail see tyerun_opt
documentation that sets theconfig
upinfo
: 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
, ornode
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"]
name | description |
---|---|
lines | transmission lines connecting the nodes |
nodes | spacial energy system nodes |
tech | generation, conversion, storage, and transmission technologies |
carrier | carrier that an energy balance is calculated for electricity , hydrogen ... |
impact | impact categories like EUR or USD, CO 2 − eq., ... |
account | fixed costs for installation and yearly expenses, variable costs |
infrastruct | infrastructure status being either new or existing |
time K | numeration of the representative periods |
time T period | numeration of the time intervals within a period |
time T point | numeration of the time points within a period |
time I period | numeration of the time invervals of the full input data periods |
time I point | numeration of the time points of the full input data periods |
dir transmission | direction of the flow uniform with or opposite to the lines direction |
Variables
name | type | dimensions | unit | description |
---|---|---|---|---|
COST | cv | [account,impact,tech] | EUR/USD, LCA-categories | Costs |
CAP | dv | [tech,infrastruct,node] | MW | Capacity |
GEN | ov | [tech,carrier,t,k,node] | MW | Generation |
SLACK | sv | [carrier,t,k,node] | MW | Power gap, not provided by installed CAP |
LL | sv | [carrier] | MWh | LoastLoad Generation gap, not provided by installed CAP |
LE | sv | [impact] | LCA-categories | LoastEmission Amount of emissions that installed CAP crosses the Emission constraint |
INTRASTOR | ov | [tech,carrier,t,k,node] | MWh | Storage level within a period |
INTERSTOR | ov | [tech,carrier,i,node] | MWh | Storage level between periods of the full time series |
FLOW | ov | [tech,carrier,dir,t,k,line] | MW | Flow over transmission line |
TRANS | ov | [tech,infrastruct,lines] | MW | maximum capacity of transmission lines |
Equations
The model tracks how it is set up and which equations are used. This can help you to understand the model's 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[tech, 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[tech, 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[tech, 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, carrier, t,k,node] + SLACK[carrier,t,k,node] = 0 ∀ t,k"
"Σ_{tech,node}GEN[tech, carrier, t,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_variables
— Functionget_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
CapacityExpansion.get_cep_slack_variables
— Functionget_cep_slack_variables(opt_result::OptResult)
Returns all slack variables in this opt_result
mathing the type "sv"
CapacityExpansion.get_cep_design_variables
— Functionget_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
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 information about all the emission limits applied:
CapacityExpansion.text_limit_emission
— Functiontext_limit_emission(limit_emission::Dict{String,Dict{String,Number}})
Return text with the information of the limit_emission
as a text