So I've convinced myself that my updating of positions is valid. However, I am still receiving final positions outside of the box. This is my entire code. Perhaps someone can find the error. Note, I intend to randomize the starting positions and velocities once I get this to actually work.
...
So I'm working on a problem where you have 100 argon atoms in a box that obey the Lennard Jones potential. We're using the Verlet method to calculate the position of each particle at the next time step. The issue I'm having has to do with our boundary conditions. We assume that atoms are on a...