【问题标题】:Mixture function in python thermo librarypython thermo库中的混合函数
【发布时间】:2022-06-16 15:35:20
【问题描述】:

我正在使用 python 中的热库并想计算“石灰乳”和水的成分,但是当我运行以下代码时:

from thermo.chemical import Mixture
mix = Mixture(['water', 'Ca(OH)2'], Vfls=[.6, .4], T=300, P=1E5)
print(mix.Cp)

我收到以下错误

TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'

当我查看热数据时,似乎 'Ca(OH)2' 的某些属性是 None,我是否假设水中有问题,而 'Ca(OH)2' 可能是混合物?

【问题讨论】:

  • 你能显示完整的回溯错误吗?

标签: python typeerror mixture


【解决方案1】:

@科里·克莱默

Traceback (most recent call last):
  File "path\VLE\chemprop.py", line 49, in <module>
    mix = Mixture(['water', 'Ca(OH)2'], Vfls=[.6, .4], T=300, P=1E5)
  File "path\Python\Python39\lib\site-packages\thermo\mixture.py", line 608, in __init__
    self.zs = Vfs_to_zs(Vfs, Vms_TP)
  File "path\Python\Python39\lib\site-packages\chemicals\utils.py", line 1519, in Vfs_to_zs
    v = Vfs[i]/Vms[i]
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'

【讨论】:

    猜你喜欢
    • 2016-12-22
    • 2013-09-17
    • 1970-01-01
    • 2020-10-11
    • 2014-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多