Preparing OptDataCEP

Here, we first describe how to load provided non-time-series dependent data or your non-time-series dependent data as OptDataCEP. We second describe the data types within the OptDataCEP and how to access it.

Loading Provided Data

load_cep_data_provided loads the non-time-series dependent data for the CEP and can take the following regions:

  • GER: Germany
  • CA: California
  • TX: Texas
CapacityExpansion.load_cep_data_providedFunction
load_cep_data_provided(region::String)

Loading from .csv files in a the folder ../CEP/data/{region}/ Follow instructions preparing your own data: -region::String: name of state or region data belongs to -costs::OptVariable: costs[tech,node,year,account,impact] - annulized costs [USD in USD/MW_el, CO2 in kg-CO₂-eq./MW_el] -techs::OptVariable: techs[tech] - OptDataCEPTech -nodes::OptVariable: nodes[tech,node] - OptDataCEPNode -lines::OptVarible: lines[tech,line] - OptDataCEPLine for regions:

  • "GER_1": Germany 1 node
  • "GER_18": Germany 18 nodes
  • "CA_1": California 1 node
  • "CA_14": California 14 nodes
  • "TX_1": Texas 1 node
source

Loading Your Own Data

Use load_cep_data with data_path pointing to the folder with your cost, node, (line), and technology data.

CapacityExpansion.load_cep_dataFunction
load_cep_data(data_path::String)

Loading from .csv files in a the folder /data_path/ Follow instructions for the CSV-Files: -region::String: name of state or region data belongs to -costs::OptVariable: costs[tech,node,year,account,impact] - annulized costs [USD in USD/MWel, CO2 in kg-CO₂-eq./MWel]-techs::OptVariable: techs[tech] - OptDataCEPTech - -nodes::OptVariable: nodes[tech,node] - OptDataCEPNode -lines::OptVarible`: lines[tech,line] - OptDataCEPLine

source

Data Types

CapacityExpansion.OptVariableType
OptVariable{T,N,Ax,L<:NTuple{N,Dict}} <: AbstractArray{T,N}{
data::Array{T,N},
axes::Ax,
lookup::L,
axes_names::Array{String,1}}
type::String

OptVariable is a structure that allows to have a multi-dimensional data-Array that can be indexed using keys. An examplary lookup can be done the following way: optvar['key1','key2']=value. The value can be of any type like e.g. Float64. The OptVariable is used both for data input and output.

  • data::Array - includes the optimization variable output in form of an array
  • axes_names::Array{String,1}` - includes the names of the different axes and is equivalent to the sets in the optimization formulation
  • axes::Tuple - includes the values of the different axes of the optimization variables
  • type::String - defines the type of the variable being cv - cost variable - dv -design variable - ov - operating variable - sv - slack variable
source
CapacityExpansion.OptDataCEPType
 OptDataCEP{region::String,
            costs::OptVariable,
            techs::OptVariable,
            nodes::OptVariable,
            lines::OptVariabl} <: OptData

All not timeseries depending data for the CapacityExpansionProblem is stored in an OptDataCEP struct. OptVariable structs are used to index an element of e.g. .costs['pv','germany',2016,'var','EUR']=value. Depending on the field the value has another type like Number, OptDataCEPLine,...

  • region::String: name of state or region data belongs to
  • costs::OptVariable: costs[tech,node,year,account,impact] - Number
  • techs::OptVariable: techs[tech] - OptDataCEPTech
  • nodes::OptVariable: nodes[tech, node] - OptDataCEPNode
  • lines::OptVariable: lines[tech, line] - OptDataCEPLine
source
CapacityExpansion.OptDataCEPTechType
 OptDataCEPTech{name::String
               tech_group::Array{String,1}
               unit::String
               structure::String
               plant_lifetime::Number
               financial_lifetime::Number
               discount_rate::Number
               annuityfactor::Number
               input::Dict
               output::Dict
               constraints::Dict} <: OptData

The information of the single tech is stored in an OptDataCEPTech struct:

  • name: A detailed name of the technology
  • tech_group: technology-groups that the technology belongs to. Groups can be: all, demand, generation, dispatchable_generation, non_dispatchable_generation, storage, conversion, transmission
  • plant_lifetime: the lifetime of this technologies plant [a]
  • financial_lifetime: financial time to break even [a]
  • annuityfactor: the annuityfactor is calculated based on the discountrate and the plantlifetime
  • discount_rate: discount rate for technology [a]
  • structure: node or line depending on the structure of the technology
  • unit: the unit that the capacity of the technology scales with. It can be power[MW] or energy[MWh]
  • input: the input can be a carrier like e.g. electricity "carrier" => electricity, atimeserieslike e.g."timeseries"=> demand_electricity, or afuellike e.g.fuel: gas`
  • constraints: a dictionary with information like an efficiency like e.g. "efficiency"=> 0.53 or cap_eq (e.g. discharge capacity is same as charge capacity) "cap_eq" => "bat_in"

returns techs::OptVariable techs[tech] - OptDataCEPTech

source
CapacityExpansion.OptDataCEPNodeType
 OptDataCEPNode{name::String,
                value::Number,
                lat::Number,
                lon::Number} <: OptData

The information about the nodes in stored in an OptDataCEPNode struct:

  • name
  • power_ex existing capacity [MW or MWh (tech_e)]
  • power_lim capacity limit [MW or MWh (tech_e)]
  • region
  • latlon hold geolocation information [°,°]
source
CapacityExpansion.OptDataCEPLineType
 OptDataCEPLine{name::String,
                node_start::String,
                node_end::String,
                reactance::Number,
                resistance::Number,
                power::Number,
                circuits::Int,
                voltage::Number,
                length::Number} <: OptData

The information of the single lines is stored in an OptDataCEPLine struct:

  • name: Name of the line
  • node_start Node where line starts
  • node_end Node where line ends
  • reactance
  • resistance [Ω]
  • power_ex: existing power limit [MW]
  • power_lim: limit power limit [MW]
  • circuits [-]
  • voltage [V]
  • length [km]
  • eff [-]
source

Examples

Example loading CEP Data

using CapacityExpansion
state="GER_1"
# load ts-input-data
cep_data = load_cep_data_provided(state)
cep_data.costs
5-dimensional OptVariable{Number,5,...} of type fv with index sets:
    Dimension 1 - tech, Any["bat_in", "bat_out", "bat_e", "h2_in", "pv", "trans", "coal", "gas", "demand", "wind", "oil", "h2_e", "h2_out"]
    Dimension 2 - node, ["germany"]
    Dimension 3 - year, [2015]
    Dimension 4 - account, ["cap_fix", "var"]
    Dimension 5 - impact, ["EUR", "CO2"]
And data, a 13×1×1×2×2 Array{Number,5}:
[:, :, 2015, "cap_fix", "EUR"] =
   8961.67479  
      0.0      
  25653.7085   
 479782.071    
 136926.376    
     51.0061474
 153702.673    
  29964.5882   
      0.0      
 168417.541    
  38429.5834   
     68.4962783
      0.0      

[:, :, 2015, "var", "EUR"] =
   0.01 
   0.0  
   0.0  
   1.9  
   0.0  
   0.0  
  10.708
  86.564
   0.0  
   0.0  
 153.586
   0.0  
   0.0  

[:, :, 2015, "cap_fix", "CO2"] =
     0.0      
     0.0      
  1658.35472  
 96666.6667   
   160.233933 
     3.3275   
    13.8595556
     1.2334   
     0.0      
    36.75     
     8.25     
     0.0      
     0.0      

[:, :, 2015, "var", "CO2"] =
    0.0 
    0.0 
    0.0 
    0.0 
    0.0 
    0.0 
 1217.49
  728.71
    0.0 
    0.0 
  874.6 
    0.0 
    0.0 

Example indexing OptVariables

Indexing is provided similar to Arrays:

cep_data.costs["pv","germany",2015,"cap_fix","EUR"]
136926.376

The axes are named, and the axes can be called using the basic axes function and providing the sets name:

axes(cep_data.costs,"tech")
13-element Array{Any,1}:
 "bat_in" 
 "bat_out"
 "bat_e"  
 "h2_in"  
 "pv"     
 "trans"  
 "coal"   
 "gas"    
 "demand" 
 "wind"   
 "oil"    
 "h2_e"   
 "h2_out"