Monday, July 4, 2016

Lloyd's Physics Simulation: Prototype 1

I'm a real physics geek. If I see a cord hanging from a ceiling light swaying back or forth, I'm immediately enthralled with the physics of the motion. I can easily imagine Galileo using this pendulum as a timing device. I can quickly conjure up Einstein's thought experiment about the equivalence principle. This principle imagines one being sealed in a little rocket ship without windows and wondering - is this light cord swaying back and forth the way it is because my rocket ship is accelerating somewhere deep in space, or is my rocket ship still sitting on the launch pad and therefore in earth's gravitational field? The cord will produce the exact same pendulum swing in both scenarios.

I'm a proud owner of the three volume set of "Lectures on Physics" by Richard Feynman - also known as the "red books," and many of his other "less technical" publications, such as his book "Surely You're Joking, Mr. Feynman!" (A real Feynman fan knows the story behind the title; hint: it's about being subjected to another's pretentiousness.) Perhaps my favorite little anecdote in one of his writings is the example of why flanges on railroad car wheels are unnecessary - it's because the inner surfaces of all the wheels are curved. This causes the wheels to always "fall back" toward the center of the track - the flanges are there just as a precautionary, safety device, but really are not necessary. In fact, you should stop reading this blog right now and immediately begin watching part 1 of the recording of The Character of Physical Law at Cornell in the 1960s. (The introduction of Professor Feynman by then provost Dale B. Corson in this very first video is very funny.)

I could go on and on. In short, I may not be a physicist, but I know what "matters."

So, why didn't I become a physicist? Simply put, learning physics is really hard and, honestly, the mathematics of it all is beyond me.

So, what to do? Well, retreat to what I understand, of course, and that takes me to Newton's Laws of motion. I barely understand Newton's Laws of Motion, but I find them a constant source of inspiration and wonder. They seem so simple at first glance - an object in motion stays in motion, etc., but it gets complicated in a hurry as you consider that these laws of motion explain the orbits of the planets and were used to get Neil Armstrong, Buzz Aldrin and Michael Collins to the moon. (I've always had a fondness for poor Michael stuck in the command module orbiting the moon as Neil and Buzz were walking around about 70 miles below. So close.)

One other very timely example of the importance of Newton's Laws of Motion is happening right now. As I finish writing this blog posting on July 4, the Juno spacecraft is scheduled to reach its destination - Jupiter - this evening. In order to attain an orbit around Jupiter for the spacecraft to carry out its mission, it must slow down sufficiently for Jupiter's gravity to snag it. For that to happen, Juno's engine must fire for about 35 minutes at just the right time. If that fails to happen perfectly, Juno will just fly by Jupiter and the mission will end in failure.

Lloyd's Physics Simulation

A really good starting point for applying the laws of motion to everyday events is understanding the relationship between acceleration, velocity, and distance. This relationship has fascinated me since I was in high school. It's one of those sets of principles that seems perfectly easy to understand - until you really try. Then, when you finally get it, the understanding opens all kinds of doors to other learning. Differential calculus is a good example. Velocity is the first derivative of distance and acceleration is the second derivative of distance. This means that acceleration is the first derivative of velocity. Well, of course.

Wait, don't close that browser window! Let's explore acceleration, velocity, and distance by playing the first prototype of "Lloyd's Physics Simulation." This app is the result of only about five hours of work.

One of the most exciting developments in the LiveCode world is the option to export projects as HTML5, so I thought I would use this option to share this project, but you can also choose to download one of the standalone versions, or just watch a very informal video demonstration I made for my summer design course I'm teaching for the University of Georgia.

HTML5 Alert! It will likely take awhile to load the first time you run it. Depending on your Internet speed, it might even take a minute or two. So, be patient.

 Video Demo

If you ran the HTML5 version, you may have noticed some "weirdness" in how the simulation runs on the second or third try. The simulation speeds up for reasons I cannot explain. At some point, the simulation becomes unplayable. This does not happen when you run it as a standalone app. One simple solution is just to reload the web page in the browser. (This won't take as long as the initial download.) I plan on submitting this problem to one of the LiveCode user forums.

If you have been able to play the simulation, I hope you begin getting the gist of the relationship between distance, velocity, and acceleration. Distance is simply the how far the marble has gone in either direction in a given time. Velocity is the change in distance, such as 20 pixels per second toward the top at any particular moment in time. Acceleration is just the change in velocity, though it is usually expressed with the odd sounding phrase of "per second per second." But, that apparent redundancy actually explains acceleration well because if the velocity is changing (i.e. acceleration is not zero) the change in the ball's speed is likewise changing constantly. You get those really beautiful parabolic curves when the marble is accelerating. You will notice that the distance graph is a straight line whenever acceleration is 0 because only then is the velocity constant. These are just some of the patterns that will emerge if you pay close attention as you run the simulation.

OK, It Was Kind of Fun Trying Out the Simulation, But I Got Bored Quickly

Yes, unless you are a physics geek too, you will probably get bored quickly with this little simulation. There is the little challenge of keeping the marble from sliding off of the yellow track, but that gets old quickly. What to do about this? Well, that's where the design possibilities can get very interesting. I actually did a bunch of research about simulations as a learning tool some years ago. I always considered it a fundamental question of how much structure to overlay onto a simulation. I was keen on understanding to what degree completely free and open-ended exploration within a simulation would result in learning and motivation about the content of the simulation. Most people do get bored quickly when there is no structure. So, I began to experiment with overlaying simple design elements, such as little games. I wanted to see to what degree people needed more and more structure, which would culminate eventually with the ultimate in most structured designs, namely instruction. Some of my early work led to the design of a software package titled "Space Shuttle Commander" where the player was asked to do just that - be the commander of the space shuttle. To be successful, you had to know, or learn about, Newton's laws of motion. I gave it away for free and NASA actually published it among their free educational resources. Alas, this was many years ago and it only ran on the Apple IIe platform.

Here's a link to one of my "classic" (aka old) research articles about this (the complete reference to Rieber, Tzeng, & Tribble, 2004 is below). In other research studies I conducted specifically on the relationship between acceleration and velocity, I took advantage of that special moment when the marble changes direction. I called it a "flip flop" and built a little game around it.  I won't go into the details of that game now, but imagine what kind of games could be designed with this little simulation. For example, I can imagine having targets placed within the area of the line graphs that you have to try to hit with one of the graph lines.

Final Thoughts

You may have noticed my use of thick, thin, and dashed lines for the various graphs. We have been reading about accessibility issues in my UGA design class. If you are color blind, you would have difficulty taking advantage of the fact that I color coded the various graphs. But, by varying the line styles, you should be able to distinguish each of the graphs.

So, the laws of motion may not be as sexy as Einstein's relativity, Heisenberg's Uncertainty Principle, or Schrödinger's cat. But, for just about everything you and I observe in the world around us, they work very, very well. And, as my good friend and former Texas A&M colleague Ron Zellner is fond of saying ... "Action - Reaction. It's not just a good idea, it's the law."


Rieber, L. P., Tzeng, S., & Tribble, K. (2004). Discovery learning, representation, and explanation within a computer-based simulation:  Finding the right mix. Learning and Instruction, 14, 307-323.


I've never been very certain about Heisenberg's Uncertainty Principle. As far as I can tell, I can either know where I am or where I'm going. Which would you prefer?


  1. FYI: The HTML version of your stack does not run on my Android phone. The file appeared to download correctly, but the button to start the program was unresponsive.

    1. Hi Clinton. I'm not surprised that you could not get it to work on an Android phone. According to the LiveCode company, there are a limited number of browsers that will run LiveCode projects exported to HTML5. You should try accessing my simulation on a laptop or desktop running Firefox.

  2. FYI: The HTML version of your stack does not run on my Android phone. The file appeared to download correctly, but the button to start the program was unresponsive.