Simulating an elastic bouncy ball

In summary, the goal of the programmer is to create a bouncy rubber ball which upon collision with the ground, will have a squeeze factor (like a spring) and will bounce back higher due to spring physics. In order to achieve this goal, they must take into account energy conservation, momentum, and force.
  • #1
Alekkk
3
2
I am trying to program a game in which I have a bouncy rubber ball which upon collision with the ground, will have a squeeze factor (like a spring) and will bounce back higher due to spring physics.

I have currently been able to make a rigid bouncing ball since that simply follows the rules of rigid body collisions with conservation of momentum. What I want now is to have a ball which upon collision with the ground, squeezes a certain amount according to the balls "spring constant", force of gravity, and speed upon collision and then bounces back up according to the spring force equation. Where I am lost however is in the connection between forces, momentum, and energy. When I detect that the ball has touched the ground at a certain speed in my game, what is the next step? How do I determine how much the ball squeezes (ie spring compression), and how do I calculate the progression of the squeezing, unsqueezing, and bounce-back of the ball.

If someone could give me a rundown of a single bounce of an elastic ball with details of every step of calculation, that would be amazing!
 
  • Like
Likes Delta2
Physics news on Phys.org
  • #2
Alekkk said:
If someone could give me a rundown of a single bounce of an elastic ball with details of every step of calculation, that would be amazing!
The more accurate the simulation, the more work it will be. So you will want to decide how good is good enough.

But with that said, are you familiar with Hooke’s Law? It‘s the basis for most ”good enough” analyses of elastic materials; here it will relate the force to the amount of squeezing. A second equation, ##W=Fd## relates the potential energy of the compressed ball to the amount by which it has been squeezed. Energy is conserved in an elastic collision so the sum of the potential energy and the kinetic energy is constant; the potential energy is zero (no compression) at the moment that the edge of the ball kisses the floor; the kinetic energy is zero at the moment that the ball has stopped moving down and is about to start up again.

That should be enough to get you started on an idealized ball that behaves like a Hooke’s Law spring and has all its mass concentrated in a single point at the center. More realistic and less idealized will be more work, without upper bound.
 
  • Like
Likes Alekkk
  • #3
Alekkk said:
If someone could give me a rundown of a single bounce of an elastic ball with details of every step of calculation, that would be amazing!
Do you want to show the bounce of the ball in slo-mo, with an accurate representation of the speed and deformation of the ball throughout the impact?
 
  • Like
Likes Alekkk
  • #4
Alekkk said:
I have currently been able to make a rigid bouncing ball since that simply follows the rules of rigid body collisions with conservation of momentum.
The momentum of a ball is reversed, not conserved in a collision with the ground. You would have to take the Earth's momentum into account to have conservation of momentum.

Do you mean conservation of energy?
 
  • Like
Likes Alekkk
  • #5
Alekkk said:
Summary:: I am trying to program a game in which I have a bouncy rubber ball which upon collision with the ground, will have a squeeze factor (like a spring) and will bounce back higher due to spring physics

I am trying to program a game in which I have a bouncy rubber ball which upon collision with the ground, will have a squeeze factor (like a spring) and will bounce back higher due to spring physics.
Because of the restrictions imposed by energy conservation, the ball cannot bounce higher than a certain point unless (a) it is already moving with some speed down at that point; (b) the object with which it collides is moving up at the time of collision; (c) the "squeeze factor" as you call it releases energy at the time of collision. For example, gymnasts bend their knees as they hit a trampoline surface and then stretch them fast when the trampoline is at maximum displacement to get that extra boost.
 
  • Like
Likes Alekkk and PeroK
  • #6
@kuruman Thank you for the explanation, though I mis-worded my question in that sense. I was more focused on the progression of the collision

@Nugatory Thank you! The energy conservation part actually clarifies a good bit. There is still one thing I'm unsure about though. That is, after the instant the ball "kisses" the floor, say, 0.1 second after (assuming after 0.1s it doesn't reach the point of 0 kinetic energy), how do I calculate the amount it squeezes, and the amount of energy that has been transferred?

@PeroK To your first post, yes, my goal is to show the full "slow-mo" progression of the ball as it collides with the ground, compresses, and then restores itself while bouncing back up. Since this is a game, I need to know what the ball is doing at every frame of the game.
 
  • #7
kuruman said:
Because of the restrictions imposed by energy conservation, the ball cannot bounce higher than a certain point unless (a) it is already moving with some speed down at that point; (b) the object with which it collides is moving up at the time of collision; (c) the "squeeze factor" as you call it releases energy at the time of collision.
(c) could also be converting rotational into linear KE
 
  • Like
Likes Alekkk
  • #8
To @Alekkk
Here is a graphic representation of a squishy bouncing ball at three different stages of the bounce (a) un-squished, (b) partially squished and (c) fully squished. You may imagine that it expands out as it is squished down to conserve mass. This effect is not shown in the picture because I suspect it's not a trivial calculation. The frame by frame displacements are sinusoidal. This is an educated guess; one would expect the dominant behavior to be harmonic.

SquashedBall.png

It was easier for me to plot this in two pieces because ##y## is double-valued. The two pieces are described by$$y_{\text{bottom}}(x,t)=\left(1-\sqrt{1-x^2}\right)\cos(t)~;~~y_{\text{top}}(x,t)=\left(1+\sqrt{1-x^2}\right)\cos(t)$$ The three calculations are at ##t=0,~0.73,~\pi/3##.

Is this what you might be looking for?
 
  • Like
Likes PeroK and Alekkk
  • #9
@kuruman Oh wow thank you so much. I never thought of approaching it from the standpoint of a sinusoidal but now that I think about it, it makes perfect sense. I will try this approach and see how it goes.

I appreciate the time you took to make the model, and write out the formulas.
 
  • Like
Likes kuruman
  • #10
Alekkk said:
That is, after the instant the ball "kisses" the floor, say, 0.1 second after (assuming after 0.1s it doesn't reach the point of 0 kinetic energy), how do I calculate the amount it squeezes, and the amount of energy that has been transferred?
Something that might get you started on a not too hopelessly inaccurate simulation:
At time zero the ball just barely contacts the floor. Some short time later it will be compressed by an amount ##\Delta x##; calculate the force required to achieve that compression; from there you can appoximate the amount of kinetic energy that was converted to potential energy; that gives you the velocity change during the compression; and from there you can get to the time ##\Delta t## it takes to compress the ball by that amount ##\Delta x## from teh original uncompressed state. Now you have the speed, energy, and compression at time ##t+\Delta t## so... wash, rinse, repeat. Choose ##\Delta x## small enough that you get a large number of steps across each bounce and you'll have a simulation good enough for a game.
 
  • Like
Likes Alekkk
  • #11
kuruman said:
You may imagine that it expands out as it is squished down to conserve mass. This effect is not shown in the picture because I suspect it's not a trivial calculation.
It definitely expands laterlaly to approximately preserve the volume. But it is also not symmetrical: the impact side is much flatter:

 
  • Like
Likes Alekkk

1. How does the elasticity of a bouncy ball affect its bounce?

The elasticity of a bouncy ball refers to its ability to deform when it comes into contact with a surface and then return to its original shape. The more elastic the ball is, the higher it will bounce. This is because the ball is able to store more energy when it deforms and then release it as kinetic energy when it bounces back.

2. What factors affect the elasticity of a bouncy ball?

The elasticity of a bouncy ball can be affected by several factors, including the material it is made of, the temperature, and the amount of air inside the ball. Materials that are more elastic, such as rubber, will result in a more bouncy ball. Higher temperatures can also increase the elasticity of a bouncy ball, making it bounce higher. Additionally, a ball with more air inside will be more elastic and bouncy.

3. How can the bounce of a bouncy ball be simulated?

The bounce of a bouncy ball can be simulated using a physics engine or computer program that takes into account the material properties of the ball, the surface it is bouncing on, and the forces acting on the ball. These simulations use mathematical equations to calculate the trajectory and height of the ball's bounce.

4. Can the elasticity of a bouncy ball be changed?

The elasticity of a bouncy ball can be changed by altering its material, temperature, or air pressure. For example, a ball made of a more elastic material will have a higher bounce than a ball made of a less elastic material. Similarly, increasing the temperature or air pressure inside the ball can also increase its elasticity and bounce.

5. Are there real-world applications for simulating the bounce of a bouncy ball?

Yes, there are real-world applications for simulating the bounce of a bouncy ball. For example, in the sports industry, simulations are used to design and test the performance of different types of balls, such as basketballs and tennis balls. In addition, simulations can also be used in engineering and design to predict how objects will behave when dropped or impacted, which can help improve product durability and safety.

Similar threads

Replies
14
Views
1K
  • Mechanics
2
Replies
53
Views
2K
Replies
7
Views
1K
  • Mechanics
Replies
2
Views
6K
Replies
2
Views
2K
Replies
4
Views
1K
  • Mechanics
Replies
4
Views
897
Replies
4
Views
2K
Replies
14
Views
2K
Back
Top