Bounces of a ball
This activity belongs to the GeoGebra book The Domain of the Time.
In this example, the script for the slider anima is somewhat longer due to the adjustments needed for the ball's velocity and position when it is near the ground and the walls where it bounces. As the ball moves at time intervals dt, we can observe that the exact moment of the bounce does not always coincide with the actual moment of impact.
SetValue(v, (x(v), -y(v))) (3rd Law of Newton)
Two situations are visualized: free fall or with initial velocity. For each of these cases, we can set the Coefficient of Restitution (CR). For CR = 1 (elastic collision), the ball is perfectly elastic, meaning that with each bounce off the ground, it will always reach the same maximum height. For values of CR less than one, the ball loses energy upon impact, so with each bounce off the ground, its height decreases in a geometric progression (with a ratio of CR), until it eventually comes to a stop. This progression can be visualized in a more familiar way than in other examples (such as the race between Achilles and the tortoise).SCRIPT FOR SLIDER anima
# Calculate the elapsed seconds dt; add one second if t1(1) < tt
SetValue(tt, t1(1))
SetValue(t1, First(GetTime(), 3))
SetValue(dt, (t1(1) < tt) + (t1(1) − tt)/1000)
# Controls the bounces of the ball with radius r on the ground and walls; x2 is the abscissa of Corner(2)
SetValue(M', M + dt v)
SetValue(case, If(y(v) < 0 ∧ y(M') < r, 1, x(v) < 0 ∧ x(M') < r, 2, x(v) > 0 ∧ x2 − x(M') < r, 3, 0))
# Updates M and v (the auxiliary point retains the position of M at its minimum height)
SetValue(Aux, If(case≟ 1, M, Aux))
SetValue(M, M')
SetValue(v, If(case < 1, v + dt g, case < 2, C_R (x(v), −y(v)), (−C_R x(v), y(v + dt g))))
# Adds the position M to the record for the polyline trace and controls the end
SetValue(reg, Append(reg, M))
StartAnimation(anima, C_R ≟ 1 ∧ y(P) > r ∨ C_R < 1 ∧ y(Aux) > r )
Author of the activity and GeoGebra construction: Rafael Losada.