VPNBody: Data Mode
Home > Data Mode
The first version of VPNBody produced only a visual output. To get numerical data, one needed the companion program, PNBody. The underlying code base was identical, but PNBody directed its output to comma-delimited files instead of the animation window. At the time, it made sense to do this. But with the redesign of the code, the advantages of merging the two programs became more obvious.
When running in data mode, VPNBody creates a subdirectory in the same directory from which the program is executed. The subdirectory and the data files stored in it are named in part after the current date and time. Thus, we avoid name conflicts between subdirectories and files. (MS-Excel will not open two files of the same name, even if they reside in different directories.)
To run VPNBody in data mode, simply change the argument of the MODE keyword in the input file from "Visual" to "Data" (without the quotes!). If we do this for the InnerPlanets.txt input file, also changing the DATA_STEP argument to 62.84 and the MAX_TIME argument to 62840, and taking Mercury out of the simulation (slows it down needlessly), we get the following subdirectory:
The directory name is based on the current date and time, and the name of the system (taken from the argument to the NAME keyword in the input file). In this example, the data files are stored in the subdirectory
In this subdirectory we find one data file for each object in the system, including the Sun. There is also README summary file, and a copy of the input file used to initiate the simulation. (There is no file for Mercury since we took it out of the simulation.)
Warning: you must not open the data files while the simulation is running, or you will create a file-sharing error between VPNBody and MS-Excel. The simulation will shut down as soon as it tries to write to the file you've opened. (This is true even if you open the file in 'read-only' mode.) Make a copy of the file you wish to inspect and open the copy instead of the original file.
The data files are written in comma-delimited (or comma-separated variables, CSV) format. They can be opened directly by MS-Excel, which can easily provide graphical representations of the data. For example, a graph of the relative energy error of a 10,000 sidereal year simulation of the inner planets looks like this:
We can also get graphical representations of the planetary orbits. The following graphs shows the evolution of the Earth's keplerian orbital elements (actually, it's for the Earth-Moon barycenter). These are screen-captures from MS-Excel, so the desktop cursor appears here-and-there.