Program 12: How Planets form around the Sun

Introduction and Purpose

The purpose of this program is to simulate how planets are formed around the Sun. Planets are created from grains with mass 1.
Operation For simple operation: A shape of 0 will generate highly elliptical objects. After some time: Select 2 and C

The display shows:

  1. The Sun in the center.
  2. At the bottom of the screen all the objects with the masses >= 2
  3. At the top: Display limit value, Revolution counter and three values i, j and distance.
    Distance is the minimum value between the objects i and j. There is a collision when this value becomes less than 2.
When ever two objects collide the one with mass 2 will be shown.

In order to see all the objects: Select 1
In order to see the objects with mass => 2 : Select 2
In order to see the objects with mass => 9 : Select 9
In order to clear the screen : Select C
In order to terminate the simulation : Select E


Program: SOLAR.BAS source

In order to retrieve the source select:SOLAR.BAS
To see the program listing select:SOLAR.HTM


Technical Data

The whole simulation is based on Newton's Law.
The mass of the Sun is 1000. The mass of each object is 1 divided by the mass correction factor.
If an object is ejected a new one will be created. If two objects collide a new one will be created.


For further reading


Last modified: 12 March 1998

Back to my home page Contents of This Document