- #1
Turgrodan
- 2
- 0
I'm a programmer and I've been working on a simulation that involves some physics.
Part of my simulation involves two 3D spheres colliding where each sphere has its own mass and velocity. I already found code that handles that and applies conservation of momentum to get the new resulting velocities after the collision. No problem there.
The other part of my simulation involves applying a force of friction (static) and a force of friction (kinetic) to the spheres. That's easy enough to do; I have that part working too.
Here is my problem though. What happens when sphere "A" has a velocity of zero and a force of friction static associated with it and then another sphere "B" collides with it? The conservation of momentum instantaneously gives sphere "A" some velocity but how do I know whether that collision was enough to overcome the force of friction (static) on sphere "A" in the first place? Maybe the sphere "A" should still be at rest. And if sphere "A" should still be at rest, will the magnitude of sphere "B"'s velocity remain the same (like a ball rebounding off a wall)?
Maybe this can be explained to me in terms of 1 dimensional physics and I can figure out how to apply it to 3D later. Its been about 17 years since I've taken college physics, so I'm rusty on all this.
So I know that (m1*u1)+(m2*u2) = (m1*v1)+(m1*v2)
Where u is the velocity before the collision and v is the velocity after the collision.
I also know that Force = mass * acceleration
So I have constant velocities in one equation and acceleration in the other equation. I don't even know how to relate the two equations together. What am I missing here?
Right now I am cheating and just using an "opposing velocity" (as my simulated force of static friction), if the magnitude of the new velocity after the collision is less than the magnitude of the opposing velocity, then I set the new velocity to zero. But this of course does not even handle the fact that sphere "B" just lost its energy and didn't move sphere "A" at all.
I would like to learn how to handle this the right way if possible.
Part of my simulation involves two 3D spheres colliding where each sphere has its own mass and velocity. I already found code that handles that and applies conservation of momentum to get the new resulting velocities after the collision. No problem there.
The other part of my simulation involves applying a force of friction (static) and a force of friction (kinetic) to the spheres. That's easy enough to do; I have that part working too.
Here is my problem though. What happens when sphere "A" has a velocity of zero and a force of friction static associated with it and then another sphere "B" collides with it? The conservation of momentum instantaneously gives sphere "A" some velocity but how do I know whether that collision was enough to overcome the force of friction (static) on sphere "A" in the first place? Maybe the sphere "A" should still be at rest. And if sphere "A" should still be at rest, will the magnitude of sphere "B"'s velocity remain the same (like a ball rebounding off a wall)?
Maybe this can be explained to me in terms of 1 dimensional physics and I can figure out how to apply it to 3D later. Its been about 17 years since I've taken college physics, so I'm rusty on all this.
So I know that (m1*u1)+(m2*u2) = (m1*v1)+(m1*v2)
Where u is the velocity before the collision and v is the velocity after the collision.
I also know that Force = mass * acceleration
So I have constant velocities in one equation and acceleration in the other equation. I don't even know how to relate the two equations together. What am I missing here?
Right now I am cheating and just using an "opposing velocity" (as my simulated force of static friction), if the magnitude of the new velocity after the collision is less than the magnitude of the opposing velocity, then I set the new velocity to zero. But this of course does not even handle the fact that sphere "B" just lost its energy and didn't move sphere "A" at all.
I would like to learn how to handle this the right way if possible.