VPNBody: Understanding the Input Files


Home > Input Files

VPNBody is driven by keyword-based input files. To create a new animation, you must create or edit an existing input file.

The following input file integrates the motion of the Earth and Jupiter around the Sun. It contains most of the keywords you will need to create your own input files. The line numbers that appear below are not part of the file. Do not use line numbers when creating your own input files.

Some general synxtax rules:

Other important notes:


1   NAME EarthJupiter
2   MODE Visual
3   FRAME Barycentric
4   TIME_STEP 0.10
5   DATA_STEP 2.00
6   MAX_TIME 628.4 # 100 sidereal years
7   METHOD CRO
8   ANIMATION_RATE 100
9
10  OBJECT Sun 1 Centered
11  COLOR 1 0 0
12
13  # The following data are actually for
14  # the Earth-Moon barycenter.
15
16  OBJECT EarthMoon 3.0401e-6
17  ELEMENTS 1.00000011 0.01671022 0.00005 102.94719 348.73936 100.46435
18  COLOR 0 0 1
19  ORBIT_COLOR 1 1 1
20
21  OBJECT Jupiter 9.5450e-4
22  ELEMENTS 5.20336301 0.04839266 1.30530 14.75385 100.55615 34.40438
23  COLOR 1 0 1
24  ORBIT_COLOR 1 1 1

The following notes explain the lines above, with keywords in CAPS:

  1. NAME specifies the name of the simulation.  When running in data mode, VPNBody will use the argument (EarthJupiter) to create the name of the subdirectory containing the data files and the name of the data file for the system.  It will also use a time-stamp to create the directory and file names.
  2. MODE selects the mode of the output.  The argument "Visual" directs VPNBody to create a 3-D animation using the VPython libraries.  The argument "Data" directs VPNBody to create data files which are stored in a subdirectory located in the same directory as the VPNBody code files.  The data files are written in comma-separated-variables (CSV) format, and can be read by MS-Excel.
  3. FRAME selects the display frame for the animation.  (This keyword is ignored when running in "Data" mode.)  The argument "Barycentric" specifies the center-of-mass reference frame, and is the default setting.  The argument "Heliocentric" selects a reference frame centered on the parent star.
  4. TIME_STEP specifies the time step for the integration scheme.
  5. DATA_STEP specifies how much (simulated) time passes before data is written to the output files.  (This keyword is required if running in "Data" mode, and ignored if running in "Visual" mode.)
  6. MAX_TIME specifies the maximum time for the simulation.
  7. METHOD the integration scheme.  Follow this link for a list of the available integration methods.

  8. ANIMATION_RATE specifies the speed of the animation.  Use a smaller argument to slow down the animation.  This is an optional keyword. 
  9. Blank.
  10. OBJECT creates one of the objects in the system. At least two arguments must follow: the name of the object and its mass. When running in "Data" mode, VPNBody uses the name of the object to create the filename for the output data file. A third argument is semi-optional and can be either "Centered" (indicates this object is the parent--at least one object in the system must be "Centered"), "Test" (indicates this is a test object that will not exert a gravitational force on any other objects in the system), or "Free" (indicates this is neither a parent nor planet).
  11. COLOR specifies the color of the displayed object when VPNBody is running in "Visual" mode.  (This keyword is ignored when VPNBody is running in "Data" mode.)  The three required arguments are the red, green, and blue color levels.
  12. Blank.
  13. A comment--all text after the pound sign (#) is ignored.
  14. Another comment.
  15. Blank.
  16. OBJECT. See note on line 10.
  17. ELEMENTS specifies the orbital elements for this object.  They must be listed in the following order:
    • semi-major axis
    • eccentricity
    • inclination
    • longitude of pericenter
    • longitude of ascending node
    • mean longitude

    Instead of the ELEMENTS keyword, you can use VECTORS and enter the three Cartesian coordinates of position and three components of velocity (all in the heliocentric reference frame).

  18. COLOR. See note on line 11.
  19. ORBIT_COLOR specifies the color of the orbit trail if VPNBody is running in "Visual" mode. (This keyword is ignored if VPNBody is running the "Data" mode.) The three required arguments are the red, green, and blue color levels.  No orbit trail is drawn if this keyword is omitted.
  20. Blank.
  21. OBJECT. See note on line 10.
  22. ELEMENTS. See note on line 17.
  23. COLOR. See note on line 11.
  24. ORBIT_COLOR. See note on line 19.