A model universe

W Roy Masefield,
Holland-on-Sea,			SPECTRUM
Essex.

THE MOTION of two bodies under the influence of gravity - the so-called two-body problem of
classical mechanics - lends itself very well to demonstration by computer. The mathematics
of the problem is quite straightforward, involving nothing more than Newton's Laws of Force
and Motion. The possible demonstrations include such things as the capture of one
astronomical body by another; orbits of satellites; behaviour of binary stars and so on, 
given only the starting data.

When the program is Run, the data is called for, and to give you some idea of suitable
values to start with, I suggest you try out those given in figures 1 to 5. Then, when you
get the feel of it, to try your own values. Angles, by the way, are entered in degrees - the
program converts these to radians as required by the ZX-Spectrum - with zero being the east
direction. Negative values for the angles are legitimate.

The initial positions of the two bodies are entered as x and y co-ordinates, these being the
normal pixel co-ordinates of the Spectrum, but do not go above x=170 because the right-hand
quarter of the screen is reserved for displaying the starting data. When all the data is
entered, the program starts to plot the paths. It is not fast, but fascinating to watch.
Plotting continues until one of the curves runs off the edge of the screen area, but
plotting can be stopped at any point by Break.

A look, now, at some of the possible demonstrations:

Figure 1: This shows a small mass orbiting a much larger one.

Figure 2: In this, a small body approaches a more massive body at an oblique angle to the
direction of the gravitational force. The larger body is initially at rest. The smaller body
is pulled out of its straight-line path and traces a near-parabola, and the larger body is
given some motion and it begins to trace out a curved path.

Figure 3: Binary stars are illustrated here. One star is larger than the other, and each has
been given the required tangential velocity for a circular orbit round the common centre of
gravity. Try other velocities and see what happens:

Figure 4: This is an Earth-Moon simulation. The larger body is given a velocity as if in 
orbit round the sun. As we are looking at only a short piece of this orbit, the lack of
curvature does not matter. The smaller mass is given the velocity calculated to keep it in
orbit, plus the velocity of the larger.

The resultant paths are fair approximations to what actually happens with the Earth-Moon
system; the moon performs a series of loops and the earth, because of the mutual
gravitational action, does a series of cycloid-like loops. Certainly, the Earth's path is
not a smooth one.

Figure 5: For fun, we may see what happens when the force of gravity is repulsive instead of
attractive, i.e., when we have the anti-gravity of science-fiction.

To do this, enter a negative value for the gravitational constant. The figure shows two
equal masses approaching each other almost, but not quite, in a direct line. See if you can
interpret what is happening if they 'are' in an exact head-on course.

Adventurous programmers might like to develop this program further by including action under
electric forces. In this case, instead of Fg, we shall have FE, which depends on the
electric charges (q) carried by the bodies:

						       kq1q2
						   FE= -----
							d2

The motions resulting from this force behave exactly as for gravitation, i.e., they depend
on the masses of the bodies.
