SENPAI-Molecular-Dynamics / SENPAI

Molecular dynamics simulation software
https://senpaimd.org
GNU General Public License v3.0
126 stars 16 forks source link

Invalid force and potential computation #7

Closed Chelsea486MHz closed 5 years ago

Chelsea486MHz commented 5 years ago

So here's me realising for months I've been rendering simulations using invalid computations. Behold the extent of my misery:

All provide incorrect results, with consequences ranging from invalid potential reduction to dead on system explosion.

I'll now have a break, have a beer, and proceeed to f@#! kill myself

Chelsea486MHz commented 5 years ago

The following functions are now fixed:

Further work will have to decide if the results of potential_electrostatic are satisfactory or not.

Chelsea486MHz commented 5 years ago

The following functions have been identified as faulty:

And disabled until a fix is developped.

Chelsea486MHz commented 5 years ago

The following functions are now fixed:

Chelsea486MHz commented 5 years ago

Wooooohooooooo

Okay so potential_angle and force_angle are fixed.

The issue was lying in the fact that I was trying to relate forces to angular displacements, while I in fact had to relate torques. Which makes sense.

Anyway, by applying a torque instead of a raw force, I had to scale down the torsion constant (C_AHO in util.h) down to 1E-18 Nm.rad-1. The bond angle potential is now correctly computed.

But something is now heavily getting on my nerves. What I thought was fixed isn't. The LJ potential is fucky.

Chelsea486MHz commented 5 years ago

LJ fixed.