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

Incorrect Dihedral Angles #801

Closed
greghjones opened this issue Sep 28, 2021 · 2 comments · Fixed by #808
Closed

Incorrect Dihedral Angles #801

greghjones opened this issue Sep 28, 2021 · 2 comments · Fixed by #808

Comments

@greghjones
Copy link

Avogadro version: 1.95.1

  • Avogadrolibs: 1.95.1
  • Qt: 5.12.10

Desktop version: (please complete the following information):

  • OS: Windows 10
  • Version: 19043.1237
  • Compiler: Github Release

Describe the bug
When measuring dihedral angles, sometimes the wrong value is obtained.

To Reproduce
Steps to reproduce the behavior:

  1. Open a molecule.
  2. Select the measure tool.
  3. Select four atoms forming a dihedral.
  4. Read the output.

Expected behavior
Correct dihedral calculated (see attached test XYZ file).

Screenshots
image

Additional context
Formula in angletools.h at first glance appears to match the accompanying Stackoverflow citation (Python code). The cited Python code, the current formula from Wikipedia, and Avogadro 1.2.0 all yield a dihedral of -66.51 degrees, as opposed to the displayed -74.30 degrees in Avogadro 1.95.1. Attached are a test case (dihedral in question is C1 - C2 - C3 - C4), as well as a Jupyter notebook demonstrating formula agreement.

Given that the formula appears correct, I'm not quite sure where the disagreement is coming from.

dihedral.zip

ghutchis added a commit to ghutchis/avogadrolibs that referenced this issue Oct 5, 2021
Fixes OpenChemistry#801

Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
@ghutchis
Copy link
Member

ghutchis commented Oct 5, 2021

Not sure why the method doesn't work either. At first, I thought it was an atom order thing, but .. much easier to just fall back to the standard method.

(I'm going to try to fix the Stackoverflow method as I finish up the force field framework.. definitely worth saving some time when doing molecular dynamics.)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2021

Here are the build results
Avogadro2.AppImage
macOS.dmg
Ubuntu-2004.tar.gz
Win64.exe
Artifacts will only be retained for 90 days.

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

Successfully merging a pull request may close this issue.

2 participants