Multimedia in Physics Teaching and Learning, Prague 2003 Developing Open Source Programs for Upper Level Science and Mathematics Wolfgang Christian and Mario Belloni Davidson College USA Abstract The switch from procedural to object-oriented (OO) programming has produced dramatic changes in professional software design. OO techniques have not, however, been widely adopted by science and mathematics teachers and curriculum authors. The continued use of procedural languages in education is partly due to the lack of up-to-date curricular development tools that implement science computation and numerical analysis techniques within an OO framework. This talk describes a new open-source development project that combines OO software development with science education research to produce such material. These OO tools include frameworks for two- and three-dimensional drawing, numerical analysis, and user interfaces. Examples are presented that show how these tools can be used to encapsulate the relevant Physics. The Open Source Physics code library, documentation, and curricular material can be downloaded from the following site: http://www.opensourcephysics.org/default.html Partial funding for this work was obtained through National Science Foundation grant DUE0126439. Introduction The switch from procedural to object-oriented (OO) programming has produced dramatic changes in professional software design. However, object-oriented techniques have not been widely adopted by scientists teaching computational physics and computer simulation methods. Although most scientists are familiar with procedural languages such as Fortran, few have formal training in computer science and therefore few have made the switch to OO programming. The continued use of procedural languages in education is due, in part, to the lack of up-to-date curricular materials that combine science topics with an OO framework. Although the Second Edition of the book An Introduction to Computer Simulation Methods contains a wealth of curricular material for teaching computational physics, it is written in Basic and is not-object oriented [1]. We are currently in the process of revising this text using the Java programming language. We are also writing a code library to provide input/output and graphing capabilities for the examples in this book. After showing this library to other educational software developers, it became apparent that it has a potentially wider audience than computational physicists. What is needed by the broader science education community is not a computational physics, numerical analysis, or Java programming book (although such books are essential for discipline-specific practitioners) but a synthesis of curriculum development, computational physics, computer science, and physics education that will be useful for scientists and students wishing to write their own simulations and develop their own curricular material. The Open Source Physics (OSP) project was established to meet this need. Multimedia in Physics Teaching and Learning, Prague 2003 Open Source Physics is a National Science Foundation-funded curriculum development project that seeks to develop and distribute a code library, programs, and examples of computer-based interactive curricular material. The project will create and make available a large number of ready-to-run Java simulations for education using the GNU open source model for code distribution. The OSP project also maintains a website that serves as in-depth guide to the tools, philosophy, and programs developed as part of this project. The Open-Source Physics project is based, in part, on a collection of Java applets written by Wolfgang Christian known as Physlets [2]. Although Physlets are written in Java, they are not open source. In fact, we often receive requests for Physlet source code but have declined to distribute this code. Physlets are compiled Java applets that are embedded into html pages and controlled using JavaScript. This paradigm works well for general-purpose programs such as a Newton's law simulation, but fails for more sophisticated one-of-a-kind simulations that require advanced discipline-specific expertise. 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 opening windows and creating buttons, text fields, and graphs can be tedious and time consuming. Moreover, it is not in the spirit of object-oriented programming to rewrite these methods for each application or applet that is developed. The Open Source Physics project solves this problem by providing a consistent object-oriented library of Java components for anyone wishing to write their own simulation programs. In addition, the OSP library provides a framework for embedding these programs into an html page and for controlling these programs using JavaScript. The Open Source Physics OSP library includes the following packages: Controls: A framework for building graphical user interfaces and components. Display: A drawing framework based the DrawingPanel class and the Drawable interface. Display2D: Visualization tools for two-dimensional data such as contour and surface plots. Display3D: A 3D visualization framework based on Java 3D. Ejs: A component library developed as part of the Easy Java Simulations project. Includes a 3D visualization framework based on the Drawable interface and Java 2D. Also includes custom user-interface components. Numerics: Numerical analysis tools such as ordinary differential equation solvers. OSP libraries are based on Swing and Java 1.4. Although the focus of these basic libraries is traditional computational physics, they have already been extended to include tools such as video analysis and a high-level modeling tool which are not covered in computational physics texts. A number of authors and developers have already adopted OSP for their own development projects and have agreed to let the OSP project distribute their programs as examples. These projects include: Computer Simulation Methods (3 ed)} by Harvey Gould, Jan Tobochnik, and Wolfgang Christian. Statistical and Thermal Physics by Harvey Gould and Jan Tobochnik. Easy Java Simulations high-level modeling tool by Francisco Esquembre. Tracker video analysis program by Doug Brown. Multimedia in Physics Teaching and Learning, Prague 2003 As a result of these collaborations, the OSP website will quickly make a large number of readyto-run Java simulations available for education. MVC Design Pattern Experienced programmers approach a programming project not as a coding task but as a design process. They look for data structures and behaviors that are common to other problems they have solved. Separating the physics from the user interface and the data visualization is one such approach. In keeping with computer science terminology, we refer to the user interface as the control. It is responsible for handling events and passing them on to other objects. Plots, tables, and other visual representation of data are examples of views. Finally, the physics can be thought of as a model that maintains data that defines a state and provides methods by which that data can change. There is usually only one model and often only one control. It is, however, common to have multiple views. We could, for example, show a plot and a table view of the same data. Separating a program into models, vies, and controls is known as the Model-View-Control (MVC) design pattern. The MVC design pattern is one of the most successful software architectures ever devised. Java is an excellent language with which to implement this pattern because it allows us to isolate the model, the control, and the view in separate classes. Object-oriented programming makes it easy to reuse these classes and easy to add new features to a class without having to change the existing code. These features are known as encapsulation, code reuse, and polymorphism. They are, in fact, the hallmarks of object-oriented programming. We now present various OSP frameworks and show how they support the MVC design pattern. OSP Control Framework In principle, any object can have a control although in practice the most important control is the control that starts, stops, and initializes a program. The OSP controls package defines a Control interface and various concrete implementations of this interface. An object registers values in a control using a setValue method and the control — usually — displays these values so that they can be seen and edited. The user edits these values and generates an event— usually a button click — that causes the object to change state by reading the values back from the control using get methods such as getDouble or getInteger. Typically, physics models require parameters — such as mass — that are held constant during a calculation and initial values of state variables — such as position or velocity — that evolve during a calculation. Both parameters and state variables are stored in a model using Java int and double identifiers. We usually refer to these identifiers as variables. Before a programmer can access a model's variables using a control, the control must be initialized by passing the name of the variable and an initial value using a set command. For example, if we want the user interface to provide access to the initial position, x0, of a particle, we execute the setValue statement: myControl.setValue("x0", 0.0); Multimedia in Physics Teaching and Learning, Prague 2003 Figure 1: A simple control for use with an OSP Calculation. The control stores the initial position, x0. The control now holds a copy of this variable and displays the variable name and value in a graphical user interface as shown in Figure 1. The user can interact with the control and change the variable’s value. However, these changes are not reflected in the model until the model reads the new values from the control. Reading values from a control is often initiated by an action, such as pressing a button. The CalculationControl shown in Figure 1 invokes the calculate method within a Calculation when the calculate button is pressed. The method within the Calculation would do the following: public void calculate () { x=myControl.getDouble("x0"); t=0; . // do the calculation here . } Because button actions can occur at any time, synchronization errors may occur. It is the programmer's responsibility to insure that actions can safely modify the model's data. As the calculation progresses, the model can modify the control's copy of the data. The control will reflect this change but constantly updating the control may demand considerable processing power. Another possibility is to send the control updated values only when the calculation stops. These design considerations are entirely up to the programmer. Multimedia in Physics Teaching and Learning, Prague 2003 Figure 2: A custom Ejs control that replaces the control shown in Figure 1. Easy Java Simulations, Ejs, is a complete high-level modeling tool written by Francisco Esquembre at the University of Murcia, Spain, which builds Java applications and applets using a graphical user interface [3]. Ejs uses the OSP library and has released components that enable programmers to build custom user interfaces independent of the complete Ejs tool. These custom controls are built without any preconditions as to the type of object that will be controlled. That is, a controlled class need not implement any given interface. Listing 1 creates the user interface shown in Figure 2. public class CustomCalculationControl extends EjsControl{ public CustomCalculationControl(Object target) { super(target); add("Frame","name=controlFrame;exit=true;size=200,90;layout=vbox"); add ("Slider", "parent=controlFrame; minimum=-1; maximum=1; ticks=11; ticksFormat=0.0; variable=x0"); add ("Panel", "name=controlPanel; parent=controlFrame; size=300,300; position=south; layout=flow"); add ("Button", "parent=controlPanel; text=Calculate; action=calculate"); add ("Button", "parent=controlPanel; text=Reset; action=resetCalculation"); update(); } } Listing 1: A custom control containing a slider and two button. The code starts by passing a reference to the object that will be controlled to the EjsControl superclass. This controlled object is referred to as the target. The target receives actions, such as button clicks or slider moves, from the control’s elements. In this example, only the buttons invoke actions. These actions are, of course, public methods within the target. The second statement begins the process of creating the user interface by instantiating a frame named controlFrame. The next statement adds a slider with an internal variable named x0. As in any control, the value of the x0 variable can later be read by invoking the control’s getValue(“x0”) method. The remaining statements add another panel and two buttons to the frame. Ejs supports a wide variety of user interface components including labels, radio buttons, check boxes, and one-line text fields. A final word about simplicity of design: The standard OSP controls are designed for input/output without worrying about details such as layout managers and appearance. This approach is ideal for testing code and for teaching students how to program. However, Ejs provides the opportunity to create very attractive user interfaces with minimal change to the computational models. We Multimedia in Physics Teaching and Learning, Prague 2003 recommend that users develop their models first and then—if a better interface is desired—build an Ejs control to fit the model. OSP Drawing Framework One of the great attractions of Java is that device and platform independent graphics is built directly into the language. Lines, ovals, rectangles, images, and text can be drawn with just a few statements. The position of each shape is specified using an integer coordinate system that has its origin located at the upper left-hand corner of the device—the computer screen or printer paper— and whose positive y direction is defined to be down. Although we can use Java's graphics capabilities to produce visualizations and animations, creating even a simple graph in such a coordinate system can require a fair amount of programming. A scale must be established, axes need to be drawn, and data needs to be transformed. An additional complication arises due to the fact that a graph must be able to redraw itself whenever an application is exposed or a window resized. But visualization is, after all, a fairly common operation. We have developed a drawing framework that not only scales data, but that can also be used for animations and other visualizations. Figure 3: A drawable circle and arrow in a drawing panel. The drawing framework is based on the Drawable interface in the display package. It contains a single method, draw. public interface Drawable { public void draw(DrawingPanel drawingPanel, Graphics g); } Drawable objects, that is, objects that implement this interface, are instantiated and added to a DrawingPanel where they will draw themselves in the order that they are added. Listing 2 shows a small program that creates a drawing panel containing a circle and an arrow. Multimedia in Physics Teaching and Learning, Prague 2003 public class TwoDrawablesApp { public static void main(String[] args) { DrawingPanel panel = new DrawingPanel(); DrawingFrame frame = new DrawingFrame(panel); panel.setSquareAspect(false); Circle circle = new Circle(0, 0); panel.addDrawable(circle); Arrow arrow = new Arrow(0, 0,4,3); panel.addDrawable(arrow); } } Listing 2: A program that creates a circle and an arrow inside a drawing panel. Figure 4: A log-log plot of the semi-major axis of a planet versus its orbital period The OSP drawing framework is, of course, designed to construct views. Because plotting data is a common requirement, the OSP library defines a subclass of a drawing panel known as a PlottingPanel that includes axes, labels, and titles to produce linear and logarithmic plots. Listing 3 demonstrates its use by producing a log-log plot showing the validity of Kepler’s third law. The arrays, a and T, contain the semi-major axis of the planets in astronomical units and the orbital period in years, respectively. Note that the plot automatically adjusts itself to fit the data because the auto-scale, option is set to true for both x and the y axis. Multimedia in Physics Teaching and Learning, Prague 2003 public static void main(String[] args) { PlottingPanel plotPanel = new PlottingPanel("ln(a)", "ln(T)", "Kepler's Second Law", Axis.LOG10, Axis.LOG10); DrawingFrame drawingFrame = new DrawingFrame(plotPanel); LogDataset dataset = new LogDataset(Axis.LOG10, Axis.LOG10); double[] a = { 0.241, 0.615, 1.0, 1.88, 11.86, 29.50, 84.0, 165, 248 }; double[] period = { 0.387, 0.723, 1.0, 1.523, 5.202, 9.539, 19.18, 30.06, 39.44 }; dataset.setConnected(false); dataset.append(a, period); plotPanel.addDrawable(dataset); plotPanel.repaint(); } Listing 3: A program that creates the log-log plot shown in Figure 4. The OSP library also provides a 2d display package, display2d, to create views of scalar and vector fields. The Data2D class in this package is designed to store the field’s data. For example, an n by m grid having one component at each grid point and spanning a region of physical space from xmin < x <xmax and ymin < y <ymax is instantiated and initialized as follows: Data2D data2d = Data2D(n,m,1); data2d.setScale(xmin,xmax,ymin,ymax); . Figure 5: A contour plot of the scalar field U(x,y) = x*y. Various classes in the 2d display package use these Data2D objects to create visualizations such as contour and surface plots. Listing 4 follows standard procedure by instantiating a drawing panel and adding the appropriate visualization tool to the panel. We can, for example, create a contour plot. public static void main(String[] args) { DrawingPanel drawingPanel = new DrawingPanel(); DrawingFrame frame= new DrawingFrame(drawingPanel); Multimedia in Physics Teaching and Learning, Prague 2003 Data2D data2d=new Data2D(16,16,1); data2d.setScale(-1,1,-1,1); Contour contour = new Contour(data2d); drawingPanel.addDrawable(contour); double[][][] data = data2d.getData(); int row=data.length; int col=data[0].length; for(int i=0;i<row;i++){ for(int j=0;j<col;j++){ double x=data[i][j][0]; // the x location double y=data[i][j][1]; // the y location data[i][j][2]=y*x; // magnitude } } contour.update (); } Listing 4: A program that draws a contour plot of a scalar field. OSP Numerics Framework Scientists frequently require the use of numerical tools, such as a matrix inversion subroutine, to build models. Although we sometimes make use of Java packages written by others [4], the OSP library includes a numerics package in order to define and implement abstract mathematical concepts such as functions, transformations, and differential equation solvers. The Function interface, for example, is defined to have a single method. package org.opensourcephysics.numerics; public interface Function { public double evaluate (double x); } Abstracting the concept of a function as a Java datatype allows us to define mathematical operations including derivatives, integrals, and interpolations without knowing the details of how the function is implemented. Two implementations of the derivative, for example, are defined within the numerics package utility class. static public double derivative(Function f, double x0, double h){ return (f.evaluate (x0 + h) - f.evaluate(x0 - h)) / h/2.0; } static public double derivativeRomberg(Function f, double x0, double h, double tol){ int n=6; //max. number of iterations in the Romberg scheme double[] d= new double[n]; d [0] = (f.evaluate (x0 + h) - f.evaluate(x0 - h)) / h/2.0; int code=1; for( int j=1; j <= n - 1;j++){ d [j] = 0.0; double d1 = d [0]; double h2 = h; h *= 0.5; if (h < Float.MIN_VALUE){ code = 2; /* step size less than Float.MIN_VALUE */ break; Multimedia in Physics Teaching and Learning, Prague 2003 } d [0] = (f.evaluate (x0 + h) - f.evaluate (x0 - h)) / h2; for (int m = 4, i = 1; i <= j; i++, m *= 4){ double d2 = d [i]; d [i] = (m * d [i-1] - d1) / (m-1); d1 = d2; } if (Math.abs(d [j] - d [j-1]) < tol){ /* desired accuracy */ return d[j]; } } throw new NumericMethodException("Did not converge.",code,d[0]); } Listing 5: Derivative methods in the utility class of the numerics package. The Listing 5 shows two methods for approximating the derivative of a function. The derivative method uses the standard second-order Taylor series approximation while the derivativeRomberg method uses the Romberg scheme for Richardson extrapolation. The solution of first-order ordinary differential equations is another example of mathematical abstraction. It is based on the two methods in the ODE interface. The getState method returns the state of the dynamic variables and the getRate method calculates their rate array. package org.opensourcephysics.numerics; public interface ODE { public double[] getState(); public void getRate(double[] state, double[] rate ); } In order to examine a concrete implementation of this interface, we show one of the classic problems in physics, the driven simple harmonic oscillator, SHO. The state array for this model contains the variables x, v, and t. The rate for this state is calculated as follows: dx v dt dv k x A sin( t ) dt m dt 1 dt A Java class that implements the ODE interface for the SHO model is easy to define. public class SHO implements ODE { double[] state = new double[] {5.0, 0.0, 0.0}; // initial state double omega=1, amp=1.0; // driving frequency and amplitude double k=1, m=1.0; // spring constant and mass public double[] getState() { return state;} public void getRate(double[] state, double[] rate ){ rate[0] = state[1]; rate[1] = - k/m*state[0] + amp*Math.sin(omega*state[2]); Multimedia in Physics Teaching and Learning, Prague 2003 rate[2] = 1; } } Listing 6: The SHO class encapsulates the rate equation for the driven simple harmonic oscillator. The differential equations encapsulated within in Listing 6 are solved by passing an instance of that object to an ODESolver. The solution to these equations is then obtained by repeatedly invoking the solver’s step method. Consider again the equations of motion for the simple harmonic oscillator. This system is solved using the very simple SHOApp test program shown in Listing 7. public static void main(String[] args) { double dt=0.1; // ode step size ODE ode = new SHO(); ODESolver ode_solver = new RK4(ode); ode_solver.initialize(dt); while(ode.getState()[2]<10){ String xStr = "x = " + ode.getState()[0]; String tStr = " t = " + ode.getState()[2]; System.out.print(xStr + tStr + "\n"); ode_solver.step(); } } Listing 7: A program that uses a fourth-order Runge-Kutta method to solve a system of differential equations. In summary, systems of ordinary differential equations can be solved using the ODE interface to define the physics and the ODESolver interface to define the numerical algorithm. Differential Equations ODE Differential Equations ODE Solver Solution A number of solver algorithms including Verlet, Euler-Richardson, fourth order Runge-Kutta, and Runge-Kutta-Fehlberg 4/5 adaptive step size are already defined in the numerics package. Specialized algorithms are easy to code. The numerical analysis group at St. Petersburg Technical University, for example, is currently coding algorithms that implement the method of Dormand and Prince [5]. Java 3D The Open Source Physics 3D, OSP3D, framework provides a hierarchy of Java classes that utilize the Java 3D API developed by Sun Microsystems. Java 3D uses high-level constructs to create, organize and manipulate 3D worlds. OSP3D simplifies these Java 3D concepts to aid programmers in the fast, accurate creation of physics simulations. Familiarity with the Java 3D API is neither assumed nor required for the use of OSP3D. Multimedia in Physics Teaching and Learning, Prague 2003 Figure 6: A spinning top as seen from (a) the space frame and (b) the body frame. Programming 3D physics simulations presents two challenges. The first challenge is to understand the physics. Interesting three dimensional phenomena, such the rigid-body dynamics of a spinning top shown in Figure 6 are mathematically challenging because they often require solving differential equations in reference frames that are attached to moving bodies. A 3D toolkit can help by providing facilities for transforming the dynamics to and from these non-inertial frames. The second challenge is the visualization itself. Java 3D is a full-featured 3D programming language. A programmer can use Java 3D to create textures, morphs, and animations that rival the latest Hollywood special effects. A basic scene, however, takes numerous lines of code to create. A virtual universe must be created, then a view into that universe, then a canvas 3D object for rendering on-screen. The list goes on, and we can't even see anything because we have no light source yet. All of these objects are created one at a time because each is highly customizable. While this structural concept makes Java 3D extremely versatile, scene creation can become tedious for programmers who prefer substance to style. In OSP3D the substance is the physics, and we aren't concerned with most of these effects. A typical 3D simulation creates objects that implement the Drawable3D interface and adds these objects to a 3D drawing panel, DrawingPanel3D. An example program consisting of a yellow ball and a green wall is shown in Listing 8. Multimedia in Physics Teaching and Learning, Prague 2003 public static void main(String[] args) { DrawingPanel3D panel = new DrawingPanel3D(); DrawingFrame3D frame = new DrawingFrame3D(panel); // Create a ball and a wall. ball = new DSphere(-5.0f, 0.0f, 0.0f, 0.5f, Color.yellow); DShape wall =new DBox(6.0f,0.0f,0.0f,0.2f,4.0f,4.0f,Color.green); // Shift the view back. panel.shiftSceneXYZ(0.0f, 0.0f, -20.0f); // Add the objects to the panel. panel.addDrawable3D(ball); panel.addDrawable3D(wall); frame.show(); } Listing 8: An OSP 3D scene consisting of a yellow ball and a green wall. The OSP 3D paradigm is clearly similar to 2D drawing. Drawable objects are added to a panel later moved using an animation thread. The location of three-dimensional objects is specified within a reference frame using standard set methods for the Cartesian coordinates. The orientation can be specified using either Euler angles or a rotation matrix. Simulations and Pedagogy Figure 7: Two electrons orbiting about a nucleus. From the Java edition of Computer Simulation Methods by H. Gould, J. Tochonik, and W. Christian. (In preparation.) The OSP project will make a large number of Java simulations available for physics education. We will do this by converting the applications in the Java edition of the Computer Simulation Methods book into web-deliverable applets. We will post the compiled applets, sample scripts, and source code on the OSP web server. Our intent is to teach good programming practice by having the user modify, compile, test, and debug OSP examples. A typical Computer Simulation Methods chapter begins with a discussion of theory, the presentation of an algorithm, and the necessary Java syntax. We implement the algorithm in a sample application and then ask the reader to test it with various parameters. The user then modifies the model, adds visualizations such as graphs and tables, and adds data analysis. Multimedia in Physics Teaching and Learning, Prague 2003 Consider the classical three-body model for Helium show in Figure 7. The book narrative asks the reader to do the following: Modify the program Planet2.java to simulate the classical Helium atom. Let the initial value of the time step be t = 0.001. Some of the possible orbits are similar to those we have already studied in our mini-solar system. The initial condition r1=(1.4,0), r2=(-1,0), v1=(0,0.86), and v2=(0,-1) gives “braiding” orbits. Most initial conditions result in unstable orbits in which one electron eventually leaves the atom (autoionization). Make small changes in this initial condition to observe autoionization. The classical helium atom is capable of very complex orbits (see Figure 3). Investigate the motion for the initial condition r1=(3,0), r2=(1,0), v1=(0,0.4), and v2=(0,-1). Does the motion conserve the total angular momentum? Choose the initial condition r1=(2,0), r2=(-1,0), and v2=(0,-1). Then vary the initial value of v1 from (0.6,0) to (1.3,0) in steps of vx = 0.02. For each set of initial conditions calculate the time it takes for autoionization. Assume that ionization occurs when either electron exceeds a distance of six from the nucleus. Run each simulation for a maximum time equal to 2000. Plot the ionization time versus v1x. Repeat for a smaller interval of v centered about one of the longer ionization times. As the Helium example shows, the focus is on both the physics and the code. The control need not be very sophisticated and a simple control that includes a few buttons and a text area for data entry is all that is needed. Simple modifications to the program and the narrative allow the Helium problem to be adapted to other contexts such as astronomy and classical mechanics. OSP Summer Workshops In order to achieve widespread distribution and to obtain feedback, the OSP project will host two half-week workshops during the summer of 2003 for curriculum authors and educational software developers. A second set of workshops will be conducted in 2004 in Florida at Eckerd College. The first three-day workshop, July 20–22, 2003, will focus on educational software development using the Java programming language and the Open Source Physics Java code library. Because all Open Source Physics code is being distributed under the GNU GPL license, it is expected (required) that workshop participants distributed their work under this license. The second workshop, July 24–26, 2003, will focus in writing material that incorporates existing Open Source Physics programs. Workshop participants are expected contribute at least one curriculum module that uses an Open Source Physics program to a public domain curriculum library and to offer refinements and suggestions for the development of new Open Source Physics materials. Conclusion Open Source Physics provides a new, exciting, and effective way to author and deliver computer simulations to students. The effectiveness of these simulations will require the development of curricular material and teacher-support tools with full understanding of principles of learning. This development is greatly accelerated by adopting a standards-based library, by involving others, and by distributing code using the GNU open source model. Multimedia in Physics Teaching and Learning, Prague 2003 Acknowledgements We would like to thank Joshua Gould, Harvey Gould, and Jan Tobochnik for their help in developing and testing OSP programs. A special thanks to Joshua Gould for helping to develop the OSP library. Thanks also to Francisco Esquembre for developing the ejs package and contributing Easy Java Simulations to the OSP project. Part of this work was supported by an Associated Colleges of the South Teaching with Technology Fellowship and by the National Science Foundation through grant DUE-0126439. References [1] H. Gould and Jan Tobochnik, An Introduction to Computer Simulation Methods (Second Ed.) Addison Wesley (1996). ISBN: 0201506041 A third edition based on Java and the OSP library is in preparation. See: http://sip.clarku.edu/3e/ [2] W. Christian and M. Belloni, Physlets: Teaching Physics with Interactive Curricular Material, Prentice Hall, Upper Saddle River, (2001). ISBN 0-13-029341-5 See also: http://webphysics.davidson.edu/applets/applets.html. [3] F. Esquembre, Easy Java Simulations, http://fem.um.es/Ejs/ [4] Java expression parser by Nathan Funk. http://www.singularsys.com/jep/ See also the FFT package by Bruce Miller. http://math.nist.gov/~BMiller/java/ [5] A. Borshchev, Y. Kolesov, Y. Senichenkov. Java engine for UML based hybrid state machines. In Proceedings of Winter Simulation Conference, Orlando, California, USA, 2000. p. 1888-1897.