Physlets

(Workshop Version)

by Wolfgang Christian

 

 

The introduction of the Java programming language by Sun Microsystems now 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 architecture, 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 75 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 script: 

Animator.addShape(10,"-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. Physlet based problems-along with video based problems-are now being distributed as part of a web-based physics homework system at North Carolina State University. It is believed that video and animation can significantly influence students' visualization of some types of physics and that mastery of these types of problems could significantly improve their understanding of physics concepts. 


Physlets

Watch this page for addtional physlets.

All Java version 1.02 compilers (Microsoft J++, Visual Cafe, and Sun) are buggy so blame the big companies if these applets crash but send me the bug report. I provide better support :-)