## Friday, April 20, 2012

### Bouncing: GeoGebra Think Aloud

Following GeoGebra on Facebook or Twitter lets you see a lot of neat uses of the program. One recent one was this quick video of a ball bouncing under a table from Hugh Hunt.

There's lots to notice. I love how the ball starts spinning after impact. Is it physically accurate? There seems to be no gravity, making it more billiards. But the main thing for me is always "how did he do that?" The change of direction of the ball ... it's just a video as opposed to the sketch, so I had to skip the stage of monkeying around with the sketch, right to the "how would I do that?" stage.

Seems like a more natural problem for Scratch, where you can program the behavior of the ball. I was thinking about the problem with gravity, which always make me think about vectors. If you could parameterize the ball's motion... how would you have it react to boundaries? You need to have it switch somehow at that point...

I needed to think about a simpler problem. How to just draw a ball bouncing on the floor? I still don't know how to parameterize it (yet), but then you could just use a piecewise function... one way to define those in GeoGebra is with the If command; the third item in the bracket is the else result. For example:
 f(x)=If[x<0,-x+3,If[x<3,3,x^2-6]]

Then I just have to solve when the bounce happens, to make the conditions for the piecewise function. As a beginning GeoGebraist, I would have plunged ahead here and then had to backtrack, but now I also think ahead of time about what I want people to be able to control. For this sketch:
• time. To show motion in GeoGebra, my favorite technique is to use a slider. You can also animate sliders, which would help with the motion feeling. Initially I had this set for 20 seconds, but finally set it to allow for six bounces. You can set the limits of a slider to be a calculated quantity or a parameter that is set somewhere else.
• gravity. The idea that students don't understand the difference between how things fall here and on the moon is one of my favorite examples of a misconception. Easy to build in.
• ball size. I thought this might change students' perception of the resulting parabolas.
• x-velocity. One of the math misconceptions I see most frequently about projectile motion is that all those height vs time graphs are height vs. horizontal distance. Maybe being able to control the horizontal speed will help with this. Set at zero, this is the experiment I do with algebra students to get a nice exponential pattern.
• elasticity. How to model how bouncy the ball is? I made a parameter called elasticity, even though I knew that wasn't the physics typical terminology. Finally looked it up as the 'coefficient of restitution' I wanted it to be the portion of velocity that is retained, where I thought in physics I thought that they might actually measure the kinetic energy lost or something else. But it turned out that typically people do measure speed lost, especially for collision with a stationary object like the floor. (Found a neat little article by someone who got wondering if the coefficient of restitution was really a constant for a ball when I was investigating this.)
• y-velocity. Do I want the ball to be dropped or thrown? I've already done some sketches to get at the projectile idea, and decided to omit it from this.
• initial height. Have decided to make it a drop, it seemed like a good idea to let students control that, and it costs nothing in terms of complexity. Instead of an input box, it seemed more physical to have it be a point on the axis.

I programmed the first parabola, and then started to think about finding the time of impact and the speed at impact. That's still a job for pen and paper for me. Solving for the first impact point (when the height equals the ball radius) gives
$$\frac{g {t_0}^2}{2}+h_0=r_{ball},\\ t_0 = \sqrt{2(r_{ball}-h_0) /g}$$.

The derivative (or formula for velocity, precalculus) gives the velocity at the first impact, modified by the coefficient of restitution, $$v_1 = eball \, g \, t_0$$.

For the next parabola, the key to simplicity was to think about it as a graph transformation,
$$b_1(t)=\frac {g (t-t_0)^2}{2}+v_1 (t-t_0)+r_{ball}$$.
I was a bit surprised at how nice the expression for the next bounce point was, then:
$$(t-t_0)(\frac {g (t-t_0)}{2}+v_1)=0\\ t=t_0 \text{ or } t=t_0-2 v_1/g$$.
That's just nice! (Remember $$g$$ is negative.)

Then the point for the ball is defined by using $$v_x \, t$$ for the x-coordinate, and the piecewise-parabolas for the y-coordinate. I like how you can get the stationary drop by setting $$v_x =0$$.
The tracing trick is one I use a lot. Define a new point equal to your old one, turn the trace on, and have the checkbox toggle which point is showing. (In the advanced settings, use the boolean variable, $$a$$ in this sketch, for the tracing point, and the negation, $$\not a$$, for the untraced point. The clear button is a trick that Linda Fahlberg shared, just a button with ZoomIn[1] as the GeoGebra script. I like the tracing so that the students have multiple ways to gather data, as well as for the nice visual.

 Just a gif; Actual sketch

And then you've got your simulation! (Here's the teacher page on GeoGebraTube.) The recent update to the applet speed seems to make it much more reasonable to embed, but this one was a bit too big for the blogscreen.

I'd be interested in your feedback. Was this post helpful, or too obvious? Or did I not provide enough detail? It's also my first time using MathJax to display math, so please let me know if that is not working or is off putting. I'll be teaching algebra this summer, and will post notes on how the activity plays with students then.