1. Initialize variables, read the data and parameter files
2. Calculate the force for each particle by direct summation. Using the PP method, this calculation can will take order of N^2 calculations. Use a softened force of the form F = GMm/(R^2 + eps^2) where eps is a fixed softening length. We will always use a small but finite softening length in these simulations. Assume G=1 for these calculations! Initial timesteps should be about 0.01.
3. Move the particles using a numerical integrator. A simple leap frog technique is satisfactory for this program. (Step v then step x.)
4. Calculate the total kinetic, potential and total energy for the system. Make sure you use a potential energy equation which corresponds to the softened point mass.
5. Calculate the change in the total energy of the system from the last time step. (Delta-E)
6. The program should be able to change timesteps based on changes in the systems total energy. Let FDE = ( abs(Delta-E)/abs(KE), abs(Delta-E)/abs(PE) ) This is an estimate of the fractional energy change of the system. We use the maximum of the two terms to prevent problems when the total energy is near zero. You do not have to consider changing the timestep for each particle
7. If FDE > delta-E-max, lower the time step by 1/2 and repeat the step.
8. If FDE < delta-E-min, raise the time step by 1.2 and continue with the program. The next step should be 20% larger.
9. You should be able to set the time step constant for each step also!!!!
10. update time, positions, and velocity using the numerical integrator.
11. Determine if you should output the data to a file. The data should be output at an interval delta-T-output. That is, the particle positions and velocites should be recorded at uniform TIME intervals.
12. Jump back to step 2 unless the number of interactions is greater than Nmax.
The format for the data file will be
(1x,710.3)
with the variables
x, y, z, vx, vy, vz, mass
1. You should plot the positions of the particles projected into the XY plane. Particles should be plotted with different symbols and plotted from the output data file at delta-T-output time intervals. You may use a series of plots for representing each time step OR plot particle trajectories on the x-y plane.
2. The total, kinetic, and potental energy should be plotted as a function of time for the simulation. This plot is an excellent debugging tool.
3. Graphics should NOT be built into the simulation code.
2. You should include instructions on how to compile this code. A "Makefile" would be nice, especially if you have multiple files and subprograms.
3. Graphics output may be created on any machine using any graphics package, and turned into a postscript file.
4. Written description and documentation may be created using any word processor or text formating program, and turned into a postscript file. Latex and TeX are also acceptable formats for documentation, as long as all auxilary files are included.
5. When you have completed the project, use the Unix tar command to create a single file which contains:
Hint: To create the tar file, put all your files into a single
directory on a unix machine. Go one level above this
directory and type
tar -cvf jwallin1.tar directory
The file jwallin1.tar is the name of the newly created tar file.
The tar file names should be your email account with a number
indicating the assignment number. To extract the file,
type
tar -xvf jwallin1.tar
6. Use anonymous ftp to leave the file in the pub/nbody directory of
galileo.gmu.edu