Challenge Team Interim Report
Team Number: 076 School Name: Santa Fe High School Area of Science: Earth and Space Sciences Project Title: The Study of Gravitation Influences in an N body system 



The majesty of the stars have long inspired people of all ages. A point of interest has been the orbits of these celestial bodies. The goal of our project is to create a computer simulation of the orbits of the bodies in a binary star system with n bodies. We are using Newton's Law of Gravitation to solve for gravity rather than Einstein's Generalized Theory of Gravitation. This is useful to astronomers who are studying the orbits of binary stars. It will aid in predicting if there is a planet in the system according to the accuracy of the predicted orbits versus the actual orbits of the two stars.
The program that was written to solve our problem will use a series of loops, one inside of the other to calculate gravity, force due to gravity, change in position, velocity, and to repeat this process indefinitely. The first action done by the program is to declare and then initialize the mass, velocity, and position of all objects within the star system. Then a do loop will be written that will continually call all functions and run all loops to recalculate the positions of all bodies within the system.
Inside this do loop there is a for loop i that runs one time for each body in the system. The for loop i calls all functions and loops to determine the change in position of object j. The first thing the i loop will do is call for loop j, which will find the force due to gravity, from that derive the acceleration due gravity for each object j and then together one sum acceleration. Loop i then takes the sum acceleration found by loop j and uses the projectile motion formula distance = average velocity * time. Average velocity is found by adding the final velocity (Vf = Vi + sum acceleration * time) and the initial velocity (which we declared earlier) and dividing by time. This process of running the i and j for loops is repeated within the do loop until the user exits the program.
To visually simulate the orbits of the binary star system we used the source code from a screen saver program. At this point we made two different versions of our program that utilize random number generators. The first version takes the longest orbit we have found so far, and adds a random number between +2 and 2 to the values of velocity and position. The second version of our program generates completely random positions and velocities for each body in the system. With both programs if any body gets of the range 300,000 to +300,000 from the origin in any axis (x, y, or z) a new position and velocity are randomly generated for that body. Every time a body is repositioned the program will output the length of the orbit, the initial velocity, and the initial position of all objects in the system to a file. Also, if an orbit goes for longer than 4000 seconds, the initial velocity and position of every body in the system will be saved to a file.
We are looking for a stable orbit for a three body system, and if we accomplish that, a four body system. That is the goal of the programs that randomly generate orbits. So far we have yet to find a stable orbit with three or more bodies, but we have found a stable orbit for a two body system and the initial values for the two suns in that stable orbit are used as the initial values for the suns in one of the programs that randomly generates position and velocity.
We expect to find a long orbit in a three body system, lasting at least one simulated earth year, or possibly a stable orbit. Then we will modify the program to output to a file a table recording the position, velocity, and sum force due to gravity affecting each body in each time step of that orbit. A graph of these results should be able to show the randomness of the orbit and show how it slowly deteriorates, or if it is a stable orbit, the repetitive motion of the bodies in all axes.
Team Members
Sponsoring Teachers
Project Advisor(s)