3

I'm currently writing a program for a particle simulator. One of the requirements is that the particles collide in a realistic way. However, I don't know how to calculate the final velocities.

For each collision, I have the $x$-component and $y$-component of each velocity, as well as the displacement and mass of each particle.

Is it possible to calculate the direction and magnitude of their velocities after the collision? If so, how?

Qmechanic
  • 201,751
Cisplatin
  • 479
  • 1
  • 6
  • 15
  • I've read on it, and attempted to use both the conservation of momentum and the conservation of kinetic energy to find a nice equation, but I end up with this extremely complicated work. I was wondering if there was a better way. – Cisplatin Dec 21 '13 at 20:03
  • 1
    The only better way is to make mostly unrealistic assumptions (e.g. all head on collisions). If you want realism, you need to have that messy formula. – Kyle Kanos Dec 21 '13 at 20:06
  • One problem: there's a $\pm$ sign at one point: I don't know how to deal with that. – Cisplatin Dec 21 '13 at 20:10
  • I do not believe there is supposed to be a $\pm$ in there, but it's possible that the sign depends on whether it is a head-on collision or not (i.e., both particles in same direction or opposite directions). – Kyle Kanos Dec 21 '13 at 20:25
  • What have you tried and what do you understand? So we know where to start. Also what kind of shape of particles due you want to use, I assume spherical. – fibonatic Dec 21 '13 at 21:45
  • Do these particles have any shape, or are they just points? – John Alexiou Dec 22 '13 at 00:41

2 Answers2

4

2 dimensional collision can be reduced to a 1-dimensional problem in the case of spheres--see here. The $\pm$ you encounter when solving the kinetic energy is likely because there are two solutions and the equations are satisfied by either one. One solution is simply where the particles pass right through eachother, which you can discard.

lionelbrits
  • 9,355
  • Those equations were just what I was looking for - thanks! – Cisplatin Dec 22 '13 at 02:04
  • Minor comment to the post (v1): Please consider to mention explicitly author, title, etc. of link, so it is possible to reconstruct link in case of link rot. – Qmechanic Dec 22 '13 at 07:46
0

Note: The simplest method of calculating collisions use some method of applying impulses to objects that collide at some point in time. The simplest algorithm is to test if two objects are intersecting at some point in time, and if they are you fix it so that they stop intersecting each other, and then apply the calculated impulses on each object. However, this isn't completely correct. You really need to find out which collisions happened first, step the whole simulation back to the moment of the first collision, and calculate the new velocities right then. This works correctly if you have many momentary and interdependent collisions.

In the worst case, if the particles are dense and come into contact with each other, the easiest method I've found (which is used in this simulation and which I used to handle collision in this simulation) is to use forces instead of impulses. Again you reduce it to a 1-dimensional problem, and have the force of interaction between two particles be:

$$f=-k d-\mu v$$

where $\mu$ and $k$ are constants, $-k d$ is a Hookean spring repulsive force, $v$ is the relative velocity of the two particles along their axis of collision, and $-\mu v$ is a viscous friction force.

I believe that if you want more accurate contact physics (with accurate sliding point contacts instead of a spring force) you'll have to use a much more sophisticated method.