Wednesday, March 4, 2009

What is Physlets?

Physlets or “Physics applets” are small, flexible Java applets that can be used in a wide variety of WWW applications. Many other Physics-related Java applets are being produced around the world some of them very useful for education. However, the class of applets we call “Physlets” has some attributes that make it valuable for the educational enterprise.
Physlets are simple. The graphics are simple; each Physlet is designed to deal with only one facet of physical phenomena, and does not incorporate very much in the way of data analysis. This keeps Physlets relatively small-easing downloading problems over slow network connections and removes details that could be more distracting than helpful.

Physlet-based pedagogy is agnostic. Physlets can be used as an element of almost any curriculum with almost any teaching style. Although we believe that interactive engagement methods such as Just-in-Time Teaching, Peer Instruction, or Tutorials can improve pedagogy, Physlets can be used as traditional lecture demonstrations and can be given as end-of-chapter homework.

Physlet technology is flexible. All Physlets can be set up and controlled with JavaScript, meaning Animator can be used for almost any subject in mechanics and EField for almost any topic in electrostatics with small changes in the JavaScript—and not the Java—associated with each exercise. Data taking and data analysis can be added when needed using inter-applet communication.

Physlets are written for the Web. They can run on (almost) any platform and be embedded in almost any type of html document, whether it be a homework assignment, a personal website, or an extensive science out-reach site.

Physlets are freely distributable for noncommercial use. Physlet archives, that is, compressed archives containing compiled Java programs, can be downloaded from the Davidson College Web Physics server:

These files can be mirrored on a local hard drive or on a noncommercial web server in order to provide students easy access to customized curricular material.

The introduction of the Java programming language by Sun Microsystems makes it possible to add platform independent programs to the HTML stew. Java accomplishes this trick by specifying a relatively simple Virtual Machine, VM, which can be implement on any computer, i.e., Unix, Mac, or Windows. Although this VM does not provide as rich a set of tools as the native operating system, the virtual machine can have a user interface with buttons, a drawing canvas, and other graphical elements. There may be virtue in simplicity. Small platform independent programs are ideally suited for instructional purposes such as homework problems. We call such applets Physlets. These Physlets can be embedded directly into HTML documents and can interact with the user using a scripting language such as JavaScript.

Since Physlets are scriptable, the physics is can be changed by the HTML author. They are designed to be embedded into physics problems. For example, the 100 Kbyte Animator Physlet we have written is used to move a shape inside the applet's bounding box along a predefined path, [x(t), y(t)]. Adding this Physlet to an HTML page is no different than adding an image. Creating a 10-pixel diameter ball that follows a parabolic trajectory requires the following two lines of script:
id=document.animator.addObject("circle","x=0,y=0");
document.animator.setTrajectory(id,"-10+6*t","-5+8*t-4.9t*t");
Although animation can certainly be accomplished using more sophisticated programs such as Interactive Physics or possibly even quick time movies, two or thee lines of script connected to another problem can add additional shapes to the applet or change the trajectory into a sinusoidal oscillation. A VCR-like set of control buttons allows students to start, stop, and step the animation. The mouse can be used to read scaled coordinates. Presenting visual rather than textual representation of information necessary to do a problem changes the problem solving strategy. It also allows for different types of questions. What is the acceleration of the red ball? Are the laws of classical dynamics observed in the collision between the red and the blue balls? Which planet in the animation does not obey Kepler's laws? In problems such as these, the student must observe the motion and make appropriate measurements to obtain a solution.