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.
Runbutton, and stopped by pressing the button again. To load a new simulation, use the File|Open menu option, and select a text file that contains data for the simulation you want to run.
Erasetoggles whether or not the planets are erased at each iteration. If this option is not checked then you can watch the trajectory of the planets over time.
Gridlinestoggles whether or not gridlines are displayed on the simulation canvas. Note that the spacing of the gridlines is specified in the simulation data file. If you turn off erasing, it is recommended that you also turn off gridlines.
Trackingallows you to select what object or point the display canvas is centered on. If you select
nothing, then the display will be centered on the coordinate (XCENTER,YCENTER) as specified in the simulation data file. If you select
center of mass, then the center of the display will always correspond to the center of mass of the system of particles. As you would expect, selecting a given planet centers the display on that planet.
Numerical Methodprovides several choices for the numerical method used by the simulation.
RK4stands for 4th-order Runge-Kutta integration, a fairly standard and accurate technique. It is the recommended default. However, the current implementation is slow. The
Eulermethod is a very simple numerical integration technique; the current implementation is fast, though not terribly accurate. Finally, the
dynamic RK4option makes the simulation use the Runge-Kutta method, but with a variable timestep. Only select this method if the
EPSILONparameter is defined in the current data file. This method is experimental and not recommended.
set file nameoption allows the user to select a file that data will be stored in. Selecting this option does not begin recording. Once these options are set, hitting the
start recordingbutton begins recording data to the specified file, assuming the simulation is running. Recording can be stopped at any time by hitting the
stop recordingbutton (this is just the
start recordingbutton with a different name). The output format is tab separated values, which makes importing into most useful programs (such as excel) straightforward.
Scaletext field controls the zoom factor of the display. Setting a higher number zooms in, and a lower number zooms out. Note that the initial value is always 100, which corresponds to 100% of the zoom factor set in the data file. Setting 200 in the text field gives twice the zoom listed in the data file. The
Time Stepfield controls the speed and accuracy of the simulation. The number can again be thought of as a percentage of the timestep listed in the data file. Setting a higher number makes the simulation go more quickly, but decreases accuracy. Setting a lower number slows the simulation, but increases accuracy.
#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.
EXPONENT, C1, C2, C3, C4, and
FORCEparameter 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
C1parameter, etc. The forces available are listed below with ther corresponding
FORCEflags. 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.
EXPONENTto -2 and c1 should be G, the gravitational constant.
FRICTIONflag. The flag currently accepts the values
D_CONST. The parameter
FC1is the constant parameter for the frictional forces, denoted fc1 below. The
D_CONSTforce is simply of the form $F_f = fc1*m1, so that it provides a constant acceleration in the direction opposite velocity. Of course,
D_NONEis used to model systems where no dissipative forces are present.
YCENTERshould each be followed by a floating point number designating the coordinate in the system frame where the display will be centered. Typically this is the coordinate of the largest planet, center of mass, or some similarly important point.
SCALEtakes a floating point value that specifies the number of pixels per unit distance. For example, if we have the earth orbiting the sun at 1 au, and specified the distance using these units, we could set
SCALEto 100 to have the earth drawn 100 pixels from the Sun. Note that
YCENTERspecify a coordinate transformation from the coordinate system of the simulated point masses, which can be in any units (meters, au, etc) to the computer screen coordinate system (which is in pixels).
TRACKINGsets the initial tracking option. Tracking controls how the program automatically updates the
TRACKINGflag should be followed by one of the options listed below:
PLANETNUMflag must also be given (on a different line) followed by the integer number of the planet. Note that planets are numbered from 0 to one less than the number of planets.
GRIDINTERVALin the same units used to specify the locations of the planets.
ERASEis false, the paths of the planets can be traced in time. However, the screen will quickly become messy. Note that it is usually preferable to set
GRIDto false before turning erasing off. Erasing should almost always be enabled initially.