Alternatively, if one could model a force that depends on the distance and/or relative velocity between particles.
So consider a collection of particle
. We have
You should be asking yourself a couple of questions: (1) What numerical methods should be used?
(2) How do you do the force calculation (an
problem) quickly?
The first is relatively straightforward. Think about R-K methods. To go high order, you'd have to evaluate the force (expensive) at every intermediate step. That is probably not worth the effort. There are several oft-used methods
This gives good evaluation of velocities, but is more expensive than a simple leap frog methods.
This gives good numerical error control, at the price of positions and velocities being evaluated at different times.
One often thinks of thermal particles. The temperature plus the total kinetic energy gives a total energy that is tracked. A random component added to the velocities can, for example, keep the system isothermal.
The second question depends on the kind of force you are working with. Lets begin by considering the rubber particles - particles interact only when they collide. This short-range force suggests that we divide the entire domain into cells, sort particles into cells, and search for possible collisions only within a particle's own cell and its immediate neighbors. This "cell binning" is fairly straightforward using linked lists, and can be easily implemented in a parallel environemnt.
Another approach would be to sort, for a given particle, all other particles into three "rings" - one consisting of particles that are very close, a second of particles that might collide with the specified particle in the next several timesteps, and all other particles that won't be colliding with the given particle for at least a long while. This "onion skin" approach requires a little care to implement it well, and is a bit more dependent on shared vs. distributed memory environments.
For long-ange particle interaction, like gravitational or Coulombic interaction, one has to re-think the approach completely.
At the boundary, one often uses periodic conditions. Again, this is not a good approach if examining long-range forces.