concord-consortium/lab — pull request #19 by pjanik (2012-11-06 13:05:37+00:00)
Title: Different integration

@stepheneb @rklancer @sfentress

Velocity Verlet integration scheme is fixed.

While changing integration scheme, I was using this for a reference:
[1] http://sbel.wisc.edu/People/schafer/mdexperiments/node12.html
Later, Stephen sent me this link with a great (and short ;)) description of different integration methods:
[2] http://physics.ucsc.edu/~peter/242/leapfrog.pdf

You can compare [1], [2] (Velocity Verlet section) and the implementation, it should be exactly the same algorithm. I'm afraid that the previous version (master branch) wasn't correct Velocity Verlet (if it was meant to be typical Velocity Verlet scheme - it could be just different form, I'm not sure).

I've also done some refactoring in md2d.js. I slightly changed functions organization (too keep consistency within 'integrate' function), updated comments and grouped similar functions together.