How a Programmer Works on a Soapbox Derby Racer

Once I knew I had a winning ticket for the race, I did what any programmer would do when getting started.

No, I didn’t make the t-shirt. I wrote a simulation.

Step #1 was to get the profile of the race course. Google Earth has nice support for generating a profile from a path:

Next was figuring out how to simulate the race. For every meter down the course, the profile lets me calculate the change in elevation, and thus the change in potential energy. Once I have this, and the mass of the vehicle, and the resistance due to wheels and air drag, and the moment of inertia of the wheels, then it was a simple matter of mapping from delta PE to delta KE:

And then I could turn these equations into code:

Finally, I could generate results with different weights, and graph them.

The sad result was that more weight == better results. Though I imagine rolling resistance isn’t linear with weight, as the “footprint” of the tread expands under increased load. Plus there’s the issue of being able to stop at the bottom of the hill…

About these ads

One Response to How a Programmer Works on a Soapbox Derby Racer

  1. Chris Bishop says:

    Now I understand why you no longer work at the Pentagon!!

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: