Bounces of a ball

[color=#0000ff][i][color=#0000ff][i][color=#999999]This activity belongs to the GeoGebra book [url=https://www.geogebra.org/m/mes4bgft]The Domain of the Time[/url].[/color][/i][/color][/i][/color][br][br]In this example, the script for the slider [b]anima [/b]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 [i]dt[/i], we can observe that the exact moment of the bounce does not always coincide with the actual moment of impact.[br][center]SetValue([color=#c51414][b]v[/b][/color], (x([color=#c51414][b]v[/b][/color]), -y([color=#c51414][b]v[/b][/color]))) [color=#999999][br](3rd Law of Newton)[/color] [/center]Two situations are visualized: free fall or with initial velocity. For each of these cases, we can set the [b]Coefficient of Restitution[/b] (C[sub]R[/sub]).[br][br]For C[sub]R[/sub] = 1 ([b][i]elastic collision[/i][/b]), the ball is perfectly elastic, meaning that with each bounce off the ground, it will always reach the same maximum height.[br][br]For values of C[sub]R[/sub] less than one, the ball loses energy upon impact, so with each bounce off the ground, its height decreases in a [b]geometric progression[/b] (with a ratio of C[sub]R[/sub]), 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).
[b]SCRIPT FOR SLIDER anima[/b][br][br][color=#cc0000][color=#cc0000]# Calculate the elapsed seconds dt; add one second if t1(1) < tt[/color][/color][br][color=#999999]SetValue(tt, t1(1))[br]SetValue(t1, First(GetTime(), 3))[br]SetValue(dt, (t1(1) < tt) + (t1(1) − tt)/1000)[/color][br] [br][color=#cc0000]# Controls the bounces of the ball with radius r on the ground and walls; x2 is the abscissa of Corner(2)[/color][color=#0000FF][br]SetValue(M', M + dt v)[br][color=#0000FF]SetValue[/color](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))[br][/color][color=#cc0000][br]# Updates M and v (the auxiliary point retains the position of M at its minimum height)[/color][color=#0000FF][br][color=#0000FF]SetValue[/color](Aux, If(case≟ 1, M, Aux))[/color][br][color=#0000FF][color=#0000FF]SetValue[/color](M, M')[br][color=#0000FF]SetValue[/color](v, If(case < 1, v + dt g, case < 2, C_R (x(v), −y(v)), (−C_R x(v), y(v + dt g))))[br][br][/color][color=#cc0000]# Adds the position M to the record for the polyline trace and controls the end[/color][color=#999999][br][color=#999999]SetValue[/color](reg, Append(reg, M))[/color][color=#0000FF][br]StartAnimation(anima, C_R ≟ 1 ∧ y(P) > r ∨ C_R < 1 ∧ y(Aux) > r )[/color][br][br][br][br][br][color=#999999][color=#0000ff][color=#0000ff][color=#999999][color=#999999]Author of the activity and GeoGebra construction: [/color][/color][/color][color=#0000ff][color=#999999][color=#999999][url=https://www.geogebra.org/u/rafael]Rafael Losada[/url].[/color][/color][/color][/color][/color]

Information: Bounces of a ball