As part of my project (which is testing parallel programming frameworks - I am a computer scientist), I am developing a basic, 3D $n$-body simulation. I assume that each particle is a sphere (uniform radius all around), has uniform density. Finally, there are no external forces applied to the particles, such that all collisions are perfectly elastic.
Each particle has their own, potential unique, set of the following properties:
- Mass
- Radius
- Position (x, y, z)
- Velocity (x, y, z)
So far, I have developed a solution to update the velocity & position of the particles by using Newton's Universal Law of Gravitation to determine the new velocity of each particle based on the particles around it. But this is all besides the point, I just wanted to show what I've done so far
The part I have remaining is determining the velocity of particles should they collide (I have determined whether they have collided or not). The problem is that I am have been unable to understand how to use the relevant laws of Physics (which I believe are the conservation of momentum, the conservation of kinetic energy) and solved them to obtain the final velocities of two colliding particles, given the initial velocities, masses, and distance (from either the boundary or centre of masses)
I guess what I'd find helpful is if someone could:
- Tell me what laws are relevant in this context
- How to solve them to get me the final velocities of both particles
This is not homework but part of a larger project. As a non-physicist or mathematician of any sort, this is out of my depth and I'd appreciate elaborate guidance. I have searched the internet for answers, but most are either for a 1D problem which I struggle to extrapolate for 3D, or are just formulas without enough context for me to understand