Skip to content

Another example of why it is essential we teach physics students computational modeling

March 10, 2012

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:

\theta=\theta_0 + \omega t + \frac{1}{2}\alpha{t}^2

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: \left|{F_{air}}\right|=kv^2. 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.

The angular velocity of the fan from 15s to 75s

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 (84.7\pm 0.4)\;\textrm{s}. 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 (\frac{d\omega}{dt}=av^2+b) 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:

  1. Find the net force acting on an object at it’s starting point
  2. Use the net force to determine how the velocity will change a tiny amount of time in the future.
  3. Use the velocity to find the position of the object a tiny amount of time in the future
  4. 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.

9 Comments leave one →
  1. Andy "SuperFly" Rundquist permalink
    March 10, 2012 2:22 pm

    I need to clarify my god-hood here for a second. Though surprising to some, I wasn’t actually aware of the fan problem (yes, my head was in the sand this week). In fact, when John elicited my help, I thought it was some data from some lab of his. My biggest mistake was not asking where the equation had come from. He asked me for some mathematica help with v'[t]=a v^2 + b and off I went. I would say that’s a poor way to do modeling. Sure, I was able to help with the syntax and the fitting, but I shouldn’t have waited so long to find out what it was all about. Now that I know, I’m a little embarrased (though still omnipotent, don’t worry), and I’d thought I’d use this comment to clarify the record.

    I want to thank you, John, for bringing me into this. It was a fun project, especially since it flexes some of the muscles I’m helping my students develop in my Applied Math Lab that I’m teaching this semester.

    • Hammer permalink
      March 21, 2012 10:16 am

      Omnipotence or no, your ‘genius’ consists in your ability to describe what your doing in plain English, so that even I, innocent of physics and mathematics beyond algebra, could follow with great interest and something approaching understanding. Thank you.

      • Andy "SuperFly" Rundquist permalink
        March 21, 2012 10:46 am

        Thank you, Hammer, and Andy-bless-you

  2. March 10, 2012 9:39 pm

    Frank’s approach uses what a mathematician would call numerical analysis. I am embarrassed on behalf of the mathematics community that numerical analysis is a topic usually reserved for college junior-level mathematics majors. In my ideal world, numerical analysis / computational modeling would be taught soon after high school algebra. The numerical solution of differential equations (which over 99% of calculus students currently never get around to learning about, despite being pretty much the whole point of calculus) could actually serve as a natural and accessible introduction to the more rigorous ideas of calculus. It pains me deeply that instead of this, any mathematical curiosity a student may have on their way to calculus is usually beaten out of them by a bloated trigonometry / “precalculus” course and the insane formality of spending a couple of weeks on the idea of a limit.

    When I finally earned the privilege of taking a numerical analysis course in college, my internal reaction toward the end of the year-long course was “Why didn’t they teach me this in high school?”

  3. Ben permalink
    March 30, 2012 11:21 am

    I totally agree to the conclusion of your post. I’m a physics student coming into my second year now and I’m stunned by the methods shown here. By now, in all the mechanic lectures I had, I never heard of such methods and everytime a problem with a nonlinear differential equation appeared, we didnt continue solving the problem.

    Great post.


  1. Post 500: In Motion « Quantum Progress
  2. Here Are Some of My Favorite Mistakes -
  3. Here Are Some of My Favorite Mistakes - Breaking News, Latest News and Current News from Breaking news and video. Latest Current News: U.S., World, Entertainment, Health
  4. Here Are Some of My Favorite Mistakes - Tumblrnews

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: