Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third Virial Coefficient of uv-BH implementation returns NaN #123

Closed
anreimer opened this issue Jan 26, 2023 · 3 comments
Closed

Third Virial Coefficient of uv-BH implementation returns NaN #123

anreimer opened this issue Jan 26, 2023 · 3 comments

Comments

@anreimer
Copy link
Contributor

anreimer commented Jan 26, 2023

Example in Python (as in lj_models.ipynb):

sigma = 3.7039
eps_k = 150.03
parameters = UVParameters.new_simple(12.0, 6.0, sigma, eps_k)
uvtheory_bh = EquationOfState.uvtheory(parameters, perturbation=Perturbation.BarkerHenderson)
uvtheory_bh.third_virial_coefficient(6 * KELVIN)

returns NaN m³/mol²
Works for uv-B3 & uv-WCA implementation.

@g-bauer g-bauer added the bug Something isn't working label Jan 26, 2023
@g-bauer
Copy link
Contributor

g-bauer commented Jan 26, 2023

The u-fraction returns NaN. The reduced_density is zero and reduced_density.powf(a) (see here) returns NaN. Looks like this is a bug in num-dual.
This can be reproduced with:

from num_dual import Dual64

Dual64.from_re(0.0)**1.0 # 0 + [0]ε
Dual64.from_re(0.0)**2.0 # 0 + [0]ε
Dual64.from_re(0.0)**1.5 # NaN + [NaN]ε

@longemen3000
Copy link
Contributor

Related:
autodiff/autodiff#242 (comment)

JuliaDiff/ForwardDiff.jl#480

@g-bauer g-bauer removed the bug Something isn't working label Jan 27, 2023
@prehner
Copy link
Contributor

prehner commented Mar 17, 2023

Since this seems to be caused by the uv-BH model actually not being differentiable sufficiently, there is nothing really to solve here, and I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants