Same Skills, Virtual Car: Constant Velocity Particle Model

I had everything in line to start the constant velocity model unit: stop watches, meter sticks, measuring tape. All I had to do was find the set of working battery operated cars that I had used last year. I found one of them right where I left it. Upon finding another one, I remembered that didn’t work last year either, and I hadn’t gotten a replacement. The two other cars were LEGO robot cars that I had built specifically for this task, and all I would need would be to build those cars, program them to run their motors forward, and I was ready to go.

Then I remembered that my computer had been swapped for a new model over the summer, so my old LEGO programming applications were gone. Install software nowhere to be found, I went to the next option: buying new ones.

I made my way to a couple stores that sold toys and had sold me one of the cars from last year. They only had remote control ones, and I didn’t want to add the variable of taping the controllers to the on position so they would run forward. Having a bunch of remote control cars in class is a recipe for distraction. In a last ditch effort to try to improve the one working car that I had, I ended up snapping the transmission off of the motor. I needed another option.

John Burk’s post about using some programming in this lab and ending it in a virtual race had me thinking how to address the hole I had dug myself into. I have learned that the challenge of running the Python IDE on a class of laptops in various states of OSX make it tricky to have students use Visual Python or even the regular Python environment.

I have come to embrace the browser as the easiest portal for having students view and manipulate the results of a program for the purposes of modeling. Using Javascript, the Raphael drawing framework, Camtasia, and a bit of hurried coding, I was able to put together the following materials:

Car 1 Part 1
Car-2-Model-
Constant Velocity model data generator (HTML)

When it came to actually running the class, I asked students to generate a table of time (in seconds) and position data (in meters) for the car from the video. The goal was to be able to figure out when the car would reach the white line. I found the following:

• Students were using a number of different measuring tools to make their measurements. Some used rulers in centimeters or inches, others created their own ruler in units of car lengths. The fact that they were measuring a virtual car rather than a real one made no difference in terms of the modeling process of deciding what to measure, and then measuring it.
• Students asked for the length of the car almost immediately. They realized that the scale was important, possibly as a consequence of some of the work we did with units during the preceding class.
• By the time it came to start generating position data, we had a realization about the difficulty arising from groups lacking a common origin. Students tended to agree on velocity as was expected, but their inability This was especially the case when groups were transitioning to the data from Car 2.
• Some students saw the benefit of a linear regression immediately when they worked with the constant velocity model data generator. They saw that they could use the information from their regression in the initial values for position, time, and velocity. I didn’t have to say a thing here – they figured it out without requiring a bland introduction to the algebraic model in the beginning.
• I gave students the freedom to sketch a graph of their work on a whiteboard, on paper, or using Geogebra. Some liked different tools. Our conversation about the details afterwards was the same.

I wish I had working cars for all of the groups, but that’s water under the bridge. I’ve grown to appreciate the flexibility that computer programming has in providing full control over different aspects of a simulation. It would be really easy to generate and assign each group a different virtual car, have them analyze it, and then discuss among themselves who would win in a race. Then I hit play and we watch it happen. This does get away from some of the messiness inherent in real objects that don’t drive straight, or slow down as the batteries die, but I don’t think this is the end of the world when we are getting started. Ignoring that messiness forever would be a problem, but providing a simple atmosphere for starting exploration of modeling as a philosophy doesn’t seem to be a bad way to introduce the concept.

What do I have wrong here? Computational thinking obsession continues

Another installment of my Hong Kong presentation titled ‘Why Computational Thinking matters.’ This is where my head is these days in figuring out how computers relate to what we do in class. My view is that activities like the one I describe in the video is more active than the way we (and I include myself in this group) usually attack word problems as part of our sequence.

[wpvideo IkQx3la4]

Help me flesh this out. I think there’s a lot here.

Processing, Pong, and Kinetic Theory

I’ve been playing around with using Processing as a way to quickly get my Calculus students doing some programming. One of my experiments was in using what I’ve learned over the past couple months about object oriented programming to make the game have multiple balls in play at once.

Once I saw how well this worked, it turned rapidly into an attempt to max out my processor. The balls have random initial locations, and ‘speeds’ distributed uniformly between -2 and 2 pixels/frame.

The pong program keeps track of the bounces off of the left and right walls, and uses this as a basic way to calculate a score. When I saw this, it looked just like a kinetic theory simulation for ideal gases, though the particles are only bouncing off of the walls, not each other. That bounce variable keeps track of the collisions with the walls – can anything cool that can be calculated just from the picture alone and the number of collisions?

Processing sketch can be found here.

Bringing robotic cars and Udacity to my classroom

I was really excited to learn about Udacity, a new online education system that premiered two courses on February 20th. That a course on programming a robotic car would appeal to me is probably not surprising to anyone that knows me. I also love having yet one more excuse to continue learning Python, especially one that gets me working with an expert in the field such as Professor Sebastian Thrun. I recall reading about him shortly before his team’s successful bid at the DARPA Grand Challenge, and have since seen his name repeated at many key moments along my development as a robotics enthusiast.

The course is structured really well, with short videos introducing concepts, quizzes and programming tasks (with solutions) along the way to check comprehension, and homework assignments. The students love that I have homework.

I am busy, but this was too cool to pass up.

I also have a pretty hard time hiding the things I’m enthusiastic about in my classroom, so the content of the class has been something I’ve mentioned and shared with students at the start or end of planned activities. The whole classroom gasped at this video from the 25th second onward:

Based on that reaction, I really wanted to give them a sense for the things I was learning to do. The first week centered on learning about localization – a process that uses probability calculations to estimate the location of the car using sensor readings and a map of the surroundings. I did a quick overview of what this meant as a filler activity to break up work during class, but wanted to find a way to do much more.

Today’s Algebra 2 class was going to be missing a couple students that are attending a Model UN conference, so I figured it would be a good time to try something different.

We started with the following warm-up problems:

Mr. Weinberg tells you we are guaranteed to have a quiz one of the days between Monday and Friday. He tells you that the probabilities of the quiz happening Monday through Thursday are 0.1, 3/8, 1/16, and 36%. What is the probability that the quiz will be on Friday? On which day is the quiz most likely to occur?

This helped review the total probability principle which is key to understanding the localization algorithm. We also did a review of finding the probability of compound independent events, first with a tree diagram, and then using multiplication and the counting principle.

We then went through the following activity for the rest of the period:
Robot Localization activity

I adapted parts of the course material provided by Udacity, primarily simplifying language, cleaning up diagrams, and adjusting the activities for my students who do not have any programming ability. We did have a Python activity back in October, but installing and running Python was a hassle on the 1-1 Macbooks with OSX since I was trying to do it with Python 3 and IDLE. It was only shortly afterward that I learned that an earlier version of Python was automatically installed. Oops. For this activity, we used http://repl.it/ to do the programming. This worked fantastically well.

The students seemed to do really well with the introductory material and filling things in, and modifying the basic programming went smoothly. They ran into some trouble around problem 7, which I half expected – that was the first part of the activity when I told them to do something without any rationale behind it. Most were generally able to implement the procedure and get to problem 9, but at this point at the end of the day on a Friday afternoon, fatigue started to take over. This was after around 45 minutes of working on the activity.

I added a section on motion for possible use in another class, as I ultimately would like them to be able to throw my own homework solution code into a simulator provided by Udacity user Anna Chiara. I did not deal with any of the sensor probability or move probability. The intuition for understanding how those apply in the algorithm is a bit subtle for the background of my students, and would take more of an investment of time than I think my students have the patience for at this state. I think it would be easier to talk about how these issues exist, and then have them observe what they mean by looking at the output of the program.

All in all, it was a cool, low-key way to share my own learning with students after an exhausting week. I think we all needed a bit of a change.

Getting started with LEGO Robotics – the book and the real thing.

This week I got a special early holiday present in my mailbox from my friend Mark Gura. Mark had invited me a couple years ago to be part of a book for helping teachers new to the field of LEGO robotics get started with their students. We had a great conversation one evening after school over the phone during which we discussed the educational goldmine that building with LEGO is for students.

Mark did this with a number of people with a range of LEGO robotics experiences, wrote up our conversations, and then combined them with a set of resources that could be immediately useful to novices in the book.

The book, Getting Started with LEGO Robotics, is published by the International Society for Technology Education. If you, or anyone you know, is just getting started with this exciting field, you will find some great stuff in here to help you work with students and get organized.

It was a particularly perfect time for the book to arrive because we have a new group of students at my school getting started themselves with building and programming using the NXT. My colleague Doug Brunner teaches fifth graders across the hall. He volunteered (or more realistically, his students volunteered him) to take on coaching a group of students in the FIRST LEGO League program for the first time. After building the field for this year’s challenge, today the fifth graders actually got their hands on the robots and programming software. I had the robots built from the middle school exploratory class available so the students could immediately start with some programming tasks.

We started with my fall-back activity for the first time using the software – program the robot to drive across the length of the table and stop before falling over the edge. The students were into it from the start.  I stepped back to take pictures and Doug took over directing the rest of the two hours. He is a natural – he came up with a number of really great challenges of increasing difficulty and wasn’t afraid to sit down with students to figure out how the software worked. By the end of the session, the students were programming their robots to grab, push, and navigate around obstacles by dead reckoning. It was probably the most impressively productive single session I’ve ever seen.

It’s always interesting to see how different people manage groups of students and LEGO. Some want to structure things within tight guidelines and teach step by step how to do everything. Others do a mini lesson on how to do one piece of the challenge, and then send the students off to figure out the rest. Some show by example that it’s perfectly fine to get something wrong in the process of solving a challenge by working alongside students. It was impressive to see Doug think on his feet and create opportunities for his students to work at different paces but all feel accomplished by the end of the day. It is also really unique to have to tell a bunch of students  at 5:15 PM on a Friday to go home from school, and yet this has now been the norm in the classroom for a couple straight weeks.

Having robotics in my teaching load means that I am thinking about these ideas interspersed among planning activities for my regular content classes. There’s no reason why the philosophies between them can’t be the same, aside from the very substantial fact that you don’t have to tell students how to play with LEGO but you do often have to tell them how to play with mathematics or physics concepts. It’s easy for these robotics students to fail at a challenge twenty times and keep trying because they are having fun figuring it out. The holy grail of education is how to pose other content and challenge problems in the right way so it is equally compelling and motivating.

Note that I am not saying making content relevant to the real world. One of my favorite education bloggers, Jason Buell, has already made this point about why teaching for “preparation for the real world” as a reason to learn in the classroom is a flawed concept to many students that have a better idea than we do about their reality. I never tell people asking about the benefits of robotics that students are learning to make a robot push a LEGO brick across a table now because later on they will build bigger robots that push a real brick across the floor. Instead I cite the fact that seeing how engaged students are solving these problems is the strongest level engagement I have ever seen. The skills they develop in the process are applicable to any subject. The self esteem (and humility) they develop by comparing their solutions to others is incredible.

This sort of learning needs to be going on in every classroom. I used to believe that students need to learn the simple stuff before they are even exposed to the complex. I used to think that the skills come first, then learning the applications. Then I realized how incongruous this was with my robotics experiences and with the success stories I’ve had working with students.

Since this realization, I’ve been working to figure out how to bridge the gap. I am really appreciative that in my current teaching home, I am supported in my efforts to experiment by my my administrators. My students thankfully indulge my attempts to do things differently. I appreciate that while they don’t always enthusiastically endorse my methods, they are willing to try.

I want to record a few things about the last couple of days of class here – cool stuff, some successes, some not as good, but all useful in terms of moving forward.

Geometry:

I have been working incredibly hard to get this class talking about their work. I have stood on chairs. I’ve given pep talks, and gotten merely nods of agreement from students, but there is this amazing resistance to sharing their work or answering questions when it is a teacher-centric moment. There are a couple students that are very willing to present, but I almost think that their willingness overshadows many others who need to get feedback from peers but don’t know how to go about it. What do I do?

We turn it into a workshop. If a student is done, great. I grab the notebook and throw it under the document camera, and we talk about it. (In my opinion, the number one reason to have a document camera in the classroom, aside from demonstrating lab procedures in science, is to make it easy and quick for students get feedback from many people at once. Want to make this even better and less confrontational? Throw up student work and use Today’s Meet to collect comments from everyone.

The most crucial thing that seems to loosen everyone up for this conversation is that we start out with a compliment. Not “you got the right answer”. Usually I tolerate a couple “the handwriting is really neat” and “I like that you can draw a straight line” comments before I say let’s have some comments that focus on the mathematics here. I also give effusive and public thanks to the person whose work is up there (often not fully with their permission, but this is because I am trying to break them of the habit of only wanting to share work that is perfect.) This praise often includes how Student X (who may be not on task but is refocused by being called out) is appreciative that he/she is seeing how a peer was thinking, whether it was incorrect or not. I also noticed that after starting to do this, all students are now doing a better job of writing out their work rather than saying “I’ll do it right on the test, right now I just want to get a quick answer.”

Algebra 2

We had a few students absent yesterday (which, based on our class size, knocks out a significant portion of the group) so I decided to bite the bullet and do some Python programming with them. We used the Introduction to Python activity made by Google. We are a 1:1 Mac school, and I had everyone install the Python 3 package for OS 10.6 and above. This worked well in the activities up through exercise 8. After this, students were then supposed to write programs using a new window in IDLE. I did not do my research well enough, unfortunately, as I read shortly afterward that IDLE is a bit unstable on Macs due to issues with the GUI module. At this point, however, we were at the end of the period, so it wasn’t the end of the world. I will be able to do more with them now that they have at least seen it.

How would I gauge the student response? Much less resistance than I thought. They seemed to really enjoy figuring out what they were doing, especially with the % operator. That took a long time. Then one student asked if the word was ‘remainder’ in English, and the rest slapped their heads as they simultaneously figured it out. Everyone enjoyed the change of pace.

For homework, in addition to doing some review problems for the unit exam this week, I had them look at the programs here at the class wiki page.

Physics

I had great success giving students immediate feedback on the physics test they took last week by giving them the solutions to look at before handing it in. I had them write feedback for themselves in colored pencils to distinguish their feedback from their original writing. In most cases, students caught their own mistakes and saw the errors in their reasoning right away. I liked many of the notes that students left for themselves.

This was after reading about Frank Noschese’s experience doing this with his students after a quiz. I realize that this is something powerful that should be done during the learning cycle rather than with a summative assessment – but it also satisfied a lot of their needs to know when they left how they did. Even getting a test back a couple days later, the sense of urgency is lost. I had them walking out of the room talking about the physics rather than talking about how great it was not to be taking a test anymore.

Today we started figuring out circular motion. We played broom ball in the hallway with a simple task – get good at making the medicine ball go around in a circle using only the broom as the source of force.

We then came in and tried to figure out what was going on. I took pictures of all of their diagrams showing velocity and the applied force to the ball.

It was really interesting to see how they talked to each other about their diagrams. I think they were pretty close to reality too, particularly since the 4 kilogram medicine ball really didn’t have enough momentum to make it very far (even on a smooth marble floor) without needing a bit of a tangential force to keep its speed constant. They were pretty much agreed on the fact that velocity was tangent and net force was at least pointed into the circle. To what extent it was pointed in, there wasn’t a consensus. So Weinberg thinks he’s all smart, and throws up the Geogebra sketch he put together for this very purpose:

All I did was put together the same diagram that is generally in textbooks for deriving the characteristics of centripetal acceleration. We weren’t going to go through the steps – I just wanted them to see a quick little demo of how as point C was brought closer to B, that the change in velocity approached the radial direction. Just to see it. Suddenly the students were all messed up. Direction of change of velocity? Why is there a direction for change in velocity? We eventually settled on doing some vector diagrams to show why this is, but it certainly took me down a notch. If these students had trouble with this diagram, what were the students who I showed this diagram and did the full derivation in previous years thinking?

Patience and trust – I appreciate that they didn’t jump out the windows to escape the madness.

_______________________________________________________

All in all, some good things happening in the math tower. Definitely enjoying the experimentation and movement AWAY from lecturing and using the I do, we do, you do model, but there are going to be days when you try something and it bombs. Pick up the pieces, remind the students you appreciate their patience, and be ready to try again the next day.