My last several articles have covered lots of softwarefordoing research in the sciences. But one important area I haven'tcovered in detail is the resources available for teaching the nextgeneration of computational scientists. To fill this gap, you can usethe code provided through theOpen Source Physics project. This projectis supported by the American Association of Physics Teachers (AAPT) andthe National Science Foundation (NSF), and it offers several differentpackages for doing simulations and analysis.
The first thing Open Source Physics provides is an entire suite ofJava applications that do simulations of different physical systems.Because thesesimulations are all written in Java, they can be run on operatingsystems other than Linux. The categories covered include astronomy,electricity and magnetism, classical mechanics, quantum mechanics,optics and relativity. On the main Web site, you either can do a specificsearch or browse by topic to find simulations. The simulation programsare packaged as .jar files, so you can download them and run themsimply by typing:
java -jar filename.jarThis lets you run the simulation on your desktop. But, because these areJava programs, you can put them a Web site and run them withina browser. This means you can include them on your science siteand show visitors simulations of the systems you might be tryingto explain.

Figure 1. For example, starting up the simulation of sliding down an inclined planealso pops up some introductory material.
Some of the simulations provided by Open Source Physics haveparameters that you can alter to change the runtime details ofthe simulation. These parameters might be items like masses,velocities or field strengths. If the simulation you are using doeshave settable parameters, there will be an option to save themodel details off to a data file. You can do this by clicking File→Save Model. The data file is an XML file, so it should be relativelyclear if you want to edit the file directly with a text editor. You then can reload these parameters in the simulation by clickingFile→Load Module. This way, you can share models you've developed withother people by sharing the XML data file.

Figure 2. Saving a Run for Sharing with Other People
Once you have gone beyond the material covered by the pre-packagedsimulations, you probably will want to see what other systems you canmodel and analyze. Open Source Physics provides a system called Easy JavaSimulations (EJS) to do just that. This Java program provides a niceand easy interface to allow for prototyping, testing and distributingyour own simulations. EJS is good for educational situations becauseit allows for relatively complex simulations without needing to know agreat deal about programming.
EJS is larger than the single simulationsI mentioned above, so you need to download a zip file rather than justa single jar file. Once you have the zip file downloaded, you needto unpack it on your machine. Then you can navigate to the directorywhere you unpacked and execute:
java -jar EjsConsole.jarThis pops up a console window where you can set some initializationparameters and start one or more EJS instances. This opens amodeling and authoring tool where you can define your physical systemand the details of what you are trying to model. You can run thesemodels from within the authoring tool, so you can try things out and seewhether you are getting the results you expect. Once you are happy withthe simulation, the authoring tool has options to allow you to packagethe entire simulation as a single bundle that you can share withothers. This is great when you are developing code for a class, becauseyou can define simulations for the exact physical systems you want toteach and then package it for your students.

Figure 3. The EJS console lets you define your own simulations.
Open Source Physics aims to help with all aspects of teaching, so to thisend, it provides a program called the Launcher. The Launcheris a central program that provides access to a series of simulations,along with supporting documentation and teaching notes. You can clickon the curriculum link and search for collections that cover specifictopics. Just like with the individual simulations, you either can searchfor a specific item or browse a list of topics for which there are curriculum launchers already prepared. You are not limited to those, however. Youcan use the LaunchBuilder to create your own collections. This utilitylets you define the materials you want to bundle together, and thenit will output a jar file that you can distribute. The actual materiallist is stored as an XML file, so you can open it with a text editorif you want to refine any of the entries before actually generating thedistributable file.

Figure 4. The Data Tool helps you do basic statistics on your data.
When you are ready to go even further, the Open Source Physics projecthas an entire programming environment available based around the EclipseIDE. This IDE includes the Open Source Physics libraries that are usedin the simulations and the EJS code. This way, you can go further anddevelop your own programs without having to re-invent the wheel whenit comes to common tasks. A lot of documentation is available,including several chapters of two upcoming books titledOpen SourcePhysics: A User's Guide with Examples andAn Introduction to ComputerSimulation Methods.
The Open Source Physics project provides two other tools:Data Tool and Tracker. First, let's look at Data Tool. Data Toolprovides plotting and data-fitting functions to help you analyzeexperimental data. You can change the appearance of plots interactivelyby selecting parameters on the main screen. Once your data is loaded,Data Tool also can do basic statistics on the data set. So, you quickly canget items like mean, median and standard deviation. Withyour data plotted, you can get the slope and area under curves in theplot. Often, you collect data to try to demonstrate some relationshipbetween inputs and outputs. To verify this, you try to fit some functionto your data. Data Tool provides a number of predefined functions thatyou can ask it to try to fit. Or, you can use Fit Builder to define yourown functions to be used in the fitting routine. You also may find thatyou need to massage your data before either plotting it or trying to fitit. This may involve applying different types of mathematical transformationsto your data. In regular data analysis, this would be astep you would handle before importing your data, but Data Tool providesa function called Data Builder that allows you to do this right here.
The last tool to look at here is Tracker. Tracker can do image andvideo analysis by using the functionality in the Open Source Physicslibrary. Tracker is capable of object tracking in video, giving youposition, velocity and acceleration. It can provide overlays and graphs,special-effects filters, multiple reference frames and calibrationpoints. It even can be used to analyze spectra and interference patterns,allowing you to analyze laboratory measurements. As an example, you canoverlay simple dynamic particle models on top of a video clip. This allowsyou to take a video of an experiment and then use it to make yourmeasurements and analysis. There are several examples on the Web wherepeople have used this to model all kinds of events, including modelingthe physics ofAngry Birds. A quick Google search will open your eyesto what is possible.

Figure 5. The tracker handles video analysis with object tracking.
This short article barely scratches the surface of what is available. Ifyou are either teaching physics or learning physics, exploring the Open SourcePhysics project definitely will be worth your time.






