Page 3 - Physlets and Open Source Physics for Quantum Mechanics:
P. 3

The Physlet paradigm, an example of which is shown in Figure 1, is based on the
                 Model-View-Control (MVC) design pattern which is one of the most successful software
                 architectures ever invented.  The model maintains data and provides methods by which
                 that data can change; the control gives the user the ability to interact with the model
                 using the keyboard and the mouse; and the view presents a visual representation of
                 the model’s data.  Java is ideal for the implementation of models and views because
                 these objects are often complex and computational speed is important.  But since the
                 control object is accessed infrequently and should be customizable, it can be
                 implemented differently.  A scripting language such as JavaScript embedded into an
                 HTML document provides an ideal solution.  The advantage of using JavaScript and
                 HTML to control a model and its views is that a common user interface can be created
                 to ease the learning curve across pedagogical contexts.  This unique approach has
                 contributed to the success and wide adoption of Physlets.  For example, a Google
                 search on “Physlets” returns over 12,000 Web pages.


                 Open Source Physics





















                                Figure 2:  An OSP program,  QMSuperpositionApp,
                                used to depict a two-state superposition for the
                                quantum-mechanical  harmonic oscillator.   The
                                visualization (the view) is shown on the left while the
                                OSP control is shown  on the right.  One  can edit
                                animation parameters by typing in the parameter
                                fields.  These parameter values can also be saved and
                                loaded using an XML file as shown in Figure 3.


                 While Physlets are in many ways ‘open,’ they are not open source.  As a consequence,
                 the underlying Java code is inaccessible.  This approach works for general-purpose
                 applications, but fails for more sophisticated one-of-a-kind simulations that require
                 advanced discipline-specific expertise, such as those for quantum mechanics.  Users
                 and developers of these types of programs often have specialized curricular needs that
                 can only be addressed by having access to the source code.  However, anyone who
                 has ever written a program in Java knows that writing code for creating buttons, text
                 fields, and graphs can be tedious and time consuming.  The Open Source Physics
                 (OSP) project [20] solves this problem by providing a consistent object-oriented library
                 of Java components (OSP libraries are based on Swing and Java 1.4) for anyone
                 wishing to write their own programs.


                 Open Source Physics curricular material is written in Java and distributed using internet
                 technologies.  Although we distribute source code under the GNU GPL license, the
   1   2   3   4   5   6   7   8