4
$\begingroup$

I'm programming an animation of a bouncing ball, and I want it to be as realistic as possible.

I fully understand the physics while the ball is rising and falling: It accelerates downward at 9.8 meters/second/second.

But once it hits the ground, I'm lost. I know that it experiences some compression which translates it's velocity upward again, at which point gravity is again the only force acting on it. But I don't know how to model the compression and deflection of the ball hitting the ground.

(Also, I'm only dealing with strictly vertical linear velocity and acceleration. The ball isn't traveling horizontally or rotating at all. And I'm assuming negligible loss to air resistance.)

I know there are constants to deal with: how much the ball resists compression and how much energy is lost during the bounce, but I don't know how they are related.

Can anybody give me a one- or two-paragraph explanation and/or (a) formula(e) and/or point me to a resource where I can read more? (yes, I've already spent an hour or so googling it)

I'm happy to continue reading about it until I understand, I just don't know where to turn at this point.

Thanks in advance!

$\endgroup$
4

3 Answers 3

6
$\begingroup$

You say you are ignoring friction of the air, but assume a partially inelastic collision. That means we can break the problem into two parts:

  1. While the ball is not in contact with the ground, the height at time $t$ after the last bounce at $t_0$ is given by $$h(t+t_0) = v_0 t - \frac12 g t^2$$ where $v_0$ is the velocity just after the bounce. This velocity will change from one bounce to the next.
  2. During the impact, the ball will deform and there will be friction. The exact shape of the ball during the impact is hard to capture in a simple equation because it depends on the composition of the ball and the floor. As a simplifying assumption, consider the ball to be a "mass on a slightly lossy spring with a spring constant $k$"; then the ball will exhibit (approximately) damped simple harmonic motion during the impact: this means that the impact time will be independent of the impact velocity(!)

The coefficient of restitution is a parameter of a ball/surface, and reflects the fraction of velocity just after the bounce divided by the velocity just before. For a golf ball, this can be as high as 0.8; for a tennis ball it is around 0.75.

Using $\rho=0.75$, if you drop a ball from a height of 5 m (and putting $g=10~m/s^2$ for convenience) it would land after 1 second with a velocity of 10 m/s, and after the bounce (some short time $\Delta t$) it would come up again with a lower velocity $v_1 = 7.5 m/s$. The time spent in the air until the next bounce is given by $$t_1 = 2\frac{v_1}{g} = 2\rho \frac{v_0}{g}$$

While the ball is in contact with the ground, we can consider its center to move in an approximately sinusoidal fashion - as I said, the important thing is that the contact time is independent of the drop height (on the assumption of linear spring constant). In reality, as the ball deforms more, the spring constant will increase - which will actually make the contact time shorter as the impact velocity is higher. But for your simulation that is unlikely to matter.

To get from the above to a "mathematical model" you might want to modify this python code to your needs:

from math import sqrt
import matplotlib.pyplot as plt

h0 = 5         # m/s
v = 0          # m/s, current velocity
g = 10         # m/s/s
t = 0          # starting time
dt = 0.001     # time step
rho = 0.75     # coefficient of restitution
tau = 0.10     # contact time for bounce
hmax = h0      # keep track of the maximum height
h = h0
hstop = 0.01   # stop when bounce is less than 1 cm
freefall = True # state: freefall or in contact
t_last = -sqrt(2*h0/g) # time we would have launched to get to h0 at t=0
vmax = sqrt(2 * hmax * g)
H = []
T = []
while(hmax > hstop):
  if(freefall):
    hnew = h + v*dt - 0.5*g*dt*dt
    if(hnew<0):
      t = t_last + 2*sqrt(2*hmax/g)
      freefall = False
      t_last = t + tau
      h = 0
    else:
      t = t + dt
      v = v - g*dt
      h = hnew
  else:
    t = t + tau
    vmax = vmax * rho
    v = vmax
    freefall = True
    h = 0
  hmax = 0.5*vmax*vmax/g
  H.append(h)
  T.append(t)

print("stopped bouncing at t=%.3f\n"%(t))

plt.figure()
plt.plot(T, H)
plt.xlabel('time')
plt.ylabel('height')
plt.title('bouncing ball')

This code produces the following plot:

enter image description here

$\endgroup$
3
  • $\begingroup$ Thanks for the BEST answer. BTW, would you please send us any link to a webpage that shows us how to calculate the movement of a ball in a curved path ? For example, when a baseball player throws a ball, it usually moves in a curved path. Do we have any equations or methods to determine the position of the ball as a function of time, speed, energy, momentum, mass, acceleration, etc... ? Please note that the ball may spin while moving. $\endgroup$ Apr 23, 2021 at 6:46
  • 1
    $\begingroup$ @Job_September_2020 the spinning ball experiences the Magnus effect. The force this produces tends to depend on the velocity of the ball, the rate of spin, and a bunch of parameters relating to the density and viscosity of the air and the surface properties of the ball. In other words - “doing it right” is pretty hard. Would an approximate solution be enough for you? $\endgroup$
    – Floris
    Apr 25, 2021 at 12:29
  • $\begingroup$ Thanks for your helpful explanation. To answer your question, I would say "Yes". Any approximate solution would be greatly appreciated. $\endgroup$ Apr 25, 2021 at 18:40
1
$\begingroup$

Visual Solutions (Now Altair) makes VisSim Software. Here is a demo block diagram that they have used to simulate a bouncing ball:enter image description here

The $1/s$ blocks are integrator blocks from the VisSim library.

The plot of the bouncing ball with these parameters is shown below.

enter image description here

If you are interested in running this, the demo comes with the install and you can download a free 60 day trial here

$\endgroup$
2
  • $\begingroup$ Thanks for the GREAT answer. BTW, would you please send us any link to a webpage that shows us how to calculate the movement of a ball in a curved path ? For example, when a baseball player throws a ball, it usually moves in a curved path. Do we have any equations or methods to determine the position of the ball as a function of time, speed, energy, momentum, mass, acceleration, etc... ? Please note that the ball may spin while moving. $\endgroup$ Apr 23, 2021 at 6:46
  • 1
    $\begingroup$ That's the Magnus effect which is based in Bernoulli's principle. For the spinning ball one side has a higher relative velocity than the opposite side in its forward motion. That creates a pressure differential and net side force leading to the curved motion. You could approximate the force in a 2D model according to forward velocity, spin rate, but a more accurate prediction requires CFD, finite element numerical simulation. I do not have an existing model. $\endgroup$
    – docscience
    Apr 23, 2021 at 14:16
1
$\begingroup$

Well the difficulty is when the ball in contact with wall. Few things you can consider.

  • elastic impact. In this case, you can treat the ball as an elastic spring. When it impacts the wall with a speed, the kinetic energy will be converted to the spring's potential energy. And then, after it reaches the maximum deformation, the ball will spring back into space. The deformation direction is normal to the wall.
  • inelastic impact. This is similar to the above except the ball recovers only a fractional of kinetic energy. This is closer to reality. The loss is usually described using coefficient of restitution.
  • inelastic impact with friction. When the ball hits a wall with an angle, the ball can slide on the surface. This becomes more close to reality.
  • air drag. When the ball is moving is space, there is air drag force to slow it down.
$\endgroup$
1
  • $\begingroup$ Sorry, I guess I wasn't clear enough. I'm talking about partially inelastic impact. From my original post "...how much energy is lost during the bounce...". Also, I mentioned in the original post, I'm ignoring air drag ("...I'm assuming negligible loss to air resistance..."), and I'm not trying to model sideways momentum ("inelastic impact with friction"). I just want to model the compression, deceleration, decompression, and acceleration that occur during impact with the ground, and the loss of energy inherent in the whole process. $\endgroup$ May 26, 2016 at 0:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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