Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Trying to understand the bouncing ball

  1. Sep 6, 2013 #1
    hi all, ok i read another post from this forum about the bouncing ball but i didnt want to start asking questions when i never made the thread

    ok so im programming a program that starts with a ball in the air and it will automatically start to fall here is a simplified look at my code to see where im going wrong etc...i want help not just the answer as i will need to apply this with other objects in the future

    speed = 9.8 * (Mathf.Pow(Time.time,2))

    the ball position then drops in the y axis due to -speed

    when it hits the floor i do the following calculations
    downVelocity = Mathf.Sqrt((2 * (9.8 * startingHeight)))
    newVelocity = COR * downVelocity
    nextBounceHeight = (Mathf.Pow(newVelocity ,newVelocity )) / (2 * 9.8);

    and then to send the ball back up i change the -speed to just speed

    now my problems i am getting are:
    the speed of when it falls is the same as when it bounces in air, surely im missing something that takes away the newvelocity? and then also looking at this the downVelocity will always be the same surely that isnt right?
  2. jcsd
  3. Sep 6, 2013 #2
    Only if COR (the Coefficient of Restitution) is 1.
  4. Sep 6, 2013 #3
    so say im imitating a tennis ball the COR is roughly 0.75 (going on what someone wrote in other thread)

    i think my problem maybe i apply gravity in beginning but never add a force(if any) so when it hits the floor how does the new velocity alter the speed in which it bounces back up?
  5. Sep 6, 2013 #4
    Oh I see the problem...

    No, speed here is just velocity without the sign attached so change the speed to COR x speed.

    Velocity simply means speed measured in a particular direction.
  6. Sep 6, 2013 #5
    ahh im confused... ok so lemme change it around

    velocity = force + gravity * (Mathf.Pow(Time.time,2))

    so when ball is in air to start it has no force only gravity...

    when it hits the floor i get the velocity
    downVelocity = Mathf.Sqrt((2 * (9.8 * startingHeight)))
    then i work out the new velocity (here is my problem)
    newVelocity = COR * downVelocity <<<so im saying my ball imiates a tennis ball which cor is 0.75 this correct?

    then i say my force now will be the new velocity in which it slows down the speed of the bounce?
  7. Sep 6, 2013 #6

    This should be velocity = velocityInitial - gravity * Time.time (with positive velocity representing upwards motion which is the usual convention).

    Due to the change of direction this should be newVelocity = (- COR * downVelocity)

    No, gravity is the force which slows down the speed of the bounce according to the equation above.

    There are other equations which may be useful, try googling "coefficient of restitution" and "suvat equations" ("suvat" refers to standard abbreviations where s is distance, u is initial velocity, v is velocity, a is acceleration and t is time).
  8. Sep 6, 2013 #7
    oh ye forgot to mention my axis is inverted but i understand what you meant :) the ball now bounces up and gets a lower bounce height until it comes to a stop but its speed of how it moves is always the same.... how do you make it go slower on the bounce back up?
  9. Sep 7, 2013 #8
    ok so this is where im at.....

    What is the velocity after the bounce? Use the COR:


    So this is the initial velocity of the second bounce. How high does it get? Again use the conservation of energy, but the other way around:


    This is how high up the second bounce gets. What is the formula for this flight? Same as before:


    ...... so i drop a ball(mass 5kg) from 30m high straight down....i use the formula to work out the downward velocity which im getting is 24.26108 and then the formual above to work out upward (assuming the cor of my ball is 0.75) and i get upward velocity of 18.19581. the formula to work out next height gives me the next height is at 16.875. so now i want to send the ball back up but when i enter the upward velocity is just shoots up very fast...

    how do you make it so it slowly loses all speed as it reaches its new height so it looks realistic? incase above is hard to follow ill write out nicer here

    ball(mass) = 5kg
    gravity = 9.81
    starting height = 30m
    COR = 0.75
    downward velocity = 24.26108
    upward velocity = 18.19581
    newHeight = 16.875
  10. Sep 7, 2013 #9
    possibly is it air resistance that slows a ball down when travelling upwards?
  11. Sep 7, 2013 #10


    User Avatar

    Staff: Mentor

    Gravity is acting to slow the ball when it's moving upward... If the ball bounces up from the ground at time ##T## with upwards speed ##V## its upward speed at later times will be ##V-g(t-T)##.
  12. Sep 7, 2013 #11


    User Avatar
    Science Advisor
    Gold Member

    Air resistance is only a secondary effect; it's gravity that reduces the vertical component of velocity and gives the familiar parabolic trajectory. The horizontal component of velocity will not change on a smooth surface but COR tells you how much the vertical component changes.
    The bounces will 'look' ok without any other computations but adding a small speed reduction in flight, proportional to, say, the square of the speed and a small horizontal velocity reduction per bounce will make things look better. Do it in stages and you can enjoy the process more.
  13. Sep 7, 2013 #12
    thanks i just got home so will spend next few hours getting it to work better thanks
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Trying to understand the bouncing ball
  1. Bouncing a ball (Replies: 1)

  2. Bouncing Ball (Replies: 4)