Processing math: 100%

mathr / blog / #

A ball bouncing down steps

The first part of the process is a ball in free flight from one step down to the next:

flight path

Consider gravitational potential energy mgh (where m is mass, g is the force of gravity, and h is the height) at the peak height H of the flight path over steps of height S relative to A and B:

EA=mg(HS)EB=mgH

Consider kinetic energy 12mv2 at A and B:

EA=12mv2AEB=12mv2B

Some simple algebra gives:

vA=2g(HS)vB=2gH

When in flight, the only force acting on the ball is gravity. Using Newton's law of motion relating force and acceleration F=ma and integrating with the initial conditions at A with t=0 gives:

tty=gty=vAgty=r+vAt12gt2

where y is the height of the ball center and r is the ball radius. Now we can find the duration Tf of the flight, which ends when y(Tf)=y(0)S:

rS=r+vATf12gT2f12gT2fvATfS=0Tf=vA+v2A+2gSg

The second part of the process is a compressive bounce when the ball reaches the lower step:

bounce path

Modelling the bounce by a damped harmonic oscillator gives an equation of motion, where d is the maximal squashing of the ball:

y=r(1dsin(βt)eγt)

Here β determines the speed of the bounce and γ determines the energy lost during the bounce. Using the boundary conditions vC=vB and vD=vA for a smooth transition from free flight to bouncing, and setting Tb to be the duration of the bounce (time of first return to initial y value), we can differentiate the equation of motion and solve for the unknowns:

ty=reγt(γsin(βt)dβcos(βt))vB=rdββ=vBrdTb=πβvA=reγTbdβγ=logvArdβTb

The time taken for the whole loop is T=Tf+Tb. Assuming the ball is initially spherical, and that volume remains constant, we can compute the squashing factor using the property of an ellipsoid that V=krxryrz assuming that rx=rz:

ry=yrx=r3y

Implementing all these equations in the Haskell programming language using the Diagrams library for visualization gives some cute animated GIFs:

Bounce 2 Bounce 3 Bounce 4

You can download the full source code for this post.