基于现有的 ecoinvent 活动在 Brightway2 中创建新活动

2023-12-01

我想创建一个活动,从充当代理的数据库(在本例中为 ecoinvent)“重新上下文化”现有数据集。例如,在瑞士热泵的基础上在魁北克创建热泵,但改变了电力来源。

我的问题与@MPa提出的问题非常相似this问题,但如果没有更多细节,我无法弄清楚如何做到这一点。这就是我所做的:

1) 从我的 ecoinvent 3.3 数据库中找到我想要用作代理的进程:

hp_ch=Database('ei_33consequential').search("heat-pump production air-water",
                                  filter={'location':'ch'},
                                  )[0]

2)创建活动的副本

hp_qc=hp_ch.copy()

3)改变位置

hp_qc['location']='CA-QC'

4) 删除原来存储兑换金额的流

for exc in hp_qc.exchanges():
    if 'electricity, low voltage' in exc['name']:
        amnt=(exc.amount)
        exc.delete()

5) 添加新流量(在本例中为来自魁北克的相同电量)

here is where I am a lost. I know how to find the process that generates that flow ('44389eae7d62fa9d4ea9ea2b9fc2f609') but I don't know how to add it as an exchange to my "hp_qc" process. I guess I should also change the unique identifier code (UUID) or otherwise I will have two activities in my database with the same UUID, which could be problematic. I should also modify the "geographical representativeness" score of the pedigree matrix, but I am not sure these scores are actually used by Brightway 2 at this point.

[编辑],按照@MPa的建议我做了以下事情:

#electricity low voltage quebec
elw_qc=Database('ei_33consequential').get('44389eae7d62fa9d4ea9ea2b9fc2f609')

elect_to_hp = [exc for exc in hp_qc.technosphere() if 'electricity, low voltage' in exc['name']][0]

elect_to_hp.input = qc_elect
elec_to_hp.save()
hp_qc.save() #necessary?

我用一种常见的影响评估方法进行了测试:

fu1={hp_qc:1}
lca1=LCA(fu1,('IMPACT 2002+ (Endpoint)', 'resources', 'total'))
lca1.lci()
lca1.lcia()
lca1.score
fu2={hp_ch:1}
lca2=LCA(fu2,('IMPACT 2002+ (Endpoint)', 'resources', 'total'))
lca2.lci()
lca2.lcia()
lca2.score

两个分数都是不同的,尽管我对瑞士热泵得到了负分,这有点奇怪,但我认为有可能,并且与瑞士热泵完全无关。重新语境化。有用!


里面有几个问题。我将逐一阐述。

1)通用唯一标识:new_activity = old_activity.copy()创建一个新的 UUIDnew_activity。就你而言,hp_qc.key==hp_ch.key将返回False。因此一切都很好。

2) 添加交换:一旦您找到您想要链接的活动(例如,qc_elec), 你可以这样做:
hp_qc.new_exchange(input=qc_elect.key, amount = amount, type='technosphere') where my_amount是本次兑换的实际金额。

3)然而,这将是much在你的情况下更简单adapt交换而不是删除并替换它:

hp_qc=hp_ch.copy()
hp_qc['location']='CA-QC'
# Assign the electricity input you want to change to a variable
elect_to_hp = [exc for exc in hp_qc.technosphere() if 'electricity, low voltage' in exc['name']][0]
# Change the input of this exchange so it links to `qc_elect`  
elect_to_hp.input = qc_elect  
# Save the resulting activity
elect_to_hp.save()

交换将与之前的电力输入相同(相同的数量、相同的不确定性、相同的文件)。然后,您需要这样更改您想要的字段(例如评论、不确定性):

elect_to_hp['comment'] = 'Recontextualisation'

4)不确定性,谱系: 您说得很对:(1) 谱系分数应该进行调整,(2) 总不确定性应该因此改变,(3) Brightway 中不使用谱系分数来计算总不确定性。但是,您可以使用以下方法轻松计算新的不确定性scale without pedigree(相当于基本不确定性)、系谱分数和已发表的附加不确定性因素(转载自here为了您的方便,请在下面)计算新的不确定性(新的scale如果 PDF 是对数正态的)一旦您修改了系谱分数。

ecoinvent_33_pedigree_matrix = {
            'reliability': 
                {
                1:0.0,
                2:0.0006,
                3:0.002,
                4:0.008,
                5:0.04
                },
            'completeness':
                {
                1: 0.0,
                2: 0.0001,
                3: 0.0006,
                4: 0.002,
                5: 0.008
                },
            'temporal correlation':
                {
                1:0.0,
                2:0.0002,
                3:0.002,
                4:0.008,
                5:0.04
                },
            'geographical correlation':
                {
                1:0.0,
                2:0.000025,
                3:0.0001,
                4:0.0006,
                5:0.002
                },
            'further technological correlation':
                {
                1:0.0,
                2:0.0006,
                3:0.008,
                4:0.04,
                5:0.12
                }
         }
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

基于现有的 ecoinvent 活动在 Brightway2 中创建新活动 的相关文章

随机推荐