Volume 3, Issue 6 e1143
SPECIAL ISSUE PAPER
Full Access

An improved C++ Poisson series processor with its applications

José Antonio López Ortí

Corresponding Author

José Antonio López Ortí

Department of Mathematics, Jaume I University of Castellón, Castellón, Spain

Correspondence José Antonio López Ortí, Department of Mathematics, Jaume I University of Castellón, Castellón, Spain.

Email: [email protected]

Search for more papers by this author
Vicente Agost Gómez

Vicente Agost Gómez

Department of Mathematics, Jaume I University of Castellón, Castellón, Spain

Search for more papers by this author
Miguel Barreda Rochera

Miguel Barreda Rochera

Department of Mathematics, Jaume I University of Castellón, Castellón, Spain

Search for more papers by this author
First published: 14 December 2020

Abstract

One of major problems in celestial mechanics is the management of the long developments in Fourier or Poisson series used to describe the perturbed motion in the planetary system. In this work we will develop a software package suitable for managing these objects. This package includes the ordinary arithmetic operations with Poisson series—such as sum or product—as well as the most commonly used functions sin , cos , or exp , among others. Derivation or integration procedures with respect to time of these objects have been implemented and inversion or serialization procedures are also attainable to obtain such series. All the programming has been accomplished overloading the arithmetic and functional operators natural to C++ with the intention of allowing the programmer to work in a more friendly way and treating the series as if they were mere numbers. In this work we extend the processor in order to obtain the solution to perturbed problems which solution is in the form of a Poisson series. These algorithms have been written in C++.

1 INTRODUCTION

One of the main goals of celestial mechanics is to study the planetary motion in the solar system, that is, the construction of planetary theories. Planetary theories can be classified as analytical, semianalytical, and numerical. The analytical theories are based on the literal development of the perturbation function.1-3 The semianalytical theories are based on developments of the perturbative potential using numerical values for the coefficients of Fourier series and literal expressions for the arguments of the trigonometric functions.4, 5 Numerical theories can be obtained by numerical integration of the motion equations. To this purpose it may be advisable to consult.6

To construct analytical and semianalytical theories it is necessary to obtain the developments of the main magnitudes of the two-body problem as Fourier series of the anomalies. To this purpose see References 2, 3, 7 if the mean anomalies are used and for other anomalies.8-12

The solution of the two-body problem is a well-known problem in celestial mechanics and its motion around the primary is given through of the elements σ ; it is quite common to use Brouwer and Clemence's set III nomenclature.1 The perturbed problem can be studied by using the method of variation of constants, which is given by the Lagrange planetary equations
d a d t = 2 n a R σ , d e d t = 1 e 2 n a 2 e R ω + 1 e 2 n a 2 e R σ , d i d t = 1 n a 2 1 e 2 sin i R Ω + ctg i n a 2 1 e 2 R ω , d Ω d t = 1 n a 2 1 e 2 sin i R i , d ω d t = 1 e 2 n a 2 e R e cos i n a 2 1 e 2 sin i R i , d σ d t = 2 n a R a 1 e 2 n a 2 e R e , ()
where σ is defined by means of the equation:
M = σ + T 0 t n d t , ()
and it coincides with ε in the case of the unperturbed motion. R is the disturbing potential, R = R i , due to the disturbing bodies i = 1, …, N and is defined as7
R = k = 1 N G m k 1 Δ k x · x k + y · y k + z · z k r k 3 , ()
where r = ( x , y , z ) and r k = ( x k , y k , z k ) are the coordinates of the secondary and the disturbing body with respect to the primary, Δ k is the distance between the secondary and the disturbing body k, and mk is the mass of the k body; finally, σ 1 , , σ N are the elements of the N bodies.
In order to integrate the Lagrange planetary equations by analytical or semianalytical methods, in the first place, we solve the zero-order two-body problem Sun-planet for each planet. In the second place, we replace in the Lagrange planetary equations the solutions obtained in the zero-order problem. Thus, the solution in the k + 1 order is obtained by replacing the k order solution in the second member of Lagrange planetary equations. The solution for the j-element of the i-planet of the planetary equations in order k is given by a development like
σ i , j = A t i cos ( n 1 M 1 + + n N M N + B ) . ()

The terms of this series are the so-called Poisson terms and the complete series is known as a Poisson series. To integrate the Lagrange planetary equations it is necessary to work with these objects. The management of these series is quite difficult and it is convenient to have a Poisson series processor in order to manipulate these objects in a natural form.

A Poisson series processor is a software package containing a set of special functions programmed to deal with Poisson series. The first Poisson series processor was developed by Broucke13 and it was coded in Fortran language. Other Poisson series processors—designed for specific purposes—were developed by Ivanova,14 Abad,15 and Navarro.16 In the next section a new special software package to improve the handling of series of Poisson in the perturbative methods.

To construct a Poisson series processor it is necessary to define a previous C++ class called tPoisson, which members are the double precision numbers A, B, defining the amplitude and the phase of the Poisson term; the integer i, that represents the time exponent; and n1, … , nN, which symbolizes the angular coefficients of the mean anomalies of the Poisson term.

This class contains methods to set and get the values of the members and methods, such as ==, >=, or !=, declared to compare two Poisson terms following specific criteria. The methods have been implemented using the operator overloading technique in order to get a comfortable usage for the final user.

Based on the previous concepts and on the native C++ vector class, a new class—named sPoisson—has been developed. The members of this new class are vectors of terms of Poisson. This class contains the methods of the class vector and a set of private methods to sort, compact, or arrange Poisson series.

The main public methods included in poisson.h are the arithmetic operations +, −, ∗, pow; the extension of the most common functions sin , cos , exp to be evaluated over Poisson series;17 and functional operations such as Taylor developments and series inversion procedures based on Lagrange and Deprit methods.18 The operators and common functions have been overloaded in order to be more user friendly.

In order to guarantee a unified representation of the Poisson series, the following rules are to be followed:
  1. If at least one kj coefficient is not zero, the first not zero coefficient will be positive, A will be positive, and B [ 0 , 2 π ] . If all kj are zero, then A will be replaced by A · cos B and B will be set to zero.
  2. In a Poisson series only one term with the same coefficients k1, … , kp and the same powers of the spatial variables can be held. If recurrence occurs, the processor will merge the similar terms in the appropriate way.

In this work a processor dealing with vectors of Poisson series has been built. A Poisson series vector, vPoisson sp[N + 1]—with N fixed in advance is an object where sp[0], sp[1], … , sp[N] respectively represent the terms of order 0, 1, … , N in ε of the solution of a perturbed problem, which its solution can be developed as a power series of ε. This processor evaluate in an automatic form the development of the second members of perturbed equation, thus avoiding having to develop in Taylor series in manual mode, which is generally very tedious.

In Section 1 we will introduce the problem by defining the Poisson series and its usage problems; this section contains the general background of the problem.

In Section 2, the Poisson series processor is extended in order to manage these objects as vectors sp[N + 1] containing sp[k] k = 0, … , N a Poisson series containing the terms of order k in a parameter ε. This section encloses a subsection explaining the content of the main classes of the taylor_poisson.h package. In Section 3, a set of simple numerical examples are developed in order to show the performance of the new processor. In Section 4, the main conclusions of this work are exposed.

2 THE TAYLOR PROCESSOR SERIES

In these paragraphs we introduce the problems depending on one or more small paramaters ε1, … , εk, which orders are o1, … , ok. In this article we will only focus on one-parameter problems, as its explanation is simpler and the generalization to more parameters can be easily accomplished by taking the greater as ε and the rest as α i ε . The method used in perturbation theory to solve the problem x ˙ = f ( x , ε , t ) consists of the preliminary integration of the differential equations for ε = 0. We obtain a solution x = x ( A , t ) , where A is a set of constants equaling the number of variables which values are determined by the initial conditions of the system.

A commonly used technique to solve the whole problem (ε ≠ 0) is the method known as variation of constants, which swaps the constants A1, … , An with the functions A1(t), … , An(t). Thus, the substitution of these functions in x ( A , t ) satisfies the complete equation. The method of variation of constants in many problems leads to linear differential equations of the form d A d t = F ( A 1 ( t ) , , A n ( t ) , t ) · A ( t ) , where F is a matrix, which elements have the same order as ε. Generally, the method used to solve this system is the method of successive iterations. Starting with the values of A that appear in the unperturbed problem we obtain a solution δ 1 A ( t ) of first order in ε. Coming out of this solution, A ( t ) + δ 1 A ( t ) , we develop in second order in δ 1 A ( t ) and we obtain d δ 2 A d t = D ( F ( A ( t ) , t ) ) δ ˙ 1 A ( t ) and the process goes on successively.

In many problems, such as planetary theories, mathematical perturbed pendulums or with large oscillations, the quantities δ r A ( t ) adopt the form of a Poisson series, so, we are aimed to extend our processor in order to be able to automatically calculate the values of d δ 2 A d t , d δ 3 A d t , and so on up to order N, established in advance.

The method is simple and it is based on the representation of each Ai(t) with a Poisson series vector of dimension N, where A[0](t) represents zero-order perturbation terms, A[1](t) the first-order ones, and up to A[N](t), that designates the terms of order N in ε. With these vectors it is easy to provide an algebra substantiating
s p ( A [ 0 ] , A [ 1 ] , , A [ n ] ) = ( s p A [ 0 ] , s p A [ 1 ] , , s p A [ n ] ) , ()
defining the scalar product,
( A [ 0 ] , A [ 1 ] , , A [ N ] ) + ( B [ 0 ] , B [ 1 ] , , B [ n ] ) = ( A [ 0 ] + B [ 0 ] , A [ 1 ] + B [ 1 ] , , A [ N ] + B [ N ] ) , ()
determining the addition of two Poisson series vectors, and finally
( A [ 0 ] , A [ 1 ] , , A [ N ] ) · ( B [ 0 ] , B [ 1 ] , , B [ n ] ) = ( C [ 0 ] , C [ 1 ] , , C [ N ] ) , C [ k ] = i = 0 k A [ i ] B [ k i ] , ()
that defines the product of two Poisson series vectors. In the previous equations sp, A[0], … , A[N], B[0], … , B[N] represent Poisson series and it is noticeable that the operations maintain the order in ε of the components of the vector in all cases.

With these operations it is possible to manipulate Poisson series of the form i = 0 N s p [ i ] ε i , represented as vectors (sp[0], sp[1], … , sp[i]), in a way that allows to redefine all the operations and functions, such as sin ( s p ) , cos ( s p ) , exp ( s p ) , log ( 1 + s p ) , (1 + sp)r, and so on, included in the Poisson series processor posison_vector.h. Functions and operators can also be overloaded and this allows to create another C++ class, namely taylor_poisson.h. This new class empowers a more friendly and natural utilization of the equations linked to the method of variation of constants in the perturbed problem. Besides, the writing of the code dealing with that problem in different orders of perturbation can be accomplish more easily. This prevents the programmer from manually developing the Taylor series of the right-hand side of the equations, which in cases such as the Lagrange equations can be extraordinarily tedious.

The Poisson series processor on which the one presented here is based has been extensively tested, as a sample in the case of an analytical planetary theory.19 The kernel of the class vPoisson is schematically shown as follows.

2.1 Classes tPoisson and sPoisson

First, we lightly describe the classes previously built: tPoisson, a Poisson term; and sPoisson, a Poisson series. We will then define the new class vPoisson, a vector Poisson series, based on the mentioned classes before.

Class tPoisson

Hence, the tPoisson class is shown in more detail. The class harbors a data structure to be capable of storing mathematical expressions of the form
T p = A · t i · cos k = 1 N P n k · b k + B , ()
which will be known as Poisson terms, and a set of specific methods.

This class will be the fundamental tool to be able to create, manipulate and, ultimately, operate Poisson terms and construct Poisson series as a vector of Poisson terms.

Members:
  • m_A. A double precision value to store the variable A.
  • m_B. A double precision value to store the variable B.
  • m_i. A whole value to store the exponent i.
  • m_j. A static vector of whole values to store the NP variables n1, … , nk.
Methods:
  • tPoisson(). A constructor to create an instance of Poisson term with all its values set to zero.
  • tPoisson (const tPoisson&). A copy constructor to create a Poisson term; the new term is copied from a given one.
  • tPoisson (double, int, int[], double). A constructor to create a Poisson term explicitly specifying all its members.
  • tPoisson (double). A constructor to create a Poisson term by defining solely the member m_A and nullifying the rest. This method will let us create a Poisson term associated to a real number.
  •  tPoisson(). An instance destructor to delete Poisson terms and free the memory consumed.
  • double getA(). Method to access and read the value of the member m_A.
  • void setA(const double&). Method to allocate a value to the member m_A in a term.
  • double getB(). Method to retrieve the value of member m_B.
  • void setB(const double&). Method to allocate a value to the member m_B of a term.
  • int getI(). Method to retrieve the value of member m_I.
  • void setI(const int&). Method to allocate a value to the member m_I of a term.
  • int getJ(int). This method retrieves the value of the angular variable of a term given its position in the vector.
  • void setJ(int, int). Method to allocate the value of an angular variable given its position in the vector.
Operators:
  • bool operator== (const tPoisson&, const tPoisson&). This function overloads the == operator in order to be able to compare two Poisson terms. For the proper functioning of the processor it is important to highlight that two Poisson terms are considered equal if both their members, m_I, and their vectors, m_J, coincide.
  • bool operator!= (const tPoisson&, const tPoisson&). Overloads the != operator in order to be able to determine if two Poisson terms are different. Two terms are different if there are unequal. The definition of the function for this operator has been constructed based on the negation of the equality operator.
  • bool operator> (const tPoisson&, const tPoisson&). Overloads the > operator allowing to decide, under certain criteria, if a Poisson term is greater than another.
  • bool operator>= (const tPoisson&, const tPoisson&). Both the definitions of the overloaded functions > and == have been defined; the operator >= combines both of them.
  • bool operator< (const tPoisson&, const tPoisson&). Overloads the < operator allowing to decide, under certain criteria, if a Poisson term is less than another.
  • bool operator<= (const tPoisson&, const tPoisson&). The <= operator is a combination of the functions < and == and both operators have been previously implemented.

Class sPoisson

The class sPoisson is a data structure able to store a mathematical expression of the form
i = 1 M T p i where T p i is a Poisson term,
which will be known as a Poisson series. It is, indeed, a vector whose elements are Poisson terms. To implement the data structure the C++ standard library has been exploited and the C++ vector container has been taken to support the recently created sPoisson class defined as vector<tPoisson>

Members:

The members of the class sPoisson are the same ones as the C++ standard library container vector, since it has been defined as #sPoisson vector<tPoisson>.

Methods:

The methods of this class are the methods corresponding to the vector class and the ones inherited from the tPoisson class. Moreover, some operators have been overloaded and some functions have also been programmed.

Operators:
  • sPoisson& operator*(sPoisson&, sPoisson&). This operator has been devised to multiply two Poisson series.
  • sPoisson& operator*(const sPoisson&, double). This operator right-multiplies a Poisson series by a real number.
  • sPoisson& operator*(double, const sPoisson&). In the case, this operator left-multiplies a Poisson series by a real number.
  • sPoisson& operator/ (const sPoisson &, double). Operator to divide a Poisson series by a real number.
  • sPoisson& operator+(const sPoisson&, const sPoisson&). Operator to perform the addition of two Poisson series.
  • sPoisson& operator+(const sPoisson&, double). Operator to right-add a Poisson series and a real number.
  • sPoisson& operator+(double, const sPoisson&). Operator to left-add a Poisson series with a real number.
  • sPoisson& operator-(const sPoisson&, const sPoisson&). Operator to subtract a Poisson series from another.

Other functions:

In addition to the members of each previous classes, some manipulative functions involving Poisson series have been programmed. All these functions depend on the basic operations defined by the operators of the class.
  • sPoisson& pow(sPoisson&, int). This function has two parameters: a Poisson series and whole number representing the exponent. Based upon the operator “*,” this function implements the power of a Poisson series by multiplying the series by itself as many times as the value indicated by the exponent. It returns the compacted Poisson series after all the operations have been performed.
  • sPoisson& exp(sPoisson&). This function admits a Poisson series as a parameter. According to the established precision, it computes an exponential approximation based on Taylor's formula and returns a new compacted Poisson series.
  • sPoisson& sin(sPoisson&). This function admits a Poisson series as a parameter. According to the established precision, it computes an approximation of the function sine based on the Taylor's formula and returns a new compacted Poisson series.
  • sPoisson& cos(sPoisson&). This function admits a Poisson series as a parameter. According to the established precision, it computes an approximation of the function cosine based on the Taylor's formula and returns a new compacted Poisson series.
  • sPoisson& sqrt(sPoisson& sp, double). This function admits two parameters: a Poisson series and the index of the root. According to the established precision, it computes an approximation of the function ( 1 + x ) 1 p based on the Taylor's formula and returns a new compacted Poisson series.
  • sPoisson& log(sPoisson&). This function admits a Poisson series as a parameter. According to the established precision, it computes an approximation of the function log ( 1 + x ) based on the Taylor's formula and returns a new compacted Poisson series.
  • void arregla(sPoisson&). This function alters the content of a Poisson series in order to meet the convenient characteristics for its future treatment. If all the angular variables (m_j) are zero and m_B is not, it is advisable to make cos(m_B) part of m_A. Besides, it is also desirable to reduce the angles to the interval [0, 2 π [.
  • sPoisson& trunca(const sPoisson&, double). This function accepts a Poisson series and a positive number representing the maximum error as parameters. It returns another Poisson series where the terms with a smaller amplitude than the maximum error have been deleted.
  • sPoisson& compacta(const sPoisson&). It accepts a Poisson series as a parameter and computes another series where its terms have been arranged, operated, unified and simplified (equality holds depending on the overloaded operator == defined in the class tPoisson).

2.2 Class vPoisson

Based on the previous classes—tPoisson and sPoisson—and their basic operations defined in (5), (6), and (7) we can build the vPoisson class. This new class is the core that will allow the construction of the Taylor series processor.

Members:

The members of this class are the members of the vector class included in the C++ standard library, as the class has been implemented by means of #vPoisson vector<sPoisson>.

Operators:
  • vPoisson& operator+(const vPoisson&, const vPoisson&). This operator admits two vectors of Poisson series as parameters. It computes the addition of both vectors and returns the result as another vector.
  • vPoisson& operator*(const vPoisson&, const vPoisson&). This operator admits two vectors of Poisson series as parameters. It computes the product of both series. Especially in this operator it is important to highlight that the order in the series is always held, as terms of the same order must be kept together.
Other functions:
  • vPoisson& pow(const vPoisson&, int). This function admits two parameters: a vector and an positive integer. It multiplies the vector as times as the integer indicates, but always maintaining the terms of the same order in its adequate position within the series in the vector.
  • vPoisson& sin(const vPoisson&). This function admits a Poisson series vector as a parameter. According to the established precision, it computes an approximation of the sine function based on the Taylor's formula and returns a vector of series. Within this new vector the terms of the same order are kept together as part of the same Poisson series.
  • vPoisson& cos(const vPoisson&). This function admits a Poisson series vector as a parameter. According to the established precision, it computes an approximation of the cosine function based on the Taylor's formula and returns a vector of series. Within this new vector the terms of the same order are kept together as part of the same Poisson series.
  • vPoisson& exp(const vPoisson&). This function admits a Poisson series vector as a parameter. According to the established precision, it computes an approximation of the exponential function based on the Taylor's formula and returns a vector of series. Within this new vector the terms of the same order are kept together as part of the same Poisson series.
  • vPoisson& log(const vPoisson&). This function admits a Poisson series vector as a parameter. According to the established precision, it computes an approximation of the log ( 1 + x ) function based on the Taylor's formula and returns a vector of series. Within this new vector the terms of the same order are kept together as part of the same Poisson series.
  • vPoisson& compacta(vPoisson&). This function admits a Poisson series vector as a parameter. As the vector comprises a list of several Poisson series, it individually manipulates each one by applying the function compacta, previously defined within the class sPoisson.

By way of example, next section includes several problems in order to prove the efficiency of the package.

The kernel including the classes introduced before can be found in the URL http://mecanicaceleste.uji.es.

3 NUMERICAL EXAMPLE

To test the efficiency of our processor we will solve a simple problem via perturbative methods: a mathematical pendulum. It is defined by
d 2 x d t 2 = ω 2 sin x , x ( 0 ) = 0 . 5 , x ˙ ( 0 ) = 0 . ()
The exact solution to this problem is a well-known result20 and is given in terms of Jacobi's elliptical functions;20, 21 the period is smaller than the one used in the approximation
d 2 x d t 2 = ω 2 x ,
commonly used for small values of the amplitude and also suitable for the zero-order approximation in our problem.
The exact solution of the mathematical pendulum x ¨ = ω 2 sin x is given by20
sin x 2 = sin α 2 sn ( ω t , k ) , ()
where α is the amplitude of the motion, and sn the elliptic sinus of Jacobi for k = sin α 2 defined as
u = 0 ϕ d ϕ 1 k 2 sin 2 ϕ , ()
where ϕ = am ( u ) and sn u = sin ( am ( u ) ) = sin ϕ .
The period of this motion is given by T = 4 K ( k ) ω where K(k) is the complete elliptic integral of the first kind
K ( k ) = 0 π / 2 d φ 1 k 2 sin 2 φ . ()

Notice that cos x 2 = 1 k 2 sn ( ω t , k ) = dn ( ω t , k ) and so x ˙ = 2 ω sin α 2 cn ( ω t , k ) .

In order to simplify the calculations, temporal units have been chosen conducive to have T = 2 π for the linear approximation, and so, ω = 1 .

If the amplitude is not small, the model of harmonic oscillator cannot be applied to mathematical pendulum. For example, for A = 0.9, we have that the period of linear oscillator is T = 2 π = 6 . 28319 and the real period is Tr = 6.61687.

To determine the solution to our problem, firstly, we consider the development of the series sin x and, secondly, we introduce the parameter ε. The parameter is chosen so that if ε = 0, we have a linear approximation and if ε = 1, the problem is complete. Therefore, we study the problem
d 2 x ( t ) d t 2 = x + k = 1 ( 1 ) k + 1 ε k x 2 k + 1 ( 2 k + 1 ) ! , ()
with the initial conditions x(0) = 0.5, x ˙ ( 0 ) = 0 .
According to the previous transformations we have changed the problem into one eligible to be approximated through perturbation theory; the solution would be of the form
x ( t ) = k = 0 ε k x k ( t ) . ()
Assuming zero-order, this problem turns into a harmonic oscillator, which solution is given by
x 0 ( t ) = A cos t + B sin t , ()
and considering the initial conditions, we have A = 0.5, B = 0. If first-order in ε terms are taken, we attain the classical problem of the Duffing oscillator.20
The Duffing oscillator problem
x ¨ = x + μ x 3 , ()
associated to mathematical pendulum can be solved by using a perturbative method by means of the introduction of a parameter ε.
x ¨ x + ε x 3 6 . ()
The solution of unperturbed problem is known and applying the constant variation method we obtain:
A ˙ ( t ) = sin ( t ) x 3 6 ε , B ˙ ( t ) = cos ( t ) x 3 6 ε . ()
The terms in first order in ε are
x 1 [ t ] = 0 . 0078125 t sin ( t ) + 0 . 000651042 cos ( t ) 0 . 000651042 cos ( 3 t ) , ()
with period T1 = 6.38237.
The second approximation in ε is
x 2 [ t ] = ( 6 . 104 t 2 cos ( t ) + 8 . 138 t sin ( t ) 3 . 052 t sin ( 3 t ) + 1 . 950 cos ( t ) 2 . 035 cos ( 3 t ) ) · 1 0 5 , ()
with period T2 = 6.38383.
The terms of third order in ε are
x 3 [ t ] = ( 1 . 19 t 2 cos ( t ) + 1 . 83 t sin ( t ) 1 . 23 t sin ( 3 t ) ) · 1 0 6 , ()
with period T3 = 6.38383.

The Duffing oscillator improves the solution given by linear oscillator; however, if the initial amplitudes are large, the periods do not converge to the true period of the mathematical pendulum.

To avoid this inconvenience we study the complete problem through perturbative methods where it is advisable to use Lagrange's method of variation of parameters. Thus, A and B are replaced in the solution to the unperturbed problem with A(t), B(t), satisfying
A ˙ ( t ) = sin ( t ) k = 1 ( 1 ) k + 1 ε k x 2 k + 1 ( 2 k + 1 ) ! , B ˙ ( t ) = cos ( t ) k = 1 ( 1 ) k + 1 ε k x 2 k + 1 ( 2 k + 1 ) ! . ()

A classic solution using the perturbation method is as follows: to solve this system we apply a successive iterative technique. First, we will obtain the terms A(t) and B(t) as a first-order approximation in ε; these results are provided by the Poisson series processor. Then, after integrating and considering the initial conditions we obtain the terms up to third order of perturbation. They are shown below.

In order to show the iterations of this problem—and considering that t is the only angular variable—the terms cos ( n t + Ψ ) will be presented as cos ( Ψ ) cos ( n t ) sin ( Ψ ) sin ( n t ) in favor of greater clarity.

The unperturbed problem entails the solution
x 0 [ t ] = 0 . 5 cos ( t ) , ()
with period T 0 = 2 π = 6 . 28319 .
After running the Poisson series processor, taking the first-order terms of the vectors of the series that we obtain from (33), integrating, and imposing the initial conditions we obtain
x 1 [ t ] = ( 0 . 651 cos ( t ) 0 . 651 cos ( 3 t ) + 7 . 813 t sin ( t ) ) 1 0 3 , ()
with period T1 = 6.38237—which results greater than the harmonic oscillator. The results are truncated at 10−6.

Another point worth underlining is the presence of a term in the form t sin ( t ) , which is a nonperiodic term—in fact t derives from the Taylor approximations of periodic terms—and the approximation is only valid for not too large values of t. As the movement is periodic and symmetric with respect to x = 0, it is enough to calculate the solution up to T 4 and extend it by periodicity and symmetry.

The terms we get in second-order perturbation in ε are obtained by replacing in (33). Considering the initial conditions we have:
x 2 [ t ] = ( 1 . 22 t cos ( t ) + 0 . 61 t cos ( 3 t ) + 0 . 31 t cos ( 5 t ) 2 . 74 sin ( t ) + 0 . 61 t 2 sin ( t ) + 0 . 05 sin ( 3 t ) + 0 . 05 sin ( 5 t ) + 0 . 03 sin ( 7 t ) ) 1 0 4 , ()
being the period in this case T2 = 6.38136.
Third-order perturbation follows the same procedure; we obtain:
x 3 [ t ] = ( ( 4 . t + 1 . t 2 ) cos ( t ) + 2 . t cos ( 3 t ) + 3 . t sin ( t ) ( 1 . 1 . t 2 sin ( 3 t ) ) ) 1 0 6 . ()

The period in this final case results T3 = 6.38137 and it remains unchanged in a fourth-order perturbation.

The solution to the problem up to third-order perturbation is given by
x [ t ] = x 0 [ t ] + x 1 [ t ] + x 2 [ t ] + x 3 [ t ] . ()

The periods are computed by solving the equation xi(t) = 0 around the point t 0 = π / 4 and considering the root ξ 1 , we have T i = 4 ξ i which slightly differs from the real one—the one provided by elliptic functions—in less than 4 · 10−6 in the interval [0, T3/4].

In this case, the problem can be written as
x ¨ = x + x sin x , ()
and in this form we can consider the problem as an harmonic oscillator perturbed by a force F = x sin x . In the method applied in the previous section it is easy to develop the perturbative force in Taylor series as
x sin x = k = 1 ( 1 ) k x 2 k + 1 / ( 2 k + 1 ) ! , ()
and from this development we can introduce the problem depending on a parameter ε
x ¨ = x k = 1 ( 1 ) k x 2 k + 1 ( 2 k + 1 ) ! ε k . ()

This problem is solved by using the perturbation theory arranging an appropriate precision for one-fourth of the period, and from this solution we can extend them for other time.

Generally, the development of the perturbative forces is not easy, for example, in (1) and in this case it is preferable to leave the algebra to be carried out by a proper Poisson processor series. In this sense, in our example it is convenient to study the problem:
x ¨ = x + ε ( x sin x ) . ()
Our original problem is satisfied when ε = 1 and the method to solve this problem is to approach the solution of the perturbed problem as
x ( t ) = x 0 ( t ) + x 1 ( t ) ε + x 2 ( t ) ε 2 + , ()
and from this solution and taking ε = 1 we obtain an approximation to the mathematical pendulum solution.
The general solution of unperturbed problem is given by (15) and in this case the equations given by the method of variation of constants are
A ˙ ( t ) = sin ( t ) ( x sin x ) ε , B ˙ ( t ) = cos ( t ) ( x sin x ) ε . ()
Applying the Taylor series processor to this problem we obtain in first order in ε
x 1 ( t ) = ( 0 . 64264 cos ( t ) 0 . 64093 cos ( 3 t ) + 0 . 00067 cos ( 5 t ) + 7 . 73154 t sin ( t ) ) 1 0 3 , ()
with period T1 = 6.38134
In second order in ε we have
x 2 ( t ) = ( 1 . 981 cos ( t ) 1 . 98085 cos ( 3 t ) + 0 . 084 cos ( 5 t ) + 7 . 952 t sin ( t ) 0 . 029 t sin ( 3 t ) + 0 . 005 sin ( 5 t ) 5 . 978 t 2 cos ( t ) ) 1 0 5 , ()
with period T2 = 6.38276
Finally, in third order in ε we get
x 3 ( t ) = ( 0 . 58 cos ( t ) 0 . 63 0 . 63 cos ( 3 t ) + 0 . 05 cos ( 5 t ) + 1 . 76 t sin ( t ) 1 . 115 t 2 cos ( t ) + 0 . 69 t 2 cos ( 37 ) 0 . 31 t 3 sin ( t ) ) 1 0 6 , ()
with period T3 = 6.38279

To sum up, the example in this section demonstrates the precision of the method. The solution of the mathematical pendulum with initial conditions x(0) = 0.5, x ˙ ( 0 ) = 0 is obtained and the periods for each order of perturbation are shown.

4 CONCLUDING REMARKS

The usage of Poisson series is of utmost importance in the performance of perturbative methods in celestial mechanics. In this article the processor included in the class poisson.h has been extended. This extension has been successfully tested in problems as complex as the development of first-order planetary theories. Using the processor in higher-order theories involves the development of the second members of the Lagrange planetary equations as Taylor series, which is a burdensome process.

The taylor_poisson.h processor deals with vPoisson objects defined as Poisson series vectors. The components of these vectors correspond to the order of the small parameter around which the perturbative method is employed. The potential advantage of this processor is that the manual development in Taylor series of the small parameter ε is not required, as the processor has been programmed to do all the work automatically.

The efficiency of the processor has been tested in a simple example involving a mathematical pendulum with nonsmall oscillations, where linear modeling is not appropriate. On the one hand, a clean illustrative example has been chosen because the prime objective is to focus on the simplicity of usage of the processor when dealing with different perturbative orders; on the other hand, we want to compare the results with the ones produced by Mathematica, which is a unviable task when dealing with problems involving planetary theories.

As summary, we can highlight that
  • The Poisson series processor is suitable for the ordinary requirements of celestial mechanics.
  • The Poisson series vector processor is appropriate to study, by the method of variation of parameters, problems close to problems admitting periodic solutions.
  • The exemplification of the solution for the oscillations of a mathematical pendulum using a perturbative method when the amplitude is small can be handily automated with a Poisson series vector processor.
  • The results obtained with the processor—which kernel is included in the class taylor_poisson.h—have been compared with the ones achieved with Mathematica and they are exactly the same.
  • The method followed is extensible to more complicated problems, such as the analytical theory of an artificial satellite, planetary theories, and other problems linked with celestial mechanics.
  • The kernel of the processor is included in the C++ class taylor_poisson.h and can be accessed under General Public License v3 at the URL http://mecanicaceleste.uji.es.

ACKNOWLEDGMENTS

This information is not included in this version in order to do not show information about the authors.

    CONFLICT OF INTEREST

    The authors declare that they have no conflict of interest with regard to this work.

    APPENDIX: C++ CODE

    This appendix contains the C++ code used to compute the solution of the problem (31) with initial conditions x(0) = 0.5, x ˙ = 0 up to third order of perturbation. To start the solution of the unperturbed problem has been used.

    Biographies

    • José Antonio López Ortí Academic background: (1) Master in Mathematics science (1982). (2) Doctor in Mathematics (1987). He was Assistant since 1983 to 1984, Lecturer since 1984 from 1989, Professor (associated) since 1989, and Full Professor since 2011 to now. https://www.uji.es/departaments/mat/base/estructura/personal/?urlRedirect=https://www.uji.es/departaments/mat/base/estructura/personal/&url=/departaments/mat/base/estructura/personal&p_departamento=92&p_profesor=65082; https://www.researchgate.net/profile/Jose_Lopez_Orti

    • Vicente Agost Gómez—born in 1974 in Castellón, Spain—graduated in Computer Engineering in 1997 and in specific Computational Mathematics in 2008 at Jaume I. He holds a master degree in Computational Mathematics and earned a Ph.D. in Sciences at Jaume I university in 2020. He obtained his permanent position as a secondary school mathematics teacher in 2008 and joined Jaume I university as a part-time associate professor in the same year. He is presently conducting research into celestial mechanics and specifically into orbital motion.

    • Miguel Barreda Rochera was born in Castelló, Spain, in 1963. He went to primary school at the school Colegio Nacional de Prácticas Aneja in Castelló and to secondary school at the high school Francisco Ribalta in Castelló. He studies Mathematics at the University of Valéncia and received the Doctor degree in Mathematical Sciences from the University of Valéncia in 1994. From 1988 to 1990 he was Research Fellow at the Collegi Universitari de Castelló (University of Valéncia), Assistant Professor at University of Valéncia in 1991 and, since 1991 he is Associate Professor at the University Jaume I of Castelló. The focus of Dr. Barreda Rochera's research has been the study of rigid motions in General Relativity and Celestial Mechanics. ORCID: https://orcid.org/0000-0001-6876-5411

      The full text of this article hosted at iucr.org is unavailable due to technical difficulties.