StarryOrbits GravSim

Introduction
Mark Ridler's Grav-Sim is a great way to get started in n-body simulations. It allows you to create your own starting star cluster models and then simulate their development under gravity. The following steps show how to achieve this. You should also refer to the Grav-Sim web site for more detailed instructions.

Installation
Go to the Grav-Sim web site and download the latest version of the Grav-Sim software. This is a zipped file that you can unpack into your choice of folder. We assume here that you choose c:\gravsim\.

Plummer Models
Plummer models are used to create the starting conditions for simulated star clusters and are described here. They contain the mass, position and velocities of each star at time zero.

To construct a 250 body Plummer model, open your Command Prompt window and navigate to your gravsim folder. Then enter the following text followed by the return key:

fastsim -g plummer -b 250 -r plummer250.csv

The Plummer model file plummer250.csv will be saved in your gravsim folder.

Cold Collapse Models
Cold collapse models are similar to Plummer models except that all initial velocities are set to zero.

To construct a 50 body Plummer model, open your Command Prompt window and navigate to your gravsim folder. Then enter the following text followed by the return key:

fastsim -g uniform -b 50 -r modeluniform50.csv

The cold collapse model file modeluniform50.csv will be saved in your gravsim folder.

Produce Orbit Files
Once you have your initial model file you can animate it. To do this open your Command Prompt window and navigate to your gravsim folder. Then enter the following text followed by the return key:

gravsim -f plummer250.csv -o orbit250x100.csv -m 100.0 -t "constant"

This will use the initial model file plummer250.csv and animate it for a time period of 100 units. Your simulation data will be saved in file orbit250x100.csv. Note the use of the command -t "constant". This is required for the current version of StarryOrbits.

Display Animations in StarryOrbits
First, you need to convert your Grav-Sim orbit file (with .csv extension) to StarryOrbits format (with .sof extension) as shown here.

StarryOrbits will then save your new file, reload it and display it.

You may want to run StarryOrbits with more memory as shown here if you are converting large files.

Speed Things up with Scripts
Entering commands in the Command Prompt window can be tedious and prone to error. You can speed things up by creating a batch file on your desktop. To do this, create a new text file on your desktop called gravsim.bat. Enter the following text in your file and save it.

c:

cd gravsim

start gravsim.exe -f model.csv -o orbit.csv -m 10.0 -t "constant"

You can then edit the model and orbit names to suit your simulation and then save the file. Double-clicking on the batch file will generate your orbit file.

You can generate similar batch files to generate your initial models.