我想参数化现有的 Brightway 活动的交换。在示例中,我发现公式是为 new_exchange 定义的,我们可以对现有的进行吗?
一个实际的例子可能是将燃料消耗重新定义为更高热值和效率的函数。
ex=[act for act in bw.Database('ei_34con') if 'natural gas' in act['name']
and 'condensing' in act['name']
and 'CH' in act['location']][0].copy()
ng_flow=[f for f in ex.technosphere() if ('natural gas' in f['name'])][0]
act_data=[{'name':'eff',
'database':ex['database'],
'code':ex['code'],
'amount':0.95,
'unit':''},
{'name':'HHV',
'database':ex['database'],
'code':ex['code'],
'amount':37,
'unit':'MJ/m3'}]
bw.parameters.new_activity_parameters(act_data, "my group")
我天真地尝试过
ng_flow['formula']='1/eff/HHV'
bw.parameters.add_exchanges_to_group("my group", ex)
ActivityParameter.recalculate_exchanges("my group")
但参数并没有更新交换量。