JavaPlanets User Manual

This document briefly describes the use of the JavaPlanets Application and the data file format used to store simulations. The information about using the simulation also applies to the applet version, but custom data files can only be used with the application version of the program.

Table of Contents

Using the Program
The Data File Format

Using the Program

The program should operate basically as one would expect. Basic explanations of major features are given below.

The Data File Format

The planet simulator reads in text data files that specify initial conditions for the system to be modeled, parameters describing the forces in the system, and rendering options. These data files can be created in any text editor. The data file is divide into two sections. In the first section, each line begins with a capitalized flag, followed (after spaces or a tab) by an appropriate value -- either a number or a word. These lines specify the force modeled in the system, and the initial drawing options. All of the flags in the initial section have defaults, so some (or all) of them can be omitted. The second section of the data file details the masses, locations, and velocities of each planet to be modeled. Numbers can be specified in any reasonable format. For example 0.0, 0, 12 and 12e-10 are all valid numbers. Note that the program cannot perform arithmetic on numbers. That is, 1/2 and 10+1 are not allowed. Lines that begin with a # character are ignored by the program, and are used for comments. The order of the flags in the first section does not matter, but all flags must come before the first line describing a planet.

An important note on units: The simulation is independent of the system of units used. However, in a given data file, values should be specified consistently. For example, distances should all be in meters, the timestep given in seconds, and the initial velocities of the planets in meters per second. Also, constants should be in the appropriate units.

Specifying the Force

The N-Body program simulates the movement of n point masses acting under an arbitrary force that acts pair-wise on the bodies. The most obvious force is that of gravity, but the following general formats are available. These forces are specified through the parameters EXPONENT, C1, C2, C3, C4, and FORCE. The FORCE parameter is a flag that specifies which equation is used for the force. The other four flags indicate values of constants in the equation. In the equations below, we use $e$ to designated the value of EXPONENT. Similarly, c1 is the value of the C1 parameter, etc. The forces available are listed below with ther corresponding FORCE flags. Note that all forces are given as a function of only distance r, the separation between two masses m1 and m2. A positive force represents an attractive force. A dissipative force can also be specified with the FRICTION flag. The flag currently accepts the values D_NONE and D_CONST. The parameter FC1 is the constant parameter for the frictional forces, denoted fc1 below. The D_CONST force is simply of the form $F_f = fc1*m1, so that it provides a constant acceleration in the direction opposite velocity. Of course, D_NONE is used to model systems where no dissipative forces are present.

Drawing Options

The following options control how the system is initially displayed.
    This parameter is only used if the dynamic RK4 numerical method is selected. It defines the maximum distance that a body can travel in one timestep. If a body moves farther than this using a certain timestep, then that timestep is reduced and the calculation repeated.

    Setting up The Planets

    The final section of the data file describes the planets. Each line describing a planet contains only numbers, giving its initial conditions and some drawing information. They represent, in the order they are entered: Though it is not necessary, formatting these values with a reasonable use of whitespace makes data files much easier to use. The easiest way to start working with the program is to take an existing data file and simply modify it. You might want to look at a sample data file.

    Page Maintained By:  Brendan McMahan
    Email to:
    Last Modified:  May 28, 1999