Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize model inputs and parameters #81

Closed
eberlea opened this issue Oct 28, 2021 · 8 comments
Closed

Generalize model inputs and parameters #81

eberlea opened this issue Oct 28, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@eberlea
Copy link
Collaborator

eberlea commented Oct 28, 2021

  • Change to title to avgmass
  • Change data format to long format (material and component should become column names)
@rjhanes
Copy link
Collaborator

rjhanes commented Nov 1, 2021

The mass input file would be melted to look like:

year technology component material mass_tonnes
1983 land-based wind blade epoxy 1.561158
1983 land-based wind blade glass fiber 6.564
1984 land-based wind blade epoxy 1.594434
1984 land-based wind blade glass fiber 6.564
1985 land-based wind blade epoxy 1.617448
1985 land-based wind blade glass fiber 6.564

Complete input file is here:
avgmass_new.csv

I'm inclined not to include the total component mass in this input file, as it's easy to do that calculation programmatically.

Edited 11/3 to include technology column

@eberlea
Copy link
Collaborator Author

eberlea commented Nov 1, 2021

@rjhanes I agree about excluding the total component mass. This updated file format looks good to me.

@rjhanes rjhanes added this to the Release 1.1.0 milestone Nov 1, 2021
@rjhanes rjhanes added the enhancement New feature or request label Nov 1, 2021
@eberlea
Copy link
Collaborator Author

eberlea commented Nov 2, 2021

@rjhanes one quick note that I think we need to add a technology column as well. I know we're only currently considering one technology but I think we want to be able to specify others. Current technology label: "land-based wind"

@rjhanes rjhanes self-assigned this Nov 10, 2021
@rjhanes
Copy link
Collaborator

rjhanes commented Nov 10, 2021

See related issue https://github.nrel.gov/akey/celavi-data/issues/42 in the data repo

Sub-tasks:

  • Along similar lines, the number_of_turbines.csv file is being renamed to number_of_technology_units.csv, and the n_turbines column within that file renamed to n_technology
  • Refactor the code that calculates total component mass
  • 'blade' needs to be passed into the DES and to CostGraph so we know that's the component being modeled in detail
  • Generalize the cumulative mass calculations for coarse and fine grinding. Inputs needed: names of steps with learning by doing and the names of components that are processed through these steps.
  • Rename pathway_cost_history (change default) and add clarification on "dist" column names

Some of the preprocessing code, like the TurbineLocations class in the data manager and the portion of compute_locations that works with the raw US WTDB, can't really be generalized because that input data will look different for different technologies. We'll need to call that out in the manuscript & documentation.


We may want to think a little bit more about the parameter naming convention in the config. Maybe something like:

pathway names
pathway1: finegrind
pathway2: coarsegrind

pathway parameters
pathway1:
cumul_intial: 1.0
initial_cost: 165.38
revenue: 242.56
learnrate: -0.05
material_loss: 0.3
pathway2:
cumul_intial: 1.0
initial_cost: 121.28
revenue: 0
learnrate: -0.05
material_loss: 0

rjhanes added a commit that referenced this issue Nov 16, 2021
rjhanes added a commit that referenced this issue Nov 22, 2021
rjhanes added a commit that referenced this issue Nov 22, 2021
@rjhanes rjhanes changed the title Generalize avgblademass input file Generalize model inputs and parameters Nov 30, 2021
rjhanes added a commit that referenced this issue Dec 6, 2021
@rjhanes
Copy link
Collaborator

rjhanes commented Dec 6, 2021

Current config file format to match with commit 6fe59d1

# The Business as Usual scenario uses high circularity
# costs.
flags:
  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
  enable_data_filtering : False  # If true, dataset will be filtered to the states below
  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
  

scenario_parameters:
    circular_components: 
    - blade
    start_year: 2000
    end_year: 2050
    timesteps_per_year: 12
    max_dist: 300 #km
    # If you specify enable_data_filtering = True above, you need to list the states to filter here.
    # Default behavior is not to pass any states through the filter.
    # If enable_data_filtering is False, this list is ignored.
    states_to_filter:
    - IA
    seed: 13

data_directories:
    inputs: inputs/
    raw_locations: inputs/raw_location_data/
    us_roads: inputs/precomputed_us_road_network/
    preprocessing_output: preprocessing/
    lookup_tables: lookup_tables/
    lci: pylca_celavi_data/
    outputs: outputs/
    routing_output: preprocessing/routing_intermediate_files/

input_filenames:
    locs: locations_computed.csv
    step_costs: step_costs.csv
    fac_edges: fac_edges.csv
    transpo_edges: transpo_edges.csv
    route_pairs: route_pairs.csv
    component_material_mass: avgmass.csv
    routes_custom: routes.csv
    routes_computed: routes_computed.csv
    transportation_graph: transportation_graph.csv
    node_locs: node_locations.csv
    power_plant_locs: uswtdb_v4_1_20210721.csv
    landfill_locs: landfilllmopdata.csv
    other_facility_locs: other_facility_locations_all_us.csv
    standard_scenario: StScen20A_MidCase_annual_state.csv
    lookup_facility_type: facility_type.csv
    lookup_step_costs: step_costs_default.csv
    technology_data: number_of_technology_units.csv

output_filenames:
    costgraph_pickle: netw.obj
    costgraph_csv: netw.csv
    pathway_cost_history: pathway_cost_history.csv
    component_counts_plot: component_counts.png
    material_mass_plot: material_mass.png
    count_cumulative_histories: count_cumulative_histories.csv
    mass_cumulative_histories: mass_cumulative_histories.csv

# CostGraph must be re-initialized for any parameter changes
# to be reflected in the model.
costgraph_parameters:
    sc_begin: manufacturing
    sc_end: 
    - landfilling
    - cement co-processing
    - next use
    cg_verbose: 1
    save_cg_csv: True
    cg_update_timesteps: 12


pathway_parameters:
    learning:
        coarse grinding:
            component : blade
            initial cumul: 1.0
            cumul: 
            initial cost: 121.28
            revenue: 0
            learn rate: -0.05
            steps:
            - coarse grinding
            - coarse grinding onsite
        fine grinding:
            component : blade
            initial cumul: 1.0
            cumul: 
            initial cost: 165.38
            revenue: 242.56
            learn rate: -0.05
            steps:
            - fine grinding
    material loss:
        fine grinding : 0.3
    vkmt : 
    component mass : 
    year : 
        

discrete_event_parameters:
    component_list:
        nacelle : 1
        blade : 3
        tower : 1
        foundation : 1
    component_materials:
        nacelle : 
        - steel
        blade : 
        - glass fiber
        - epoxy
        tower : 
        - steel
        foundation : 
        - concrete
    min_lifespan: 120 # Units: timesteps
    component_fixed_lifetimes:
        nacelle : 30
        blade : 20
        foundation : 50
        tower : 50
    component_weibull_params: #L, K
        nacelle : 
        blade : 
            L : 240
            K : 2.2
        foundation : 
        tower :  

rjhanes added a commit that referenced this issue Dec 6, 2021
@rjhanes
Copy link
Collaborator

rjhanes commented Dec 6, 2021

Current config file for commit 1f5085d:

The Business as Usual scenario uses high circularity

costs.

flags:
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
enable_data_filtering : False # If true, dataset will be filtered to the states below
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

scenario_parameters:
circular_components:
- blade
start_year: 2000
end_year: 2050
timesteps_per_year: 12
max_dist: 300 #km
# If you specify enable_data_filtering = True above, you need to list the states to filter here.
# Default behavior is not to pass any states through the filter.
# If enable_data_filtering is False, this list is ignored.
states_to_filter:
- IA
seed: 13

data_directories:
inputs: inputs/
raw_locations: inputs/raw_location_data/
us_roads: inputs/precomputed_us_road_network/
preprocessing_output: preprocessing/
lookup_tables: lookup_tables/
lci: pylca_celavi_data/
outputs: outputs/
routing_output: preprocessing/routing_intermediate_files/

input_filenames:
locs: locations_computed.csv
step_costs: step_costs.csv
fac_edges: fac_edges.csv
transpo_edges: transpo_edges.csv
route_pairs: route_pairs.csv
component_material_mass: avgmass.csv
routes_custom: routes.csv
routes_computed: routes_computed.csv
transportation_graph: transportation_graph.csv
node_locs: node_locations.csv
power_plant_locs: uswtdb_v4_1_20210721.csv
landfill_locs: landfilllmopdata.csv
other_facility_locs: other_facility_locations_all_us.csv
standard_scenario: StScen20A_MidCase_annual_state.csv
lookup_facility_type: facility_type.csv
lookup_step_costs: step_costs_default.csv
technology_data: number_of_technology_units.csv

output_filenames:
costgraph_pickle: netw.obj
costgraph_csv: netw.csv
pathway_criterion_history: pathway_criterion_history.csv
component_counts_plot: component_counts.png
material_mass_plot: material_mass.png
count_cumulative_histories: count_cumulative_histories.csv
mass_cumulative_histories: mass_cumulative_histories.csv

CostGraph must be re-initialized for any parameter changes

to be reflected in the model.

costgraph_parameters:
sc_begin: manufacturing
sc_end:
- landfilling
- cement co-processing
- next use
cg_verbose: 1
save_cg_csv: True
cg_update_timesteps: 12

pathway_parameters:
learning:
coarse grinding:
component : blade
initial cumul: 1.0
cumul:
initial cost: 121.28
revenue: 0
learn rate: -0.05
steps:
- coarse grinding
- coarse grinding onsite
fine grinding:
component : blade
initial cumul: 1.0
cumul:
initial cost: 165.38
revenue: 242.56
learn rate: -0.05
steps:
- fine grinding
material loss:
fine grinding : 0.3
vkmt :
component mass :
year :

discrete_event_parameters:
component_list:
nacelle : 1
blade : 3
tower : 1
foundation : 1
component_materials:
nacelle :
- steel
blade :
- glass fiber
- epoxy
tower :
- steel
foundation :
- concrete
min_lifespan: 120 # Units: timesteps
component_fixed_lifetimes:
nacelle : 30
blade : 20
foundation : 50
tower : 50
component_weibull_params: #L, K
nacelle :
blade :
L : 240
K : 2.2
foundation :
tower :

@rjhanes
Copy link
Collaborator

rjhanes commented Dec 6, 2021

Regarding the pathway "cost" history filename, it's now renamed as pathway_criterion_history in the config file, shortened to pathway_crit_history within the code itself. The "criterion" is thus whatever quantitative measure is used to decide between circularity pathways. Currently this is cost, for the wind turbine case study.

The file itself has the following format:

The column names now refer to "criterion" rather than "dist" (distance) which was causing confusing (it was a network distance over edges, not a transportation distance)

year facility_id region_id_1 region_id_2 region_id_3 region_id_4 eol_pathway_type eol_pathway_criterion bol_pathway_criterion
2012 57517 USA TX Hansford County landfilling 905.5591991 11906.18124
2012 57517 USA TX Hansford County cement co-processing 970.0313773 11906.18124
2012 57517 USA TX Hansford County next use 959.2925938 11906.18124
2013 58321 USA TX Mills County landfilling 952.7260795 11781.31345
2013 58321 USA TX Mills County cement co-processing 961.5883097 11781.31345

@rjhanes
Copy link
Collaborator

rjhanes commented Dec 23, 2021

closed with pr #106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants