i am trying to implement/extend an implementation of Lennard-Jones potential simulation regarding Xenon molecules (for curious ones, the code can be found here functions (force_naive->lj_force)).
First and foremost i altered the above code to make collisions full elastic with the box bounds.
For box bounds:100 Ang, particles: 16348 and dt: 1e-15 sec i am trying to calculate the total energy of the system but the numbers doesnt make sense to me for example at beginning total energy is Xe+12 (Joules?!?!) and it continues rises until float overflow to inf.
For calculation of total energy i am using the typo found here page 5.
I think the problem is at velocity calculation. Someone any help? Before misinterpreting my intentions my question is about the continuous rising of total energy and if it makes sense? cause in my understanding its definitely not. I thought that the total energy should be pretty low and in theory at equilibrium state even zero. Am I right?