Another example of why it is essential we teach physics students computational modeling
It really doesn’t take much before all those equations students learn in physics for solving toy problems in the back of the textbook completely fall apart. Here’s a classic example brought to us by Dan Meyer yesterday:
It’s a celing fan—how boring could you get? But the question is obvious—how long does it take this fan to slow down?
Once again, the internet comes together for an awesome day of problem solving. This time, I’m going to skip all the effusive praise for the awesomeness of solving problems collabratively between dozens of teachers and professors (as awesome as that is), but feel free to read my old post on the Dartboard problem to get a sense of this collaboration and why we need to be finding ways to help our students have experiences like this.
Instead, I want to talk about how we prepare physics students to deal with the real world, or as the case most often is, how we don’t prepare students to deal with the real world.
Let’s start with this simple ceiling fan question. It should be a scoop of chocolate and vanilla for the physics blog-o-twitterverse, right? Dan even baits the hook with the term rotational kinematics. A little googling gives us:
It’s a quadratic—please. Wolfram Alpha should be able to spit out an answer faster than a superluminal neutrino. Make a few quick measurements of the acceleration by measuring the angular position of the post it for a few revolutions and fitting a quadratic and you come away with a time around 40s. Done and done.
But wait one second. That equation is only good for constant angular acceleration. Is that what we have going on with the ceiling fan? What forces are responsible for the acceleration of the ceiling fan? Friction is the usual go-to force for things are slowing down, and even in the case of rotating things, it’s constant. By Newton’s second law, we know constant forces (or torques) produce constant accelerations (or angular accelerations)—so far so good.
But this is a fan—it’s designed to push air around the room, and by Newton’s 3rd law, if the fan is pushing on the air, the air must be pushing on the fan. Uh-oh. For large objects moving at everyday speeds, the force of air resistance is proportional to the square of the velocity: . Since the velocity of the fan blade is obviously changing as it slows down, this means the Force and acceleration are changing too. This means we can’t use the constant acceleration formula from above, and most physics classes, even AP ones, would tell you to run away from a problem like this.
Let’s persist. I want to show two ways of solving this problem.
Solving the ceiling fan the hard way
First, let’s do this the traditional way—by pulling out all the stops on our math engine. We have to write a differential equation to solve this problem, and the equation would look something like this
This tells us the rate of change of the angular velocity (angular acceleration) is proportional to the sum of square of the angular velocity (the air resistance term) and a constant (frictional term). That’s a first order, non-linear differential equation, and solving it isn’t easy—it’s something one would do only in a differential equations course, following at least a year and a half of calculus.
Thanks to some tutoring from Andy Rundquist, we can employ the help of Mathematica to solve this equation.
We’re asking Mathematica to find the general solution to our differential equation given the initial condition that the starting velocity is v0. And this is something Mathematica can do. It gives us a somewhat nasty function involving tangent, inverse tangent and a bunch of square roots of the parameters a and b.
To find the time the fan stops, we really just need to figure out the initial velocity (easy enough to measure) and the two parameters, a and b, and then solve the above equation (likely numerically) for the time v=0.
Finding these two parameters is hard. The only way to really do this is to take some data of the position of the post-it that is attached to the fan. This is where we need another power tool—Tracker Video Analysis. Also, it helps to track as much data as possible, so you really need the power of Tracker’s autotracker to not die of boredom from marking frames on the video. As good as autotracker is, you also need to start 10-15 seconds into the video so that the post it is moving slowly enough to be recognized by autotracker. Here it is in action:
When you finish, you get a really nice dataset for the angular velocity of the post-it, but you can also see that this data is far from linear (what you would expect if the acceleration were constant). In fact, it’s completely beyond Tracker’s abilities to fit this data to anything meaningful.
But if the ceiling fan follows the differential equation model above, then we should be able to get Mathematica to fit the solution to the DE to this data, and in the process, give us values for a and b. Mathematica to the rescue again. But, this is easier said than done, because even Mathematica can’t straight fit this data to the function, you’ve got to help it out with some reasonable values for a and b.
I’ll let Mathematica god Andy Rundquist take it from here:
I’m in awe of Andy’s Mathematica wizardry, but basically, the process he follows is have Mathematica fit our solution to the DE to the data, and give us the parameters. Then have Mathematica numerically find when the solution with the parameters is equal to zero to tell us when the fan stops.
Of course, Andy couldn’t stop there—he had to find out the uncertainty in his prediction using his awesome Monte-Carlo Technique:
Andy is using Mathematica essentially simulate 10,000 runs of the fan experiment for normally distributed values of a and b with the mean and standard deviation reported by the original Mathematica fit. A little bit of wizardry later, and Andy comes away with a time of $latex . Andy’s prediction has an uncertainty of less than 0.4%! And so let’s roll the film
Boom, Andy nails it, and has no need Dan’s generous 10% error margins. I’ll let XKCD call this one.
To recap—solving this simple problem required the following tools outside the scope of physics understanding one would get in a traditional physics education:
- An understanding of differential equations
- An advanced video analysis package capable of measuring a fairly large amount of data and calculating the angular velocity of the post it.
- A very powerful (and expensive) technical computing package capable of solving nonlinear differential equations, and fitting nonlinear models to data
- Someone with Andy’s god-like powers to make Mathematica do the necessary analysis.
Basically, the above four things put this problem—a simple lazy ceiling fan—completely out of bounds for all but the most advanced undergraduate physics majors. Yep—ceiling fans are a 3rd year physics problem.
Computational Modeling (and Python) save the day with an easier way
The truly nasty part of this problem isn’t the differential equation itself. With effort, even beginning students can understand that all this equation () is that the way the velocity changes depends on the velocity itself. The truly nasty part is having to find an solution to that equation.
But what if we skip that part and instead use our computational modeling powers? Why not start with the initial angular velocity, and good estimates for the a and b terms and then use the equation above to predict what the velocity will just a tiny amount of time in the future (say 0.1 seconds)? Then we could take that new velocity, and plug it back into the equation to find the change one more tenth of a second in the future, and repeat this process over and over until we get to a point where the fan has come to rest.
Though it may sound a bit tedious, this is a piece of cake for a computer, and something one can accomplish in less than 15 lines of Python code.
But the problem still remains that we don’t have any idea of what a and b are. This is where Frank Noschese comes in with a genius solution—you really need to watch him explain it.
- Measure the angular position of the post-it just by manually finding the time when it crosses the white line. This far less complex that what tracker is doing, and likely accessible even to the most novice physics studnet.
- Pick a reigon near the beginning of the motion and fit a quadratic to the graph to determine the angular acceleration. Do this again near the end of the motion, and you have a system of linear equations that you can easily solve to find good esitmates for a and b. (to me, this is the move that requires considerable physical insight).
- Put those values for a and b into the Python program, do a little bit of tweaking and boom, you’ve got your prediction.
To me, the most exciting thing about this second approach is that you take a problem that is really out of the range of all but the most advanced undergraduate physics students, and make it accessible to even novice high school students, with almost no loss of fidelity, and no obfuscation. Taught correctly, students know what every single step in that Python program is doing (and given enough time, could write it themselves).
Lesson for the day: why we must teach computational thinking from the beginning
If you read the comments in Dan’s post, you’ll see there is a point where the first 9 physicists (myself include) strike out in such a way that Dan calls into question the entire enterprise of physics (just like any student would). And later, there’s another moment where we physicists try to answer with some wishy-washy “our models don’t really work with the real world—there are too many variables” crap. Are you kidding me? 40 years ago, we put a man on the freaking moon with way less computing power than you’ll find in my iPhone—why can’t we figure out when this dumb ceiling fan is going to come to rest?
But this is the picture that students often get from traditional physics. Solve a bunch of projectile motion problems without air resistance. Then predict where the ball launched from the launcher will land, and when it misses the target, blithely chalk it up to a mixture of “friction” “human error” and “air resistance.” And so students stick to the idea that physics is good for solving physics problems, and has nothing to do with the real world.
But if we teach computational modeling—it doesn’t have to be that way. Students can literally write a program to model their own trajectory to the moon, or to model the path of that projectile with air resistance. And they aren’t doing it with some equation they memorized, they’re doing it with an algorithm they understand:
- Find the net force acting on an object at it’s starting point
- Use the net force to determine how the velocity will change a tiny amount of time in the future.
- Use the velocity to find the position of the object a tiny amount of time in the future
- Go back to step 1 and repeat until you get to where you want to go.
I know that things aren’t this simple. Truly understanding this algorithm and doing things like Frank did to find estimates of parameters for the computational model are pro moves that require lots of practice to master. But I have also seen that students can do it, starting even in the 9th grade. We need to work to make the tools easier master and the lessons more integrated into the everyday work students are doing so that computational modeling is more familiar and easier to learn. After all, I didn’t even think to write a program to solve this problem until I saw Frank’s brilliant approach.
The reward of this will be great—students will see that physics really does work—it can explain the world around them, far beyond the toy problems they see in textbooks, and a simple ceiling fan will no longer mark the boundary of their physics understanding.