Computational Modeling with Scratch

I’ve been following the thoughts of John Burke and what he’s been writing and doing with introducing computational modeling to HS physics.  I think there are some real opportunities with using modeling in this way.  The greatest thing I see with it is that the students end up doing science and engineering.  They’re not answering pseudo contextual questions from a textbook or worksheet, but actually applying their knowledge in a way that real scientists and engineers would.

The physics computational modeling I’ve seen typically is centered around mechanics, with things like projectiles and objects interacting with forces.  To accomplish this, John and others turn to using Python and Vpython.  Vpython is a library that allows the user to easily incorporate graphical objects so that their programs produce visual outputs.  For example, a ball is drawn with the function sphere(position, radius, color).

ScratchI wanted to try and do this same kind of modeling using Scratch, a graphical OO programming language from MIT.   Scratch creates a background storyboard where sprites (objects, characters) are moved around and do things.  So my plan was to draw an objects, such as  a ball, and then control it with the script.  It works quite well, and is very comparable to using Vpython.  My projectile motion script is a bit longer than really is needed: I have bits added so the user can enter in the starting velocity, and I also have the shade of the projectile path get lighter as the speed decreases.

I’m no programming wiz, so I can’t give you a great comparison between the two methods.  However, here is my very brief pro/con:

Scratch Pros

  • Can draw/import any object to control (maybe interesting from a creativity POV)
  • No worries about syntax for first-time programmers
  • Installing of Scratch is easier, especially if using a raspberry pi (no need to grab the Vpython library)
  • Scripts can be shared/remixed from the web

Vpython Pros

  • gives exposure to text syntax, which is where programming leads to
  • gives much better vector interpretation of what is happening in 2D/3D
  • formulas are easier to recognize using text syntax

In terms of purely HS physics, I think Scratch may be the better route to start with.  However, if we keep an eye to the future goals of the students, then perhaps it would be wise to move onto Vpython.

I’m going to keep looking at this and see if improvements can be made on the Scratch side of things.  Specifically, the newer version of Scratch currently in beta allows for “build your own blocks.”  I wonder if it’s possible to build blocks that take care of vectors and vector math.

Let me know if you’ve used Scratch or Vpython in introductory physics, and what you think of it!