[Physics] Bouncing ball simulation computer science

collisionhomework-and-exercisesnewtonian-mechanicsprojectilesimulations

In my Computer science class I was given a problem where I have to simulate a bouncing ball using "real physics". I have been trying to find a equation that will simulate the height of the bounce given a gravity and an arbitrary mass. And I will need to calculate the next bounce and it's height. A lot of the equations I've found require a time. But I don't really care about a time, all I want is to get the next height after the previous bounce until it finally hits height of 0 or close to it. I haven't taken a physics class since high school( 5 years ago) and that was basic physics.

Best Answer

The question title indicates a 'simulation', yet you state that you 'don't really care about time.' Your question does not need to be solved with a computer program - it's fairly straightforward to do by hand. Let $H$ be the maximum height, $m$ be the mass, $g$ be the gravitational acceleration, $9.81 \frac {m}{s^2}$, $v$ be the velocity, $C_R$ be the coefficient of restitution. $C_R$ is a ratio of the final velocity to the initial velocity, before and after the collision, so: $$C_R=\frac{v_f}{v_i}$$ $C_R$ should be found emprically. For example, a bowling ball and a basketball have different $C_R$ when dropped from the same height (the initial velocity is the same, the final velocities are different). Let $C_R=.5$ (you can change it later on).

Use energy conservation to find the velocity of the ball when it hits the ground:$$mgH=\frac{1}{2}mv^2$$ $$v=\sqrt{2gH}$$

When it rebounds, from the ground, the new velocity will be:$$v_f=v_iC_R$$

Use energy conservation again to find the new max height:$$\frac{1}{2}mv^2=mgH$$ $$H=\frac{v^2}{2g}$$

You can see that the speed of the ball coming down is exactly the same as the speed of the ball coming up (neglecting air resistance), thus we repeat the equations for $v_f$ and the max height $H$ until we're satisfied.