You could also make up your physics given that the situation is so specific. If you know the radius of the ball and the size of the container you can do:
(invent a velocity y and x properties) ball velocity y += gravity acceleration ball position y += ball velocity y (contain) if ball position y > container limit y 1 ball velocity y *= -1 ball position y = container limit 1 etc...