1
$\begingroup$

I'm computer programmer, and I was making a little test of my “possibilities”, so to speak, so I made a small game with sort of gravity, bouncing ball and walls around.

Recently I've noticed that when bouncing off a wall, the ball will divide its speed and so endlessly even if the speed is less than 1 (digital pixels per second), for example if speed equals to 0.05 pixels per second it will divide and it will be 0.025 pixels per second, etc. To prevent this, I did limit bounce values.

How can this be explained in real life physics? Are there any limits of bounce value?

$\endgroup$
  • 1
    $\begingroup$ Are you worried about the ball bouncing an infinite number of times, or are you worried about the ball bouncing for an infinite amount of time? $\endgroup$ – probably_someone May 23 at 14:39
  • $\begingroup$ In your simulation did you put in that the ball halves its speed on every bounce? Obviously things do something similar in real like, but I can't see how that could emerge from a simulation without putting it in by hand. $\endgroup$ – jacob1729 May 23 at 15:44
  • $\begingroup$ @jacob, I put dividing the bounce value by hand, in other words, I didn't know what I had to put in there besides it. $\endgroup$ – Eadwine Youn May 23 at 18:09
  • $\begingroup$ Sorry, but I think that it's not clear what your concern (and question) is. What are you asking about to be explained in real life physics? You ask why objects don't bounce infinitely, but your description says that they do bounce infinitely. You "noticed" that the speed is divided, but it was put there by hand so no surprise. ? (Can it be that you are just asking about an emulation of the real world?) $\endgroup$ – Helen May 23 at 21:13
3
$\begingroup$

Suppose the ball loses a fraction $b$ of its velocity on every bounce. Let's also assume the ideal case, where the ball takes an infinite amount of bounces to lose all of its momentum. (In reality, the model is no longer valid at sufficiently small bounces, because, for example, thermal fluctuations of the atoms in the materials are larger.) The key here is that, while there are an infinite number of bounces, they happen in a finite amount of time, and we can actually calculate that time.

Let's start with the ball in the air at height $h$, at rest (i.e. right when it's dropped). The amount of time $t_0$ it takes to fall a distance $h$ is given by the usual kinematic equations:

$$t_0=\sqrt{\frac{2h}{g}}$$

When it reaches the ground, it has a velocity $v_0=gt_0=\sqrt{2gh}$. After the bounce, it has a velocity $v_1=(1-b)\sqrt{2gh}$, since it lost a fraction $b$ of its velocity. The time it takes to go to the next bounce $t_1$ is equal to the time it takes for the velocity to change from $v_1$ to $-v_1$; in other words,

$$gt_1=2v_1\implies t_1=2(1-b)\sqrt{\frac{2h}{g}}$$

On the second bounce, it has a velocity $v_2=(1-b)v_1=(1-b)^2\sqrt{2gh}$, and we can repeat the same procedure forever.

So, in general, for bounce $n$, we have that $v_n=(1-b)^n\sqrt{2gh}$, and therefore that

$$t_n=2(1-b)^n\sqrt{\frac{2h}{g}}$$

The time $t_{rest}$ it takes for the ball to come to rest is equal to the time it takes to complete all of the bounces (since this is a geometric series, we can actually evaluate it exactly):

\begin{align} t_{rest}&=t_0+\sum_{n=1}^\infty t_n\\ &=\sqrt{\frac{2h}{g}}+\sum_{n=1}^\infty\sqrt{\frac{8h}{g}}(1-b)^n\\ &=\sqrt{\frac{2h}{g}}+\sqrt{\frac{8h}{g}}\frac{1}{b}-\sqrt{\frac{8h}{g}}\\ &=\frac{1}{b}\sqrt{\frac{8h}{g}}-\sqrt{\frac{2h}{g}} \end{align}

For example, for a ball with $b=0.1$ dropped from height of 1 meter will execute an infinite number of bounces and come to rest after roughly 8.6 seconds according to this model. If instead that ball had $b=0.4$, it would come to rest in roughly 1.8 seconds. So if you're not worried about the number of bounces, then this is a perfectly workable solution for how much time it takes for a bouncing ball to come to rest.


That said, if you're doing a simulation, you're likely worried about an infinite number of bounces as well. In that case, one thing you can do is take advantage of the fact that your simulation (probably) has a finite time step. You can calculate $t_n$ with the above, and whenever $t_n$ is shorter than your time step, the object stops bouncing.

$\endgroup$
  • $\begingroup$ Thank you for this extremely detailed explanation. I will try to understand all this and make my simulation better. $\endgroup$ – Eadwine Youn May 23 at 18:14
  • $\begingroup$ I am not really sure that I can calculate the time, or maybe I just don't understand how I can do that. $\endgroup$ – Eadwine Youn May 23 at 18:26
  • 1
    $\begingroup$ @EadwineYoun If you have the height the ball starts at, and you know how strong gravity is in your simulation, and you know how much velocity the ball loses for each bounce, then you definitely can - those are the only inputs into the final function. $\endgroup$ – probably_someone May 23 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.