Python Thermo库中的混合功能

发布于 2025-02-08 03:37:40 字数 385 浏览 2 评论 0原文

我正在尝试使用Python中的Thermo库,并想计算“石灰牛奶”和水的组成,但是当我在下面运行代码时:

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

当我查看Thermo Data时,我会遵循错误的错误

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

,这似乎是'CA的某些属性(哦)2'没有,我是否假设水中有问题,而'ca(oh)2'可能是混合物吗?

I am trying the thermo library in python and want to calculate composition of 'milk of lime' and water however when I run the code below:

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

I get following error

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

When I looked into thermo data it seems like some of the properties for 'Ca(OH)2' is None, am I assuming something wrong in water and 'Ca(OH)2' can be a mixture?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等待圉鍢 2025-02-15 03:37:40

@Cory Kramer

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'

@Cory Kramer

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'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文