FeOs-torch - Automatic differentiation of phase equilibria.
Project description
FeOs-torch - Automatic differentiation of phase equilibria
FeOs-torch combines the FeOs thermodynamics engine with the machine learning/automatic differentiation framework PyTorch.
import torch
from feos_torch import PcSaftPure
# define PC-SAFT parameters
# m, sigma, epsilon_k, mu, kappa_ab, epsilon_k_ab, na, nb
params = torch.tensor([1.5, 3.5, 250.0, 0, 0.03, 1500.0, 1, 1], dtype=torch.float64, requires_grad=True)
pcsaft = PcSaftPure(params.repeat(5, 1))
# evaluate vapor pressures (in Pa)
temperature = torch.tensor([250., 300., 350., 400., 450.], dtype=torch.float64)
_, vp = pcsaft.vapor_pressure(temperature)
print(vp)
# determine the derivatives of the first vapor pressure w.r.t. PC-SAFT parameters
vp[0].backward()
print(params.grad)
tensor([ 20693.5960, 216164.6184, 1049770.6187, 3281855.9640, 7875531.7021],
dtype=torch.float64, grad_fn=<MulBackward0>)
tensor([-6.7923e+04, -1.7737e+04, -7.0413e+02, 0.0000e+00, -5.7458e+05,
-6.9122e+01, -3.6892e+04, -3.6892e+04], dtype=torch.float64)
Models
The following models and properties are currently implemented in FeOs-torch
| model | vapor pressure | liquid density | equilibrium liquid density | bubble point pressure | dew point pressure |
|---|---|---|---|---|---|
| PC-SAFT | ✓ | ✓ | ✓ | ✓ | ✓ |
| gc-PC-SAFT | ✓ | ✓ |
Cite us
If you find FeOs-torch useful for your own research, consider citing our publication from which this library resulted.
@article{rehner2023mixtures,
author = {Rehner, Philipp and Bardow, André and Gross, Joachim},
title = {Modeling Mixtures with PCP-SAFT: Insights from Large-Scale Parametrization and Group-Contribution Method for Binary Interaction Parameters}
journal = {International Journal of Thermophysics},
volume = {44},
number = {12},
pages = {179},
year = {2023}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file feos_torch-0.1.0-cp37-abi3-win_amd64.whl.
File metadata
- Download URL: feos_torch-0.1.0-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f04d7725f4033913f08cc6b1d96eba231631f088debaceb6a569f544a121a3bf
|
|
| MD5 |
32a4854d79d52c94260b71f912b4a6bf
|
|
| BLAKE2b-256 |
1cf9e67af96f9ae1066bf53b3ec17bcd8510c21e713b8f6d1b727c92599eedc4
|
File details
Details for the file feos_torch-0.1.0-cp37-abi3-win32.whl.
File metadata
- Download URL: feos_torch-0.1.0-cp37-abi3-win32.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.7+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cf01617c8230c17cd97cef701d84a249872c07c538cfe8fc2c35e9e3ad207f9
|
|
| MD5 |
7e8ac9886646cd0bd2ef40f4e0a6297f
|
|
| BLAKE2b-256 |
3352f2e7f1792033ee4b898c6ab71bf301831c34ebac2c29fdd1d3099083e340
|
File details
Details for the file feos_torch-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: feos_torch-0.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dddbc099de1ffd532aef9982f20924c38439de806310a6bff71b61c61ce93876
|
|
| MD5 |
be11d1d3b6a72f9872373a16c77e1bb8
|
|
| BLAKE2b-256 |
aa1687210b5771b7bf6bfd7cfa09e96e5ff8009e3bd813fb12f3a539edc08b91
|
File details
Details for the file feos_torch-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: feos_torch-0.1.0-cp37-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.7+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90f06432e711401b51d3554c041300a372c3d00fde4daadba36b7f31b2baf22f
|
|
| MD5 |
0c02956b8a036264f4dae2aa328c9308
|
|
| BLAKE2b-256 |
72e3a8571a8dbe59ad8e5a6591c30ebeaf091566bc32b57040271b7f6d593b62
|
File details
Details for the file feos_torch-0.1.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: feos_torch-0.1.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.7+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5de2511c2a282762e94b2797054ee097524b16949c2cb3d369bc3d640abd69c7
|
|
| MD5 |
c15b3e9647d879709a4ed1d85ee7edaa
|
|
| BLAKE2b-256 |
3a3783ad2be69f352d85bcb242f792ed76cefe5cd3886544db3127c3f2820a77
|