Mathematical Algorithm for Solving Two–Body Problem

In this paper, computational algorithm with the aid of Mathematica software is specifically designed for the gravitational two–body problem. Mathematical module is established to find the position and velocity vectors. Application of this module for different kind of orbits (elliptic, parabolic and hyperbolic) leads to accurate results, which proved module efficiency and to be skillful. The classical power series method is to be utilized as the methodology.


Introduction
The classical two-body problem is the dynamical system which describes the motion of two objects. Of course, it is the simplest and only integrable system within frame of the classical Newtonian potential between two-bodies is applied. There are many applications in mathematical astronomy or in engineering and physical sciences can be analyzed within the frame work of two-body systems, it can be used in both quantum mechanics (particles motion) and celestial mechanics (Stars motion) The multivariate of the perturbed forces in inner and outer space change the two-body from a simple and integrable system to one is complex and is not integrable. Thereby the analytical solutions will be invalid in most real applications. The analysis of two-body problem under the effect of many perturbed forces have received a comprehensive an extended study in the literature space dynamics. For example, the perturbed twobody problem by radiation pressure force and many types of drag forces or both together has been investigated [6,[9][10][11][12]. Furthermore, the analytical solutions of the satellite motion within frame of non-sphericity and zonal harmonics perturbations effect have been studied by [7,8]. [4] have studied also the dynamics of anisotropic Kepler problem with small anisotropy. They proved that at every energy level the anisotropic dynamical system has two periodic orbits.
The perturbed two-body system is not limited to the perturbations of either radiation pressure and drag force or the non-sphericity of the bodies. But the other bodies can be taken as a perturbed forces for the motion of two-body system [5]. Another consequence of two-body problem is that the three-body problem can be reduced to the system of two-body, if we consider either the third body has mass equals zero or if it moves to infinity while the other primary does not. There are a considerable work have been constructed to find the periodic solution for many perturbed two-body systems, see for details [1,2,13]. In addition the two-body problem within frame of the corrections law of Newtonian inverse square law of gravitation can be studied as a perturbed model [3].
The motion of planets and asteroids is a very important field of interest in astronomy, and space dynamics. It can be formulated as a dynamical system of differential equations based on the Newton's laws of gravitation [14]. The law states that everybody attracts every other body along a line intersecting the two bodies with a force equals to F = Gm 1 m 2 /r 2 , where F is the force between the two bodies, G is the gravitational constant, m 1 is the mass o f the first body, m 2 is the mass of the second body, and r the distance between the centres of masses of the bodies [15].
Additionally, the Newtonian gravitation can be extended to N−bodies by simply summing the forces [16][17][18]. Moreover, various analytical and numerical methods have been used to examine such problems of celestial mechanics comprising of the two-body, three-body and the generalized N−body problem, see [19][20][21][22][23][24][25][26]. But we aim in this paper to computationally tackle the gravitational two-body problem with the application of the power series method [14].

Vector two-body equation
We start off this section by first introducing the equation of the gravitational N−body problem as [16] wherer i is the position vector of m i relative to m 0 , m i and m 0 are masses of i th body and central body, respectively and G is the universal constant of gravitation. Note that if all masses are equal zero except m 0 , m i , then Eq. (1) becomesr where µ = G(m 0 + m i ). The above equation is called the classical vector two-body equation.

Basic differential equations
Here, to analyze the gravitational two-body problem by formulate and examine the following nonlinear differential equations [14,27,28]q In analyzing the previous system of nonlinear differential equations, with employ the power series method [16]. Thus, leads to the power series expansion of the four dependent variables in Eqs. (4) as follows: Upon substitution of Eqs. (5) to Eqs. (4) and then solve for the coefficients of q n , ε n , λ n and ψ n , we get the following recurrence relations Also with the recurrence relations above taking the following starting values Furthermore, the values of q 0 and q 1 are known from the formulated problem, while ε 0 , λ 0 and ψ 0 to be determined from r 0 ≡ r(t 0 ) and v 0 ≡ v(t 0 ) as follows with r 0 = x 2 0 + y 2 0 + z 2 0 . In the next section with a help of Eqs. (6,7), the computational values of q n are determined for n = 9 using a designed algorithm which is called QPS, see Appendix A for algorithm.

f and g functions
Here, two Lagrangian coefficients functions f and g [14,27] introduced instead of one that led to the following position vector r = f r 0 + gv 0 where r 0 and v 0 are the initial values of the position and velocity vectors. Note also that the velocity vector is given by v =ḟ r 0 +ġv 0 Moreover, it is remarkable that Eqs. (8,9) satisfies the first equation in Eq. (4) with the following initial conditions [14,27] As in the above, using the power series method to get the relation recursively. The power series expansion of these functions take the form [27] together with the starting values [14,27] f 0 = 1 f 1 = 0 Also in the next section, analytical computations determine for the values of f n and g n for n = 10 using a designed algorithm called FGPS, see Appendix B for the algorithm.

Results and Discussion
In this chapter, computational values determine for the values q n+2 for n=9, f n and g n for n = 10 using Mathematica software with designed computational algorithms QPS and FGPS are given in Appendix A and Appendix B, respectively.
Furthermore, a mathematical modules establish to find the scalar values of the position and velocity vectors of the two-body motion via Mathematica software with the designed computational algorithm RVPS is given in Appendix C then we apply this module for different kinds of orbits (elliptic, parabolic and hyperbolic).

Values of q n
With the application of QPS algorithm for n = 9, the following symbolic expression of the q's coefficients are

Values of f n
With the application of FGPS for n = 10; T = 1, 2, the following symbolic expressions of the f 's are Again with the application of FGPS for n = 10; T = 1, 2, the following symbolic expressions of g's coefficients are

Applications on orbits
With the application of RVPS algorithm on different kinds of orbits with the initial values components for the position and velocity vectors is given by then, we get the final scalar values of the position and velocity vectors

Conclusion
The dynamical system of the two-body problem is addressed, by applying the mathematical modules, which are established to find the scalar values of the position and velocity vectors of the two-body motion. The Application of this module for different kinds of orbits (elliptic, parabolic and hyperbolic) leads to accurate results, that prove module efficiency.

* Input
T:A positive integer takes the value 1 or 2, such that: • T = 1 if it is required to find the f 's coefficients, • T = 2 if it is required to find the g's coefficients, ε 0 ,λ 0 ,ψ 0 ,n * Output n symbolic expressions of the f 's or g's coefficients according to the value of T .

* Purpose
To generate the position and velocity values for any orbit.