stability of motions near lagrange points in the elliptic...
TRANSCRIPT
1
MSC Computational Physics
Thesis
Stability of motions near Lagrange points in
the Elliptic Restricted Three Body Problem
Zografos Panagiotis
Supervising Professor:
Voyatzis George
Aristotle University of Thessaloniki
Faculty of Science, Department of Physics
2
Contents
Abstract__________________________________________________3
1. Introduction_____________________________________________4
2. Description of the Elliptic Restricted Three Body
Problem__________________________________________________6
A. Equations of Motion in the Inertial Barycentric
system__________________________________________________11
B. Equations of Motion in the Rotating system______________15
C. The Five Lagrange points of Equilibrium________________20
D. The Fast Lyapunov Indicator (FLI)_____________________27
3. The Stability of The Lagrange points of Equilibrium and Stability
range___________________________________________________28
A. Stability of the Lagrange points_______________________28
B. Regular orbits in the neighborhood of the Lagrange
points___________________________________________________33
C. Examination of the results____________________________97
D. Appreciation for Exoplanetary systems__________________99
4. Conclusions___________________________________________102
APPENDIX_____________________________________________103
References______________________________________________143
3
Abstract
The nature of stability of the Lagrange points has been
studied in the two-dimensional, elliptic restricted three body
problem. The regular regions near the neighborhoods of
Lagrange points 𝐿4 and 𝐿5 have been computed for different
values of the mass ratio μ and the orbital eccentricity e of the
primaries. It has been found that the volume of stability
regions decreases as both μ and e increase. The range of the
regular regions near 𝐿4 of 15 extrasolar planetary systems,
consisting of one star and one Jupiter-like planet, has been
calculated. Given a large enough regular region, there exists
the possibility of co-orbital companions or Trojan-like objects
in stable orbits around the triangular equilibrium points. A
system of rotating-pulsating coordinates has been used. The
equations of motion and the corresponding variational
equations have been integrated numerically using the Runge-
Kutta method of the 4th order. The nature of stability of the
Lagrange points has been calculated using the Floquet theory.
The range of the regular regions θ has been determined by
calculation of the Fast Lyapunov Indicators (FLI) for a grid of
initial conditions around 𝐿4 and 𝐿5. For the purposes of this
study several computer programs have been written using C
and C++ programming language.
4
1. Introduction
The elliptic restricted three body problem is a special case
of the three body problem. This means that one of the three
bodies has mass equal to zero, and that the other two bodies
move in Keplerian elliptic orbits. The purpose here is to study
the motion of the massless body under the gravitational
influence of the other two bodies. This study can be carried out
in two or three dimensions, but here we chose the former and
the simplest.
Unlike the “circular restricted three body problem” which
is a well-documented and simple dynamical system, the elliptic
problem is considerably more complicated and presents
different challenges in its study. This is due to the fact that the
elliptic problem is non-conservative, as the absence of the
energy integral adds numerous implications.
The interest of studying the elliptic problem stems from
the fact that it is a better approximation of the motions that
occur in the solar system in comparison to the circular
problem. For instance, the motion of the moon as it is affected
by the Sun and the Earth, or the motion of a satellite under the
influence of the Earth and the moon, are better studied by
using primaries moving in elliptic orbits.
The equations of motion of the elliptic problem differ
from those in the circular problem in three important places:
1. The elliptic problem contains two parameters
instead of one, the eccentricity e and the mass ratio
of the primary bodies μ.
2. The elliptic problem has no energy (Jacobi) integral.
3. The independent variable is present in the equations
of motion, even when rotating axes are used.
5
The details of the solution of the equations of motion and the
variational equations are discussed in Section 2.
This work concentrates on the nature of stability of the
triangular Lagrange equilibrium points 𝐿4 and 𝐿5, as well as
the stability of orbits in their neighboring regions for a large
number of μ and e (including cases of e=0) and different initial
conditions of the massless body. This work’s goal is to
determine the regions near the Lagrange points, where if the
massless body is left motionless (initial velocity components
equal to zero), it will follow a stable or regular orbit in the
neighborhood of the Lagrange points and not veer to infinity.
In order to accomplish this, the nature of stability of the five
Lagrange points - which according to Broucke (1969) falls into
seven categories - was calculated for different pairs of μ-e
using the Floquet theory. All of the above were made possible
by numerical integration of the equations of motion of the
elliptic problem in the rotating-pulsating frame of reference
using the Runge-Kutta method of the 4th order, as well as
integration of the variational equations.
The stability of the neighborhood of the Lagrange points
in the elliptic three-body problem is of great interest when the
problem is applied to exoplanetary systems (EPS). The vast
majority of extrasolar planetary systems that have been
discovered contain one Jupiter-like gas giant, their masses
ranging from 5𝑀⊕ up to several Jupiter masses (Schwarz,
Dvorak, Süli & Érdi, 2007). The importance of the stable
regions near the equilibrium points and especially near the
triangular Lagrange points 𝐿4 and 𝐿5 becomes apparent if one
poses the question of whether or not a Trojan-like planet may
move in a stable orbit around the aforementioned Lagrange
points. Even more importantly, can such planets be habitable?
“When astronomers look for life in EPS, they have to know the
location of the so-called habitable zone (HZ), which is defined
6
as a region around the star where the planet could receive
enough radiation to maintain liquid water on its surface and to
be able to build a stable atmosphere” (Schwarz, Dvorak, Süli
& Érdi, 2007). When the gas giant of an EPS moves into the
HZ, a habitable satellite could have a stable orbit (e.g. Titan
around Saturn), or a Trojan-like planet could exist in a stable
orbit near the 𝐿4 and 𝐿5 Lagrange points (Schwarz, Dvorak,
Süli & Érdi, 2007). The results of this work concerning the
regular regions near the equilibrium points, depending on the
mass ratio μ and the eccentricity e, are cross-examined with
known EPS in order to suggest possible candidate systems for
investigation of the possible existence of Trojan-like planets in
those systems.
The computer programs needed for the calculations were
written in C programming language. The results, diagrams and
data matrices are provided and discussed in Section 3.
2. Description of the Elliptic Restricted Three Body
Problem
In this section, the equations of motion of the elliptic
problem relative to different coordinate systems are presented.
The results of this study were obtained by numerical
integration of these equations in two dimensions.
Suppose a particle called the satellite is moving under the
gravitational influence of two massive bodies according to
Newton’s laws. The massive bodies are called the primaries.
All three objects are moving on the same plane. The problem
is defined as restricted because the satellite is massless
meaning that it can’t influence the motion of the primaries,
which move in elliptic Keplerian orbits relative to each other
7
or relative to their center of mass. Elliptic orbits with various
values of eccentricity e including e=0 (circular problem), are
considered in this study.
In the following, the equations of motion in an inertial
barycentric frame of reference will be presented, although the
most important calculations use rotating systems of
coordinates. At the initial value of the independent variable
(t=0), the primaries always lie on the x-axis at an apse, at
periapsis at minimum distance or apopsis at maximum distance
(Broucke, 1969). Also, a system of regular units is used in
such a way that the semi-major axis α and the mean motion n
of the motion of the primaries equals 1. In this case, the masses
of the primaries (including the gravitational constant) can be
written as
𝑚1 = 1 − 𝜇, 𝑚2 = 𝜇 <1
2. (1)
The distance between the primaries is
𝑟 = (1 − 𝑐𝑜𝑠𝐸) =𝑝
1 + 𝑒 𝑐𝑜𝑠𝑣 (2)
where E is the eccentric anomaly, v the true anomaly and
𝑝 = (1 − 𝑒2) (3)
8
is the semilatus rectum. In this barycentric system of
coordinates, the coordinates of the primaries are
𝜉1 = −𝜇 𝑟 𝑐𝑜𝑠𝑣 = −𝜇(𝑐𝑜𝑠𝐸 − 𝑒) (4𝑎)
𝜂1 = −𝜇 𝑟 𝑠𝑖𝑛𝑣 = −𝜇(1 − 𝑒2)12 𝑠𝑖𝑛𝐸 (4𝑏)
𝜉2 = (1 − 𝜇) 𝑟 𝑐𝑜𝑠𝑣 = (1 − 𝜇)(𝑐𝑜𝑠𝐸 − 𝑒) (4𝑐)
𝜂2 = (1 − 𝜇)𝑟 𝑠𝑖𝑛𝑣 = (1 − 𝜇)(1 − 𝑒2)12 𝑠𝑖𝑛𝐸 (4𝑑).
Kepler’s equation will be used to relate the eccentric
anomaly E with the time t:
𝑡 + 𝑥 = 𝐸 − 𝑒 𝑠𝑖𝑛𝐸 (5)
Here, the phase constant x is either equal to 0 (periapsis) or π
(apopsis). Equation (5) can be differentiated with respect to t to
produce the differential equation
𝑑𝐸
𝑑𝑡=
1
1 − 𝑒 𝑐𝑜𝑠𝐸 (6)
which is solved numerically in order to acquire E, which in
turn is used to calculate the coordinates of the primaries from
eq. (4).
A few more formulas relating to the motion of the
primaries are proven useful. The first and second derivatives of
r, v and E are
9
𝑟′ =𝑒 𝑠𝑖𝑛𝑣
𝑝12
=𝑒 𝑠𝑖𝑛𝐸
𝑟, 𝑟′′ =
𝑒 𝑐𝑜𝑠𝑣
𝑟2=𝑝 − 𝑟
𝑟3
𝑣′ =𝑝12
𝑟2, 𝑣′′ =
−2𝑒 𝑠𝑖𝑛𝑣
𝑟3 (7)
𝐸′ =1
𝑟, 𝐸′′ =
−𝑒 𝑠𝑖𝑛𝑣
𝑟2𝑝12
.
Using eq. (7), the energy integral of the two-body problem of
the primaries can be verified:
1
2(𝑟′2 + 𝑟2𝑣′2) −
1
𝑟= −
1
2. (8)
The above derivatives are notated with a prime to indicate
differentiation with respect to the time t. Later, the true
anomaly v will be used as the independent variable, and the
corresponding derivatives will be indicated by dots. The
derivatives of r with respect to v are
�̇� =𝑒𝑟2 𝑠𝑖𝑛𝑣
𝑝, �̈� =
2�̇�2
𝑟+ 𝑟 (1 −
𝑟
𝑝). (9)
The energy integral can then be written as
10
𝑝
2(�̇�2
𝑟+ 𝑟) −
1
𝑟= −
1
2. (10)
By combining eq. (10) and the second eq. (9), the following
differential equation for r is obtained:
�̈� = −2
𝑝𝑟3 +
3
𝑝𝑟2 − 𝑟. (11)
Eq. (11) can be used to determine r except when p=0 or e=1, in
which case eq. (1) has to be used, after solving Kepler’s
equation eq. (5) or (6). Also, since changes in the independent
variable from t to v will be made, the relation between the t-
derivatives and the v-derivatives of any given quantity F are
𝐹′ =𝑝12
𝑟2�̇�, 𝐹′′ =
𝑝(𝑟�̈� − 2�̇��̇�)
𝑟5. (12)
In the following sections, a special set of coordinates
(𝜉̅, �̅�) will be introduced. These are called “reduced” or
pulsating coordinates and they introduce a radial scale change
such that the elliptic motion of the primaries in the system
(𝜉, 𝜂) is transformed in a circular motion in the system (𝜉̅, �̅�)
(Broucke, 1969).The relation between the two sets is
proportional to r:
𝜉 = 𝑟𝜉̅, 𝜂 = 𝑟�̅�. (13)
11
The reduced coordinates of the primaries 𝑚1 and 𝑚2 are then
written as
𝜉1̅ = −𝜇 𝑐𝑜𝑠𝑣, 𝜂1̅̅̅ = −𝜇 𝑠𝑖𝑛𝑣
(14)
𝜉2̅ = (1 − 𝜇) 𝑐𝑜𝑠𝑣, 𝜂2̅̅ ̅ = (1 − 𝜇) 𝑠𝑖𝑛𝑣
and represent circular motion (with non-constant angular
momentum (Broucke, 1969).When r=0 or e=1 this
transformation cannot be used.
A. Equations of Motion in the Inertial Barycentric
system
As mentioned before, in this work most calculations were
made by using a “rotating” system of coordinates. However,
before the equations of motion of the satellite relative to this
system are presented, it is important to present the equations of
motion in the inertial barycentric system, as the transition to
the rotating system will be much easier. Theoretically, the
results of this study can be obtained by solely using the inertial
system, although the calculations are much less convenient.
In the inertial barycentric frame of reference, the equations
of motion of the satellite are derived from the Lagrangian
function
𝐿 =1
2(𝜉′2 + 𝜂′2) +
1 − 𝜇
𝑠1+𝜇
𝑠2. (15)
12
The distances between the satellite and the primaries 𝑚1 and
𝑚2 respectively are
𝑠12 = (𝜉 − 𝜉1)
2 + (𝜂 − 𝜂1)2
(16)
𝑠22 = (𝜉 − 𝜉2)
2 + (𝜂 − 𝜂2)2
If 𝑞𝑗 and 𝑞�̇� denote the generalized positions and generalized
velocities respectively such that
𝑞1 = 𝜉, 𝑞2 = 𝜂
(17)
𝑞1̇ = 𝜉′, 𝑞2̇ = 𝜂′
then by using the equation
𝑑
𝑑𝑡(𝜕𝐿
𝜕𝑞�̇�) −
𝜕𝐿
𝜕𝑞𝑗= 0 (18)
(Hadjidemetriou, 2000)
the equations of motion are thus
𝜉′′ = −(1 − 𝜇)(𝜉 − 𝜉1)
𝑠13 −
𝜇(𝜉 − 𝜉2)
𝑠23
(19)
𝜂′′ = −(1 − 𝜇)(𝜂 − 𝜂1)
𝑠13 −
𝜇(𝜂 − 𝜂2)
𝑠23 .
Lagrangian eq. (15) is non-conservative because it explicitly
contains the independent variable t through 𝑠1 and 𝑠2.
According to Broucke (1969) using the true anomaly v as
the independent variable, the Lagrangian equation would
change to
13
𝐿 =𝑟2
𝑝12
𝐿 =𝑝12
2𝑟2(𝜉2̇ + 𝜂2̇) +
𝑟2
𝑝12
(1 − 𝜇
𝑠1+𝜇
𝑠2). (20)
If the “reduced” or “pulsating” coordinates (𝜉,̅ �̅�) are used,
according to eq. (13), and
𝜉′ = 𝑟′𝜉̅ + 𝑟𝜉 ′̅, 𝜉̇ = �̇�𝜉̅ + 𝑟𝜉̅̇
(21)
𝜂′ = 𝑟′�̅� + 𝑟𝜂′̅, 𝜉̇ = �̇��̅� + 𝑟�̇̅�
the Lagrangian equations in eqs. (15) and (20) can be
transformed accordingly to
𝐿 =𝑟2
2(𝜉 ′̅
2+ 𝜂′̅
2) + 𝑟𝑟′(𝜉�̅� ′̅ + �̅��̅�′) +
𝑟′2
2(𝜉2̅̅ ̅ + 𝜂2̅̅ ̅)
+1
𝑟′(1 − 𝜇
𝑟1+𝜇
𝑟2) (22)
𝐿 =𝑝12
2(𝜉̅2̇ + �̅�2̇) +
𝑝12�̇�
𝑟(𝜉̅𝜉̅̇ + �̅��̇̅�) +
𝑝12
2
�̇�2
𝑟2(𝜉2̅̅ ̅ + 𝜂2̅̅ ̅)
+𝑟
𝑝12
(1 − 𝜇
𝑟1+𝜇
𝑟2) (23)
where
𝑟12 = (𝜉̅ − 𝜉1̅)
2+ (�̅� − 𝜂1̅̅̅)
2 =𝑠12
𝑟2
𝑟22 = (𝜉̅ − 𝜉2̅)
2+ (�̅� − 𝜂2̅̅ ̅)
2 =𝑠22
𝑟2. (24)
14
Dividing eq. (23) by 𝑝1
2 and substituting �̇� by its value from eq.
(9), the Lagrangian transforms into
𝐿 =1
2(𝜉̅2̇ + �̅�2̇) +
𝑒 𝑟 𝑠𝑖𝑛𝑣
𝑝(𝜉�̅�̅̇ + �̅��̇̅�)
+𝑒2 𝑟2 sin2 𝑣
2𝑝2(𝜉̅2 + �̅�2) +
𝑟
𝑝(𝑚1𝑟1+𝑚2𝑟2). (25)
Eq. (25) can be replaced by a simpler Lagrangian by
subtracting the following exact differential, which by taking
into account eq. (2) and eq. (9) is
𝑑
𝑑𝑣(𝑒 𝑟 𝑠𝑖𝑛𝑣
2𝑝(𝜉2̅̅ ̅ + 𝜂2̅̅ ̅))
=𝑒 𝑟 𝑠𝑖𝑛𝑣
𝑝(𝜉̅𝜉̅̇ + �̅��̇̅�) +
𝑒2 𝑟2 sin2 𝑣
2𝑝2(𝜉̅2 + �̅�2)
+1
2(1 −
𝑟
𝑝) (𝜉̅2 + �̅�2), (26)
from eq. (25). The above exact differential can be safely
omitted from the Lagrangian without change in the equations
of motion. Thus, the simplified Lagrangian is
𝐿 =1
2(𝜉2̅̅ ̅̇ + 𝜂2̅̅ ̅̇) +
1
2(𝑟
𝑝− 1) (𝜉2̅̅ ̅ + 𝜂2̅̅ ̅)
+𝑟
𝑝(𝑚1𝑟1+𝑚2𝑟2). (27)
The equations of motion in the “inertial barycentric pulsating”
frame of reference, with the true anomaly v as independent
variable, are thus
15
𝜉̅̈ = (𝑟
𝑝− 1) 𝜉̅ −
𝑟
𝑝(𝑚1(𝜉̅ − 𝜉1̅)
𝑟13 +
𝑚2(𝜉̅ − 𝜉2̅)
𝑟23 )
(28)
�̈̅� = (𝑟
𝑝− 1) �̅� −
𝑟
𝑝(𝑚1(�̅� − 𝜂1̅̅̅)
𝑟13 +
𝑚2(�̅� − 𝜂2̅̅ ̅)
𝑟23 )
The forces which are present in the last equations of
motion, eq. (28), contain three terms: an apparent radial force
that comes only from the radial scale change of the coordinate
system, and 𝑚1 and 𝑚2, which are, of course, the Newtonian
attraction potential from the two primaries.
B. Equations of motion in the Rotating system
Now, the equations of motion in a rotating barycentric
system are presented. The angle of rotation is the true anomaly
v. The angular velocity of the axes are time dependent, unless
the eccentricity e equals zero (Broucke, 1969). The equations
of motion will be written both with time t and the true anomaly
v as independent variable, in ordinary and in pulsating
coordinates. The equations of motion written in rotating
pulsating coordinates and with the true anomaly v as the
independent variable provide certain advantages, which will be
discussed later, and this is the reason they were chosen for the
calculations.
The ordinary rotating coordinates (�̅�, �̅�) are related to the
inertial coordinates (𝜉, 𝜂) by
16
𝜉 = �̅� 𝑐𝑜𝑠𝑣 − �̅� 𝑠𝑖𝑛𝑣
(29)
𝜂 = �̅� 𝑠𝑖𝑛𝑣 + �̅� 𝑐𝑜𝑠𝑣
The rotating coordinates simplify things by keeping the two
primaries 𝑚1 and 𝑚2 on the x-axis permanently. Their
coordinates in this system are
𝑥1̅̅̅ = −𝜇 𝑟, 𝑦1̅̅ ̅ = 0
(30)
𝑥2̅̅ ̅ = (1 − 𝜇) 𝑟, 𝑦2̅̅ ̅ = 0
These coordinates are not constant; the two primaries are
oscillating on the x-axis (Broucke, 1969). Lagrangian eq. (15)
combined with eqs. (29) transforms into
𝐿 =1
2(𝑥′2̅̅ ̅̅ + 𝑦′2̅̅ ̅̅ ) + (�̅�𝑦 ′̅ + �̅�𝑥 ′̅)𝑣′ +
1
2(𝑥2 + 𝑦2)𝑣′2
+ (𝑚1𝑠1+𝑚2𝑠2) (31)
and the equations of motion derived from this Lagrangian are
17
𝑥′′̅̅̅̅ − 2𝑦 ′̅𝑣′ − �̅�𝑣′′ − �̅�𝑣′2
= −(1 − 𝜇)(�̅� − 𝑥1̅̅̅)
𝑠13 −
𝜇(�̅� − 𝑥2̅̅ ̅)
𝑠23 (32𝑎)
𝑦′′̅̅̅̅ − 2𝑥 ′̅𝑣′ − �̅�𝑣′′ − �̅�𝑣′2 = −(1 − 𝜇)�̅�
𝑠13 −
𝜇�̅�
𝑠23 . (32𝑏)
The above equations will be transformed to the desired
form by writing them using rotating-pulsating coordinates
(x,y). These coordinates are defined in the same way as eq.
(13):
�̅� = 𝑟𝑥, �̅� = 𝑟𝑦 (33)
Lagrangian eq. (31) transforms in the new form
𝐿 =𝑟2
2(𝑥′2 + 𝑦′2) + 𝑟𝑟′(𝑥𝑥′ + 𝑦𝑦′) + 𝑝
12(𝑥𝑦′ − 𝑦𝑥′)
+1
2(𝑟′2 +
𝑝
𝑟2) (𝑥2 + 𝑦2) +
1
𝑟(𝑚1𝑟1+𝑚2𝑟2) (34)
and the corresponding equations of motion are written as
𝑟2𝑥′′ − 2𝑦′𝑝12 + 2𝑟𝑟′𝑥′ −
1
𝑟𝑥
= −1
𝑟(𝑚1(𝑥 − 𝑥1)
𝑟13 +
𝑚2(𝑥 − 𝑥2)
𝑟23 ) (35𝑎)
𝑟2𝑦′′ − 2𝑥′𝑝12 + 2𝑟𝑟′𝑦′ −
1
𝑟𝑦 = −
1
𝑟(𝑚1𝑦
𝑟13 +
𝑚2𝑦
𝑟23 ) (36𝑏)
18
The above equations of motion are written with time t as
the independent variable, but they can be simplified if the true
anomaly v is used as the independent variable instead. This
change in variable is done by using the expression of 𝑣′ of eq.
(7), and in the same way it was used to obtain the Lagrangian
eq. (20). By subtracting the exact derivative, as in eqs. (26),
(27),
𝑑
𝑑𝑣(1
2
�̇�
𝑟(𝑥2 + 𝑦2)) (37)
and dividing the Lagrangian equation by 𝑝1
2, then eq. (34)
finally transforms into
𝐿 =1
2(�̇�2 + �̇�2) + (𝑥�̇� − 𝑦�̇�)
+𝑟
𝑝[1
2(𝑥2 + 𝑦2) +
𝑚1𝑟1+𝑚2𝑟2] (35).
The corresponding equations of motion are thus
�̈� − 2�̇� =𝑟
𝑝(𝑥 −
𝑚1(𝑥 − 𝑥1)
𝑟13 −
𝑚2(𝑥 − 𝑥2)
𝑟23 )
(36)
�̈� + 2�̇� =𝑟
𝑝(𝑦 −
𝑚1𝑦
𝑟13 −
𝑚2𝑦
𝑟23 ).
19
The Lagrangian eq. (35) and its equations of motion (36),
present the unique advantage that they differ only by a factor
of 𝑟
𝑝=
1
1+𝑒 𝑐𝑜𝑠𝑣 from the Lagrangian and classical equations of
motion of the circular restricted three body problem. They
have also been used in the study of orbits near the equilibrium
points in this work.
It is important to note that since the numerical integration
of eqs. (36) was achieved using the Runge-Kutta 4 method, the
system of equations (36) was altered slightly in such a way that
instead of containing two second order differential equations, it
contained four first order differential equation. This was easily
done using the following substitutions:
𝑢𝑥 = �̇�, 𝑢�̇� = �̈�
(37)
𝑢𝑦 = �̇�, 𝑢�̇� = �̈�
The system (36) using eqs. (37) transforms into
�̇� = 𝑢𝑥
𝑢�̇� − 2𝑢𝑦 =𝑟
𝑝(𝑥 −
𝑚1(𝑥 − 𝑥1)
𝑟13 −
𝑚2(𝑥 − 𝑥2)
𝑟23 )
(38)
�̇� = 𝑢𝑦
𝑢�̇� + 2𝑢𝑥 =𝑟
𝑝(𝑦 −
𝑚1𝑦
𝑟13 −
𝑚2𝑦
𝑟23 )
20
where 𝑢𝑥 , 𝑢𝑦 are, of course, the satellites velocity components.
The systems (36) and (38) of differential equations are
equivalent.
C. The five Lagrange points of Equilibrium
The five Lagrange points (equilibrium points) are present
both in the circular and in the elliptic three body problem. At
these points, the satellite remains in the same position relative
to the primaries if no other forces are applied to it (i.e. the
force field at these points is zero). The study of the five
Lagrange points, their stability as well as their neighborhoods
was made mainly by using the rotating-pulsating coordinates
(x, y), but the inertial coordinates (ξ, η) can also be used.
In the rotating-pulsating frame of reference, the Lagrange
points are fixed (Broucke, 1969). From the equations of
motion (36), it is clear that there are five particular solutions
with constant coordinates and with �̈� = �̈� = �̇� = �̇� = 0. These
constant coordinates are solutions to the equations of motion
by setting their right side equal to zero. From eqs. (36) we
obtain
𝑥 −𝑚1(𝑥 − 𝑥1)
𝑟13 −
𝑚2(𝑥 − 𝑥2)
𝑟23
= 𝑥 (1 −1 − 𝜇
𝑟13 −
𝜇
𝑟23) + 𝜇(1 − 𝜇) (
1
𝑟23 −
1
𝑟13)
= 0 (39𝑎)
𝑦 −𝑚1𝑦
𝑟13 −
𝑚2𝑦
𝑟23 = 𝑦 (1 −
1 − 𝜇
𝑟13 −
𝜇
𝑟23) = 0 (39𝑏)
21
In the above equations 𝑚1, 𝑚2 were replaced by
𝑚1 = 1 − 𝜇, 𝑚2 = 𝜇 (40)
and 𝑥1, 𝑥2 were replaced by their values in the rotating-
pulsating system:
𝑥1 = −𝜇, 𝑥2 = 1 − 𝜇. (41)
The case where the eccentricity 𝑒 = 1 has been excluded
because in the rotating-pulsating system of coordinates r must
be always different from zero. The eqs. (39) are the same
equations one would arrive at in the study of the classical
circular three-body problem (Broucke, 1969). The first two
equilibrium solutions are easily found from eqs. (39) if 𝑟1 =
𝑟2 = 1. Since the distances between the primaries and the
satellite are
𝑟12 = (𝑥 − 𝑥1)
2 + 𝑦2
(42)
𝑟22 = (𝑥 − 𝑥2)
2 + 𝑦2
solving the system (42) for 𝑟1 = 𝑟2 = 1 provides the
coordinates of the 𝐿4 and 𝐿5 Lagrange points which
correspond to the equilateral triangle configurations with the
two primaries. They are thus:
22
𝐿4: 𝑥4 =1
2(1 − 2𝜇), 𝑦4 = +
312
2
(43)
𝐿5: 𝑥5 =1
2(1 − 2𝜇), 𝑦5 = −
312
2
The other three solutions of eq. (39) are 𝐿1, 𝐿2 and 𝐿3.
These are called collinear equilibrium points because they lie
on the syzygy-axis (the line of the primaries) where y=0
(Broucke, 1969).
Their abscissa x therefore is root of equation
𝑓(𝑥) ≡ −𝑥 + (1 − 𝜇)(𝑥 − 𝑥1)
𝑟13 + 𝜇
(𝑥 − 𝑥2)
𝑟23 (44)
where
𝑟13 = |𝑥 − 𝑥1|
3
(45)
𝑟23 = |𝑥 − 𝑥2|
3
Equation (44) has one root in each of the three intervals on
both sides of 𝑚1 and 𝑚2 and between them. This is easily
verifiable if one looks at the derivative of f(x):
23
𝑑𝑓(𝑥)
𝑑𝑥= −1 −
2(1 − 𝜇)
|𝑥 − 𝑥1|3−
2𝜇
|𝑥 − 𝑥2|3< 0. (46)
Since the derivative is negative in each interval, f(x) is
monotonously decreasing from +∞ to −∞ in each interval
thus crossing the x-axis. In order to obtain the abscissae of the
𝐿1, 𝐿2, 𝐿3 Lagrange points, eq. (44) was numerically solved
using the Newton-Raphson method. The following figure show
the change in 𝑥𝐿1, 𝑥𝐿2, and 𝑥𝐿3 with respect to the mass ratio μ.
Figure 1: Change in 𝒙𝑳𝟏, 𝒙𝑳𝟐, 𝐚𝐧𝐝 𝒙𝑳𝟑 with respect to the
mass ratio μ. The mass ratio is between 𝟎. 𝟎𝟎𝟎𝟏 < 𝝁 < 𝟎. 𝟓
and the eccentricity is e=0.2.
As aforementioned, the purpose of this work is to study
the neighborhood of the Lagrange points of equilibrium, in
order to determine the stability of these points as well as the
stability of their neighborhoods. To achieve this, the equations
of motion, eqs. (36), must be linearized in the neighborhood of
0.2 0.4 0.6 0.8xL1
0.1
0.2
0.3
0.4
0.5
mu
1.05 1.10 1.15 1.20 1.25xL2
0.1
0.2
0.3
0.4
0.5
mu
1.15 1.10 1.05 1.00xL3
0.1
0.2
0.3
0.4
0.5
mu
24
the Lagrange points in order to obtain the so-called first order
variational equations (Broucke, 1969). Eqs. (36) are written in
the form
�̈� − 2�̇� −𝑟
𝑝𝑥 =
𝑟
𝑝𝑈𝑥
(47)
�̈� + 2�̇� −𝑟
𝑝𝑦 =
𝑟
𝑝𝑈𝑦
where U is the potential function
𝑈 =1 − 𝜇
𝑟1+𝜇
𝑟2. (48)
The subscripts x and y in U are used to represent the partial
derivatives of U.
The variational equations derived from eqs. (47) are
written as
𝛿�̈� − 2𝛿�̇� −𝑟
𝑝𝛿𝑥 =
𝑟
𝑝(𝑈𝑥𝑥𝛿𝑥 + 𝑈𝑥𝑦𝛿𝑦)
(49)
𝛿�̈� + 2𝛿�̇� −𝑟
𝑝𝛿𝑦 =
𝑟
𝑝(𝑈𝑦𝑥𝛿𝑥 + 𝑈𝑦𝑦𝛿𝑦)
25
Again, as with the equations of motion (36), the variational
equations (49) were numerically integrated using the Runge-
Kutta of the 4th order method. For this reason, the system (49)
was transformed to include four first-order differential
equations, in a similar way as eqs. (38). This transformed
system is written as
𝛿�̇� = 𝛿𝑢𝑥
𝛿𝑢�̇� − 2𝛿𝑢𝑦 −𝑟
𝑝𝛿𝑥 =
𝑟
𝑝(𝑈𝑥𝑥𝛿𝑥 + 𝑈𝑥𝑦𝛿𝑦)
(50)
𝛿�̇� = 𝛿𝑢𝑦
𝛿𝑢�̇� + 2𝛿𝑢𝑥 −𝑟
𝑝𝛿𝑦 =
𝑟
𝑝(𝑈𝑦𝑥𝛿𝑥 + 𝑈𝑦𝑦𝛿𝑦)
Equations (49) are a system of linear differential equations
with nonconstant periodic coefficients, due to factor r, which
depends on the cosine of the true anomaly v. In the circular
three-body problem, the respective system would have
constant coefficients since 𝑟 = 1. This principal difference
between the circular and the elliptic problem, makes the study
of the latter a more difficult proposition, thus a more complex
method is required in order to study the variational equations
in the elliptic problem. The Floquet theory was used, in order
to determine the stability of the Lagrange points. Omitting the
details of the theory, a 4x4 monodromy matrix D is obtained
by integrating the variational equations for a single period of
the true anomaly v (0 < 𝑣 < 2𝜋) using the following initial
conditions for the variational equations:
𝛿𝑥(0) = 1, 𝛿𝑦(0) = 0, 𝛿𝑢𝑥(0) = 0, 𝛿𝑢𝑦(0) = 0 (51)
26
At 𝑣 = 2𝜋 the integration of the variational equations yields
𝛿𝑥(2𝜋) = 𝛿𝑥1, 𝛿𝑦(2𝜋) = 𝛿𝑦1,
(52)
𝛿𝑢𝑥(2𝜋) = 𝛿𝑢𝑥1, 𝛿𝑢𝑦(2𝜋) = 𝛿𝑢𝑦1
The integration of system (50) was repeated three more times,
each time changing the place of unity in the initial conditions
(51). For instance, the second integration would use
𝛿𝑥(0) = 0, 𝛿𝑦(0) = 1, 𝛿𝑢𝑥(0) = 0, 𝛿𝑢𝑦(0) = 0 (53)
in order to obtain
𝛿𝑥(2𝜋) = 𝛿𝑥2, 𝛿𝑦(2𝜋) = 𝛿𝑦2,
(54)
𝛿𝑢𝑥(2𝜋) = 𝛿𝑢𝑥2, 𝛿𝑢𝑦(2𝜋) = 𝛿𝑢𝑦2
and so forth. The monodromy matrix D is thus constructed in
the following way:
𝐷 = (
𝛿𝑥1 𝛿𝑥2𝛿𝑦1 𝛿𝑦2
𝛿𝑥3 𝛿𝑥4𝛿𝑦3 .
𝛿𝑢𝑥1 𝛿𝑢𝑥2𝛿𝑢𝑦1 𝛿𝑢𝑦2
. .
. .
) (55)
27
The stability of any point is then determined by numerically
calculating the eigenvalues and their magnitudes of the
monodromy matrix D using the widely used QR algorithm.
The QR algorithm has its basis on the QR decomposition,
in which a matrix A is decomposed to a product A=QR of an
orthogonal matrix Q and an upper triangular matrix R.
Formally, let A be a real matrix of which we want to compute
the eigenvalues, and let A0:=A. At the k-th step (starting with k
= 0), we compute the QR decomposition 𝐴𝑘 = 𝑄𝑘𝑅𝑘 where 𝑄𝑘
is an orthogonal matrix (i.e., QT = Q−1) and 𝑅𝑘 is an upper
triangular matrix. We then form 𝐴𝑘+1 = 𝑅𝑘𝑄𝑘 . Note that
𝐴𝑘+1 = 𝑅𝑘𝑄𝑘 = 𝑄𝑘−1𝑄𝑘𝑅𝑘𝑄𝑘 = 𝑄𝑘
−1𝐴𝑘𝑄𝑘 = 𝑄𝑘𝑇𝐴𝑘𝑄𝑘 so all
the 𝐴𝑘 are similar and hence they have the same eigenvalues.
The algorithm is numerically stable because it proceeds by
orthogonal similarity transforms. Under certain conditions, the
matrices 𝐴𝑘converge to a triangular matrix. The eigenvalues of
a triangular matrix are listed on the diagonal, and the
eigenvalue problem is solved.
All the above calculations were made for many different
values for the mass ratio μ and the eccentricity e. The results
and the kinds of stability of the Lagrange points are discussed
in Section 3.
D. The fast Lyapunov indicator (FLI)
The regions near the Lagrange points of equilibrium are of
great interest and part of this work focuses on finding the parts
of these regions which produce regular satellite orbits. This is
again accomplished by integrating the equations of motion
(38) and the variational equations (50) together for initial
conditions that correspond to the neighboring region of the
Lagrange points, this time calculating for every single orbit the
so-called fast Lyapunov indicator or FLI.
28
The FLI is a great tool which allows the identification of
regular and chaotic orbits. The FLI accomplishes this by
measuring the mean exponential distancing of a neighboring
orbit to a control orbit (Voyatzis & Meletlidou, 2015). There
are many formulas that define FLI, but the following was used:
𝐹𝐿𝐼(𝑣)
= log
(
√𝛿𝑥(𝑣)2 + 𝛿𝑦(𝑣)2 + 𝛿𝑢𝑥(𝑣) + 𝛿𝑢𝑦(𝑣)
𝑣
)
(56)
For a regular orbit of the system, the FLI increases in value at
a slow rate as 𝑣 → ∞. On the other hand, for a chaotic orbit
the FLI increases at a much faster rate. Therefore, after a
comparatively small interval of the independent variable v, the
FLI either has a small value, indicating a regular orbit or it has
a large value which indicates a chaotic orbit (Voyatzis &
Meletlidou, 2015).
3. The Stability of The Lagrange points of Equilibrium
and their Neighborhoods
A. Stability of the Lagrange points
The stability of the Lagrange points will be discussed. As
shown in Section 2C, the type of stability of any point can be
calculated by constructing a monodromy matrix D by
29
integrating the variational equations (50) as indicated by the
Floquet theory. The stability then depends upon the
corresponding eigenvalues of the monodromy matrix D,
𝜆1, 𝜆2, 𝜆3, 𝜆4.
Of particular interest are, of course, the Lagrange points of
equilibrium and for which combinations of the mass ratio μ
and the eccentricity e they present linear stability. It is well
known that the collinear Lagrange points 𝐿1, 𝐿2, 𝐿3 found in
the circular three body problem, show instability for any
combination of the values of μ and e (Szebehely, 1967). This
fact persists in the elliptic problem and as a result, only the
triangular Lagrange points 𝐿4, 𝐿5 were tested for linear
stability.
The four eigenvalues, which can be real or complex
numbers, of the 4x4 monodromy matrix D are found not to be
independent of one another. It is proved that the eigenvalues
form reciprocal pairs. If e.g. 𝜆1 ∈ ℝ then 𝜆2 = 1/𝜆1 is also an
eigenvalue. Also if 𝜆1 = 𝑎 + 𝑖𝑏 ∈ ℂ then 𝜆2 = 𝑎 − 𝑖𝑏 is also
an eigenvalue. Depending on the place of the four eigenvalues
on the unit circle, there exist seven stability regions. The six
are unstable regions and one is stable. The stable region
corresponds to the eigenvalues that are on the unit circle.
The seven stability regions and the properties of their
eigenvalues are described in Table 1.
30
Table 1: Properties of the seven stability regions
Region Properties of
eigenvalues
𝝀,𝟏
𝝀, 𝝁,
𝟏
𝝁
Remarks Properties of
Orbits
1 �̅� = 1/𝜆,�̅� = 1/𝜇 (λ and μ
complex with
|𝜆| = |𝜇| =1)
All four on
unit circle
Stability
2 �̅� = 𝜇,�̅� = 𝜆
(λ and μ
complex)
Not on unit
circle
Complex
instability
3 λ real, μ real
𝜆𝜇 < 0
Two positive
and two
negative
Even-odd
instability
4 λ real >0
μ real >0
Four real
positive
Even-even
instability
5 λ real <0
μ real <0
Four real
negative
Odd-odd
instability
6 λ real >0
μ complex
�̅� = 1/𝜇
Two real
positive and
two complex
on unit circle
Even-semi-
instability
7 λ complex
�̅� = 1/𝜆
μ real <0
Two real
negative and
two complex
on unit circle
Odd-semi-
instability
(Broucke, 1969).
31
Figure 2: Eigenvalue configuration for stability regions
λ
1/λ
μ
1/μ
1.0 0.5 0.5 1.0x
1.0
0.5
0.5
1.0
y
Region 1
λ
μ
1/μ
1/λ
1.0 0.5 0.5 1.0 1.5x
1.5
1.0
0.5
0.5
1.0
1.5
y
Region 2
λ1/λμ1/μ
1.5 1.0 0.5 0.5 1.0 1.5x
1.0
0.5
0.5
1.0
y
Region 3
1/μ 1/λ λ μ
1.0 0.5 0.5 1.0 1.5x
1.0
0.5
0.5
1.0
y
Region 4
1/μ 1/λ λ μ
1.5 1.0 0.5 0.5 1.0x
1.0
0.5
0.5
1.0
y
Region 5
μ
1/μ
λ 1/λ
1.0 0.5 0.5 1.0x
1.0
0.5
0.5
1.0
y
Region 6
32
The results of the analysis concerning the linearized
stability of the triangular Lagrange points 𝐿4, 𝐿5 for a wide
range of values of the mass ratio μ and the eccentricity e, are
presented in Figure 2
Figure 3: Linear stability of the triangular Lagrange points in
the elliptic restricted three-body problem
The shaded areas in figure 2 represent linear stability. “The
point denoted by 𝜇∗ on the μ axis corresponds to the value of
the mass ratio at which any nonzero eccentricity introduces
λ
1/λ
1/μ μ
1.0 0.5 0.5 1.0x
1.0
0.5
0.5
1.0
y
Region 7
33
linear instability” (Szebehely, 1967, p. 599). The point denoted
by 𝜇0 represents the value at which instability presents itself
when 𝑒 = 0.
The numerical calculation of the points (μ, e) that present
linear stability, also provide the values of the points 𝜇∗ and 𝜇0.
These points are found to be
𝜇∗ = 0.0286, 𝜇0 = 0.0385.
As figure 3 shows, the eccentricity of the motion of the two
primaries may introduce stability for 𝜇 > 𝜇0. In fact, the orbits
around the triangular Lagrange points are stable up to
𝜇 = 0.04698 with the proper value of e (Szebehely, 1967).
B. Regular orbits in the neighborhood of the Lagrange
points
In this section, the results of the calculations of the regular
orbits around the Lagrange points of equilibrium are presented.
These results consist of a number of regions of initial
conditions around the equilibrium points for which the satellite
follows a regular orbit. The calculations were made for
different combinations of the mass ratio μ and the eccentricity
e. The range of the regular region is also calculated as the
angle θ of the region measured from the axes point of origin.
Figure 4 shows exactly how the range of the regular region θ is
calculated.
34
Figure 4: Range of the regular region θ. The shaded
area is the regular region.
As mentioned in Section 2D, the fast Lyapunov indicator
or FLI was used to distinguish between regular and chaotic
orbits. The initial conditions of the satellite that have been used
are 𝒙�̇� = 𝟎, 𝒚�̇� = 𝟎, which means that the satellite starts
motionless, and for 𝒙𝟎, 𝒚𝟎 a grid has been considered with its
center at the coordinates of the Lagrange point 𝐿4 (𝑥𝐿4, 𝑦𝐿4)or
𝐿5 (𝑥𝐿5, 𝑦𝐿5). Thus, the initial conditions 𝑥0 and 𝑦0 are
between 𝒙𝑳𝒊 − 𝟎. 𝟗 < 𝒙𝟎 < 𝒙𝑳𝒊 + 𝟎. 𝟗 and
𝒚𝑳𝒊 − 𝟎. 𝟒 < 𝒚𝟎 < 𝒚𝑳𝒊 + 𝟎. 𝟒. It is also important to note that
all the calculations were made whit the two primaries at
periapsis (minimum elongation). The following figure shows
the FLI as a function of the independent variable v for a
regular and a chaotic orbit.
35
Figure 5: The change in FLI with respect to the true anomaly v
for a regular and a chaotic orbit. The orbits have been calculated
for μ=0.001 and e=0.05 for 325 orbital periods (𝒗𝒎𝒂𝒙 = 𝟔𝟓𝟎𝝅).
Initial conditions of the regular orbit are 𝒙𝟎 = −𝟎. 𝟐𝟖𝟔, 𝒚𝟎 =
𝟎. 𝟗𝟓𝟖𝟓𝟐𝟓 and for the chaotic orbit 𝒙𝟎 = 𝟎. 𝟓, 𝒚𝟎 = 𝟏. 𝟎𝟒𝟑𝟔𝟕𝟖. The
coordinates of 𝑳𝟒 are (𝒙𝑳𝟒 = 𝟎. 𝟒𝟗𝟗, 𝒚𝑳𝟒 = 𝟎. 𝟖𝟔𝟔𝟎𝟐𝟓).
From figure 5 it can clearly be seen that the value of FLI for a
regular orbit stays relatively low whereas it quickly increases
for a chaotic orbit. The following two figures show the
corresponding orbits of the satellite which are taken for a
smaller interval of the independent variable v.
36
Figure 6: Regular orbit for μ=0.001 and e=0.05 for 15 orbital
periods (𝒗𝒎𝒂𝒙 = 𝟑𝟎𝝅). Initial conditions of the satellite are 𝒙𝟎 =
−𝟎. 𝟐𝟖𝟔, 𝒚𝟎 = 𝟎. 𝟗𝟓𝟖𝟓𝟐𝟓. The coordinates of 𝑳𝟒 are (𝒙𝑳𝟒 =
𝟎. 𝟒𝟗𝟗, 𝒚𝑳𝟒 = 𝟎. 𝟖𝟔𝟔𝟎𝟐𝟓).
Figure 7: Chaotic orbit for μ=0.001 and e=0.05 for 15 orbital
periods (𝒗𝒎𝒂𝒙 = 𝟑𝟎𝝅). Initial conditions of the satellite are
𝒙𝟎𝟎. 𝟓, 𝒚𝟎 = 𝟏. 𝟎𝟒𝟑𝟔𝟕𝟖. The coordinates of 𝑳𝟒 are (𝒙𝑳𝟒 =
𝟎. 𝟒𝟗𝟗, 𝒚𝑳𝟒 = 𝟎. 𝟖𝟔𝟔𝟎𝟐𝟓). Even though the initial conditions are
closer to 𝑳𝟒 in comparison to the regular orbit, a chaotic orbit is
produced.
37
However, apart from the FLI, as an added measure of
accuracy, the actual distance between the satellite and the
Lagrange point has also been taken into account. This is
calculated by
𝑑𝐿 = √(𝑥 − 𝑥𝐿)2 + (𝑦 − 𝑦𝐿)
2 (57)
where 𝑥𝐿 and 𝑦𝐿 denote the coordinates of the Lagrange point
whose neighborhood is tested. If this distance increases beyond
a certain threshold after a certain interval of the independent
variable v, then the orbit clearly veers into infinity and thus the
initial conditions which produced it are excluded.
In addition, orbits which lead to collisions of the satellite
with the two primaries are also excluded. The distance
between the satellite and the primaries is calculated by
𝑑𝑝𝑟1 = √(𝑥 − 𝑥1)2 + (𝑦 − 𝑦1)
2
(58)
𝑑𝑝𝑟2 = √(𝑥 − 𝑥2)2 + (𝑦 − 𝑦2)
2
If these distances become zero, a collision has occurred and the
corresponding initial conditions are excluded.
With all this information the so called stability maps have
been constructed around the Lagrange points. These maps
consist of the initial condition 𝑥0, 𝑦0 of the satellite, for which
it follows a regular orbit. In each such pair of initial conditions
38
a color has been added according to the value of FLI that has
been calculated for this particular orbit. For the chaotic orbits
and the collision orbits a special arbitrary value of 100 is
assigned to the FLI for the purposes of visualization. The color
ranges from black to yellow with yellow being the region that
does not produce regular orbits. It was found that the boundary
of the value of the FLI that separates the regular orbits region
from the chaotic orbits region is FLI=6.0. The implication here
is that initial conditions that produce regular orbits with FLI
value close to 6.0 (represented by orange color), could be
excluded from the regular region if the integrations were to be
made for larger intervals of the independent variable v. For this
reason the range of the regular regions have been calculated
using initial conditions which produce orbits with a value of
FLI close to 1.50 (represented by blue color). The results that
follow were obtained for a maximum value of v equal to 650π
or 325 orbital periods of the primaries. The interval of μ tested
is 0.001 < 𝜇 < 0.04 with step equal to 0.0025 starting from
0.0025. The values of e that have been tested start at 0.0 with
step equal to 0.05 and end whenever the range of the regular
regions θ reach 0.
39
i. Regular regions near equilibrium point 𝑳𝟒
μ=0.001, e=0.0, θ=1.45 rad
μ=0.001, e=0.05, θ=1.30 rad
40
μ=0.001, e=0.1, θ=1.07rad
μ=0.001, e=0.15, θ=0.96 rad
41
μ=0.001, e=0.2, θ=0.86 rad
μ=0.001, e=0.25, θ=0.80 rad
42
μ=0.001, e=0.3, θ=0.74 rad
μ=0.001, e=0.35, θ=0.65 rad
43
μ=0.001, e=0.4, θ=0.61 rad
μ=0.001, e=0.45, θ=0.41 rad
44
μ=0.001, e=0.5, θ=0.38 rad
μ=0.001, e=0.55, θ=0.18 rad
45
μ=0.001, e=0.6, θ=0.12 rad
μ=0.001, e=0.65, θ=0.08 rad
After e=0.65 there are no initial conditions that produce
regular orbits.
46
μ=0.0025, e=0.0, θ=1.43 rad
μ=0.0025, e=0.05, θ=1.29 rad
47
μ=0.0025, e=0.1, θ=1.04 rad
μ=0.0025, e=0.15, θ=0.99 rad
48
μ=0.0025, e=0.2, θ=0.75 rad
μ=0.0025, e=0.25, θ=0.72 rad
49
μ=0.0025, e=0.3, θ=0.58 rad
μ=0.0025, e=0.35, θ=0.41 rad
50
μ=0.0025, e=0.4, θ=0.38 rad
μ=0.0025, e=0.45, θ=0.21 rad
51
μ=0.0025, e=0.5, θ=0.20 rad
μ=0.0025, e=0.55, θ=0.04 rad
After e=0.55 there are no initial conditions that produce
regular orbits.
52
μ=0.005, e=0.0, θ=1.26 rad
μ=0.005, e=0.05, θ=1.15 rad
53
μ=0.005, e=0.1, θ=0.96 rad
μ=0.005, e=0.15, θ=0.50 rad
54
μ=0.005, e=0.2, θ=0.41 rad
μ=0.005, e=0.25, θ=0.46 rad
55
μ=0.005, e=0.3, θ=0.32 rad
μ=0.005, e=0.35, θ=0.18 rad
56
μ=0.005, e=0.4, θ=0.17 rad
μ=0.005, e=0.45, θ=0.08 rad
57
μ=0.005, e=0.5, θ=0.0 rad
After e=0.5 there are no initial conditions that produce regular
orbits.
μ=0.0075, e=0.0, θ=1.24 rad
58
μ=0.0075, e=0.05, θ=0.99 rad
μ=0.0075, e=0.1, θ=0.56 rad
59
μ=0.0075, e=0.15, θ=0.28 rad
μ=0.0075, e=0.2, θ=0.19 rad
60
μ=0.0075, e=0.25, θ=0.27 rad
μ=0.0075, e=0.3, θ=0.29 rad
61
μ=0.0075, e=0.35, θ=0.03 rad
After e=0.35 there are no initial conditions that produce
regular orbits.
μ=0.01, e=0.0, θ=0.88 rad
62
μ=0.01, e=0.05, θ=0.77 rad
μ=0.01, e=0.1, θ=0.62 rad
63
μ=0.01, e=0.15, θ=0.53 rad
μ=0.01, e=0.2, θ=0.25 rad
64
μ=0.01, e=0.25, θ=0.06 rad
μ=0.01, e=0.3, θ=0.06 rad
65
μ=0.01, e=0.35, θ=0.14 rad
After e=0.35 there are no initial conditions that produce
regular orbits.
μ=0.0125, e=0.0, θ=0.65 rad
66
μ=0.0125, e=0.05, θ=0.31 rad
μ=0.0125, e=0.05, θ=0.16 rad
67
μ=0.0125, e=0.1, θ=0.16 rad
μ=0.0125, e=0.15, θ=0.13 rad
68
μ=0.0125, e=0.2, θ=0.04 rad
μ=0.0125, e=0.25, θ=0.09 rad
69
μ=0.0125, e=0.3, θ=0.09 rad
After e=0.3 there are no initial conditions that produce regular
orbits.
μ=0.015, e=0.0, θ=0.53 rad
70
μ=0.015, e=0.05, θ=0.15 rad
μ=0.015, e=0.1, θ=0.18 rad
71
μ=0.015, e=0.15, θ=0.18 rad
μ=0.015, e=0.2, θ=0.22 rad
72
μ=0.015, e=0.25, θ=0.06 rad
After e=0.25 there are no initial conditions that produce
regular orbits.
μ=0.0175, e=0.0, θ=0.74 rad
73
μ=0.0175, e=0.05, θ=0.69 rad
μ=0.0175, e=0.1, θ=0.48 rad
74
μ=0.0175, e=0.15, θ=0.31 rad
μ=0.0175, e=0.2, θ= 0.04 rad
After e=0.2 there are no initial conditions that produce regular
orbits.
75
μ=0.02, e=0.0, θ=0.64 rad
μ=0.02, e=0.05, θ=0.60 rad
76
μ=0.02, e=0.1, θ=0.19 rad
After e=0.1 there are no initial conditions that produce regular
orbits.
μ=0.0225, e=0.0, θ=0.11 rad
77
μ=0.0225, e=0.05, θ=0.07 rad
μ=0.0225, e=0.1, θ=0.03 rad
After e=0.1 there are no initial conditions that produce regular
orbits.
78
μ=0.025, e=0.0, θ=0.03 rad
μ=0.025, e=0.05, θ=0.07 rad
After e=0.05 there are no initial conditions that produce
regular orbits.
79
μ=0.0275, e=0.0, θ=0.12 rad
After e=0.05 there are no initial conditions that produce
regular orbits.
μ=0.03, e=0.0, θ=0.19 rad
After e=0.0 there are no initial conditions that produce regular
orbits.
80
μ=0.0325, e=0.0, θ=0.20 rad
μ=0.0325, e=0.05, θ=0.03 rad
After e=0.05 there are no initial conditions that produce
regular orbits.
81
μ=0.035, e=0.0, θ=0.17 rad
μ=0.035, e=0.05, θ=0.08 rad
82
μ=0.035, e=0.1, θ=0.01 rad
After e=0.1 there are no initial conditions that produce regular
orbits.
μ=0.0375, e=0.0, θ=0.14 rad
83
μ=0.0375, e=0.05, θ=0.03 rad
μ=0.0375, e=0.1, θ=0.01 rad
After e=0.0 there are no initial conditions that produce regular
orbits.
84
μ=0.04, e=0.0, θ=0.06 rad
After μ=0.05, e=0.0 there are no initial conditions that produce
regular orbits.
ii. Regular regions near equilibrium point 𝑳𝟓
The regular regions near equilibrium point 𝐿5 are almost
completely symmetrical to the ones near 𝐿4 the reason being
that actually 𝐿5 becomes 𝐿4 as the initial conditions become
𝑦 → −𝑦 and the independent variable becomes 𝑣 → −𝑣. As a
result and for the sake of time, less values of the mass ratio μ
have been considered here. The results of the calculations are
as follows:
85
μ=0.005, e=0.0, θ=1.26 rad
μ=0.005, e=0.05, θ=1.09 rad
86
μ=0.005, e=0.1, θ=1.04 rad
μ=0.005, e=0.15, θ=0.54 rad
87
μ=0.005, e=0.2, θ=0.46 rad
μ=0.005, e=0.25, θ=0.53 rad
88
μ=0.005, e=0.3, θ=0.36 rad
μ=0.005, e=0.35, θ=0.21 rad
89
μ=0.005, e=0.4, θ=0.19 rad
μ=0.005, e=0.45, θ=0.10 rad
90
μ=0.005, e=0.5, θ=0.0 rad
After e=0.5 there are no initial conditions that produce regular
orbits.
μ=0.01, e=0.0, θ=0.88 rad
91
μ=0.01, e=0.05, θ=0.73 rad
μ=0.01, e=0.1, θ=0.65 rad
92
μ=0.01, e=0.15, θ=0.54 rad
μ=0.01, e=0.2, θ=0.28 rad
93
μ=0.01, e=0.25, θ=0.06 rad
μ=0.01, e=0.3, θ=0.06 rad
94
μ=0.01, e=0.35, θ=0.14 rad
After e=0.35 there are no initial conditions that produce
regular orbits.
μ=0.02, e=0.0, θ=0.64 rad
95
μ=0.02, e=0.05, θ=0.59 rad
μ=0.02, e=0.1, θ=0.19 rad
After e=0.1 there are no initial conditions that produce regular
orbits.
96
μ=0.03, e=0.0, θ=0.19 rad
After e=0.0 there are no initial conditions that produce regular
orbits.
μ=0.04, e=0.0, θ=0.05 rad
After e=0.0 there are no initial conditions that produce regular
orbits.
97
C. Examination of the results
This examination of the results focuses on the regular
regions near the Lagrange point 𝐿4. The apparent symmetry
between the regular regions near 𝐿4 and 𝐿5 means that any
conclusions that are drawn for one region can be applied to the
other.
By examining the range of the regular regions near 𝐿4, it
becomes clear that the range θ decreases in value as the mass
ratio μ and the eccentricity of the orbits increases as shown in
figures 3-5. In fact, the rate of its decrease is rather fast as the
regular regions are virtually non-existent after μ=0.03 (save for
very low values of e) and e=0.65 in the most extreme cases
where μ is closer to zero. This suggests that the chances of the
existence of co-orbital companions, such as Trojan-like bodies,
increase in dynamical systems with low to moderate orbital
eccentricities (< 0.3) (Schwarz, Dvorak, Süli & Érdi, 2007)
where the regular area is larger. Figure 8 shows the change in
the regular range θ with the mass ratio μ for 𝑒 = 0.0 and 𝑒 =
0.1. Since the majority of extrasolar planetary systems that
have been discovered resemble a dynamical system not unlike
the Sun and Jupiter system (1M⊙ = 1047.56 MJupiter , 𝜇 =
0.0009546), the most interesting range of the mass ratio μ,
that warrants further examination, is 0.001≤ μ ≤0.005. Figure 9
shows the change in the regular range θ with the orbital
eccentricity e for 𝜇 = 0.001 and 𝜇 = 0.005.
98
Figure 8: The change in the range of the regular region θ with
the mass ratio μ for e=0.0
Figure 9: The change in the range of the regular region θ with
the eccentricity e for μ=0.001 and μ=0.005
Figure 10 shows the change of the range θ with both μ and
e. While it is clear that θ decreases as e increases, there is a
noticeable increase of θ around μ=0.018 as indicated by the
“bump”.
99
Figure 10: The change in the range of the regular region θ with
the mass ratio μ and the eccentricity e
D. Stability Regions of Exoplanetary systems
The results of Sections 3B and 3C can be applied to
existing exoplanetary systems in an attempt to suggest possible
candidate systems in which co-orbital companions could exist
in stable orbits near the Lagrange point 𝐿4. By taking into
account that the range of the regular region θ decreases as the
mass ratio μ and the orbital eccentricity e increase in value, a
list of 15 exoplanetary systems has been examined to
determine their regular regions. The criteria which the possible
candidates must fulfill are a low to moderate eccentricity e (<
0.3), and a mass ratio μ with values between 0.001 and 0.005.
100
This would resemble a system in which the planet’s mass
would be comparable to that of Jupiter, and the host star’s
mass would be comparable to that of the Sun. This is because,
as can be seen in figure 11, the majority of the known
exoplanetary systems fulfill these criteria.
Figure 11: Distribution of known exoplanetary systems with
regards to the mass of the host star (in 𝑴⊙) and the mass of the
planet (in 𝑴𝑱𝒖𝒑𝒊𝒕𝒆𝒓). The color range shows their orbital eccentricity.
The distribution is denser around 𝟏𝑴⊙and 𝟏𝑴𝑱𝒖𝒑𝒊𝒕𝒆𝒓.
Table 2 gives the list of the candidate exoplanetary systems
for which the range of the regular region θ has been calculated,
along with their characteristics.
101
Table 2
System 𝑀𝑆(𝑀⊙) 𝑀𝑃(𝑀𝐽𝑢𝑝) μ e θ (rad)
HR 810 1.11 2.26 0.001944 0.161 0.909211
HD 95872 0.95 4.6 0.0046223 0.06 1.065137
HD 73267 0.89 3.06 0.0032821 0.256 0.543495
WASP-38 1.216 2.712 0.002129 0.0321 1.357102
HD 195019 1.06 3.7 0.0033321 0.014 1.394702
HD 96127 0.91 4.0 0.004196 0.3 0.509436
Kepler-434 1.198 2.86 0.0022789 0.131 0.951384
HD 28185 1.24 5.7 0.0043881 0.07 0.887029
WASP-8 1.033 2.244 0.0020737 0.31 0.566593
HIP 8541 1.17 5.59 0.0045609 0.16 0.754938
tau Boo 1.3 5.84 0.0042884 0.0787 0.758422
Kepler-43 1.32 3.23 0.0023359 0.025 1.401148
KOI-830 0.87 1.27 0.0013935 0.22 0.799872
WASP-32 3.6 1.1 0.0031241 0.018 1.405745
HIP 109600 0.87 2.68 0.0029406 0.163 0.786861
102
4. Conclusions
In this work, the nature of stability of the Lagrange points
𝐿4 and 𝐿5 and of their neighborhoods for different values of
the mass ratio μ and the orbital eccentricity e, using the Elliptic
Restricted Three Body Problem as a theoretical basis has been
studied. The range of the regions near the equilibrium points
𝐿4 and 𝐿5, where a motionless satellite follows regular orbits,
has been determined using the Fast Lyapunov Indicators (FLI).
The extend of these regions depends on the mass parameter μ
and the eccentricity e. The range of the regular regions θ
decreases as both the mass ration μ and the eccentricity e
increase. It is possible that co-orbital companions such as
Trojan-like bodies of small mass exist in the regular regions
near 𝐿4 and 𝐿5 of extrasolar planetary systems that consists of
a Sun-like star and one Jupiter-like planet. Fifteen
exoplanetary systems have been examined and their regular
region have been determined in order to propose possible
candidates for investigation of the existence of possible co-
orbital companions in these systems.
Further works are necessary to better calculate the range
of the regular regions near the equilibrium points considering
larger intervals of the independent variable. In addition, the list
of exoplanetary systems that could be host to Trojan-like
bodies can be greatly expanded, since there are more than 2700
known exoplanetary systems, with more discovered yearly.
103
APPENDIX
The programs that have been prepared for the this study
are presented here. The programming languages C and C++
have been used.
Program A:
//INTEGRATION OF THE ELLIPCTIC RESTRICTED THREE BODY PROBLEM IN THE
BARYCENTRIC INERTIAL FRAME OF REFERENCE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
//ODE for eccentric anomaly E
double dydx(double x, double y, double e){
double dy;
dy=1.0/(1.0-(e*cos(y)));
return dy;
}
//ODEs for satellite coordinates in the barycentric inertial frame
double dqdt(double t, double q, double p, double vq, double vp,
double m, double q1, double q2, double p1, double p2){
double dq;
dq=vq;
return dq;
}
double dvqdt(double t, double q, double p, double vq, double vp,
double m, double q1, double q2, double p1, double p2){
double dvq, s1, s2;
s1=sqrt(pow((q-q1), 2.0) + pow((p-p1), 2.0));
s2=sqrt(pow((q-q2), 2.0) + pow((p-p2), 2.0));
dvq=-(1-m)*((q-q1)/(pow(s1, 3.0))) - m*((q-q2)/(pow(s2, 3.0)));
return dvq;
}
double dpdt(double t, double q, double p, double vq, double vp,
double m, double q1, double q2, double p1, double p2){
double dp;
dp=vp;
104
return dp;
}
double dvpdt(double t, double q, double p, double vq, double vp,
double m, double q1, double q2, double p1, double p2){
double dvp, s1, s2;
s1=sqrt(pow((q-q1), 2.0) + pow((p-p1), 2.0));
s2=sqrt(pow((q-q2), 2.0) + pow((p-p2), 2.0));
dvp=-(1-m)*((p-p1)/(pow(s1, 3.0))) - m*((p-p2)/(pow(s2, 3.0)));
return dvp;
}
//function f(a) for Newton-Raphson
double func(double m, double a){
double fa;
fa=(1-a)/(pow(m, 2)) - a/(pow(1-m, 2)) + (m*a)/pow(abs(a), 3) +
((1-m)*(a-1))/pow(abs(a-1), 3);
return fa;
}
//function f'(a) for Newton-Raphson (root of a>1)
double funcdot(double m, double a){
double fdota;
fdota=-(1/pow(1-m, 2)) - (1/pow(m, 2)) + ((1-m)/pow(abs(a-1),
3)) + (m/pow(abs(a), 3)) - ((3*(a-1)*(1-m))/pow(abs(a-1), 4)) -
((3*a*m)/pow(abs(a), 4));
return fdota;
}
//function f'(a) for Newton-Raphson (roots of a<1)
double funcdot2(double m, double a){
double fdota2;
fdota2=-(1/pow(1-m, 2)) - (1/pow(m, 2)) + ((1-m)/pow(abs(a-1),
3)) + (m/pow(abs(a), 3)) + ((3*(a-1)*(1-m))/pow(abs(a-1), 4)) +
((3*a*m)/pow(abs(a), 4));
return fdota2;
}
int main(int argc, char *argv[]) {
double tn,En,k1,k2,k3,k4,E,t,h,t0,E0,e;
double m, q1, q2, p1, p2, xi0;
double ql1, pl1, ql2, pl2, ql3, pl3;
double q4, p4;
double q, p, vq, vp, q0, p0, vq0, vp0;
double qn, pn, vqn, vpn;
double limit;
double a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2,
d3, d4;
double a01, a02, a03, an1, an2, an3;//for Newton-Raphson
FILE * fp1;
105
FILE * fp2;
FILE * fp3;
FILE * fp4;
FILE * fp5;
FILE * fp6;
FILE * fp7;
FILE * fp8;
FILE * fp9;
/*Initial conditions and step h*/
t0=0.0; // initial time
E0=0.0; //initial E
//Initial Coordinates
q0=-2.0;
p0=0.0;
//Initial velocity components
vq0=-0.0;
vp0=-0.6;
m=0.2; //mass ratio
e=0.9; //eccentricity
h=0.005; //RK4 step
limit=t0+120; //time limit
a01=1.1; //Newton-Raphson starting values
a02=-0.01;
a03=0.5;
tn=t0;
En=E0;
qn=q0;
pn=p0;
vqn=vq0;
vpn=vp0;
/*Newton-Raphson*/
an1=a01;
if( func(m, a01)!=0 && funcdot(m, a01)!=0 ){
do{
a01=an1;
an1=a01 - ((func(m, a01)/funcdot(m, a01)));
}
while(fabs(an1 - a01) >= 0.0000001);
}
an2=a02;
if( func(m, a02)!=0 && funcdot2(m, a02)!=0 ){
do{
106
a02=an2;
an2=a02 - ((func(m, a02)/funcdot2(m, a02)));
}
while(fabs(an2 - a02) >= 0.0000001);
}
an3=a03;
if( func(m, a03)!=0 && funcdot2(m, a03)!=0 ){
do{
a03=an3;
an3=a03 - ((func(m, a03)/funcdot2(m, a03)));
}
while(fabs(an3 - a03) >= 0.0000001);
}
cout << "a1= " << an1 << endl;
cout << "a2= " << an2 << endl;
cout << "a3= " << an3 << endl;
//Coordinates of the Primaries
q1=-m*(cos(En)-e);
p1=-m*sqrt(1-pow(e,2))*sin(En);
q2=(1-m)*(cos(En)-e);
p2=(1-m)*sqrt(1-pow(e,2))*sin(En);
//Quantity q0
xi0=(1/2.0)-m;
//Coordinates of L4/L5 lagrange Point
q4=xi0*(cos(En)-e) - (sqrt(3.0)/2.0)*sqrt(1-pow(e,2))*sin(En);
p4=xi0*sqrt(1-pow(e,2))*sin(En) + (sqrt(3.0)/2.0)*(cos(En)-e);
//Coordinates of L1 (a>1) Lagrange Point
ql1=(an1 - m)*(cos(En) - e);
pl1=(an1 - m)*(sqrt(1-pow(e,2))*sin(En));
//Coordinates of L2 (a<1) Lagrange Point
ql2=(an2 - m)*(cos(En) - e);
pl2=(an2 - m)*(sqrt(1-pow(e,2))*sin(En));
//Coordinates of L3 (0<a<1) Lagrange Point
ql3=(an3 - m)*(cos(En) - e);
pl3=(an3 - m)*(sqrt(1-pow(e,2))*sin(En));
fp1=fopen("EccentricAnomaly.txt", "w+");
fp2=fopen("Primary1Coordinates.txt", "w+");
fp3=fopen("Primary2Coordinates.txt", "w+");
fp4=fopen("SatelliteCoordinates.txt", "w+");
fp5=fopen("L4Coordinates.txt", "w+");
fp6=fopen("L5Coordinates.txt", "w+");
fp7=fopen("L1Coordinates.txt", "w+");
fp8=fopen("L2Coordinates.txt", "w+");
fp9=fopen("L3Coordinates.txt", "w+");
107
while(tn<=limit){
//RK4 for E
k1=h*dydx(tn,En, e);
k2=h*dydx((tn+h/2.0),(En+k1/2.0), e);
k3=h*dydx((tn+h/2.0),(En+k2/2.0), e);
k4=h*dydx((tn+h),(En+k3), e);
//RK4 for our ODE system
a1=h*dqdt(tn,qn,pn,vqn,vpn,m,q1,q2,p1,p2);
b1=h*dpdt(tn,qn,pn,vqn,vpn,m,q1,q2,p1,p2);
c1=h*dvqdt(tn,qn,pn,vqn,vpn,m,q1,q2,p1,p2);
d1=h*dvpdt(tn,qn,pn,vqn,vpn,m,q1,q2,p1,p2);
a2=h*dqdt((tn+h/2.0),(qn+a1/2.0),(pn+b1/2.0),(vqn+c1/2.0),(vpn+d1/2
.0),m,q1,q2,p1,p2);
b2=h*dpdt((tn+h/2.0),(qn+a1/2.0),(pn+b1/2.0),(vqn+c1/2.0),(vpn+d1/2
.0),m,q1,q2,p1,p2);
c2=h*dvqdt((tn+h/2.0),(qn+a1/2.0),(pn+b1/2.0),(vqn+c1/2.0),(vpn+d1/
2.0),m,q1,q2,p1,p2);
d2=h*dvpdt((tn+h/2.0),(qn+a1/2.0),(pn+b1/2.0),(vqn+c1/2.0),(vpn+d1/
2.0),m,q1,q2,p1,p2);
a3=h*dqdt((tn+h/2.0),(qn+a2/2.0),(pn+b2/2.0),(vqn+c2/2.0),(vpn+d2/2
.0),m,q1,q2,p1,p2);
b3=h*dpdt((tn+h/2.0),(qn+a2/2.0),(pn+b2/2.0),(vqn+c2/2.0),(vpn+d2/2
.0),m,q1,q2,p1,p2);
c3=h*dvqdt((tn+h/2.0),(qn+a2/2.0),(pn+b2/2.0),(vqn+c2/2.0),(vpn+d2/
2.0),m,q1,q2,p1,p2);
d3=h*dvpdt((tn+h/2.0),(qn+a2/2.0),(pn+b2/2.0),(vqn+c2/2.0),(vpn+d2/
2.0),m,q1,q2,p1,p2);
a4=h*dqdt((tn+h),(qn+a3),(pn+b3),(vqn+c3),(vpn+d3),m,q1,q2,p1,p2);
b4=h*dpdt((tn+h),(qn+a3),(pn+b3),(vqn+c3),(vpn+d3),m,q1,q2,p1,p2);
c4=h*dvqdt((tn+h),(qn+a3),(pn+b3),(vqn+c3),(vpn+d3),m,q1,q2,p1,p2);
d4=h*dvpdt((tn+h),(qn+a3),(pn+b3),(vqn+c3),(vpn+d3),m,q1,q2,p1,p2);
E=((k1+2.0*k2+2.0*k3+k4)/6.0);
q=((a1+2.0*a2+2.0*a3+a4)/6.0);
p=((b1+2.0*b2+2.0*b3+b4)/6.0);
vq=((c1+2.0*c2+2.0*c3+c4)/6.0);
vp=((d1+2.0*d2+2.0*d3+d4)/6.0);
fprintf(fp1, "%f\t%f\n", tn, En);
fprintf(fp2, "%f\t%f\n", q1, p1);
108
fprintf(fp3, "%f\t%f\n", q2, p2);
fprintf(fp4, "%f\t%f\n", qn, pn);
fprintf(fp5, "%f\t%f\n", q4, p4);
fprintf(fp6, "%f\t%f\n", q4, -p4);
fprintf(fp7, "%f\t%f\n", ql1, pl1);
fprintf(fp8, "%f\t%f\n", ql2, pl2);
fprintf(fp9, "%f\t%f\n", ql3, pl3);
//cout << "t= " << tn << " E= " << En << " q1= " << q1 << "
p1= " << p1 << " q2= " << q2 << " p2= " << p2 << " q= " << qn << "
p= " << pn << endl;
tn=tn+h;
En=En+E;
qn=qn+q;
pn=pn+p;
vqn=vqn+vq;
vpn=vpn+vp;
q1=-m*(cos(En)-e);
p1=-m*sqrt(1-pow(e, 2))*sin(En);
q2=(1-m)*(cos(En)-e);
p2=(1-m)*sqrt(1-pow(e, 2))*sin(En);
q4=xi0*(cos(En)-e) - (sqrt(3.0)/2.0)*sqrt(1-
pow(e,2))*sin(En);
p4=xi0*sqrt(1-pow(e,2))*sin(En) + (sqrt(3.0)/2.0)*(cos(En)-
e);
ql1=(an1 - m)*(cos(En) - e);
pl1=(an1 - m)*(sqrt(1-pow(e,2))*sin(En));
ql2=(an2 - m)*(cos(En) - e);
pl2=(an2 - m)*(sqrt(1-pow(e,2))*sin(En));
ql3=(an3 - m)*(cos(En) - e);
pl3=(an3 - m)*(sqrt(1-pow(e,2))*sin(En));
}
fclose(fp1);
fclose(fp2);
fclose(fp3);
fclose(fp4);
fclose(fp5);
fclose(fp6);
fclose(fp7);
fclose(fp8);
fclose(fp9);
return 0;
}
109
Program B:
//INTEGRATION OF THE ELLIPCTIC RESTRICTED THREE BODY PROBLEM IN THE
ROTATING-PULSATING FRAME OF REFERENCE AND FLI CALCULATION FOR A
REGULAR ORBIT AND A CHAOTIC ORBIT
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
//ODEs for satellite coordinates in the pulsating-rotating frame
double dxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dx;
dx=ux;
return dx;
}
double dydv(double v, double x, double y, double ux, double uy,
double m, double e){
double dy;
dy=uy;
return dy;
}
double duxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dux, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
dux=2*uy+rdivp*(x - m1*((x+m)/pow(r1, 3.0)) - m2*((x+m-
1)/pow(r2, 3.0)));
return dux;
}
double duydv(double v, double x, double y, double ux, double uy,
double m, double e){
double duy, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
duy=-2*ux+rdivp*(y - m1*(y/pow(r1, 3.0)) - m2*(y/pow(r2,
3.0)));
return duy;
}
//Variational ODEs for Lagrange points stability
110
double VdDxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDx;
dDx=Dux;
return dDx;
}
double VdDydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDy;
dDy=Duy;
return dDy;
}
double VdDuxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDux, rdivp, Uxx,Uxy;
rdivp=1/(1+e*cos(v));
Uxx=m*( (3*pow(x+m-1, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(x+m,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uxy=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDux=2*Duy + rdivp*Dx + rdivp*(Uxx*Dx + Uxy*Dy);
return dDux;
}
double VdDuydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDuy, rdivp, Uyx,Uyy;
rdivp=1/(1+e*cos(v));
Uyy=m*( (3*pow(y, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(y,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uyx=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDuy=-2*Dux + rdivp*Dy + rdivp*(Uyx*Dx + Uyy*Dy);
return dDuy;
}
//Equation f(x) for L1, l2, L3
double fx(double x, double m){
double func, r1c, r2c;
r1c=pow(fabs(x+m), 3);
r2c=pow(fabs(x+m-1), 3);
func=-x + (1.0-m)*((x+m)/r1c) + m*((x+m-1)/r2c);
return func;
}
111
//Equation f'(x) for L1, l2, l3 (root x>1)
double fdotx1(double x, double m){
double func1;
func1=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) - (3.0*m*(x+m-1))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func1;
}
//Equation f'(x) for L1, l2, l3 (root x<0)
double fdotx2(double x, double m){
double func2;
func2=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) + (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func2;
}
//Equation f'(x) for L1, l2, l3 (root 0<x<1)
double fdotx3(double x, double m){
double func3;
func3=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func3;
}
int main(int argc, char *argv[]) {
int i, j, k, colms=0, rows=0;
int i1=0,i2=1,i3=2,i4=3;
double v, v0, x, y, ux, uy, x0, y0, x0c, y0c, ux0, uy0, h;
double vn, xn, yn, uxn, uyn, limit;
double Dx, Dy, Dux, Duy, Dx0, Dy0, Dux0, Duy0;//for Variational
ODEs
double Dxn, Dyn, Duxn, Duyn;//for Variational ODEs
double stabtestx, stabtesty;
double x1, x2, y1, y2;
double xl1, yl1, xl2, yl2, xl3, yl3, xl4, yl4, xl5, yl5;//for
Lagrange points
double m, e, mass, ecc;
double a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2,
d3, d4;
double k1, k2, k3, k4, l1, l2, l3, l4, m1, m2, m3, m4, n1, n2,
n3, n4;
double x01, x02, x03, xn1, xn2, xn3;//for Newton-Raphson
double FLI, FLI2;
FILE * fp1;
FILE * fp2;
FILE * fp3;
FILE * fp4;
FILE * fp5;
FILE * fp6;
112
FILE * fp7;
FILE * fp8;
FILE * fp9;
/*Initial conditions and step h*/
v0=0.0; //true anomaly
m=0.001; //mass ratio
e=0.05; //eccentricity
h=0.005; //RK4 step
limit=v0+30*3.14159265;
x01=1.1; //Newton-Raphson starting values
x02=-1.0;
x03=0.5;
/*Newton-Raphson*/
xn1=x01;
if( fx(x01, m)!=0 && fdotx1(x01, m)!=0 ){
do{
x01=xn1;
xn1=x01 - ((fx(x01, m)/fdotx1(x01, m)));
}
while(fabs(xn1 - x01) >= pow(10, -15));
}
xn2=x02;
if( fx(x02, m)!=0 && fdotx2(x02, m)!=0 ){
do{
x02=xn2;
xn2=x02 - ((fx(x02, m)/fdotx2(x02, m)));
}
while(fabs(xn2 - x02) >= pow(10, -15));
}
xn3=x03;
if( fx(x03, m)!=0 && fdotx3(x03, m)!=0 ){
do{
x03=xn3;
xn3=x03 - ((fx(x03, m)/fdotx3(x03, m)));
113
}
while(fabs(xn3 - x03) >= pow(10, -15));
}
printf("xl1=%f\n",xn1);
printf("xl2=%f\n",xn2);
printf("xl3=%f\n\n",xn3);
//Coordinates of the Primaries
x1=-m;
y1=0.0;
x2=1-m;
y2=0.0;
//L4/l5 Coordinates
xl4=0.5*(1-2*m);
yl4=sqrt(3)/2;
xl5=0.5*(1-2*m);
yl5=-sqrt(3)/2;
//L1/L2/L3 Coordinates
xl1=xn1;
yl1=0.0;
xl2=xn2;
yl2=0.0;
xl3=xn3;
yl3=0.0;
fp1=fopen("SatelliteCoordinates.txt", "w+");
fp2=fopen("Primary1Coordinates.txt", "w+");
fp3=fopen("Primary2Coordinates.txt", "w+");
fp4=fopen("L4L5Coordinates.txt", "w+");
fp5=fopen("L1L2L3Coordinates.txt", "w+");
fp6=fopen("VariationalCoordinatesAt2pi.txt", "w+");
fp7=fopen("InitialConditionsFLI.txt", "w+");
fp8=fopen("FLI_TrueAnomalyRegular.txt", "w+");
fp9=fopen("FLI_TrueAnomalyChaotic.txt", "w+");
fprintf(fp2, "%f\t%f\n", x1, y1);
fprintf(fp3, "%f\t%f\n", x2, y2);
fprintf(fp4, "%f\t%f\n%f\t%f", xl4, yl4, xl5, yl5);
fprintf(fp5, "%f\t%f\n%f\t%f\n%f\t%f", xl1, yl1, xl2, yl2, xl3,
yl3);
//Initial Coordinates (Regular Orbits)
x0=-0.286;
y0=0.958525 ;
//Initial Coordinates (Chaotic Orbits)
x0c=0.50;
y0c=1.043678;
//Initial velocity components
ux0=0.0;
uy0=0.0;
//Initial Variational Coordinates
Dx0=100.0;
Dy0=100.0;
Dux0=0.0;
Duy0=0.0;
114
Dxn=Dx0;
Dyn=Dy0;
Duxn=Dux0;
Duyn=Duy0;
vn=v0;
xn=x0;
yn=y0;
uxn=ux0;
uyn=uy0;
while(vn<=limit){
//RK4 for ODE system
a1=h*dxdv(vn, xn, yn, uxn, uyn, m, e);
b1=h*dydv(vn, xn, yn, uxn, uyn, m, e);
c1=h*duxdv(vn, xn, yn, uxn, uyn, m, e);
d1=h*duydv(vn, xn, yn, uxn, uyn, m, e);
a2=h*dxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
b2=h*dydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
c2=h*duxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
d2=h*duydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
a3=h*dxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
b3=h*dydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
c3=h*duxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
d3=h*duydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
a4=h*dxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
b4=h*dydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
c4=h*duxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
d4=h*duydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
x=((a1+2.0*a2+2.0*a3+a4)/6.0);
y=((b1+2.0*b2+2.0*b3+b4)/6.0);
ux=((c1+2.0*c2+2.0*c3+c4)/6.0);
uy=((d1+2.0*d2+2.0*d3+d4)/6.0);
xn=xn+x;
yn=yn+y;
uxn=uxn+ux;
uyn=uyn+uy;
fprintf(fp1, "%f\t%f\n", xn, yn);
115
//RK4 for Variational ODEs
k1=h*VdDxdv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
l1=h*VdDydv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
m1=h*VdDuxdv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
n1=h*VdDuydv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
k2=h*VdDxdv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
l2=h*VdDydv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
m2=h*VdDuxdv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
n2=h*VdDuydv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
k3=h*VdDxdv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
l3=h*VdDydv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
m3=h*VdDuxdv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
n3=h*VdDuydv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
k4=h*VdDxdv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
l4=h*VdDydv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
m4=h*VdDuxdv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
n4=h*VdDuydv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
Dx=((k1+2.0*k2+2.0*k3+k4)/6.0);
Dy=((l1+2.0*l2+2.0*l3+l4)/6.0);
Dux=((m1+2.0*m2+2.0*m3+m4)/6.0);
Duy=((n1+2.0*n2+2.0*n3+n4)/6.0);
vn=vn+h;
Dxn=Dxn+Dx;
Dyn=Dyn+Dy;
Duxn=Duxn+Dux;
Duyn=Duyn+Duy;
FLI2=log((sqrt(pow(Dxn, 2.0)+pow(Dyn, 2.0) + Duxn +
Duyn))/vn);
fprintf(fp8, "%f\t%f\n", vn, FLI2);
}
fprintf(fp6, "%f\t%f\t%f\t%f\n", Dxn, Dyn, Duxn, Duyn);
//FLI Calculation
FLI=log((sqrt(pow(Dxn, 2.0)+pow(Dyn, 2.0) + Duxn +
Duyn))/vn);
printf("x0=%f\ty0=%f\tFLI=%f\n",x0, y0, FLI);
if(FLI<6.0){
116
fprintf(fp7, "%f\t%f\t%f\n", x0, y0, FLI);
}
Dx0=100.0;//reinitiallise initial variational conditions
Dy0=100.0;
Dux0=0.0;
Duy0=0.0;
Dxn=Dx0;
Dyn=Dy0;
Duxn=Dux0;
Duyn=Duy0;
vn=v0;//reinitiallise true anomaly and initial conditions
xn=x0c;
yn=y0c;
uxn=ux0;
uyn=uy0;
//CHAOTIC ORBIT
while(vn<=limit){
//RK4 for ODE system
a1=h*dxdv(vn, xn, yn, uxn, uyn, m, e);
b1=h*dydv(vn, xn, yn, uxn, uyn, m, e);
c1=h*duxdv(vn, xn, yn, uxn, uyn, m, e);
d1=h*duydv(vn, xn, yn, uxn, uyn, m, e);
a2=h*dxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
b2=h*dydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
c2=h*duxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
d2=h*duydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
a3=h*dxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
b3=h*dydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
c3=h*duxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
d3=h*duydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
a4=h*dxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
b4=h*dydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
c4=h*duxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
d4=h*duydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
x=((a1+2.0*a2+2.0*a3+a4)/6.0);
y=((b1+2.0*b2+2.0*b3+b4)/6.0);
ux=((c1+2.0*c2+2.0*c3+c4)/6.0);
uy=((d1+2.0*d2+2.0*d3+d4)/6.0);
117
xn=xn+x;
yn=yn+y;
uxn=uxn+ux;
uyn=uyn+uy;
//RK4 for Variational ODEs
k1=h*VdDxdv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
l1=h*VdDydv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
m1=h*VdDuxdv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
n1=h*VdDuydv(vn, Dxn, Dyn, Duxn, Duyn, xn, yn, m, e);
k2=h*VdDxdv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
l2=h*VdDydv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
m2=h*VdDuxdv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
n2=h*VdDuydv((vn+h/2.0), (Dxn+k1/2.0), (Dyn+l1/2.0),
(Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
k3=h*VdDxdv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
l3=h*VdDydv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
m3=h*VdDuxdv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
n3=h*VdDuydv((vn+h/2.0), (Dxn+k2/2.0), (Dyn+l2/2.0),
(Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
k4=h*VdDxdv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
l4=h*VdDydv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
m4=h*VdDuxdv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
n4=h*VdDuydv((vn+h), (Dxn+k3), (Dyn+l3), (Duxn+m3),
(Duyn+n3), xn, yn, m, e);
Dx=((k1+2.0*k2+2.0*k3+k4)/6.0);
Dy=((l1+2.0*l2+2.0*l3+l4)/6.0);
Dux=((m1+2.0*m2+2.0*m3+m4)/6.0);
Duy=((n1+2.0*n2+2.0*n3+n4)/6.0);
vn=vn+h;
Dxn=Dxn+Dx;
Dyn=Dyn+Dy;
Duxn=Duxn+Dux;
Duyn=Duyn+Duy;
FLI2=log((sqrt(pow(Dxn, 2.0)+pow(Dyn, 2.0) + Duxn +
Duyn))/vn);
fprintf(fp9, "%f\t%f\n", vn, FLI2);
}
vn=v0;//reinitiallise true anomaly
fclose(fp1);
118
fclose(fp2);
fclose(fp3);
fclose(fp4);
fclose(fp5);
fclose(fp6);
fclose(fp7);
fclose(fp8);
fclose(fp9);
return 0;
}
Program C:
//CALCULATION OF THE NATURE OF STABILLITY OF THE LAGRANGE POINTS
FOR A GRID OF MASS RATIO AND ECCENTRICITY e USING THE FLOQUET
THEORY VIA THE QR METHOD AND HESSENBERG ELIMINATION
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#define SWAP(g,h) {y=(g);(g)=(h);(h)=y;}
#define SIGN(a,b) ((b) > 0 ? fabs(a) : -fabs(a))
void nrerror(char error_text[]){
void exit();
fprintf(stderr,"Numerical Recipes run-time error...\n");
fprintf(stderr,"%s\n",error_text);
fprintf(stderr,"...now exiting to system...\n");
exit(1);
}
//Offset vector allocation
float *vector(int nl,int nh){
double *v;
v=(double *)malloc((unsigned) (nh-nl+1)*sizeof(double));
if (!v) nrerror("allocation failure in vector()");
return v-nl;
}
//Offset matrix conversion
double **convert_matrix(double *a,int nrl,int nrh,int ncl,int nch){
int i,j,nrow,ncol;
double **mat;
nrow=nrh-nrl+1;
ncol=nch-ncl+1;
mat = (double **) malloc((unsigned) (nrow)*sizeof(double*));
if (!mat) nrerror("allocation failure in convert_matrix()");
mat-= nrl;
for(i=0,j=nrl;i<=nrow-1;i++,j++) mat[j]=a+ncol*i-ncl;
return mat;
}
//Hessenberg Elimination
119
void elmhes(double **a, int n){
int m,j,i;
double y,x;
for (m=2;m<n;m++){
x=0.0;
i=m;
for (j=m;j<=n;j++) {
if (fabs(a[j][m-1]) > fabs(x)) {
x=a[j][m-1];
i=j;
}
}
if (i != m) {
for (j=m-1;j<=n;j++) SWAP(a[i][j],a[m][j])
for (j=1;j<=n;j++) SWAP(a[j][i],a[j][m])
}
if(x){
for (i=m+1;i<=n;i++) {
if (y=a[i][m-1]) {
y /= x;
a[i][m-1]=y;
for (j=m;j<=n;j++)a[i][j] -= y*a[m][j];
for (j=1;j<=n;j++)a[j][m] += y*a[j][i];
}
}
}
}
}
//QR algorithm for Eigenvalues
void hqr(double **a, int n, double wr[], double wi[]){
int nn,m,l,k,j,its,i,mmin;
double z,y,x,w,v,u,t,s,r,q,p,anorm;
void nrerror();
anorm=fabs(a[1][1]);
for (i=2;i<=n;i++)
for (j=(i-1);j<=n;j++)
anorm += fabs(a[i][j]);
nn=n;
t=0.0;
while (nn >= 1) {
its=0;
do {
for (l=nn;l>=2;l--) {
s=fabs(a[l-1][l-1])+fabs(a[l][l]);
if (s == 0.0) s=anorm;
if (fabs(a[l][l-1]) + s == s) break;
}
x=a[nn][nn];
if (l == nn) {
wr[nn]=x+t;
wi[nn--]=0.0;
} else {
y=a[nn-1][nn-1];
w=a[nn][nn-1]*a[nn-1][nn];
if (l == (nn-1)) {
p=0.5*(y-x);
q=p*p+w;
z=sqrt(fabs(q));
120
x += t;
if (q >= 0.0) {
z=p+SIGN(z,p);
wr[nn-1]=wr[nn]=x+z;
if (z) wr[nn]=x-w/z;
wi[nn-1]=wi[nn]=0.0;
} else {
wr[nn-1]=wr[nn]=x+p;
wi[nn-1]= -(wi[nn]=z);
}
nn -= 2;
} else {
if (its == 30) nrerror("Too many iterations in
HQR");
if (its == 10 || its == 20) {
t += x;
for (i=1;i<=nn;i++) a[i][i] -= x;
s=fabs(a[nn][nn-1])+fabs(a[nn-1][nn-2]);
y=x=0.75*s;
w = -0.4375*s*s;
}
++its;
for (m=(nn-2);m>=l;m--) {
z=a[m][m];
r=x-z;
s=y-z;
p=(r*s-w)/a[m+1][m]+a[m][m+1];
q=a[m+1][m+1]-z-r-s;
r=a[m+2][m+1];
s=fabs(p)+fabs(q)+fabs(r);
p /= s;
q /= s;
r /= s;
if (m == l) break;
u=fabs(a[m][m-1])*(fabs(q)+fabs(r));
v=fabs(p)*(fabs(a[m-1][m-
1])+fabs(z)+fabs(a[m+1][m+1]));
if (u+v == v) break;
}
for (i=m+2;i<=nn;i++) {
a[i][i-2]=0.0;
if (i != (m+2)) a[i][i-3]=0.0;
}
for (k=m;k<=nn-1;k++) {
if (k != m) {
p=a[k][k-1];
q=a[k+1][k-1];
r=0.0;
if (k != (nn-1)) r=a[k+2][k-1];
if (x=fabs(p)+fabs(q)+fabs(r)) {
p /= x;
q /= x;
r /= x;
}
}
if (s=SIGN(sqrt(p*p+q*q+r*r),p)) {
if (k == m) {
if (l != m)
a[k][k-1] = -a[k][k-1];
} else
a[k][k-1] = -s*x;
121
p += s;
x=p/s;
y=q/s;
z=r/s;
q /= p;
r /= p;
for (j=k;j<=nn;j++) {
p=a[k][j]+q*a[k+1][j];
if (k != (nn-1)) {
p += r*a[k+2][j];
a[k+2][j] -= p*z;
}
a[k+1][j] -= p*y;
a[k][j] -= p*x;
}
mmin = nn<k+3 ? nn : k+3;
for (i=l;i<=mmin;i++) {
p=x*a[i][k]+y*a[i][k+1];
if (k != (nn-1)) {
p += z*a[i][k+2];
a[i][k+2] -= p*r;
}
a[i][k+1] -= p*q;
a[i][k] -= p;
}
}
}
}
}
} while (l < nn-1);
}
}
//ODEs for satellite coordinates in the pulsating-rotating frame
double dxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dx;
dx=ux;
return dx;
}
double dydv(double v, double x, double y, double ux, double uy,
double m, double e){
double dy;
dy=uy;
return dy;
}
double duxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dux, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
122
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
dux=2*uy+rdivp*(x - m1*((x+m)/pow(r1, 3.0)) - m2*((x+m-
1)/pow(r2, 3.0)));
return dux;
}
double duydv(double v, double x, double y, double ux, double uy,
double m, double e){
double duy, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
duy=-2*ux+rdivp*(y - m1*(y/pow(r1, 3.0)) - m2*(y/pow(r2,
3.0)));
return duy;
}
//Variational ODEs for Lagrange points stability
double VdDxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDx;
dDx=Dux;
return dDx;
}
double VdDydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDy;
dDy=Duy;
return dDy;
}
double VdDuxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDux, rdivp, Uxx,Uxy;
rdivp=1/(1+e*cos(v));
Uxx=m*( (3*pow(x+m-1, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(x+m,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uxy=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDux=2*Duy + rdivp*Dx + rdivp*(Uxx*Dx + Uxy*Dy);
return dDux;
}
double VdDuydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDuy, rdivp, Uyx,Uyy;
123
rdivp=1/(1+e*cos(v));
Uyy=m*( (3*pow(y, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(y,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uyx=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDuy=-2*Dux + rdivp*Dy + rdivp*(Uyx*Dx + Uyy*Dy);
return dDuy;
}
//Equation f(x) for L1, l2, L3
double fx(double x, double m){
double func, r1c, r2c;
r1c=pow(fabs(x+m), 3);
r2c=pow(fabs(x+m-1), 3);
func=-x + (1.0-m)*((x+m)/r1c) + m*((x+m-1)/r2c);
return func;
}
//Equation f'(x) for L1, l2, l3 (root x>1)
double fdotx1(double x, double m){
double func1;
func1=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) - (3.0*m*(x+m-1))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func1;
}
//Equation f'(x) for L1, l2, l3 (root x<0)
double fdotx2(double x, double m){
double func2;
func2=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) + (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func2;
}
//Equation f'(x) for L1, l2, l3 (root 0<x<1)
double fdotx3(double x, double m){
double func3;
func3=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func3;
}
int main(int argc, char *argv[]) {
int i, j, k, colms=0, rows=0;
int i1=0,i2=1,i3=2,i4=3;
double v, v0, x, y, ux, uy, x0, y0, ux0, uy0, h;
124
double vn, xn, yn, uxn, uyn, limit;
double Dx, Dy, Dux, Duy, Dx0[4]={1,0,0,0}, Dy0[4]={0,1,0,0},
Dux0[4]={0,0,1,0}, Duy0[4]={0,0,0,1};//for Variational ODEs
double Dxn[4], Dyn[4], Duxn[4], Duyn[4];//for Variational ODEs
double stabtestx, stabtesty, stabtestx2, stabtesty2;
double x1, x2, y1, y2;
double xl1, yl1, xl2, yl2, xl3, yl3, xl4, yl4, xl5, yl5,
truexl4, trueyl4, truexl5, trueyl5;//for Lagrange points
double m, e, mass, ecc;
double a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2,
d3, d4;
double k1, k2, k3, k4, l1, l2, l3, l4, m1, m2, m3, m4, n1, n2,
n3, n4;
double x01, x02, x03, xn1, xn2, xn3;//for Newton-Raphson
double A[4][4], D[4][4], D2[4][4], **DD, **mat;
double massecc[100000][2], massecc2[10000][2];
double *eigmag;
double *wr, *wi;//Real and Imaginary parts for Eigenvalues
eigmag=vector(1,4);
wr=vector(1,4);
wi=vector(1,4);
int alpha;
DD=(double **) malloc((unsigned) 4*sizeof(double*));
for(alpha=0;alpha<=4;alpha++) DD[alpha]=D[alpha];
FILE * fp1;
FILE * fp2;
FILE * fp3;
FILE * fp4;
FILE * fp5;
FILE * fp6;
FILE * fp7;
FILE * fp8;
FILE * fp9;
/*Initial conditions and step h*/
v0=0.0; //true anomaly
m=0.035; //mass ratio
e=0.01; //eccentricity
h=0.005; //RK4 step
limit=v0+2*3.1415;
x01=1.1; //Newton-Raphson starting values
x02=-1.0;
x03=0.5;
/*Newton-Raphson*/
xn1=x01;
if( fx(x01, m)!=0 && fdotx1(x01, m)!=0 ){
125
do{
x01=xn1;
xn1=x01 - ((fx(x01, m)/fdotx1(x01, m)));
}
while(fabs(xn1 - x01) >= pow(10, -15));
}
xn2=x02;
if( fx(x02, m)!=0 && fdotx2(x02, m)!=0 ){
do{
x02=xn2;
xn2=x02 - ((fx(x02, m)/fdotx2(x02, m)));
}
while(fabs(xn2 - x02) >= pow(10, -15));
}
xn3=x03;
if( fx(x03, m)!=0 && fdotx3(x03, m)!=0 ){
do{
x03=xn3;
xn3=x03 - ((fx(x03, m)/fdotx3(x03, m)));
}
while(fabs(xn3 - x03) >= pow(10, -15));
}
//Coordinates of the Primaries
x1=-m;
y1=0.0;
x2=1-m;
y2=0.0;
//L4/l5 Coordinates
xl4=0.5*(1-2*m);
yl4=sqrt(3)/2;
xl5=0.5*(1-2*m);
yl5=-sqrt(3)/2;
//L1/L2/L3 Coordinates
xl1=xn1;
yl1=0.0;
xl2=xn2;
yl2=0.0;
xl3=xn3;
yl3=0.0;
//Initial Coordinates
x0=xl5;
y0=yl5;
126
//Initial velocity components
ux0=0.0;
uy0=0.01;
//Lagrange point to be tested for stability (LEAVE AS IS)
stabtestx=xl4;
stabtesty=yl4;
vn=v0;
xn=x0;
yn=y0;
uxn=ux0;
uyn=uy0;
fp1=fopen("SatelliteCoordinates.txt", "w+");
fp2=fopen("Primary1Coordinates.txt", "w+");
fp3=fopen("Primary2Coordinates.txt", "w+");
fp4=fopen("L4L5Coordinates.txt", "w+");
fp5=fopen("L1L2L3Coordinates.txt","w+");
fp6=fopen("VariationalCoordinatesAt2pi.txt", "w+");
fp7=fopen("HessenbergD.txt", "w+");
fp8=fopen("e_mStableL4.txt", "w+");
fp9=fopen("e_m_StabReg.txt", "w+");
while(vn<=limit){
//RK4 for ODE system
a1=h*dxdv(vn, xn, yn, uxn, uyn, m, e);
b1=h*dydv(vn, xn, yn, uxn, uyn, m, e);
c1=h*duxdv(vn, xn, yn, uxn, uyn, m, e);
d1=h*duydv(vn, xn, yn, uxn, uyn, m, e);
a2=h*dxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
b2=h*dydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
c2=h*duxdv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
d2=h*duydv((vn+h/2.0), (xn+a1/2.0), (yn+b1/2.0),
(uxn+c1/2.0), (uyn+d1/2.0), m, e);
a3=h*dxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
b3=h*dydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
c3=h*duxdv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
d3=h*duydv((vn+h/2.0), (xn+a2/2.0), (yn+b2/2.0),
(uxn+c2/2.0), (uyn+d2/2.0), m, e);
a4=h*dxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
b4=h*dydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
c4=h*duxdv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
d4=h*duydv((vn+h), (xn+a3), (yn+b3), (uxn+c3), (uyn+d3), m,
e);
x=((a1+2.0*a2+2.0*a3+a4)/6.0);
y=((b1+2.0*b2+2.0*b3+b4)/6.0);
127
ux=((c1+2.0*c2+2.0*c3+c4)/6.0);
uy=((d1+2.0*d2+2.0*d3+d4)/6.0);
vn=vn+h;
xn=xn+x;
yn=yn+y;
uxn=uxn+ux;
uyn=uyn+uy;
fprintf(fp1, "%f\t%f\n", xn, yn);
}
vn=v0;//reinitiallise true anomaly
fprintf(fp2, "%f\t%f\n", x1, y1);
fprintf(fp3, "%f\t%f\n", x2, y2);
fprintf(fp4, "%f\t%f\n%f\t%f", xl4, yl4, xl5, yl5);
fprintf(fp5, "%f\t%f\n%f\t%f\n%f\t%f", xl1, yl1, xl2, yl2, xl3,
yl3);
for(mass=0.0; mass<=0.05; mass=mass+0.0001){
for(ecc=0.0; ecc<=1.0; ecc=ecc+0.001){
//L4/l5 Coordinates
truexl4=0.5*(1-2*mass);
trueyl4=sqrt(3)/2;
truexl5=0.5*(1-2*mass);
trueyl5=-sqrt(3)/2;
//Lagrange point to be tested for stability (CHANGE 4 TO 5 FOR
L5)
stabtestx2=truexl4;
stabtesty2=trueyl4;
for(i=0; i<=3; i++){
Dxn[i]=Dx0[i];
Dyn[i]=Dy0[i];
Duxn[i]=Dux0[i];
Duyn[i]=Duy0[i];
while(vn<=limit){
//RK4 for Variational ODEs
k1=h*VdDxdv(vn, Dxn[i], Dyn[i], Duxn[i], Duyn[i],
stabtestx2, stabtesty2, mass, ecc);
l1=h*VdDydv(vn, Dxn[i], Dyn[i], Duxn[i], Duyn[i],
stabtestx2, stabtesty2, mass, ecc);
m1=h*VdDuxdv(vn, Dxn[i], Dyn[i], Duxn[i], Duyn[i],
stabtestx2, stabtesty2, mass, ecc);
n1=h*VdDuydv(vn, Dxn[i], Dyn[i], Duxn[i], Duyn[i],
stabtestx2, stabtesty2, mass, ecc);
k2=h*VdDxdv((vn+h/2.0), (Dxn[i]+k1/2.0), (Dyn[i]+l1/2.0),
(Duxn[i]+m1/2.0), (Duyn[i]+n1/2.0), stabtestx2, stabtesty2, mass,
ecc);
128
l2=h*VdDydv((vn+h/2.0), (Dxn[i]+k1/2.0), (Dyn[i]+l1/2.0),
(Duxn[i]+m1/2.0), (Duyn[i]+n1/2.0), stabtestx2, stabtesty2, mass,
ecc);
m2=h*VdDuxdv((vn+h/2.0), (Dxn[i]+k1/2.0), (Dyn[i]+l1/2.0),
(Duxn[i]+m1/2.0), (Duyn[i]+n1/2.0), stabtestx2, stabtesty2, mass,
ecc);
n2=h*VdDuydv((vn+h/2.0), (Dxn[i]+k1/2.0), (Dyn[i]+l1/2.0),
(Duxn[i]+m1/2.0), (Duyn[i]+n1/2.0), stabtestx2, stabtesty2, mass,
ecc);
k3=h*VdDxdv((vn+h/2.0), (Dxn[i]+k2/2.0), (Dyn[i]+l2/2.0),
(Duxn[i]+m2/2.0), (Duyn[i]+n2/2.0), stabtestx2, stabtesty2, mass,
ecc);
l3=h*VdDydv((vn+h/2.0), (Dxn[i]+k2/2.0), (Dyn[i]+l2/2.0),
(Duxn[i]+m2/2.0), (Duyn[i]+n2/2.0), stabtestx2, stabtesty2, mass,
ecc);
m3=h*VdDuxdv((vn+h/2.0), (Dxn[i]+k2/2.0), (Dyn[i]+l2/2.0),
(Duxn[i]+m2/2.0), (Duyn[i]+n2/2.0), stabtestx2, stabtesty2, mass,
ecc);
n3=h*VdDuydv((vn+h/2.0), (Dxn[i]+k2/2.0), (Dyn[i]+l2/2.0),
(Duxn[i]+m2/2.0), (Duyn[i]+n2/2.0), stabtestx2, stabtesty2, mass,
ecc);
k4=h*VdDxdv((vn+h), (Dxn[i]+k3), (Dyn[i]+l3), (Duxn[i]+m3),
(Duyn[i]+n3), stabtestx2, stabtesty2, mass, ecc);
l4=h*VdDydv((vn+h), (Dxn[i]+k3), (Dyn[i]+l3), (Duxn[i]+m3),
(Duyn[i]+n3), stabtestx2, stabtesty2, mass, ecc);
m4=h*VdDuxdv((vn+h), (Dxn[i]+k3), (Dyn[i]+l3),
(Duxn[i]+m3), (Duyn[i]+n3), stabtestx2, stabtesty2, mass, ecc);
n4=h*VdDuydv((vn+h), (Dxn[i]+k3), (Dyn[i]+l3),
(Duxn[i]+m3), (Duyn[i]+n3), stabtestx2, stabtesty2, mass, ecc);
Dx=((k1+2.0*k2+2.0*k3+k4)/6.0);
Dy=((l1+2.0*l2+2.0*l3+l4)/6.0);
Dux=((m1+2.0*m2+2.0*m3+m4)/6.0);
Duy=((n1+2.0*n2+2.0*n3+n4)/6.0);
vn=vn+h;
Dxn[i]=Dxn[i]+Dx;
Dyn[i]=Dyn[i]+Dy;
Duxn[i]=Duxn[i]+Dux;
Duyn[i]=Duyn[i]+Duy;
}
A[i][0]=Dxn[i];
A[i][1]=Dyn[i];
A[i][2]= Duxn[i];
A[i][3]=Duyn[i];
vn=v0;//reinitiallise true anomaly
}
//Transpose matrix A to ontain matrix D
for(i=0; i<=3; i++){
for(j=0; j<=3; j++){
D[i][j]=A[j][i];
}
129
}
/* //Print matrix D
printf("D=\n");
for(i=0; i<=3; i++){
printf("%f\t%f\t%f\t%f\n", DD[i][0], DD[i][1], DD[i][2],
DD[i][3] );
fprintf(fp6, "%f\t%f\t%f\t%f\n", D[i][0], D[i][1], D[i][2],
D[i][3] );
}
printf("\n");*/
//Eigenvalues with QR method via Hessenberg Elimination
//Conversion of matrix to D to offset form
mat=convert_matrix(&DD[0][0],1,4,1,4);
//Hessenberg form of Matrix D
elmhes(mat,4);
/* //Print matrix m Hessenberg D
printf("Hessenberg D (elements below the subdiagonal are
considered 0)\n");
for(i=1; i<=4; i++){
printf("%f\t%f\t%f\t%f\n", mat[i][1], mat[i][2], mat[i][3],
mat[i][4]);
fprintf(fp7, "%f\t%f\t%f\t%f\n", mat[i][1], mat[i][2],
mat[i][3], mat[i][4] );
}
printf("\n");*/
//QR method for Eigenvalues
hqr(mat,4,wr,wi);
/* //printf("Eigenvalues\n");
for(i=1; i<=4; i++){
printf("l%i=%f+(%f)*i\n", i, wr[i], wi[i]);
}*/
//Eigenvalues Magnitude calculation
for(i=1; i<=4; i++){
eigmag[i]=sqrt(pow(wr[i], 2) + pow(wi[i], 2));
//printf("Magnitude of eigenvalue l%i=%f\n", i, eigmag[i]);
}
if(eigmag[1]>0.999999 && eigmag[1]<1.000001 &&
eigmag[2]>0.999999 && eigmag[2]<1.000001 && eigmag[3]>0.999999 &&
eigmag[3]<1.000001 && eigmag[4]>0.999999 &&
eigmag[4]<1.000001){//UPDATE CRITIRIA FOR STABILITY ACCORDING TO
p.29
fprintf(fp8,"%f\t%f\n", mass, ecc);
}
130
//Stability Region 1-7 Calculation
printf("-------------------------------------------------------
-------------------------\n");
printf("m=%f\te=%f\n", mass, ecc);
fprintf(fp9, "%f\t%f\t", mass, ecc);
for(i=1; i<=4; i++){
printf("l%i=%f+(%f)*i\t", i, wr[i], wi[i]);
printf("Mag l%i=%f\n", i, eigmag[i]);
}
if( wr[2]==wr[1] && wi[2]==-wi[1] && wr[4]==wr[3] &&
wi[4]==-wi[3] && eigmag[1]>0.999999 && eigmag[1]<1.000001 &&
eigmag[2]>0.999999 && eigmag[2]<1.000001 && eigmag[3]>0.999999 &&
eigmag[3]<1.000001 && eigmag[4]>0.999999 && eigmag[4]<1.000001 ){
fprintf(fp9, "%i\n", 1);
printf("Reg.1\n");
}
else if( wr[3]==wr[1] && wi[3]==-wi[1] && wr[4]==wr[2] &&
wi[4]==-wi[2] ){
fprintf(fp9, "%i\n", 2);
printf("Reg.2\n");
}
else if( wr[2]==wr[1] && wi[2]==-wi[1] && wr[4]==wr[3] &&
wi[4]==-wi[3] ){
fprintf(fp9, "%i\n", 2);
printf("Reg.2\n");
}
else if( wi[1]==0.0 && wi[2]==0.0 && wi[3]==0.0 &&
wi[4]==0.0 && wr[1]*wr[3]<0.0 ){
fprintf(fp9, "%i\n", 3);
printf("Reg.3\n");
}
else if( wi[1]==0.0 && wi[2]==0.0 && wi[3]==0.0 &&
wi[4]==0.0 && wr[1]>0.0 && wr[3]>0.0 ){
fprintf(fp9, "%i\n", 4);
printf("Reg.4\n");
}
else if( wi[1]==0.0 && wi[2]==0.0 && wi[3]==0.0 &&
wi[4]==0.0 && wr[1]<0.0 && wr[3]<0.0 ){
fprintf(fp9, "%i\n", 5);
printf("Reg.5\n");
}
else if( wi[3]==0.0 && wi[4]==0.0 && wr[3]>0.0 && wr[4]>0.0
&& wr[2]==wr[1] && wi[2]==-wi[1] ){
fprintf(fp9, "%i\n", 6);
printf("Reg.6\n");
}
else if( wi[1]==0.0 && wi[2]==0.0 && wr[1]>0.0 && wr[2]>0.0
&& wr[4]==wr[3] && wi[4]==-wi[3] ){
fprintf(fp9, "%i\n", 6);
printf("Reg.6\n");
}
else if( wi[1]==0.0 && wi[4]==0.0 && wr[1]>0.0 && wr[4]>0.0
&& wr[3]==wr[2] && wi[3]==-wi[2] ){
fprintf(fp9, "%i\n", 6);
printf("Reg.6\n");
}
else if( wr[4]==wr[3] && wi[4]==-wi[3] && wi[1]==0.0 &&
wi[2]==0.0 && wr[1]<0.0 && wr[2]<0.0 ){
131
fprintf(fp9, "%i\n", 7);
printf("Reg.7\n");
}
else if( wr[2]==wr[1] && wi[2]==-wi[1] && wi[3]==0.0 &&
wi[4]==0.0 && wr[3]<0.0 && wr[4]<0.0 ){
fprintf(fp9, "%i\n", 7);
printf("Reg.7\n");
}
else if( wr[3]==wr[2] && wi[3]==-wi[2] && wi[1]==0.0 &&
wi[4]==0.0 && wr[1]<0.0 && wr[4]<0.0 ){
fprintf(fp9, "%i\n", 7);
printf("Reg.7\n");
}
printf("\n");
}
}
fclose(fp1);
fclose(fp2);
fclose(fp3);
fclose(fp4);
fclose(fp5);
fclose(fp6);
fclose(fp7);
fclose(fp8);
fclose(fp9);
return 0;
}
Program D:
//CALCULATION OF THE REGULAR REGIONS NEAR L4 OR L5 VIA THE FLI
METHOD
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#include <omp.h>
#define bool char
#define true 1
#define false 0
//Grid of Initial Conditions Around the Lagrange Point to be tested
#define UPPER_BOUNDARY_X 0.9
#define LOWER_BOUNDARY_X 0.9
#define UPPER_BOUNDARY_Y 0.4
#define LOWER_BOUNDARY_Y 0.4
#define AREA_STEP_X 0.0025
#define AREA_STEP_Y 0.0025
//Number of threads to be used by the computer(USE EVEN NUMBER, IF
THREADS = 8 CHANGE THE BOUNDARIES OF X(above) TO BE DIVISIBLE BY 8)
#define NUMBER_OF_THREADS 6
132
#define min(a,b) a >= b ? b : a
//ODEs for satellite coordinates in the pulsating-rotating frame
double dxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dx;
dx=ux;
return dx;
}
double dydv(double v, double x, double y, double ux, double uy,
double m, double e){
double dy;
dy=uy;
return dy;
}
double duxdv(double v, double x, double y, double ux, double uy,
double m, double e){
double dux, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
dux=2*uy+rdivp*(x - m1*((x+m)/pow(r1, 3.0)) - m2*((x+m-
1)/pow(r2, 3.0)));
return dux;
}
double duydv(double v, double x, double y, double ux, double uy,
double m, double e){
double duy, rdivp, m1, m2, r1, r2;
rdivp=1/(1+e*cos(v));
m1=1-m;
m2=m;
r1=sqrt(pow((x+m), 2.0) + pow(y, 2.0));
r2=sqrt(pow((x+m-1), 2.0) + pow(y, 2.0));
duy=-2*ux+rdivp*(y - m1*(y/pow(r1, 3.0)) - m2*(y/pow(r2,
3.0)));
return duy;
}
//Variational ODEs for Lagrange points stability
double VdDxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDx;
dDx=Dux;
return dDx;
133
}
double VdDydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDy;
dDy=Duy;
return dDy;
}
double VdDuxdv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDux, rdivp, Uxx,Uxy;
rdivp=1/(1+e*cos(v));
Uxx=m*( (3*pow(x+m-1, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(x+m,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uxy=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDux=2*Duy + rdivp*Dx + rdivp*(Uxx*Dx + Uxy*Dy);
return dDux;
}
double VdDuydv(double v, double Dx, double Dy, double Dux, double
Duy, double x, double y, double m, double e){
double dDuy, rdivp, Uyx,Uyy;
rdivp=1/(1+e*cos(v));
Uyy=m*( (3*pow(y, 2))/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) -
1/pow(pow(x+m-1, 2)+pow(y, 2), 3/2.0) ) + (1-m)*( (3*pow(y,
2))/pow(pow(x+m, 2)+pow(y, 2), 5/2.0) - 1/pow(pow(x+m, 2)+pow(y,
2), 3/2.0) );
Uyx=(3*m*(x+m-1)*y)/pow(pow(x+m-1, 2)+pow(y, 2), 5/2.0) +
(3*(1-m)*(x+m)*y)/pow(pow(x+m, 2)+pow(y, 2), 5/2.0);
dDuy=-2*Dux + rdivp*Dy + rdivp*(Uyx*Dx + Uyy*Dy);
return dDuy;
}
//Equation f(x) for L1, l2, L3
double fx(double x, double m){
double func, r1c, r2c;
r1c=pow(fabs(x+m), 3);
r2c=pow(fabs(x+m-1), 3);
func=-x + (1.0-m)*((x+m)/r1c) + m*((x+m-1)/r2c);
return func;
}
//Equation f'(x) for L1, l2, l3 (root x>1)
double fdotx1(double x, double m){
double func1;
func1=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) - (3.0*m*(x+m-1))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
134
return func1;
}
//Equation f'(x) for L1, l2, l3 (root x<0)
double fdotx2(double x, double m){
double func2;
func2=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) + (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func2;
}
//Equation f'(x) for L1, l2, l3 (root 0<x<1)
double fdotx3(double x, double m){
double func3;
func3=-1.0 + m/pow(fabs(x+m-1.0), 3) + (1.0-m)/pow(fabs(x+m),
3) + (3.0*m*(x+m-1.0))/pow(fabs(x+m-1.0), 4) - (3.0*(1.0-
m)*(x+m))/pow(fabs(x+m), 4);
return func3;
}
int main(int argc, char *argv[]) {
int i, j, k, colms=0, rows=0;
int i1=0,i2=1,i3=2,i4=3;
double v, v0, x, y, ux, uy, x0, y0, ux0, uy0, h;
double vn, xn, yn, uxn, uyn, limit;
double Dx, Dy, Dux, Duy, Dx0, Dy0, Dux0, Duy0;//for Variational
ODEs
double Dxn, Dyn, Duxn, Duyn;//for Variational ODEs
double stabtestx, stabtesty;
double x1, x2, y1, y2;
double xl1, yl1, xl2, yl2, xl3, yl3, xl4, yl4, xl5, yl5;//for
Lagrange points
double m, e, mass, ecc;
double a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4, d1, d2,
d3, d4;
double k1, k2, k3, k4, l1, l2, l3, l4, m1, m2, m3, m4, n1, n2,
n3, n4;
double x01, x02, x03, xn1, xn2, xn3;//for Newton-Raphson
double FLI;
double OmegaA, OmegaB, Theta;
double distance0, distancePr1, distancePr2;
bool FLIcheck;
int firstNormalAreaPoint_k = -1 , firstNormalAreaPoint_i = -1;
bool firstNormalAreaPoint = true;
FILE * fp1;
FILE * fp2;
FILE * fp3;
FILE * fp4;
FILE * fp5;
FILE * fp6;
FILE * fp7;
FILE * fp8;
135
FILE * fp9;
int thread_ID;
int number_Of_Threads;
int RECORDS;
double threadStart;
double threadEnd;
double ***res_mat, *temp;
int *res_records; //for each thread
double progress = 0.0;
/*Initial conditions and step h*/
v0=0.0; //true anomaly
m=0.005; //mass ratio
e=0.1; //eccentricity
h=0.005; //RK4 step
limit=v0+650*3.14159265;//Interval of Integration
x01=1.1; //Newton-Raphson starting values
x02=-1.0;
x03=0.5;
/*Newton-Raphson*/
xn1=x01;
if( fx(x01, m)!=0 && fdotx1(x01, m)!=0 ){
do{
x01=xn1;
xn1=x01 - ((fx(x01, m)/fdotx1(x01, m)));
}
while(fabs(xn1 - x01) >= pow(10, -15));
}
xn2=x02;
if( fx(x02, m)!=0 && fdotx2(x02, m)!=0 ){
do{
x02=xn2;
xn2=x02 - ((fx(x02, m)/fdotx2(x02, m)));
}
while(fabs(xn2 - x02) >= pow(10, -15));
}
136
xn3=x03;
if( fx(x03, m)!=0 && fdotx3(x03, m)!=0 ){
do{
x03=xn3;
xn3=x03 - ((fx(x03, m)/fdotx3(x03, m)));
}
while(fabs(xn3 - x03) >= pow(10, -15));
}
printf("xl1=%f\n",xn1);
printf("xl2=%f\n",xn2);
printf("xl3=%f\n\n",xn3);
//Coordinates of the Primaries
x1=-m;
y1=0.0;
x2=1-m;
y2=0.0;
//L4/l5 Coordinates
xl4=0.5*(1-2*m);
yl4=sqrt(3)/2;
xl5=0.5*(1-2*m);
yl5=-sqrt(3)/2;
//L1/L2/L3 Coordinates
xl1=xn1;
yl1=0.0;
xl2=xn2;
yl2=0.0;
xl3=xn3;
yl3=0.0;
fp1=fopen("SatelliteCoordinates.txt", "w+");
fp2=fopen("Primary1Coordinates.txt", "w+");
fp3=fopen("Primary2Coordinates.txt", "w+");
fp4=fopen("L4L5Coordinates.txt", "w+");
fp5=fopen("L1L2L3Coordinates.txt", "w+");
fp6=fopen("VariationalCoordinatesAt2pi.txt", "w+");
fp7=fopen("InitialConditionsFLI.txt", "w+");
fp8=fopen("FLI.txt", "w+");
fp9=fopen("x0y0FLIAll.txt", "w+");
fprintf(fp2, "%f\t%f\n", x1, y1);
fprintf(fp3, "%f\t%f\n", x2, y2);
fprintf(fp4, "%f\t%f\n%f\t%f", xl4, yl4, xl5, yl5);
fprintf(fp5, "%f\t%f\n%f\t%f\n%f\t%f", xl1, yl1, xl2, yl2, xl3,
yl3);
RECORDS = ( ( UPPER_BOUNDARY_X + LOWER_BOUNDARY_X ) /
AREA_STEP_X ) * ( ( UPPER_BOUNDARY_Y + LOWER_BOUNDARY_Y ) /
AREA_STEP_Y );
number_Of_Threads = NUMBER_OF_THREADS;
137
omp_set_num_threads( number_Of_Threads );
res_mat = (double***)malloc( number_Of_Threads *
sizeof(double**) );
res_records = ( int* )malloc( number_Of_Threads * sizeof(
int ) );
for( i = 0; i < number_Of_Threads; ++i )
{
res_mat[ i ] = (double**)malloc( 3 * sizeof(double*) );
// 3: for x0,y0,FLI
res_records[ i ] = 0;
for( j = 0; j < 3; ++j )
{
res_mat[ i ][ j ] = (double*)malloc( RECORDS *
sizeof(double) );
}
}
#pragma omp parallel
private(x0,y0,ux0,uy0,Dx0,Dy0,Dux0,Duy0,Dxn,Dyn,Duxn,Duyn,vn,xn,yn,
uxn,uyn,x,y,ux,uy,Dx,Dy,Dux,Duy,\
a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3,a4,b4,c4,d4,k1,l1,m1,n1,k2,l2,m
2,n2,k3,l3,m3,n3,k4,l4,m4,n4,\
FLI,thread_ID,threadStart,threadEnd,temp, FLIcheck, distance0,
distancePr1, distancePr2) \
firstprivate(
limit,h,m,e,v0,number_Of_Threads ) \
shared( res_mat,res_records,progress )
{
thread_ID = omp_get_thread_num();
number_Of_Threads = omp_get_num_threads();
threadStart = ( thread_ID*( ( UPPER_BOUNDARY_X +
LOWER_BOUNDARY_X ) / number_Of_Threads ) ) + xl4-LOWER_BOUNDARY_X;
//Change xl1-5 here for different Lagrange point
threadEnd = ( ( (thread_ID+1)*( ( UPPER_BOUNDARY_X +
LOWER_BOUNDARY_X ) / number_Of_Threads ) ) + xl4-LOWER_BOUNDARY_X
);
threadEnd = ( thread_ID == number_Of_Threads - 1 ?
threadEnd + AREA_STEP_X : threadEnd ); // last thread should
include upper limit too.
for(x0= threadStart; x0 < threadEnd;
x0=x0+AREA_STEP_X){
for(y0=yl4-LOWER_BOUNDARY_Y;
y0<=yl4+UPPER_BOUNDARY_Y; y0=y0+AREA_STEP_Y){ //Change yl1-5 here
for different Lagrange point
138
//Initial velocity components
ux0=0.0;
uy0=0.0;
//Initial Variational Coordinates
Dx0=100.0;
Dy0=100.0;
Dux0=0.0;
Duy0=0.0;
Dxn=Dx0;
Dyn=Dy0;
Duxn=Dux0;
Duyn=Duy0;
vn=v0;
xn=x0;
yn=y0;
uxn=ux0;
uyn=uy0;
FLIcheck = true;
while(vn<=limit){
//RK4 for ODE system
a1=h*dxdv(vn, xn, yn, uxn, uyn, m, e);
b1=h*dydv(vn, xn, yn, uxn, uyn, m, e);
c1=h*duxdv(vn, xn, yn, uxn, uyn, m, e);
d1=h*duydv(vn, xn, yn, uxn, uyn, m, e);
a2=h*dxdv((vn+h/2.0), (xn+a1/2.0),
(yn+b1/2.0), (uxn+c1/2.0), (uyn+d1/2.0), m, e);
b2=h*dydv((vn+h/2.0), (xn+a1/2.0),
(yn+b1/2.0), (uxn+c1/2.0), (uyn+d1/2.0), m, e);
c2=h*duxdv((vn+h/2.0), (xn+a1/2.0),
(yn+b1/2.0), (uxn+c1/2.0), (uyn+d1/2.0), m, e);
d2=h*duydv((vn+h/2.0), (xn+a1/2.0),
(yn+b1/2.0), (uxn+c1/2.0), (uyn+d1/2.0), m, e);
a3=h*dxdv((vn+h/2.0), (xn+a2/2.0),
(yn+b2/2.0), (uxn+c2/2.0), (uyn+d2/2.0), m, e);
b3=h*dydv((vn+h/2.0), (xn+a2/2.0),
(yn+b2/2.0), (uxn+c2/2.0), (uyn+d2/2.0), m, e);
c3=h*duxdv((vn+h/2.0), (xn+a2/2.0),
(yn+b2/2.0), (uxn+c2/2.0), (uyn+d2/2.0), m, e);
d3=h*duydv((vn+h/2.0), (xn+a2/2.0),
(yn+b2/2.0), (uxn+c2/2.0), (uyn+d2/2.0), m, e);
a4=h*dxdv((vn+h), (xn+a3), (yn+b3),
(uxn+c3), (uyn+d3), m, e);
b4=h*dydv((vn+h), (xn+a3), (yn+b3),
(uxn+c3), (uyn+d3), m, e);
c4=h*duxdv((vn+h), (xn+a3), (yn+b3),
(uxn+c3), (uyn+d3), m, e);
d4=h*duydv((vn+h), (xn+a3), (yn+b3),
(uxn+c3), (uyn+d3), m, e);
x=((a1+2.0*a2+2.0*a3+a4)/6.0);
139
y=((b1+2.0*b2+2.0*b3+b4)/6.0);
ux=((c1+2.0*c2+2.0*c3+c4)/6.0);
uy=((d1+2.0*d2+2.0*d3+d4)/6.0);
xn=xn+x;
yn=yn+y;
uxn=uxn+ux;
uyn=uyn+uy;
//RK4 for Variational ODEs
k1=h*VdDxdv(vn, Dxn, Dyn, Duxn, Duyn, xn,
yn, m, e);
l1=h*VdDydv(vn, Dxn, Dyn, Duxn, Duyn, xn,
yn, m, e);
m1=h*VdDuxdv(vn, Dxn, Dyn, Duxn, Duyn, xn,
yn, m, e);
n1=h*VdDuydv(vn, Dxn, Dyn, Duxn, Duyn, xn,
yn, m, e);
k2=h*VdDxdv((vn+h/2.0), (Dxn+k1/2.0),
(Dyn+l1/2.0), (Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
l2=h*VdDydv((vn+h/2.0), (Dxn+k1/2.0),
(Dyn+l1/2.0), (Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
m2=h*VdDuxdv((vn+h/2.0), (Dxn+k1/2.0),
(Dyn+l1/2.0), (Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
n2=h*VdDuydv((vn+h/2.0), (Dxn+k1/2.0),
(Dyn+l1/2.0), (Duxn+m1/2.0), (Duyn+n1/2.0), xn, yn, m, e);
k3=h*VdDxdv((vn+h/2.0), (Dxn+k2/2.0),
(Dyn+l2/2.0), (Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
l3=h*VdDydv((vn+h/2.0), (Dxn+k2/2.0),
(Dyn+l2/2.0), (Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
m3=h*VdDuxdv((vn+h/2.0), (Dxn+k2/2.0),
(Dyn+l2/2.0), (Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
n3=h*VdDuydv((vn+h/2.0), (Dxn+k2/2.0),
(Dyn+l2/2.0), (Duxn+m2/2.0), (Duyn+n2/2.0), xn, yn, m, e);
k4=h*VdDxdv((vn+h), (Dxn+k3), (Dyn+l3),
(Duxn+m3), (Duyn+n3), xn, yn, m, e);
l4=h*VdDydv((vn+h), (Dxn+k3), (Dyn+l3),
(Duxn+m3), (Duyn+n3), xn, yn, m, e);
m4=h*VdDuxdv((vn+h), (Dxn+k3), (Dyn+l3),
(Duxn+m3), (Duyn+n3), xn, yn, m, e);
n4=h*VdDuydv((vn+h), (Dxn+k3), (Dyn+l3),
(Duxn+m3), (Duyn+n3), xn, yn, m, e);
Dx=((k1+2.0*k2+2.0*k3+k4)/6.0);
Dy=((l1+2.0*l2+2.0*l3+l4)/6.0);
Dux=((m1+2.0*m2+2.0*m3+m4)/6.0);
Duy=((n1+2.0*n2+2.0*n3+n4)/6.0);
vn=vn+h;
Dxn=Dxn+Dx;
Dyn=Dyn+Dy;
Duxn=Duxn+Dux;
Duyn=Duyn+Duy;
140
//manually set FLI=100 if the satellite's
trajectory is not near lagrange point based on its distance from
Lagrange point, or if there is a collision with the primaries
distance0 = sqrt( pow(xn - xl4 , 2.0) +
pow(yn - yl4, 2.0) ); //Change xl1-5, yl1-5 here for different
Lagrange point
distancePr1 = sqrt( pow((xn - x1), 2.0) +
pow((yn - y1), 2.0) );
distancePr2 = sqrt( pow((xn - x2), 2.0) +
pow((yn - y2), 2.0) );
if ( distance0 > 1.0 || distancePr1 < 0.001
|| distancePr2 < 0.001 ){
FLI = 100;
FLIcheck = false;
break;
}
}
//FLI Calculation
if (FLIcheck){
FLI=log((sqrt(pow(Dxn,
2.0)+pow(Dyn, 2.0) + Duxn + Duyn))/vn);
}
//fprintf(fp9, "%f\t%f\t%f\n", x0, y0,
FLI);
res_mat[ thread_ID ][ 0 ][ res_records[
thread_ID ] ] = x0;
res_mat[ thread_ID ][ 1 ][ res_records[
thread_ID ] ] = y0;
res_mat[ thread_ID ][ 2 ][ res_records[
thread_ID ] ] = FLI;
++(res_records[ thread_ID ]);
}
printf("\rProgress\t[");
for(i = 0; i < 100; i+=5 )
{
if( ( progress / ( ( UPPER_BOUNDARY_X +
LOWER_BOUNDARY_X ) ) ) * 100 > i )
printf("|");
else
printf("-");
// printf("Progress: %.2f%%\n",(
progress / ( ( UPPER_BOUNDARY + LOWER_BOUNDARY ) ) ) * 100 );
}
141
printf("]\t%.2f%%\r", min( progress / ( (
UPPER_BOUNDARY_X + LOWER_BOUNDARY_X ) ) * 100, 100 ) );
#pragma omp critical
progress += AREA_STEP_X;
}
}
for( i = 0; i < number_Of_Threads; ++i )
{
for( k = 0; k < res_records[ i ]; ++k )
{
//Results of Initial Conditions and FLI for the
whole grid
fprintf(fp9, "%f\t%f\t%f\n", res_mat[ i ][
0/*x0*/ ][ k ], res_mat[ i ][ 1/*y0*/ ][ k ], res_mat[ i ][
2/*FLI*/ ][ k ] );
//If FLI < 6.0 write initial conditions and FLI
in seperate files
if( res_mat[ i ][ 2/*FLI*/ ][ k ] < 6.0 )
{
if( firstNormalAreaPoint )
{
firstNormalAreaPoint = false;
firstNormalAreaPoint_i = i;
firstNormalAreaPoint_k = k;
}
fprintf(fp7, "%f\t%f\n", res_mat[ i ][
0/*x0*/ ][ k ], res_mat[ i ][ 1/*y0*/ ][ k ]);
fprintf(fp8, "%f\n", res_mat[ i ][ 2/*FLI*/
][ k ]);
OmegaB =
atan(res_mat[i][1/*y0*/][k]/res_mat[i][0/*x0*/][k]);
}
}
}
if( !firstNormalAreaPoint )
{
if(res_mat[ firstNormalAreaPoint_i ][0][
firstNormalAreaPoint_k ]>0.0) {
OmegaA = atan(res_mat[ firstNormalAreaPoint_i ][1][
firstNormalAreaPoint_k ]/res_mat[ firstNormalAreaPoint_i ][0][
firstNormalAreaPoint_k ]);
}
else if(res_mat[ firstNormalAreaPoint_i ][0][
firstNormalAreaPoint_k ]<0.0){
OmegaA = 3.14159265 - atan(res_mat[
firstNormalAreaPoint_i ][1][ firstNormalAreaPoint_k ]/(-res_mat[
firstNormalAreaPoint_i ][0][ firstNormalAreaPoint_k ]));
}
}
142
//Range of the Regular Region Calculation(CAUTION: THE
PROGRAM USES THE FIRST AND LAST POINTS OF THE REGION WITHOUT TAKING
INTO ACCOUNT FLI VALUES THAT ARE CLOSE TO 6.0)
Theta = OmegaA-OmegaB;
printf("\nmu=%f\te=%f\tTheta = %f rad\n", m, e, Theta);
fclose(fp1);
fclose(fp2);
fclose(fp3);
fclose(fp4);
fclose(fp5);
fclose(fp6);
fclose(fp7);
fclose(fp8);
return 0;
}
143
References
Broucke, R. A. (1967). On Changes of Independent Variable in
Dynamical Systems and Applications to Regularization. Icarus,
Vol. 7, No. 2, pp. 221-231
Broucke, R. A. (1969). Periodic Orbits in the Elliptic Restricted
Three-Body Problem. Pasadena, California, Jet Propulsion
Laboratory, California Institute of Technology.
Hadjidemetriou, I. (2000). Theoretical Mechanics: Analytic
Dynamics, Special Theory of Relativity Vol. 2. Thessaloniki,
Giahoudi Publications.
Schwarz, R., Dvorak, R., Süli, Á., & Érdi, B. (2007). Survey of
the stability region of hypothetical habitable Trojan planets.
DOI: 10.1051/0004-6361:20077994
Szebehely, V. (1967). Theory of Orbits: The Restricted Problem
of Three Bodies. New York and London, Academic Press.
Voyatzis, G., & Meletlidou, E. (2015). Introduction to non-linear
dynamical systems. Athens, Kallipos Publications.
Exoplanet.eu, The Extrasolar Planets Encyclopedia (updated:
Oct. 11, 2017). Diagrams retrieved October 6, 2017, from
http://exoplanet.eu/