Collision of an expanding disc with another disc.

AI Thread Summary
The discussion revolves around the challenges of simulating collisions between expanding or shrinking discs in a 2D collision engine. The user has successfully implemented collision detection for regular circles but struggles with calculating post-collision movement for non-regular discs, particularly when they are stationary but expanding. Suggestions include modifying the velocity vector of the disc's center to account for the radial velocity due to expansion and considering the radius growth speed in the center of mass speed calculation. The user seeks clarity on how to incorporate radius growth into the collision dynamics effectively. The conversation highlights the complexities of maintaining conservation of momentum while accounting for the unique properties of expanding discs.
Tipx
Messages
6
Reaction score
0
Hi,
Like a lot of people programming, I created a simplistic 2D collision engine. This engine handles the collisions of circles (I know I typed "disc" in the title, but I wanted to avoid replies like "circles don't really exist so they can't collide".)

The simulation is friction-less, so since the circles do not rotate initially, they never end up rotating. The collisions are also totally elastic and since there is no deformation, the collisions happen instantly. The detection model is an a-priori model. I want my engine to handles circles that expand or shrink.

It works fine with regular ("regular", opposed to "expanding" or "shrinking") circles, but when it comes to non-regular circles, I'm having an issue :
I can detect when the collision will occur, but I have no clues how to calculate the movement of the circles after the collision. I can't base the impact forces on the velocity of the circles since it's possible for 2 non-moving circles to collide if one (or both) of them expands.

I thought about taking into account the "radius growth speed" into the velocity, but that's just a wild guess. Anyone can steer me in the right direction?

Thanks,
Xavier
 
Physics news on Phys.org
Your collision model is fundamentally based on the conservation of momentum... but from your post it is not clear how a moving, expanding disk has a conserved momentum. Does its density fall to keep its mass constant? At the point of collision, do you assume the disk is not expanding? (otherwise it would expand into the other disk!)
 
Tipx said:
I thought about taking into account the "radius growth speed" into the velocity, but that's just a wild guess. Anyone can steer me in the right direction?
Sounds reasonable. You modify the velocity vector of the disc center with the radial velocity of the circumference due to explansion/shinking. The sum of both vectors gives you the velocity of the collision point at the discs circumference, used for the collision calculations.
 
Oh, forgot to specify, sorry. The mass of the disk is deemed in the middle of the disk and remains constant through the expansion.

As for preventing the disk from further expanding when it collides : I though that since the collision is totally elastic, after any given collision, the 2 colliding disks will move away from each other at at-least the "Radius Growth speed". This is if I manage to take the radius growth speed into account. The following code is how I handle the collision for now. I'll mention the changes I plan to make after :

float collAMass = collidableA.Mass;
Vector2 collASpeed = collidableA.Speed;
float collAGrowth = collidableA.RadiusGrowth;

float collBMass = collidableB.Mass;
Vector2 collBSpeed = collidableB.Speed;
float collBGrowth = collidableB.RadiusGrowth;

// Center of Mass Speed
Vector2 cmSpeed = (collAMass * collASpeed + collBMass * collBSpeed) / (collAMass + collBMass);

Vector2 collAInitialRelativeSpeed = collASpeed - cmSpeed;
Vector2 collBInitialRelativeSpeed = collBSpeed - cmSpeed;

Vector2 collAParallelSpeed = Vector2Tools.Projection(collAInitialRelativeSpeed, impulseNormal);
Vector2 collBParallelSpeed = Vector2Tools.Projection(collBInitialRelativeSpeed, impulseNormal);

Vector2 collAPerpendicularSpeed = collAInitialRelativeSpeed - collAParallelSpeed;
Vector2 collBPerpendicularSpeed = collBInitialRelativeSpeed - collBParallelSpeed;

Vector2 collAFinalRelativeSpeed = -collAParallelSpeed + collAPerpendicularSpeed;
Vector2 collBFinalRelativeSpeed = -collBParallelSpeed + collBPerpendicularSpeed;

Vector2 collAFinalSpeed = collAFinalRelativeSpeed + cmSpeed;
Vector2 collBFinalSpeed = collBFinalRelativeSpeed + cmSpeed;



So I know I need to take into account the RadiusGrowth, but where I'm unsure, is how to incorporate it in the "Center of Mass Speed". I think I'll have to add the growth of one disk and subtract the growth of the other one when calculating cmSpeed. I know it sounds silly because the actual center of mass doesn't change, but that's the only way I see to transfer the "Expansion" from one disk into another disk (as a motion). For example if we lose one dimension for the time being :

Disk A (CollidableA) :
* Position : 0
* Speed : 0
* Mass : 10
* Radius : 1
* Radius Growth : 1/sec

Disk B (CollidableB) :
* Position : 3
* Speed : 0
* Mass : 5
* Radius : 1
* Radius Growth : 0

There should be a collision after 1sec. I expect Disk A to end up with a negative speed (relative to the referential) that is about half of how fast Disk B should be going the other way. If I don't change cmSpeed, Disk A would end up moving after the collision, and not Disk B.

(Just explaining this helps me see my problem clearer, as always!)
 
The rope is tied into the person (the load of 200 pounds) and the rope goes up from the person to a fixed pulley and back down to his hands. He hauls the rope to suspend himself in the air. What is the mechanical advantage of the system? The person will indeed only have to lift half of his body weight (roughly 100 pounds) because he now lessened the load by that same amount. This APPEARS to be a 2:1 because he can hold himself with half the force, but my question is: is that mechanical...
Hello everyone, Consider the problem in which a car is told to travel at 30 km/h for L kilometers and then at 60 km/h for another L kilometers. Next, you are asked to determine the average speed. My question is: although we know that the average speed in this case is the harmonic mean of the two speeds, is it also possible to state that the average speed over this 2L-kilometer stretch can be obtained as a weighted average of the two speeds? Best regards, DaTario
Some physics textbook writer told me that Newton's first law applies only on bodies that feel no interactions at all. He said that if a body is on rest or moves in constant velocity, there is no external force acting on it. But I have heard another form of the law that says the net force acting on a body must be zero. This means there is interactions involved after all. So which one is correct?
Back
Top