Efficiently calculating inventory parameters

Accompanying blog post

In [1]:
import brightway2 as bw

Set up a new project

In [2]:
bw.projects.set_current("Inventory flows")
In [3]:
bw.create_default_biosphere3()
bw.create_core_migrations()
Creating default biosphere

Writing activities to SQLite3 database:
0%                          100%
[###                           ] | ETA: 00:00:01
Applying strategy: normalize_units
Applying strategy: drop_unspecified_subcategories
Applied 2 strategies in 0.02 seconds
[##############################] | ETA: 00:00:00
Total time elapsed: 00:00:01
Title: Writing activities to SQLite3 database:
  Started: 11/13/2018 08:31:10
  Finished: 11/13/2018 08:31:11
  Total time elapsed: 00:00:01
  CPU %: 63.70
  Memory %: 0.87
Created database: biosphere3
Creating default LCIA methods

Applying strategy: normalize_units
Applying strategy: set_biosphere_type
Applying strategy: drop_unspecified_subcategories
Applying strategy: link_iterable_by_fields
Applied 4 strategies in 2.03 seconds
Wrote 850 LCIA methods with 220699 characterization factors
Creating core data migrations

In [4]:
ei = bw.SingleOutputEcospold2Importer(
    "/Users/cmutel/Documents/LCA/Ecoinvent/3.5/cutoff/datasets", 
    "ecoinvent 3.5 cutoff"
)
ei.apply_strategies()
ei.statistics()
Extracting XML data from 16022 datasets
Extracted 16022 datasets in 83.12 seconds
Applying strategy: normalize_units
Applying strategy: update_ecoinvent_locations
Applying strategy: remove_zero_amount_coproducts
Applying strategy: remove_zero_amount_inputs_with_no_activity
Applying strategy: remove_unnamed_parameters
Applying strategy: es2_assign_only_product_with_amount_as_reference_product
Applying strategy: assign_single_product_as_activity
Applying strategy: create_composite_code
Applying strategy: drop_unspecified_subcategories
Applying strategy: fix_ecoinvent_flows_pre35
Applying strategy: drop_temporary_outdated_biosphere_flows
Applying strategy: link_biosphere_by_flow_uuid
Applying strategy: link_internal_technosphere_by_composite_code
Applying strategy: delete_exchanges_missing_activity
Applying strategy: delete_ghost_exchanges
Applying strategy: remove_uncertainty_from_negative_loss_exchanges
Applying strategy: fix_unreasonably_high_lognormal_uncertainties
Applying strategy: set_lognormal_loc_value
Applying strategy: convert_activity_parameters_to_list
Applied 19 strategies in 9.28 seconds
16022 datasets
544735 exchanges
0 unlinked exchanges
  
Out[4]:
(16022, 544735, 0)
In [5]:
ei.write_database()
Writing activities to SQLite3 database:
0%                          100%
[##############################] | ETA: 00:00:00
Total time elapsed: 00:00:54
Title: Writing activities to SQLite3 database:
  Started: 11/13/2018 08:45:22
  Finished: 11/13/2018 08:46:17
  Total time elapsed: 00:00:54
  CPU %: 89.10
  Memory %: 8.24
Created database: ecoinvent 3.5 cutoff
Out[5]:
Brightway2 SQLiteBackend: ecoinvent 3.5 cutoff

Calculating flows via the supply array

In [4]:
car = next(x for x in bw.Database("ecoinvent 3.5 cutoff") 
           if x['name'] == "passenger car production, petrol/natural gas")
car
Out[4]:
'passenger car production, petrol/natural gas' (kilogram, GLO, None)
In [4]:
lca = bw.LCA({car: 1000})  # Assume car is 1000 kilograms
lca.lci()
In [5]:
STEEL_NAMES = {
    'steel production, converter, chromium steel 18/8',
    'steel production, converter, low-alloyed',
    'steel production, converter, unalloyed',
    'steel production, electric, chromium steel 18/8',
    'steel production, electric, low-alloyed',
    # Not actually production processes
    #     'steel production, chromium steel 18/8, hot rolled',
    #     'steel production, low-alloyed, hot rolled',
    #     'reinforcing steel production',
}
STEELS = [x for x in bw.Database("ecoinvent 3.5 cutoff") 
          if x['name'] in STEEL_NAMES]
In [6]:
sum(lca.supply_array[lca.activity_dict[act.key]] for act in STEELS)
Out[6]:
999.7328308178185

New biosphere flows and LCIA method

In [34]:
bw.Database("Inventory flows").write({
    ('Inventory flows', 'steel'): {
        'unit': 'kilogram',
        'type': 'inventory flow',
        'categories': ('inventory',),
    }
})
Writing activities to SQLite3 database:
0%  100%
[#] | ETA: 00:00:00
Total time elapsed: 00:00:00
Title: Writing activities to SQLite3 database:
  Started: 11/13/2018 09:39:55
  Finished: 11/13/2018 09:39:55
  Total time elapsed: 00:00:00
  CPU %: 106.80
  Memory %: 3.38
In [43]:
for act in STEELS:
    act.new_exchange(**{
        'input': ('Inventory flows', 'steel'),
        'type': 'biosphere',
        'amount': 1,  # Assumes production amount of 1
    }).save() 
In [40]:
m = bw.Method(("Inventory flows", "Steel"))
m.register(unit='kilogram')
m.write([
    (('Inventory flows', 'steel'), 1)
])
In [62]:
bw.Database("ecoinvent 3.5 cutoff").process()
In [27]:
lca = bw.LCA({car: 1000}, ("Inventory flows", "Steel"))
lca.lci()
lca.lcia()
lca.score
Out[27]:
999.7328308178185
In [105]:
def without_double_counting(lca, activity_of_interest, activities_to_exclude):
    """Calculate a new LCIA score for ``activity_of_interest`` but excluding 
    contributions from ``activities_to_exclude``.
    
    * ``lca`` is an ``LCA`` object for which LCI and LCIA have already been calculated
    * ``activity_of_interest`` is a demand dictionary, e.g. {some_activity: amount}
    * ``activities_to_exclude`` is an iterable of activity objects or keys
    
    Returns the LCIA score.
    """
    assert hasattr(lca, "characterized_inventory"), "Must do LCI and LCIA first"
    
    tm_original = lca.technosphere_matrix.copy()
    
    to_key = lambda x: x if isinstance(x, tuple) else x.key
    
    exclude = set([to_key(o) for o in activities_to_exclude]).difference(
              set([to_key(o) for o in activity_of_interest]))
    
    for activity in exclude:
        row = lca.product_dict[activity]
        col = lca.activity_dict[activity]
        production_amount = lca.technosphere_matrix[row, col]
        lca.technosphere_matrix[row, :] *= 0
        lca.technosphere_matrix[row, col] = production_amount
        
    lca.redo_lcia(activity_of_interest)    
    lca.technosphere_matrix = tm_original
    return lca.score
In [24]:
# market for glider, passenger car
glider = ('ecoinvent 3.5 cutoff', '3190a5aaecaaa169947d055586a0a4ae')

# market for internal combustion engine, passenger car
engine = ('ecoinvent 3.5 cutoff', 'e4bdb0c9a5612e4df90ac8c8cbc9692f')
In [29]:
for name, act in [("Glider", glider), ("Engine", engine)]:
    print(name, lca.supply_array[lca.activity_dict[act]])
Glider 739.8802761540312
Engine 260.1336051832947
In [106]:
without_double_counting(lca, {car: 1000}, [glider, engine])
Out[106]:
0.8322468900755811
In [30]:
without_double_counting(lca, {glider: 739.8802761540312}, [car, engine])
Out[30]:
840.408990053158
In [31]:
without_double_counting(lca, {engine: 260.1336051832947}, [car, glider])
Out[31]:
158.49646168629997
In [32]:
(158.49646168629997 + 840.408990053158 + 0.8322468900755811) / 999.7328308178185
Out[32]:
1.000004869112592

How can 1 kg of glider induce production of more than 1 kg of steel?

In [60]:
lca = bw.LCA({glider: 1}, ("Inventory flows", "Steel"))
lca.lci()
lca.lcia()
lca.score
Out[60]:
1.1358793666869558
In [75]:
def recursive_search(lca, fu, amount, total_score=None, level=0, max_level=3, cutoff=0.005, tab="\t"):        
    if level >= max_level:
        return
    
    lca.redo_lcia({fu: amount})
    if total_score is None:
        total_score = lca.score
    if abs(lca.score) < abs(total_score * cutoff):
        return
    print("{}{:g} | {:f} | {:g} | {}".format(tab * level, amount, lca.score / total_score, lca.score, fu))
    for exc in fu.technosphere():
        recursive_search(lca, exc.input, exc['amount'] * amount, 
                         total_score, level + 1, max_level, cutoff, tab)
In [55]:
recursive_search(lca, bw.get_activity(glider), 1, max_level=7, tab="> ")
1 | 1.000000 | 1.13588 | 'market for glider, passenger car' (kilogram, GLO, None)
> 1 | 1.000000 | 1.13588 | 'glider production, passenger car' (kilogram, GLO, None)
> > 0.163566 | 0.152812 | 0.173576 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> > > 0.0271845 | 0.025396 | 0.0288464 | 'steel production, low-alloyed, hot rolled' (kilogram, RER, None)
> > > > 0.0271845 | 0.024172 | 0.0274568 | 'market for steel, low-alloyed' (kilogram, GLO, None)
> > > > > 0.0130224 | 0.011604 | 0.0131808 | 'steel production, converter, low-alloyed' (kilogram, RoW, None)
> > > > > 0.00858122 | 0.007597 | 0.00862873 | 'steel production, electric, low-alloyed' (kilogram, RoW, None)
> > > 0.136382 | 0.127417 | 0.14473 | 'steel production, low-alloyed, hot rolled' (kilogram, RoW, None)
> > > > 0.136382 | 0.006147 | 0.00698243 | 'market for hot rolling, steel' (kilogram, GLO, None)
> > > > > 0.119277 | 0.005377 | 0.00610805 | 'hot rolling, steel' (kilogram, RoW, None)
> > > > > > 0.00596384 | 0.005299 | 0.00601895 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > 0.136382 | 0.121270 | 0.137748 | 'market for steel, low-alloyed' (kilogram, GLO, None)
> > > > > 0.0120159 | 0.010706 | 0.0121611 | 'steel production, converter, low-alloyed' (kilogram, RER, None)
> > > > > 0.015661 | 0.013838 | 0.0157187 | 'steel production, electric, low-alloyed' (kilogram, RER, None)
> > > > > 0.065332 | 0.058216 | 0.0661265 | 'steel production, converter, low-alloyed' (kilogram, RoW, None)
> > > > > 0.043051 | 0.038111 | 0.0432894 | 'steel production, electric, low-alloyed' (kilogram, RoW, None)
> > 0.0258262 | 0.024491 | 0.0278192 | 'market for steel, chromium steel 18/8, hot rolled' (kilogram, GLO, None)
> > > 0.00853796 | 0.008096 | 0.00919637 | 'steel production, chromium steel 18/8, hot rolled' (kilogram, RER, None)
> > > > 0.00853796 | 0.007712 | 0.00875992 | 'market for steel, chromium steel 18/8' (kilogram, GLO, None)
> > > 0.0172883 | 0.016395 | 0.0186228 | 'steel production, chromium steel 18/8, hot rolled' (kilogram, RoW, None)
> > > > 0.0172883 | 0.015616 | 0.0177377 | 'market for steel, chromium steel 18/8' (kilogram, GLO, None)
> > > > > 0.0105952 | 0.009565 | 0.0108652 | 'steel production, converter, chromium steel 18/8' (kilogram, RoW, None)
> > 0.805779 | 0.753105 | 0.855437 | 'market for reinforcing steel' (kilogram, GLO, None)
> > > 0.266384 | 0.248741 | 0.282539 | 'reinforcing steel production' (kilogram, RER, None)
> > > > 0.167822 | 0.149112 | 0.169373 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > > 0.0260709 | 0.023141 | 0.0262859 | 'steel production, converter, unalloyed' (kilogram, RER, None)
> > > > > 0.141751 | 0.125833 | 0.142931 | 'steel production, converter, unalloyed' (kilogram, RoW, None)
> > > > 0.0985622 | 0.087641 | 0.0995493 | 'market for steel, low-alloyed' (kilogram, GLO, None)
> > > > > 0.00868381 | 0.007737 | 0.00878872 | 'steel production, converter, low-alloyed' (kilogram, RER, None)
> > > > > 0.0113181 | 0.010001 | 0.0113598 | 'steel production, electric, low-alloyed' (kilogram, RER, None)
> > > > > 0.047215 | 0.042072 | 0.0477892 | 'steel production, converter, low-alloyed' (kilogram, RoW, None)
> > > > > 0.0311127 | 0.027543 | 0.031285 | 'steel production, electric, low-alloyed' (kilogram, RoW, None)
> > > > 0.266384 | 0.011988 | 0.0136172 | 'hot rolling, steel' (kilogram, RER, None)
> > > > > 0.0133192 | 0.011834 | 0.0134423 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > > > 0.0112501 | 0.009987 | 0.0113437 | 'steel production, converter, unalloyed' (kilogram, RoW, None)
> > > 0.539395 | 0.503706 | 0.572149 | 'reinforcing steel production' (kilogram, RoW, None)
> > > > 0.539395 | 0.024312 | 0.0276158 | 'market for hot rolling, steel' (kilogram, GLO, None)
> > > > > 0.471744 | 0.021268 | 0.0241576 | 'hot rolling, steel' (kilogram, RoW, None)
> > > > > > 0.0235872 | 0.020957 | 0.0238052 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > 0.339819 | 0.301932 | 0.342959 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > > 0.0527904 | 0.046859 | 0.0532256 | 'steel production, converter, unalloyed' (kilogram, RER, None)
> > > > > 0.287028 | 0.254796 | 0.289418 | 'steel production, converter, unalloyed' (kilogram, RoW, None)
> > > > 0.199576 | 0.177461 | 0.201575 | 'market for steel, low-alloyed' (kilogram, GLO, None)
> > > > > 0.0175836 | 0.015667 | 0.017796 | 'steel production, converter, low-alloyed' (kilogram, RER, None)
> > > > > 0.0229177 | 0.020251 | 0.0230022 | 'steel production, electric, low-alloyed' (kilogram, RER, None)
> > > > > 0.0956045 | 0.085191 | 0.0967671 | 'steel production, converter, low-alloyed' (kilogram, RoW, None)
> > > > > 0.0629993 | 0.055770 | 0.0633481 | 'steel production, electric, low-alloyed' (kilogram, RoW, None)
> > 0.6887 | 0.052991 | 0.0601916 | 'market for sheet rolling, steel' (kilogram, GLO, None)
> > > 0.18333 | 0.014090 | 0.0160042 | 'sheet rolling, steel' (kilogram, RER, None)
> > > > 0.0156747 | 0.013927 | 0.0158195 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > > 0.0132397 | 0.011753 | 0.0133499 | 'steel production, converter, unalloyed' (kilogram, RoW, None)
> > > 0.50537 | 0.038901 | 0.0441874 | 'sheet rolling, steel' (kilogram, RoW, None)
> > > > 0.0432092 | 0.038392 | 0.0436084 | 'market for steel, unalloyed' (kilogram, GLO, None)
> > > > > 0.00671248 | 0.005958 | 0.00676783 | 'steel production, converter, unalloyed' (kilogram, RER, None)
> > > > > 0.0364967 | 0.032398 | 0.0368005 | 'steel production, converter, unalloyed' (kilogram, RoW, None)

Which activities have the highest losses?

In [66]:
def recursive_search_2(lca, fu, amount, total_score=None, level=0, max_level=3, 
                     cutoff=0.005, tab="\t", seen=set()):        
    if level >= max_level:
        return
    
    seen.add(fu)
    lca.redo_lcia({fu: amount})
    if total_score is None:
        total_score = lca.score
    if abs(lca.score) < abs(total_score * cutoff):
        return
    for exc in fu.technosphere():
        recursive_search_2(lca, exc.input, exc['amount'] * amount, 
                         total_score, level + 1, max_level, cutoff, tab, seen)
        
    return seen
In [67]:
seen = recursive_search_2(lca, bw.get_activity(glider), 1, max_level=7, tab="> ")
In [63]:
results = []

for o in seen:
    lca.redo_lcia({o: 1})
    results.append((lca.score, o))
    
sorted(results, reverse=True)
Out[63]:
[(34607882.40763581,
  'market for blast oxygen furnace converter' (unit, GLO, None)),
 (34598681.610800944,
  'blast oxygen furnace converter production' (unit, RER, None)),
 (18838386.267116528,
  'market for electric arc furnace converter' (unit, GLO, None)),
 (18835290.41979831,
  'electric arc furnace converter construction' (unit, RER, None)),
 (15348629.08600751, 'market for road vehicle factory' (unit, GLO, None)),
 (61541.81016853929, 'market for rolling mill' (unit, GLO, None)),
 (2.3530684581297403, 'market for molybdenum trioxide' (kilogram, GLO, None)),
 (2.143629007176738, 'market for light emitting diode' (kilogram, GLO, None)),
 (2.1141140059582977, 'market for molybdenite' (kilogram, GLO, None)),
 (1.7265083785749016,
  'market for printed wiring board, mounted mainboard, desktop computer, Pb free' (kilogram, GLO, None)),
 (1.5875346673014703,
  'market for sawnwood, softwood, raw, dried (u=20%)' (cubic meter, RER, None)),
 (1.58753466730147,
  'market for sawnwood, softwood, raw, dried (u=20%)' (cubic meter, RoW, None)),
 (1.1358793666869558,
  'glider production, passenger car' (kilogram, GLO, None)),
 (1.1358793666869558,
  'market for glider, passenger car' (kilogram, GLO, None)),
 (1.0771940408720138,
  'steel production, chromium steel 18/8, hot rolled' (kilogram, RoW, None)),
 (1.0771679743924059,
  'market for steel, chromium steel 18/8, hot rolled' (kilogram, GLO, None)),
 (1.0771150959678797,
  'steel production, chromium steel 18/8, hot rolled' (kilogram, RER, None)),
 (1.0616271789004774, 'market for reinforcing steel' (kilogram, GLO, None)),
 (1.0612122430510338,
  'steel production, low-alloyed, hot rolled' (kilogram, RoW, None)),
 (1.0611990908698365,
  'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)),
 (1.061133298146901,
  'steel production, low-alloyed, hot rolled' (kilogram, RER, None)),
 (1.0607247763228014, 'reinforcing steel production' (kilogram, RoW, None)),
 (1.0606458314186678, 'reinforcing steel production' (kilogram, RER, None)),
 (1.0259963580044986,
  'market for steel, chromium steel 18/8' (kilogram, GLO, None)),
 (1.0254813976003325,
  'steel production, converter, chromium steel 18/8' (kilogram, RoW, None)),
 (1.0254015158861738,
  'steel production, converter, chromium steel 18/8' (kilogram, RER, None)),
 (1.024221823963864,
  'steel production, electric, chromium steel 18/8' (kilogram, RoW, None)),
 (1.0234248030100135,
  'steel production, electric, chromium steel 18/8' (kilogram, RER, None)),
 (1.0121608230208945,
  'steel production, converter, low-alloyed' (kilogram, RoW, None)),
 (1.0120809413067355,
  'steel production, converter, low-alloyed' (kilogram, RER, None)),
 (1.01061821885946,
  'steel production, electric, low-alloyed' (kilogram, CA-QC, None)),
 (1.010014560183519, 'market for steel, low-alloyed' (kilogram, GLO, None)),
 (1.0092408034661808, 'market for steel, unalloyed' (kilogram, GLO, None)),
 (1.0083247284111965,
  'steel production, converter, unalloyed' (kilogram, RoW, None)),
 (1.0082448466970375,
  'steel production, converter, unalloyed' (kilogram, RER, None)),
 (1.0055372219857037,
  'steel production, electric, low-alloyed' (kilogram, RoW, None)),
 (1.0036857851402592,
  'steel production, electric, low-alloyed' (kilogram, RER, None)),
 (0.3030358773893778, 'market for magnesium' (kilogram, GLO, None)),
 (0.2729099654668954, 'market for ferrosilicon' (kilogram, GLO, None)),
 (0.08806876415550981, 'market for copper' (kilogram, GLO, None)),
 (0.08743562285378681, 'sheet rolling, steel' (kilogram, RoW, None)),
 (0.08739885765333064,
  'market for sheet rolling, steel' (kilogram, GLO, None)),
 (0.0872975100215885, 'sheet rolling, steel' (kilogram, RER, None)),
 (0.07507796820243819, 'market for nickel, 99.5%' (kilogram, GLO, None)),
 (0.05532448723349175, 'market for ferronickel, 25% Ni' (kilogram, GLO, None)),
 (0.05120900307278748, 'hot rolling, steel' (kilogram, RoW, None)),
 (0.05119768286751503, 'market for hot rolling, steel' (kilogram, GLO, None)),
 (0.05111873796338172, 'hot rolling, steel' (kilogram, RER, None)),
 (0.04175168201222754, 'market for coating powder' (kilogram, RER, None)),
 (0.04040729729182478, 'market for coating powder' (kilogram, RoW, None)),
 (0.0393309403910401,
  'market for aluminium, wrought alloy' (kilogram, GLO, None)),
 (0.028026707931626763,
  'market for epoxy resin, liquid' (kilogram, RoW, None)),
 (0.02786423212552196,
  'market for natural gas, high pressure' (cubic meter, JP, None)),
 (0.026643643487504476,
  'market for epoxy resin, liquid' (kilogram, RER, None)),
 (0.02427947142710488, 'market for sodium dichromate' (kilogram, GLO, None)),
 (0.022205584291671694, 'market for zinc' (kilogram, GLO, None)),
 (0.021845580624908146, 'market for viscose fibre' (kilogram, GLO, None)),
 (0.0212998665186689, 'market for synthetic rubber' (kilogram, GLO, None)),
 (0.020343474266562304, 'market for silicon carbide' (kilogram, GLO, None)),
 (0.019882275584054164,
  'market for polyethylene terephthalate, granulate, amorphous' (kilogram, GLO, None)),
 (0.018801832120325088,
  'market for aluminium, cast alloy' (kilogram, GLO, None)),
 (0.01766473152893546,
  'market for glass fibre reinforced plastic, polyester resin, hand lay-up' (kilogram, GLO, None)),
 (0.016025029564123983, 'market for lubricating oil' (kilogram, RoW, None)),
 (0.015677503123545305, 'market for lubricating oil' (kilogram, RER, None)),
 (0.014784763846420433,
  'market for chemicals, inorganic' (kilogram, GLO, None)),
 (0.012263149539383629,
  'market for ferromanganese, high-coal, 74.5% Mn' (kilogram, GLO, None)),
 (0.01187812590473099, 'market for ethylene glycol' (kilogram, GLO, None)),
 (0.011043370874450417,
  'market for kraft paper, bleached' (kilogram, GLO, None)),
 (0.01098555967617057,
  'market for ferrochromium, high-carbon, 68% Cr' (kilogram, GLO, None)),
 (0.010348804305484368,
  'market for hydrochloric acid, without water, in 30% solution state' (kilogram, RoW, None)),
 (0.010308765445593976,
  'market for refractory, basic, packed' (kilogram, GLO, None)),
 (0.009241315866232832,
  'market for hydrochloric acid, without water, in 30% solution state' (kilogram, RER, None)),
 (0.009154474162753612, 'market for cast iron' (kilogram, GLO, None)),
 (0.008873436309012469,
  'market for corrugated board box' (kilogram, RER, None)),
 (0.008527371165117741,
  'market for kraft paper, unbleached' (kilogram, GLO, None)),
 (0.008216909485047264,
  'market for wire drawing, copper' (kilogram, GLO, None)),
 (0.00793923122812218,
  'market for polyurethane, flexible foam' (kilogram, RoW, None)),
 (0.007540280227826214, 'market for pig iron' (kilogram, GLO, None)),
 (0.0075306782295734825,
  'market for liquefied petroleum gas' (kilogram, RoW, None)),
 (0.007461426718421679, 'market for lead' (kilogram, GLO, None)),
 (0.007357996819970322,
  'market for natural gas, high pressure' (cubic meter, RU, None)),
 (0.0069982323626518895,
  'market for corrugated board box' (kilogram, CA-QC, None)),
 (0.006785567680416323,
  'market for packaging film, low density polyethylene' (kilogram, GLO, None)),
 (0.006547132943170943,
  'market for liquefied petroleum gas' (kilogram, CH, None)),
 (0.006325947249072192,
  'market for natural gas, high pressure' (cubic meter, CH, None)),
 (0.006260653447445912,
  'market group for natural gas, high pressure' (cubic meter, Europe without Switzerland, None)),
 (0.006184785378053111,
  'market for natural gas, high pressure' (cubic meter, US, None)),
 (0.006101320967529389, 'market for argon, liquid' (kilogram, RER, None)),
 (0.0059802739091609795,
  'market for polyurethane, flexible foam' (kilogram, RER, None)),
 (0.005907931994583794,
  'market for corrugated board box' (kilogram, RoW, None)),
 (0.005866284454371878,
  'market group for natural gas, high pressure' (cubic meter, CA, None)),
 (0.00572417148366035,
  'market for hard coal' (kilogram, Europe, without Russia and Turkey, None)),
 (0.005710025243243539,
  'market for natural gas, high pressure' (cubic meter, DZ, None)),
 (0.004823713536619284, 'market for hard coal' (kilogram, RoW, None)),
 (0.004539323554284537,
  'market for flat glass, uncoated' (kilogram, GLO, None)),
 (0.004453224150911878, 'market for hard coal' (kilogram, CN, None)),
 (0.004353979407603915, 'market for sulfuric acid' (kilogram, RoW, None)),
 (0.004062190665571754, 'market for sulfuric acid' (kilogram, RER, None)),
 (0.0037516427231847633, 'market for hard coal' (kilogram, IN, None)),
 (0.0037322061906980937,
  'market for natural gas, high pressure' (cubic meter, RoW, None)),
 (0.0034557074271696292,
  'market for anode, for metal electrolysis' (kilogram, GLO, None)),
 (0.003328732006824914, 'market for oxygen, liquid' (kilogram, RoW, None)),
 (0.0033233678650178107,
  'market for acrylonitrile-butadiene-styrene copolymer' (kilogram, GLO, None)),
 (0.0033192881270339442,
  'market for sheet rolling, aluminium' (kilogram, GLO, None)),
 (0.0031196763180207816, 'market for hard coal' (kilogram, ZA, None)),
 (0.002989261196052238,
  'market group for electricity, low voltage' (kilowatt hour, RAS, None)),
 (0.0029403738456020116, 'market for hard coal' (kilogram, RU, None)),
 (0.0026389321517675084,
  'market group for transport, freight train' (ton kilometer, GLO, None)),
 (0.00260924260452875,
  'market group for electricity, low voltage' (kilowatt hour, RAF, None)),
 (0.0025904737465319563,
  'market group for electricity, medium voltage' (kilowatt hour, RAS, None)),
 (0.0025716680940866604,
  'market for electricity, low voltage' (kilowatt hour, NZ, None)),
 (0.0025371267831518574, 'market for oxygen, liquid' (kilogram, RER, None)),
 (0.002481980105297478,
  'market for electricity, low voltage' (kilowatt hour, RU, None)),
 (0.0024761617593657944,
  'market for electricity, low voltage' (kilowatt hour, RoW, None)),
 (0.0022287856870056013,
  'market for electricity, medium voltage' (kilowatt hour, NZ, None)),
 (0.0021510244092604568,
  'market group for electricity, low voltage' (kilowatt hour, US, None)),
 (0.002104069656791963,
  'market group for electricity, medium voltage' (kilowatt hour, GLO, None)),
 (0.0021001156485166397,
  'market for electricity, medium voltage' (kilowatt hour, RoW, None)),
 (0.0020696233148825415,
  'market for electricity, medium voltage' (kilowatt hour, RU, None)),
 (0.0020464336674833805,
  'market group for electricity, medium voltage' (kilowatt hour, RAF, None)),
 (0.002033637004626417,
  'market for iron ore, beneficiated, 65% Fe' (kilogram, GLO, None)),
 (0.0019925986404250215,
  'market group for electricity, low voltage' (kilowatt hour, RER, None)),
 (0.001836419145221061,
  'market group for electricity, medium voltage' (kilowatt hour, US, None)),
 (0.0018034045928612679, 'market for hard coal' (kilogram, RLA, None)),
 (0.0017903284416430098, 'market for nylon 6' (kilogram, GLO, None)),
 (0.001712271309611096,
  'market group for electricity, medium voltage' (kilowatt hour, RNA, None)),
 (0.0017090687165114435,
  'market group for electricity, low voltage' (kilowatt hour, RLA, None)),
 (0.0016520877623418203,
  'market group for electricity, medium voltage' (kilowatt hour, RER, None)),
 (0.0016256883473549908,
  'market for diesel, burned in building machine' (megajoule, GLO, None)),
 (0.0016098876982283173,
  'market for polyethylene, low density, granulate' (kilogram, GLO, None)),
 (0.0016082546863908477,
  'market for propane, burned in building machine' (megajoule, GLO, None)),
 (0.0016079495061405303,
  'market for polyvinylchloride, suspension polymerised' (kilogram, GLO, None)),
 (0.0016023705343866921,
  'market group for transport, freight, lorry, unspecified' (ton kilometer, GLO, None)),
 (0.001598827963485388,
  'market for polypropylene, granulate' (kilogram, GLO, None)),
 (0.0015818707037364734,
  'market for electricity, low voltage' (kilowatt hour, AU, None)),
 (0.0014958659738789546,
  'market for iron scrap, sorted, pressed' (kilogram, GLO, None)),
 (0.0014871513411989618,
  'market group for transport, freight, inland waterways, barge' (ton kilometer, GLO, None)),
 (0.0014802080761125947, 'market for hard coal' (kilogram, ID, None)),
 (0.0014776058907320735,
  'market group for electricity, low voltage' (kilowatt hour, Canada without Quebec, None)),
 (0.001361336210182151,
  'market for lime, hydrated, loose weight' (kilogram, RoW, None)),
 (0.0013080457201591897,
  'market for electricity, medium voltage' (kilowatt hour, AU, None)),
 (0.0012889621579892487,
  'market group for electricity, medium voltage' (kilowatt hour, RLA, None)),
 (0.0011666576985087395,
  'market group for electricity, medium voltage' (kilowatt hour, Canada without Quebec, None)),
 (0.0010656561268898987,
  'market for quicklime, in pieces, loose' (kilogram, RoW, None)),
 (0.0007949079926151939, 'market for hard coal' (kilogram, AU, None)),
 (0.0007933074335267406,
  'market for quicklime, in pieces, loose' (kilogram, CH, None)),
 (0.0007576838113260384,
  'market for lime, hydrated, loose weight' (kilogram, CH, None)),
 (0.0007243064623190479,
  'market for tempering, flat glass' (kilogram, GLO, None)),
 (0.0005048728280340304, 'market for dolomite' (kilogram, RoW, None)),
 (0.0004448563806144153, 'market for dolomite' (kilogram, RER, None)),
 (0.00032786521944481637,
  'market for heat, district or industrial, natural gas' (megajoule, CA-QC, None)),
 (0.00023884837074800023, 'market for coke' (megajoule, GLO, None)),
 (0.00020836362881669903,
  'market for heat, district or industrial, other than natural gas' (megajoule, RoW, None)),
 (0.00020692541235701418,
  'market group for heat, district or industrial, other than natural gas' (megajoule, GLO, None)),
 (0.00019267850753566245,
  'market for heat, district or industrial, other than natural gas' (megajoule, CA-QC, None)),
 (0.0001558855753093835,
  'market group for heat, district or industrial, other than natural gas' (megajoule, RER, None)),
 (0.00014997595169378346,
  'market group for heat, district or industrial, natural gas' (megajoule, GLO, None)),
 (0.00014855864449670673,
  'market for transport, freight, sea, transoceanic ship' (ton kilometer, GLO, None)),
 (0.00014834247997751632,
  'market for heat, district or industrial, natural gas' (megajoule, RoW, None)),
 (0.00014723311256626564,
  'market group for heat, district or industrial, natural gas' (megajoule, RER, None)),
 (1.0768157194953702e-05,
  'market for water, deionised, from tap water, at user' (kilogram, RoW, None)),
 (9.002802637756188e-06,
  'market for water, deionised, from tap water, at user' (kilogram, Europe without Switzerland, None)),
 (7.970639207903291e-06,
  'market for water, deionised, from tap water, at user' (kilogram, CH, None)),
 (4.049781073654079e-06, 'market group for tap water' (kilogram, GLO, None)),
 (0.0, 'iron scrap, unsorted, Recycled Content cut-off' (kilogram, GLO, None)),
 (0.0, 'aluminium scrap, new, Recycled Content cut-off' (kilogram, GLO, None)),
 (-0.00011232333614143965,
  'market for municipal solid waste' (kilogram, CY, None)),
 (-0.00013504497680578162,
  'market for inert waste, for final disposal' (kilogram, CH, None)),
 (-0.0001566375531657434,
  'market for inert waste, for final disposal' (kilogram, RoW, None)),
 (-0.0001724429535157326,
  'market for municipal solid waste' (kilogram, RoW, None)),
 (-0.00019906687371456301,
  'market for slag, unalloyed electric arc furnace steel' (kilogram, GLO, None)),
 (-0.0001990668737145631,
  'market for dust, unalloyed electric arc furnace steel' (kilogram, GLO, None)),
 (-0.0004472393014168889,
  'market for municipal solid waste' (kilogram, CA-QC, None)),
 (-0.0006708848794181545,
  'market for used glider, passenger car' (kilogram, GLO, None)),
 (-0.0006882688236524513,
  'market for waste mineral oil' (kilogram, RoW, None)),
 (-0.0007713738026267988,
  'market for average incineration residue' (kilogram, CH, None)),
 (-0.0008291907416573144,
  'market group for municipal solid waste' (kilogram, RER, None)),
 (-0.0012436727620671398,
  'market for waste plastic, industrial electronics' (kilogram, CH, None)),
 (-0.0012965011000350035,
  'market for waste plastic, industrial electronics' (kilogram, RoW, None)),
 (-0.001298055620427722,
  'market for sludge from steel rolling' (kilogram, GLO, None)),
 (-0.001338997146990171,
  'market for steel in car shredder residue' (kilogram, CH, None)),
 (-0.0013585694581387928,
  'market for basic oxygen furnace waste' (kilogram, GLO, None)),
 (-0.0013585694581387932,
  'market for dust, alloyed electric arc furnace steel' (kilogram, GLO, None)),
 (-0.0013634224666073589,
  'market for average incineration residue' (kilogram, RoW, None)),
 (-0.001404708798973588,
  'market for waste mineral oil' (kilogram, Europe without Switzerland, None)),
 (-0.0016122208933175963, 'market for waste mineral oil' (kilogram, CH, None)),
 (-0.0019484235892252345,
  'market for spent solvent mixture' (kilogram, Europe without Switzerland, None)),
 (-0.001960283204947772,
  'market for steel in car shredder residue' (kilogram, RoW, None)),
 (-0.002291379851724163,
  'market for spent solvent mixture' (kilogram, CH, None))]

What is going on with soft wood production?

In [72]:
# 'market for sawnwood, softwood, raw, dried (u=20%)' (cubic meter, RER, None)
wood = ('ecoinvent 3.5 cutoff', 'c028ce5c9f43e7f4fd03763f4e71f33c')

# 'market for sawnwood, board, softwood, raw, dried (u=20%)' (cubic meter, GLO, None)
wood = ('ecoinvent 3.5 cutoff', '690c108e2ffdad3444d28625b8dcddd3')
In [71]:
[(o, o.key) for o in bw.Database("ecoinvent 3.5 cutoff") 
 if o['name'] == 'market for sawnwood, board, softwood, raw, dried (u=20%)']
Out[71]:
[('market for sawnwood, board, softwood, raw, dried (u=20%)' (cubic meter, GLO, None),
  ('ecoinvent 3.5 cutoff', '690c108e2ffdad3444d28625b8dcddd3'))]
In [76]:
recursive_search(lca, bw.get_activity(wood), 1, max_level=7, tab="> ", cutoff=0.01)
1 | 1.000000 | 1.58714 | 'market for sawnwood, board, softwood, raw, dried (u=20%)' (cubic meter, GLO, None)
> 93.8108 | 0.094711 | 0.15032 | 'market group for transport, freight, lorry, unspecified' (ton kilometer, GLO, None)
> > 27.1113 | 0.027472 | 0.0436025 | 'market for transport, freight, lorry, unspecified' (ton kilometer, RER, None)
> > > 12.1212 | 0.012689 | 0.020139 | 'transport, freight, lorry, all sizes, EURO3 to generic market for transport, freight, lorry, unspecified' (ton kilometer, RER, None)
> > > 10.5785 | 0.010456 | 0.0165952 | 'transport, freight, lorry, all sizes, EURO4 to generic market for transport, freight, lorry, unspecified' (ton kilometer, RER, None)
> > 66.6995 | 0.067239 | 0.106717 | 'market for transport, freight, lorry, unspecified' (ton kilometer, RoW, None)
> > > 29.8206 | 0.031056 | 0.0492895 | 'transport, freight, lorry, all sizes, EURO3 to generic market for transport, freight, lorry, unspecified' (ton kilometer, RoW, None)
> > > > 10.0552 | 0.012140 | 0.0192683 | 'market for transport, freight, lorry 16-32 metric ton, EURO3' (ton kilometer, RoW, None)
> > > > > 10.0552 | 0.012140 | 0.0192683 | 'transport, freight, lorry 16-32 metric ton, EURO3' (ton kilometer, RoW, None)
> > > > 17.5966 | 0.011797 | 0.018723 | 'market for transport, freight, lorry >32 metric ton, EURO3' (ton kilometer, RoW, None)
> > > > > 17.5966 | 0.011797 | 0.018723 | 'transport, freight, lorry >32 metric ton, EURO3' (ton kilometer, RoW, None)
> > > 26.0252 | 0.025592 | 0.0406172 | 'transport, freight, lorry, all sizes, EURO4 to generic market for transport, freight, lorry, unspecified' (ton kilometer, RoW, None)
> > > > 16.2658 | 0.010869 | 0.0172505 | 'market for transport, freight, lorry >32 metric ton, EURO4' (ton kilometer, RoW, None)
> > > > > 16.2658 | 0.010869 | 0.0172505 | 'transport, freight, lorry >32 metric ton, EURO4' (ton kilometer, RoW, None)
> 55.6639 | 0.092552 | 0.146893 | 'market group for transport, freight train' (ton kilometer, GLO, None)
> > 55.6639 | 0.092552 | 0.146893 | 'market for transport, freight train' (ton kilometer, RoW, None)
> > > 19.4989 | 0.032567 | 0.0516882 | 'transport, freight train, electricity' (ton kilometer, RoW, None)
> > > > 8.94998e-07 | 0.012613 | 0.0200187 | 'market for goods wagon' (unit, GLO, None)
> > > > 0.0018118 | 0.018139 | 0.0287885 | 'market for railway track' (meter-year, GLO, None)
> > > > > 0.00179655 | 0.017991 | 0.0285546 | 'railway track construction' (meter-year, RoW, None)
> > > > > > 0.0242535 | 0.016223 | 0.0257482 | 'market for reinforcing steel' (kilogram, GLO, None)
> > > 36.165 | 0.059985 | 0.095205 | 'transport, freight train, diesel' (ton kilometer, RoW, None)
> > > > 0.00336334 | 0.033672 | 0.0534416 | 'market for railway track' (meter-year, GLO, None)
> > > > > 0.00333504 | 0.033398 | 0.0530074 | 'railway track construction' (meter-year, RoW, None)
> > > > > > 0.045023 | 0.030116 | 0.0477976 | 'market for reinforcing steel' (kilogram, GLO, None)
> > > > 1.65997e-06 | 0.023394 | 0.0371291 | 'market for goods wagon' (unit, GLO, None)
> > > > > 1.1112e-06 | 0.015662 | 0.0248573 | 'goods wagon production' (unit, RoW, None)
> > > > > > 0.0233352 | 0.015602 | 0.0247633 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> 2.88077 | 0.072443 | 0.114977 | 'market group for transport, freight, light commercial vehicle' (ton kilometer, GLO, None)
> > 2.56511 | 0.064505 | 0.102378 | 'market for transport, freight, light commercial vehicle' (ton kilometer, RoW, None)
> > > 2.56511 | 0.064505 | 0.102378 | 'transport, freight, light commercial vehicle' (ton kilometer, RoW, None)
> > > > 6.14369e-05 | 0.051616 | 0.0819209 | 'market for light commercial vehicle' (unit, GLO, None)
> > > > > 2.03106e-05 | 0.017051 | 0.0270618 | 'light commercial vehicle production' (unit, RER, None)
> > > > > > 0.021123 | 0.014123 | 0.0224157 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> > > > > 4.11263e-05 | 0.034565 | 0.054859 | 'light commercial vehicle production' (unit, RoW, None)
> > > > > > 0.0427714 | 0.028598 | 0.0453889 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> 0.0379292 | 0.043397 | 0.068877 | 'board, softwood, raw, air drying to u=20%' (cubic meter, CA-QC, None)
> > 0.0395096 | 0.043397 | 0.068877 | 'sawing, softwood' (cubic meter, CA-QC, None)
> > > 0.0663415 | 0.024565 | 0.0389884 | 'market for sawlog and veneer log, softwood, measured as solid wood under bark' (cubic meter, CA-QC, None)
> > > > 0.0663415 | 0.018881 | 0.0299661 | 'softwood forestry, mixed species, boreal forest' (cubic meter, CA-QC, None)
> > > > > 15.0296 | 0.015395 | 0.0244334 | 'market for diesel, burned in building machine' (megajoule, GLO, None)
> > > > > > 15.0296 | 0.015395 | 0.0244334 | 'diesel, burned in building machine' (megajoule, GLO, None)
> > > 7.60271e-09 | 0.011980 | 0.0190132 | 'market for sawmill' (unit, GLO, None)
> 0.958393 | 0.687505 | 1.09116 | 'board, softwood, raw, air drying to u=20%' (cubic meter, RoW, None)
> > 0.998326 | 0.687505 | 1.09116 | 'sawing, softwood' (cubic meter, RoW, None)
> > > 1.99941e-07 | 0.315045 | 0.50002 | 'market for sawmill' (unit, GLO, None)
> > > > 5.92733e-08 | 0.094435 | 0.149882 | 'sawmill construction' (unit, Europe without Switzerland, None)
> > > > > 0.0506787 | 0.033885 | 0.0537801 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> > > > > > 0.0422559 | 0.028254 | 0.0448425 | 'steel production, low-alloyed, hot rolled' (kilogram, RoW, None)
> > > > > 0.000132772 | 0.048108 | 0.0763542 | 'conveyor belt production' (meter, RER, None)
> > > > > > 0.0703692 | 0.047051 | 0.0746758 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> > > > 1.40667e-07 | 0.220610 | 0.350138 | 'sawmill construction' (unit, RoW, None)
> > > > > 0.118325 | 0.079115 | 0.125567 | 'market for steel, low-alloyed, hot rolled' (kilogram, GLO, None)
> > > > > > 0.0196655 | 0.013148 | 0.0208678 | 'steel production, low-alloyed, hot rolled' (kilogram, RER, None)
> > > > > > 0.0986598 | 0.065967 | 0.104699 | 'steel production, low-alloyed, hot rolled' (kilogram, RoW, None)
> > > > > 0.000309998 | 0.112326 | 0.178277 | 'market for conveyor belt' (meter, GLO, None)
> > > > > > 0.000102483 | 0.037133 | 0.0589357 | 'conveyor belt production' (meter, RER, None)
> > > > > > 0.000207515 | 0.075193 | 0.119342 | 'conveyor belt production' (meter, RoW, None)
> > > > > 0.00107669 | 0.021705 | 0.0344481 | 'market for building, hall' (square meter, GLO, None)
> > > > > > 0.00106763 | 0.021524 | 0.034161 | 'building construction, hall' (square meter, RoW, None)
> > > 26.8545 | 0.027507 | 0.0436571 | 'market for diesel, burned in building machine' (megajoule, GLO, None)
> > > > 26.8545 | 0.027507 | 0.0436571 | 'diesel, burned in building machine' (megajoule, GLO, None)
> > > > > 3.59851e-06 | 0.024140 | 0.0383133 | 'market for building machine' (unit, GLO, None)
> > > > > > 2.40887e-06 | 0.016162 | 0.0256515 | 'building machine production' (unit, RoW, None)
> > > 1.47751 | 0.316065 | 0.501638 | 'market for sawlog and veneer log, softwood, measured as solid wood under bark' (cubic meter, RoW, None)
> > > > 0.662724 | 0.089232 | 0.141623 | 'softwood forestry, pine, sustainable forest management' (cubic meter, RoW, None)
> > > > > 10.4422 | 0.010696 | 0.0169758 | 'market for diesel, burned in building machine' (megajoule, GLO, None)
> > > > > > 10.4422 | 0.010696 | 0.0169758 | 'diesel, burned in building machine' (megajoule, GLO, None)
> > > > > 0.0648807 | 0.055455 | 0.088014 | 'market for harvesting, forestry harvester' (hour, GLO, None)
> > > > > > 0.0648807 | 0.055455 | 0.088014 | 'harvesting, forestry harvester' (hour, RoW, None)
> > > > > 0.0323226 | 0.017751 | 0.028173 | 'market for forwarding, forwarder' (hour, GLO, None)
> > > > > > 0.0323226 | 0.017751 | 0.028173 | 'forwarding, forwarder' (hour, RoW, None)
> > > > 0.814788 | 0.102887 | 0.163296 | 'softwood forestry, spruce, sustainable forest management' (cubic meter, RoW, None)
> > > > > 0.0389941 | 0.021415 | 0.033988 | 'market for forwarding, forwarder' (hour, GLO, None)
> > > > > > 0.0389941 | 0.021415 | 0.033988 | 'forwarding, forwarder' (hour, RoW, None)
> > > > > 0.0797677 | 0.068179 | 0.108209 | 'market for harvesting, forestry harvester' (hour, GLO, None)
> > > > > > 0.0797677 | 0.068179 | 0.108209 | 'harvesting, forestry harvester' (hour, RoW, None)
> > > > 2.61675 | 0.065804 | 0.104439 | 'market for transport, freight, light commercial vehicle' (ton kilometer, RoW, None)
> > > > > 2.61675 | 0.065804 | 0.104439 | 'transport, freight, light commercial vehicle' (ton kilometer, RoW, None)
> > > > > > 6.26739e-05 | 0.052655 | 0.0835703 | 'market for light commercial vehicle' (unit, GLO, None)
> > > > 22.719 | 0.037775 | 0.0599538 | 'market for transport, freight train' (ton kilometer, RoW, None)
> > > > > 7.95838 | 0.013292 | 0.0210963 | 'transport, freight train, electricity' (ton kilometer, RoW, None)
> > > > > 14.7606 | 0.024483 | 0.0388575 | 'transport, freight train, diesel' (ton kilometer, RoW, None)
> > > > > > 0.00137273 | 0.013743 | 0.0218119 | 'market for railway track' (meter-year, GLO, None)
> > > 8.40814 | 0.013724 | 0.0217811 | 'market group for electricity, medium voltage' (kilowatt hour, RAS, None)

No clear answer - a lot of steel in the saw mill construction, and then small amounts in the different forestry equipments and transportation steps. Needs to be investigated further, as this result feels wrong.

Vehicles sector: Exclude LDV from HDV

LDV (light duty vehicles) have a gross vehicle weight of up to 8 tons. In ecoinvent, LDVs are classified as "3.5-7.5 ton". HDV (heavy duty vehicles) are... heavier :)

In [85]:
trucks = next(x for x in bw.Database("ecoinvent 3.5 cutoff") 
           if x['name'] == "market group for transport, freight, lorry, unspecified")
trucks
Out[85]:
'market group for transport, freight, lorry, unspecified' (ton kilometer, GLO, None)
In [88]:
ldvs = [o for o in bw.Database("ecoinvent 3.5 cutoff") 
        if o['name'].startswith("transport, freight, lorry") and "3.5-7.5 ton" in o['name']]
In [90]:
lca = bw.LCA({trucks: 1}, ("Inventory flows", "Steel"))
lca.lci()
lca.lcia()
lca.score
Out[90]:
0.0016023705343866921
In [92]:
0.0016023705343866921 - without_double_counting(lca, {trucks: 1}, ldvs)
Out[92]:
2.168404344971009e-18

As expected, in this particular case the marginal steel input is quite small, as LDVs only contribute 3% of ton-kilometers, and have proportionately small amounts of truck mass.

Exogenous demand: Transport and electricity

Sometimes the amounts of materials demanded will come from external models, such as integrated assessment models. In this case, we don't need to look up demands in the supply array, but just supply them directly.

In cases where one aggregate demand from an external model maps to multiple ecoinvent activities, we allocate based on reported production volumes.

In [100]:
def get_production_volume(act):
    return next(iter(act.production()))['production volume']
In [103]:
all_transport = {
    o: get_production_volume(o) 
    for o in bw.Database("ecoinvent 3.5 cutoff") 
    if o['name'].startswith("transport, freight, lorry")
}
total = sum(all_transport.values())
all_transport = {k: v / total * 1e4 for k, v in all_transport.items()}
In [104]:
all_electricity = {
    o: get_production_volume(o) 
    for o in bw.Database("ecoinvent 3.5 cutoff") 
    if o['name'].startswith("market for electricity,")
}
total = sum(all_electricity.values())
all_electricity = {k: v / total * 1e2 for k, v in all_electricity.items()}
In [107]:
without_double_counting(lca, all_transport, all_electricity)
Out[107]:
0.001582994381059183
In [110]:
lca.redo_lcia(all_transport)
lca.score
Out[110]:
0.0016145330490756776
In [108]:
without_double_counting(lca, all_electricity, all_transport)
Out[108]:
0.00216614294414289
In [111]:
lca.redo_lcia(all_electricity)
lca.score
Out[111]:
0.0021898578697670595