Beruflich Dokumente
Kultur Dokumente
Introduction
Gravitational interaction between massive objects/bodies such as stars and planets
is described by Newtons law of gravity; and paths taken by these objects resulting
from such gravitational interaction can be described by Newtons second law and
kinematics.
G M1 M2
F12= r 12 , where
F12
Newtons law of gravity is r 312 is the force of object 2
on object 1,
r 12
is the vector pointing from object 1 to object 2, (
r 12 =
r 12 ,) M1
and M2 are the masses of objects 1 and 2 respectively, and G = universal
d v d r
The equations of motion are acceleration
a = v =
dt , velocity dt , where
r = position.
Given initial position and velocity conditions for all bodies, an analytic solution for
the paths of the bodies cannot be found in most cases. A numerical method that
can be used for solving such initial value problems is the Euler method, which is a
first-order technique. There are two types of Euler method, backward (implicit) and
forward (explicit). For example, in propagating the position of a body at time t n to its
position at time tn+1, the forward Euler method would use r (t ) = r (t ) + t
n+1 n
v (tn) (where t is some small time step), whereas the backward Euler method
Since only the gravitational force is considered, there will be two types of energy
present in the n-body system kinetic and gravitational potential. The gravitational
G M 1 M 2
potential energy between body 1 and body 2 can be given by r 12 (by
assuming the gravitational potential energy is 0 when the bodies are infinite
distance apart), where M1 and M2 are the masses of bodies 1 and 2 respectively, and
r12 is the radius between the bodies. There are (n2 ) (n choose 2) gravitational
Method
This program models a system in two dimensions on the x-y plane, where forces
only occur in the plane. The calculations could easily be extended for three or more
dimensions, however visualisation of such data would be difficult. The systems
analysed are part of the solar system, and thus can be approximated in a two-
dimensional model without much simplification. The program could also model as
many bodies as needed, though only two and three body systems are analysed
here.
The essential feature of the program is a loop that iterates through time, executing
once each t time step. Given the positions of all the bodies at the previous time
step, it will calculate for each body the x and y component of the net gravitational
force exerted on it (due to the other bodies) and therefore its acceleration. The
velocities of the bodies are then updated using the forward Euler method: v (tn+1)
= r (tn) + t a (tn), and the positions of the bodies are updated using the
backward Euler method: r (tn+1) = r (tn) + t v (tn+1), since v (tn+1) has just
been calculated. The initial conditions required for this program are thus the initial
positions and velocities of all bodies. A fixed time step was used (rather than an
adaptive one).
The output of the program is a static graph with vertical y-axis and horizontal x-axis,
showing all the positions the bodies took. Consecutive positions were joined linearly.
This was implemented using Python language, and was interpreted using iPython.
Graphs were generated using the mathplotlib.pyplot library.
These units were used to minimise round-off error to ensure the numbers appearing
in the program were not too small. It is a random error.
The Shell Theorem says that the gravitational field generated by a uniform
spherically-symmetric body is equivalent to that generated by a point mass at the
centre of the sphere. Also, the gravitational force experienced by an extended mass
can only be approximated by the force experienced by a point mass located at its
centre of mass; the accuracy of this approximation requires the spherical symmetry
of the body and the size of the body be at least an order of magnitude smaller than
the distance between the bodies exerting and experiencing the force.
Thus, the bodies modelled need to have approximately uniform density and
spherical symmetry in order to produce realistic results. This is satisfied for large
objects such as the Sun, Earth and Jupiter, however not so for smaller ones that
may take non-spherically-symmetric shapes (e.g. comet).
The bodies also need to be far apart for an additional reason: Newtonian gravity is
an inadequate description for the behaviour of bodies when strong gravitational
force is involved this could be due to either the proximity of bodies or their large
mass. (Newtonian gravity is also inaccurate when bodies are moving very fast, or
the gravitational field is changing quickly, however these concerns are less relevant
here.) The largest body in these simulations is the Sun, which has a diameter of
approximately 0.01 AU; thus any simulation subsequent to bodies passing within
0.1AU of the Sun should be considered inaccurate. This is a liberal constraint as
Newtonian gravity fails to model aspects of Mercurys orbit with an average radius
of 0.4AU.
speed, it was found that giving the Earth an initial position on the circle of radius
2
1AU around the Sun with 365.25 AU day-1 speed perpendicular to the direction of
the Sun, caused the Earth to indeed traverse a circular path around the Sun. This
occurred for both clockwise and anti-clockwise traversal. (See Appendix 1)
However, in a frame where the Earth has a circular orbit around the Sun at the
origin, it is not physically possible for the Sun to remain perfectly stationary as the
moving Earth will exert a gravitational force on it. Indeed, the simulations show an
initially stationary Sun moves in the direction of the initial velocity of Earth with
small circular motions. This effect is amplified in a two-body simulation with the Sun
and Jupiter. The exact mechanism for this behaviour is unclear, however
heuristically, it appears that the gravitational force of the planet pulls the Sun in the
direction that it initially travels (with a larger gravitational force resulting from a
larger mass pulling the Sun in that direction faster.)
The familiar behaviour of two bodies rotating around the barycentre of the system
can also be reproduced. (See Appendix 2)
Thus, the simulation produces behaviour that is physically plausible and consistent
with experiment.
Since the speed acquired by an initially stationary Sun is small enough that the
overall shape of the Earths orbit is unaffected, the Sun was set to be stationary at
the origin in the following analysis for simplicity. Furthermore, since the system
consists of two bodies, one of which is always initially located at the origin, it is
rotationally symmetric the path diagram produced for some initial position and
velocity conditions on the Earth that are rotated by x around the origin with
respect to some unrotated initial conditions will be the path diagram produced by
the unrotated initial conditions, rotated by x. (e.g. ) Thus it suffices to analyse the
system with the Earths initial position always at (1,0)AU.
The path diagrams in Appendix 3 show that when the Earth is given an initial
velocity perpendicular to the direction of the Sun (i.e. in the y direction), the semi-
major axis of the orbit is always along the x axis (and thus semi-minor parallel to
the y axis), regardless of the initial speed. If the initial speed (v i) is greater than the
critical speed for a circular orbit (vc), then the centre of the ellipse is to the left of
the origin, and if the vi < vc, the centre of the ellipse is to the right of the origin. A
heuristic explanation for this is that a high initial speed allows the Earth to travel
further away from the Sun before returning(, meaning the section of orbit path away
from the Earth is longer). Similarly, a low initial speed means the Earth cannot
travel as far from the Sun.
When the Earth is given an initial velocity with a non-zero x-component, the semi-
major axis of the orbit is no longer the x axis. What causes the direction of the semi-
major/minor axis is unclear and further investigation is required. (These preliminary
results show that for a given non-zero x-velocity-component, as the velocity-y-
component increases, the slope of the semi-major axis in the x-y plane decreases
and eventually becomes negative.)
Energy Conservation
Since we do not enforce energy conservation in the generation of the orbit path, the
extent to which our paths obey conservation of energy is a measure of the accuracy
of the program. The total energy of the modelled system can be calculated and
plotted with time. Periodic oscillations were found in all simulations, suggesting they
had a non-random cause. For circular orbits, those fluctuations in three-body Sun-
Jupiter-Earth systems were one order magnitude larger (10 -14) than those in the two-
body Sun-Earth system (10-15) (see Appendix 4). The cause of the energy oscillations
in the Sun-Earth system will be discussed here, with expected generalisation to
other systems. (The dependence of energy fluctuations on mass of the bodies in the
system, and whether there exists an upper limit on the fluctuations is a source of
further investigation.)
It was found that the period of the energy oscillations was approximately equal to
the period of Earths orbit. There were both peaks and dips in energy, with one peak
and dip per period, and magnitude of the peaks and dips were the same. If the
initial velocity of the Earth was perpendicular to the direction of the Sun, the energy
started at its average value. (Note that the following conclusions were drawn from
simulations with Earths initial position at (1,0)AU, however this can be generalised
to other cases using rotational symmetry as argued previously.) Furthermore, if v i >
vc, the energy dip occurs first, and if v i < vc, the energy peak occurs first.
This is consistent with the interpretation that an energy peak occurs when the Earth
approaches the Sun, and a dip occurs when the Earth leaves the Sun: If vi > vc, it
was found that the centre of the elliptical orbit path was to the left of origin, and
thus as the Earth moves anticlockwise (or indeed clockwise) around the ellipse from
the point (1,0)AU, its point of closest approach, it will move away from the Sun.
Whereas if if vi < vc and the centre of the ellipse is to the right of origin, the Earth
will approach the Sun as it leaves its initial position at (1,0)AU.
It is claimed that this is due to the nature of the backward Euler method creating
desynchronization between Earths velocity and radius. As stated, the positions of
bodies are updated as r (t ) = r (t ) + t v (t ), whereas the velocities of
n+1 n n+1
velocity of Earth is always slightly ahead of where it should be based on its location
in orbit. This might cause the gravitational potential energy to decrease before the
kinetic energy increases when the Earth leaves the Sun, resulting in an energy dip.
This explanation is consistent with the observation that for a given set of initial
conditions, the energy oscillations decrease in magnitude if t is decreased the
velocity and position of the Earth are more synchronised. (See Appendix 5)
It was found that non-circular orbits could produce energy fluctuations orders of
magnitude larger than those found in circular ones (10 -10). It is postulated that this is
due to the larger variation of kinetic and gravitational potential energy around the
orbit; the fluctuations still arise from the same desynchronization mechanism.
If the positions were instead updated using the forward Euler method, energy peaks
and troughs are not observed; there is an energy kick each time the Earth swings
past the Sun that is entirely unphysical. This is accompanied by an unstable orbit of
increasing radius. This potential for instability in implicit numerical methods such as
the forward Euler method make it unsatisfactory for modelling paths of bodies.
It may be supposed that energy fluctuations are due to inaccurate modelling of the
paths of the bodies (such that the correct path would produce a constant energy).
This can be used to estimate the discrepancy between our path and the correct
one. (Of course inaccurate body velocity may also be to blame, however since the
purpose of the simulation is to generate paths of bodies, we should conservatively
attribute all error in energy to error in path.) Also observe that energy is a function
of the distance between bodies, so we are unable to determine the correct path
using energy error alone.
An order-of-magnitude calculation shows that for Earths circular orbit,
G M1M2 G M1 M2
dE d
=
dr dr (
Kinetic Energy
r
= )
r2
r2 E 12 AU 2 4 1015 mu AU 2 day2
r= = 4 106 AU
G M 1 M 2 3 104 mu1 AU 3 day2 1 mu 3 106 mu
where r is taken to be the average radius of Earth from the Sun, 1AU. This scale of
discrepancy is negligible on the path diagrams generated, even for energy errors up
to 5 orders of magnitude larger.
The fluctuations in total energy do not grow noticeably, even up to 300,000 days,
which suggests that the resulting error in path is not cumulative. Thus it appears
safe to conclude that using the backward Euler method, inaccuracy of the program
revealed by energy non-conservation is negligible for the purposes of path
visualisation.
Note that this error should occur additionally to round-off error, since the
desynchronization of Earths velocity and radius acts equally on any velocity or
radius.
Limitations of program
The program fails to model the collision scenario, as well as behaviour when bodies
are in close proximity. Collisions cannot be modelled as the program treats the
bodies as point masses (and point particles cannot collide). This could be rectified
by assigning each point mass a radial size and joining two bodies together if their
distance apart is less than their joint radial size. This method can only be
dependable if the forces on the bodies are not so strong that the collision would
take place between time steps, and the bodies would only be modelled to jump
across each other on successive time steps this would require adaptive step size
(decreasing as the velocities of the bodies increase) to ensure. When initial
conditions should result in a collision, the current program would model unexpected
behaviour such as sudden change of direction. It is advisable to set an alert
triggered when the distance between any pair of objects drops below some
minimum, whereby the bodies can be assumed to have collided, and any
subsequent data must be discarded.
Conclusion
The shape of two-body orbits where one body was approximately stationary was
analysed using the Sun-Earth system, with the Earths initial position at (1,0)AU. It
was found that when the initial velocity of the Earth was perpendicular to the
direction of the Sun (i.e. the velocity was in the y direction), the elliptical orbit of the
Earth had semi-major axis along the x axis, whereas if the initial velocity had some
non-zero x component, the semi-major axis was tilted with respect to that direction.
Given that Earths initial velocity was in the y direction, if v i < vc, the centre of the
ellipse was to the right of the origin, and if v i > vc, the centre of the ellipse was to
the right of origin. These results hold under rotation of the co-ordinate system.
It was found that the program could reproduce the real Sun-Earth orbit. The
accuracy of the simulation was discussed with respect to energy conservation. It
was hypothesised that the shape of the energy graph was due to the effect of the
Euler method desynchronising the velocity and position of the bodies. It was found
that the error in the path diagram as revealed by energy non-conservation could be
deemed negligible. Other limitations of the program its simplifying assumptions,
inability to model collisions, and computational complexity were also briefly
discussed. The simulation can produce reasonable visualisations of the paths of
bodies when they are not in close proximity for t=0.01.
References
En.wikipedia.org. (2016). Newtonian limit. [online] Available at:
https://en.wikipedia.org/wiki/Newtonian_limit [Accessed 21 Oct. 2016].
2
Figure 1: Earth has initial position (1,0)AU, initial velocity (0, 365.25 ) AU day-1.
Sun has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.01
Appendix 2:
Figure 2: Movement of Sun. Earth has initial position (1,0)AU, initial velocity (0,
2
365.25 )AU day-1. Sun has initial position (0,0)AU and initial velocity (0,0)AU day -1.
t=0.01
Figure 3: Barycentric orbit. Earth has initial position (1,0)AU, initial velocity (0,
2
365.25 )AU day-1. Sun has initial position (0,0)AU and initial velocity (0,-5 *10 -8)AU
day-1. t=0.01
Appendix 3:
Figure 4: Earth has initial position (1,0)AU, initial velocity (0, 0.02 )AU day-1. Sun
has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.01
Figure 5: Earth has initial position (1,0)AU, initial velocity (0, 0.01 )AU day-1. Sun
has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.01
Figure 6: Earth has initial position (1,0)AU, initial velocity (0.012, 0.012 )AU day-1.
Sun has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.01
Appendix 4:
Figure 7: Earth has initial position (1,0)AU, initial velocity (0, 0.02 )AU day-1. Sun
has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.01
The scale for the Total energy vs time graph is read as follows: If the y coordinate
of the graph is y, then it corresponds to energy y * 10 -14 3.0362 * 10-10.
2
Figure 8: Earth has initial position (1,0)AU, initial velocity (0, 365.25 ) AU day-1.
5.25
Jupiter has initial position (5.2,0)AU, initial velocity (0, 365.2512 ). Sun has initial
Figure 9: Earth has initial position (1,0)AU, initial velocity (0, 0.02 )AU day-1. Sun
has initial position (0,0)AU and initial velocity (0,0)AU day -1. t=0.005
Figure 10: Velocity calculated using forward Euler method. Earth has initial position
(1,0)AU, initial velocity (0, 0.02 )AU day-1. Sun has initial position (0,0)AU and
initial velocity (0,0)AU day-1. t=0.01
Figure 11: Velocity calculated using forward Euler method. Earth has initial position
(1,0)AU, initial velocity (0, 0.02 )AU day-1. Sun has initial position (0,0)AU and
initial velocity (0,0)AU day-1. t=0.01