NREL / celavi

Codebase for the Circular Economy Lifecycle Assessment and VIsualization (CELAVI) modeling framework.
https://nrel.github.io/celavi/
GNU General Public License v3.0
9 stars 7 forks source link

Adds complete stochastic uncertainty capabilities to CostMethods with supporting changes elsewhere #170

Closed rjhanes closed 2 years ago

rjhanes commented 2 years ago

How the CostMethods worked before

How the CostMethods will work following this PR

Data and config changes to support this PR

Stochastic scenario YAML for use with tiny data

flags:
  clear_results         : True # If results files already exist, move them to a sub-directory to avoid overwriting
  compute_locations     : True  # if compute_locations is enabled (True), compute locations from raw input files (e.g., LMOP, US Wind Turbine Database)
  run_routes            : True  # if run_routes is enabled (True), compute routing distances between all input locations
  use_computed_routes   : True  # if use_computed_routes is enabled, read in a pre-assembled routes file instead of generating a new one
  initialize_costgraph  : True  # create cost graph fresh or use an imported version
  location_filtering    : False  # If true, dataset will be filtered to the states below
  distance_filtering    : False # if true, filter computed routes based on max distances in route_pairs file
  pickle_costgraph      : True  # save the newly initialized costgraph as a pickle file
  generate_step_costs   : True # set to False if supply chain costs for a facility type vary regionally
  use_fixed_lifetime    : True # set to False to use Weibull distribution for lifetimes
  use_lcia_shortcut     : True # set to False to re-generate the lca_db file

scenario:
    name: Tiny Stochastic Test
    capacity_projection: StScen20A_Fake_annual_state.csv
    states_included:
    seed: 13
    electricity_mix_level : state
    runs: 10

circular_pathways:
    sc_begin:
    - manufacturing
    sc_end: 
    - landfilling
    #sc_in_circ:
    sc_out_circ:
    - cement co-processing
    - next use
    learning:
        coarse grinding:
            component : blade
            uncertainty: 
            initial cumul: 1.0
            cumul: 
            learn rate: -0.05
            steps:
            - coarse grinding
            - coarse grinding onsite
        fine grinding:
            component : blade
            uncertainty:
            initial cumul: 1.0
            cumul: 
            learn rate: -0.05
            steps:
            - fine grinding
    cost uncertainty:
        landfilling:
            uncertainty: stochastic
            m:
                value: 1.5921
            b:
                c: 0.5
                loc: 23.12
                scale: 11.56
                value: 
        rotor teardown:
            uncertainty:
            m: 1467.08
            b: 285.0
        segmenting: 
            uncertainty:
            b: 27.56
        coarse grinding onsite:
            uncertainty: stochastic
            initial cost:
                c: 0.5
                loc: 53
                scale: 106
                value: 
        coarse grinding: 
            uncertainty: stochastic
            initial cost:
                c: 0.5
                loc: 53
                scale: 106
                value: 
        fine grinding: 
            uncertainty: stochastic
            initial cost:
                c: 0.5
                loc: 71.5
                scale: 143
                value: 
            revenue:
                c: 0.5
                loc: 136.5
                scale: 273
                value: 
        coprocessing:
            uncertainty:
            b: 10.37
        segment transpo:
            uncertainty: stochastic
            cost 1:  # Before 2001; 2002-2003
                c: 0.5
                loc: 2.175
                scale: 4.35
                value: 
            cost 2:  # 2001-2002; 2003-2019
                c: 0.5
                loc: 4.35
                scale: 8.70
                value: 
            cost 3:  # 2019-2031
                c: 0.5
                loc: 6.525
                scale: 13.05
                value: 
            cost 4:  # 2031-2044
                c: 0.5
                loc: 8.7
                scale: 17.40
                value: 
            cost 5:  # 2044-2050
                c: 0.5
                loc: 10.875
                scale: 21.75
                value: 
        shred transpo:
            uncertainty: stochastic
            m: 
                c: 0.5
                loc: 0.00056105
                scale: 0.0011221
                value: 
            b: 
                c: 0.5
                loc: 0.0262
                scale: 0.0524
                value: 
        manufacturing:
            uncertainty:
            b: 11440.0
    path_split:
        fine grinding:
            fraction: 
                value: 0.3
            facility_1: landfilling
            facility_2: next use  
        pass:
            next use
    permanent_lifespan_facility: 
    - landfilling
    - cement co-processing
    - next use
    vkmt : 
    component mass : 
    year : 

technology_components:
    circular_components:
    - blade
    component_list:
        nacelle : 1
        blade : 3
        tower : 1
        foundation : 1
    component_materials:
        nacelle : 
        - steel
        blade : 
        - glass fiber
        - epoxy
        tower : 
        - steel
        foundation : 
        - concrete
    component_fixed_lifetimes: # Years
        nacelle : 30
        blade : 20
        foundation : 50
        tower : 50
    component_weibull_params: #L, K
        nacelle : 
        blade : 
            L : 240
            K : 2.2
        foundation : 
        tower :
    substitution_rates:
        sand: 0.15
        coal: 0.30
rjhanes commented 2 years ago

@jwalzberg and @TJTapajyoti A heads up that I'll be going over this PR in our hackathon tomorrow. I've prepared a scenario YAML file to start our stochastic runs on HPC (in OneDrive under uncertainty/stochastic-yamls), and this PR covers changes to the Cost Methods that will enable those runs.

I've identified eight parameters to include in the stochastic runs, based on our OAAT results:

To ensure that we get results worth interpreting, I recommend we use the +/- 50% range to define the triangular probability distributions. How many runs we execute is up for debate - we should probably discuss how the single-run time has changed with adding two states and the pyLCA 2.0 upgrade and go from there. Since we're not trying to do statistical analyses or actual sensitivity analyses I think we can pretty much pick a nice round number.