Search code examples
brightway

Monte Carlo LCA on activities that have parameters with uncertainty from a SimaPro project returns constant value (no uncertainty)


I've imported a project from SimaPro in which almost every activity uses parameters that have uncertainty. When I run a Monte Carlo LCA on any of these in Brightway, the results are constant, as though the quantities have no uncertainty (the snippet shows 10 steps, but it's the same for 2000 steps).

sp = bw.SimaProCSVImporter(fp, name="All Param")
sp.apply_strategies()
sp.statistics()  # returns 0 unlinked
sp.write_database(activate_parameters=True)
spdb = bw.Database("All Param")

imported_material = [act for act in spdb if 'Imported' in act['name']][0]

mciter=10
mc_imported = bw.MonteCarloLCA({imported_material:1},('IPCC 2013', 'climate change', 'GWP 100a'))
scores = [next(mc_imported) for _ in range(mciter)]
scores
[0.015027544172490276,
 0.015027544172490276,
 ...
 0.015027544172490276,
 0.015027544172490276]

I'm at a loss, as everything loads without errors, and looking at the activities and exchanges show the expected formulas, parameters and uncertainties on parameters.

I suspect that the issue might be related to the distinction between active and passive parameters described in the documentation, but do not see how to make the designation that these parameters are (all) "active" beyond xxx.write_database(activate_parameters=True) as in the parameterized dataset example notebook. I also don't see how to list which parameters are active or passive, so the issue might be something else completely.

What do I need to do to get my parameterized activities to incorporate the uncertainty from the parameters in the MC LCA? Any help would be most appreciated!

For what it's worth, they do work in the SimaPro project whence they come - the uncertainty analysis uses the uncertainty on the parameters - so I don't think the issue is in the originating project.

Thank you for any guidance you can provide!


Solution

  • Parameterized inventories generally don't work in Monte Carlo, as the Monte Carlo class is focused on data point uncertainties described by PDFs. There is a separate project called presamples which allows for the use of parameterized inventories in Monte Carlo through some pre-calculations - however, it doesn't have great documentation yet. Look in the docs, and ParameterizedBrightwayModel.

    Note: Check your parameter names and formulas from SimaPro, Brightway is stricter in what it allows (e.g. python is case sensitive and has more reserved words).