1 Introduction

The dynamics of comet 39P/Oterma is known to experience a fast transition between heliocentric orbits inside and outside of the orbit of Jupiter (Harris and Bailey 1998). It is remarkable that, during this transition, the comet passes close to the Lagrangian points \(L_1\) and \(L_2\) of the Sun–Jupiter system.

The simplest model to study this transition is the well-known planar circular restricted three-body problem (PCRTBP). The PCRTBP describes the motion of an infinitesimal particle (the comet) under the combined gravitational attraction of two primaries (Sun and Jupiter), which are assumed to move in circular orbits around their common centre of mass. Besides, the particle is assumed to move in the plane defined by the motion of the primaries. It is common to use a rotating system of reference (usually called synodical reference frame) so that the origin is at the centre of mass and Sun and Jupiter are kept fixed on the x axis. The unit of length is the Sun–Jupiter distance, the unit of mass is the total mass of the system and the unit of time is that the gravitational constant is equal to one. With these units, the period of Jupiter is \(2\pi \). Calling \(\mu \) to the mass of Jupiter, the Sun is located at \((\mu ,0)\) and Jupiter is at \((-1+\mu ,0)\). It is also well known that this model has five equilibrium points Szebehely (1967), three of them (\(L_{1,2,3}\), or collinear points) on the x axis and two of them (\(L_{4,5}\) or triangular points) defined as the third vertex of the equilateral triangle that has the primaries as the other two vertices (see Fig. 1).

The collinear points are of centre\(\times \)saddle type, so they are unstable. The well-known Lyapunov centre theorem Meyer and Offin (2017) implies the existence of a one-parametric family of periodic orbits that are born at the equilibrium point. This family is also unstable and, near the point, each periodic orbit in the family has a stable and a unstable manifold. It is remarkable that the manifolds of these periodic orbits meet so that there is an intricate network of connections between the neighbourhoods of \(L_1\) and \(L_2\) (Koon et al. 2000; Gómez et al. 2004; Canalias and Masdemont 2006; Canalias et al. 2006).

The transition of Oterma has been studied, using the PCRTBP, in Koon et al. (2001) where it has been shown that the invariant manifolds of the Lyapunov orbits near \(L_1\) and \(L_2\) can be used to connect orbits outside that of Jupiter with orbits inside, and vice versa. In Duarte and Jorba (2023) explicit normal form calculations around \(L_{1,2}\) are used to identify the concrete periodic orbits and their manifolds that organise this transition. This paper is done based on a previously built code Jorba (1999), in which the author explains the basis of it. Extensions of this work were done in several directions, i.e. different models, such as the elliptic restricted three-body problem Paez and Guzzo (2021, 2022), the Hill restricted four-body problem Peterson et al. (2023) and the quasi-bicircular problem Rosales et al. (2023).

In this paper we focus on a periodic time-dependent perturbation of the PCRTBP, the planar elliptic restricted three-body problem (PERTBP). In this model, Jupiter moves not in a circular but on an elliptic orbit. The phenomenon of the transition experimented by Oterma is caused by heteroclinic connections between objects (Lyapunov periodic orbits in the case of the PCRTBP, and the equivalent ones, in the PERTBP) around \(L_1\) and \(L_2\). Another important application of this study of heteroclinic connections is the computation of a chain for fast Arnold diffusion in the PERTBP Capiński and Duarte (2023).

Fig. 1
figure 1

The positions of the equilibrium points in the Sun–Jupiter RTBP

1.1 Description of the model

The planar elliptic restricted three body problem, PERTBP, models the motion of an infinitesimal particle under the gravitational attraction of two massive bodies that move on elliptical orbits around their common centre of mass. As before, by infinitesimal we mean that the particle is attracted by the two massive bodies but its mass is so small that its effect on the bodies can be neglected. In what follows we will focus on the Sun–Jupiter case.

There are several systems of coordinates which are common to use for this model. The one that is used in this paper is also known as roto-pulsating and it is inspired by the synodical system of coordinates of the PCRTBP. The origin is taken as the centre of mass, and the x axis is defined as the line joining Sun and Jupiter, so it rotates with a non-constant angular velocity. The unit of length is taken in a time-dependent way, so it expands and contracts periodically in time (creating an effect of pulsation) such that Sun and Jupiter have fixed coordinates on this axis and their relative distance is always 1. The positive direction on the x line is from Jupiter to the Sun. The z axis is parallel to the angular momentum of the system and the y-axis is chosen to obtain a positive-oriented system of coordinates. The plane \(z=0\) is invariant by the motion of the particle and, as the motion of Oterma takes place very close to this plane, we restrict ourselves to \(z=0\). It is usual to take units of time and mass such that the period of Sun and Jupiter is \(2\pi \), and the total mass of the system is 1. With these units, the gravitational constant is also equal to 1. Calling \(\mu \) to the mass of Jupiter, the Sun is located at \((\mu ,0)\) and Jupiter is at \((-1+\mu ,0)\).

To write the equations of motion in a simple way, it is common to use the true anomaly instead of time (see Szebehely 1967 for details). Then, the Hamiltonian \(H=H(x,y,p_x,p_y,f)\) for this problem is non-autonomous and can be written in the following way,

$$\begin{aligned} H = \dfrac{1}{2}\left( (p_x+y)^2+(p_y-x)^2\right) -\dfrac{1}{1+e\,\textrm{cos}\,f}\left( \dfrac{1}{2}(x^2+y^2) +\dfrac{1-\mu }{r_1}+\dfrac{\mu }{r_2}\right) , \end{aligned}$$
(1)

where \(r_1^2=(x-\mu )^2+y^2\), \(r_2^2=(x+1-\mu )^2+y^2\) and e is Jupiter’s eccentricity and f is its true anomaly that here plays the role of the time. The parameter values used here are \(\mu =0.0009538811803631\) and \(e=0.04859403602748\).

1.2 Goal

We will focus on the neighbourhood of \(L_1\) and \(L_2\) of the PERTBP. If the eccentricity e is zero, is the classical PCRTBP and these points are of centre\(\times \)saddle type, with a one-parametric family of periodic orbits emanating from them. If e is nonzero but small enough, these families of periodic orbits become (Cantorian) families of 2D tori, see Jorba and Villanueva (1997a). These tori have two basic frequencies: one is the frequency of a periodic Lyapunov orbit while the second one is the perturbing frequency, 1 in this case. Moreover, as the equilibrium point has a saddle direction, these tori have stable and unstable manifolds that organise the arriving/departing trajectories. Our primary goal is to show, for the Sun–Jupiter case, how these manifolds serve as a bridge that connects the neighbourhoods of \(L_1\) and \(L_2\) between them and with outside regions, in a similar manner as it happens on the PCRTBP. In a following paper Duarte and Jorba (2023) we will show that the PERTBP provides a much better description of the transition of Oterma (because the position of Jupiter is very important when passing nearby). In Duarte and Jorba (2023), we have identified which tori and manifolds guide the motion of Oterma during this transition and we have use them to have an accurate description of its motion. The computation of these heteroclinic connections between different tori also allows for the computation of a chain for the Arnold diffusion in the PERTBP. In Capiński and Duarte (2023), the authors use the data produced in this work to compute an initial guess and estimates for a real orbit diffusing in this model, using connections of tori from different frequencies around \(L_1\).

1.3 Summary of the paper

Section 2 explains the numerical methods used to compute the Lyapunov families of 2D tori around \(L_{1,2}\). It is common to use a Poincaré section to reduce the dimensionality of the problem and, specially, the dimension of the torus that becomes a 1D invariant curve. In periodically forced ODEs, it is common to use the temporal section given by the period of the flow (this is sometimes called an stroboscopic map), which results in an autonomous discrete dynamical system. We stress that this is not an option in this case, since the instability of the regions around \(L_{1,2}\) is so high that most of the initial conditions near these points are sent far away after \(2\pi \) units of time, which makes the stroboscopic map useless to study the dynamics near \(L_{1,2}\). A standard tool to deal with this situation is to use multiple shooting techniques. In Sect. 2, we explain a multiple shooting method to compute invariant tori, including the computation of their linear stability. The main difference with previous works (Jorba 2001) is that the computation of the Floquet change and the reduced matrix has to be adapted to a multiple shooting environment. In Sect. 3, we discuss how we have adapted a method for the computation of invariant manifolds to multiple shooting, and Sect. 4 shows some of the obtained tori, their invariant manifolds and how they provide a network connecting regions outside the orbit of Jupiter with regions inside and vice versa.

2 Numerical approximation of invariant tori

A standard first step to compute invariant objects of flows is to apply a suitable Poincaré section so that the dimension of the invariant object is reduced by one. In this way, the computation of periodic orbits becomes the computation of fixed points, and the computation of 2D tori becomes the computation of 1D invariant curves. The case of very unstable periodic orbits can be very difficult since the error growth during the numerical integration needed to return to the section can be so big that the accurate computation of the periodic orbit becomes very difficult or impossible. To solve this difficulty, it is common to use a multiple shooting method Stoer and Bulirsch (2002). Here, we combine the multiple shooting method used to find periodic orbits with a method to compute invariant 2D tori (for a version of these methods adapted to parallel computers see Gimeno et al. 2022). Next we will summarise a method to compute invariant tori and next we will explain how it is modified to be used in combination with multiple shooting.

2.1 Single shooting

As the PERTBP is a \(2\pi \)-periodic perturbation of the RTBP, the Lyapunov periodic orbits around \(L_1\) and \(L_2\) with frequencies that are non-resonant with the frequency 1 become 2D tori if the eccentricity is small enough. The method we use to compute them is a modification of the method in Castellà and Jorba (2000). To explain it, let us start by considering the (stroboscopic) section \(f=0\) (mod \(2\pi \)). Let P be the map from the section \(f=0\) to itself, defined by the numerical integration of the flow given by (1). Since the flow is \(2\pi \) periodic w.r.t. f, the map P becomes autonomous. Then, the 2D tori of the flow become 1D invariant curves of P, with a frequency \(\omega \) that comes from the frequency of a periodic orbit of the RTBP. This is, if \(\varphi :{\mathbb T}^1\rightarrow {\mathbb R}^4\) is a parametrisation of the invariant curve, it satisfies,

$$\begin{aligned} P(\varphi (\theta ))=\varphi (\theta +\omega ),\quad \forall \theta \in {\mathbb T}^1, \end{aligned}$$
(2)

which can be written in the form of a functional equation,

$$\begin{aligned} F(\varphi ,\omega )(\theta )=P(\varphi (\theta ))-T_{\omega }(\varphi )(\theta ) =0,\quad \forall \theta \in {\mathbb T}^1, \end{aligned}$$
(3)

where \(T_{\omega }\) is the linear operator defined by \(T_{\omega }(\varphi )(\theta ) = \varphi (\theta +\omega )\). The option considered here is to solve this equation by means of a Newton method. Let us first discuss the case in which \(\omega \) is known which, as we will see, it is the case here. It is natural to approximate \(\varphi \) by a truncated Fourier series,

$$\begin{aligned} \varphi (\theta )\approx \varphi _N(\theta )= a_0+\sum _{k=1}^Na_k\cos (k\theta )+b_k\sin (k\theta ), \qquad a_0,a_k,b_k\in {\mathbb R}^4, \quad \forall k=1,\ldots ,N. \end{aligned}$$

The chosen value for N has to do with the accuracy of the approximation of the curve, and its value will be discussed later on in this section. For now, let us choose some fixed value for it. The idea is to solve a discretised version of Eq. (3) on the mesh \(\theta _j=2\pi j/(2N+1)\), \(j=0,\ldots ,2N\). Then, given a truncated Fourier series \(\varphi _N^{(0)}\), we can evaluate it to produce a table of values for \(F(\varphi _N^{(0)},\omega )\),

$$\begin{aligned} F_j=P\left( \varphi _N^{(0)}\left( \frac{2\pi j}{2N+1}\right) \right) -\varphi _N^{(0)}\left( \frac{2\pi j}{2N+1}+\omega \right) ,\quad j=0,\ldots ,2N. \end{aligned}$$

To apply a Newton method, we can compute the derivatives of the values \(F_j\) w.r.t. the coefficients \(a_k\), \(b_k\) of \(\varphi _N^{(0)}\) by means of the chain rule, as discussed in Jorba (2001) and Castellà and Jorba (2000). Let us note that the number of unknowns (\(a_k\), \(b_k\)) and the number of equations coincides. Let us also note that, as the Poincaré map P is autonomous, the representation of an invariant curve is not unique: if \(\varphi (\theta )\), \(\theta \in {\mathbb T}^1\), is a representation of an invariant curve, for any \(\beta \in {\mathbb T}\), \(\varphi (\theta +\beta )\) is another representation of the same curve (i.e. the Fourier coefficients of \(\varphi (\theta )\) and \(\varphi (\theta +\beta )\) are different). This implies that Eq. (2) has a 1D manifold of solutions. This is usually solved by adding an extra condition, typically to ask that some coordinate has a prescribed value when \(\theta =0\) (Castellà and Jorba 2000; Gabern and Jorba 2004). This implies that the linear system to be solved at each step of the Newton method has one extra condition, which is solved using Gaussian elimination with pivoting (the pivoting sends a linearly dependent equation to the last row, which is then ignored since it has to be linearly dependent of the previous ones).

2.1.1 Error estimates

After successfully computing, via a Newton’s method, a set of Fourier coefficients such that \(\Vert F_j\Vert \) is small enough for all j, we should check if they represent an invariant curve of the Poincaré map P within a certain level of accuracy. To this end, for a given \(\omega \), we use

$$\begin{aligned} E(\varphi )=\max _{\theta \in \mathbb {T}^1}\Vert F(\varphi )(\theta )\Vert , \end{aligned}$$

that we estimate by using a much finer mesh (typically, with 10 or 100 times more points) than the one used for the discretisation. If this value is greater than the required level of accuracy, it means that a larger number of Fourier modes (i.e. a larger N) is needed. Therefore, N is increased and the computation is restarted using the previous invariant curve as starting point, see Fig. 2.

Fig. 2
figure 2

Algorithm for the determination of N

2.1.2 Initial conditions for the Newton method

As it has been mentioned before, the frequencies of the Lyapunov tori near \(L_{1,2}\) are the ones of Lyapunov orbits of the RTBP plus the perturbing frequency of the PERTBP, which is exactly 1. To compute these tori, we have computed first the family of Lyapunov periodic orbits when the eccentricity e is zero and we consider the time\(-2\pi \) flow for this case \(e=0\). A Lyapunov periodic orbit with irrational frequency \(\omega _0\) is then seen as an invariant curve for the time\(-2\pi \) map when \(e=0\): if the periodic orbit is parametrised from 0 to \(2\pi \), then a point on the orbit advances \(\omega =2\pi \omega _0\), which is the frequency of the curve. We have used this invariant curve as the starting point of a continuation method w.r.t. e, till the eccentricity of Jupiter is reached. Note that in all the continuation process the frequency of the invariant curve is known and constant. More details are given in Sect. 2.4.

2.2 Multiple shooting

Due to the high instability of the region near \(L_{1,2}\) we will combine the methods summarised in Sect. 2.1 with a multiple shooting technique Stoer and Bulirsch (2002). To this end, we will use four temporal sections for the angular variable f, \(f_j=\frac{j}{4}2\pi \), \(j=1,\ldots ,4\). We denote each of these sections by \(\Sigma _{f_j}\), the codimension 1 manifold defined as

$$\begin{aligned} \Sigma _{f_j}=\{(x,y,p_x,p_y,f)\in \mathbb {R}^4\times \mathbb {T}^1 \text{ such } \text{ that } f=f_j\}. \end{aligned}$$

Let us denote by \(P^j\), \(j=0,\ldots ,3\), the flow between sections \(\Sigma _{f_j}\) and \(\Sigma _{f_{j+1}}\). Therefore, the time-\(2\pi \) flow of the PERTBP, starting at \(f=0\), is given by \(P = P^3 \circ P^2 \circ P^1 \circ P^0\), see Fig. 3.

Fig. 3
figure 3

Illustration of the multiple shooting used for the PERTBP

In this context, to look for an invariant torus is to look for four curves, \(\varphi _j\), \(j=0,1,2,3\) (one for each section), such that

$$\begin{aligned} \left\{ \begin{aligned} P^0(\varphi _0(\theta ))&=\varphi _1(\theta ),\\ P^1(\varphi _1(\theta ))&=\varphi _2(\theta ),\\ P^2(\varphi _2(\theta ))&=\varphi _3(\theta ),\\ P^3(\varphi _3(\theta ))&=T_{\omega }(\varphi _0(\theta )). \end{aligned} \right. \end{aligned}$$
(4)

Each of these curves \(\varphi _j\) is approximated by a truncated Fourier series and, similarly as before, their coefficients are found by considering the equations

$$\begin{aligned} \left\{ \begin{aligned} F^0(\varphi )(\theta )&= P^0(\varphi _0(\theta ))-\varphi _1(\theta ),\\ F^1(\varphi )(\theta )&= P^1(\varphi _1(\theta ))-\varphi _2(\theta ),\\ F^2(\varphi )(\theta )&= P^2(\varphi _2(\theta ))-\varphi _3(\theta ),\\ F^3(\varphi )(\theta )&= P^3(\varphi _3(\theta ))-T_{\omega }(\varphi _0(\theta )). \end{aligned} \right. \end{aligned}$$
(5)

where we are using the notation \(\varphi =(\varphi _0,\varphi _1,\varphi _2,\varphi _3)\). As usual, these equations are discretised by representing the curves \(\varphi _j\) as a truncated Fourier series,

$$\begin{aligned} \varphi _j(\theta )=a_{0,j}+\sum _{k=1}^N a_{k,j}\cos (k\theta )+b_{k,j}\sin (k\theta ), \end{aligned}$$

and the system is solved iteratively by means of a Newton method. The computation of the Jacobian is similar to the single shooting case, taking into account that not all the equations depend on all the unknowns (the coefficients \(a_{k,j}\), \(b_{k,j}\)). This implies that the Jacobian has the form

$$\begin{aligned} {J =} \left( \begin{array}{llll} \dfrac{\partial F^0}{\partial c_0}\bigg |_{\theta } &{}\quad \dfrac{\partial F^0}{\partial c_1}\bigg |_{\theta } &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad \dfrac{\partial F^1}{\partial c_1}\bigg |_{\theta } &{}\quad \dfrac{\partial F^1}{\partial c_2}\bigg |_{\theta } &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad \dfrac{\partial F^2}{\partial c_2}\bigg |_{\theta } &{}\quad \dfrac{\partial F^2}{\partial c_3}\bigg |_{\theta } \\ \dfrac{\partial F^3}{\partial c_0}\bigg |_{\theta +\omega } &{}\quad 0 &{}\quad 0 &{}\quad \dfrac{\partial F^3}{\partial c_3}\bigg |_{\theta } \end{array} \right) , \end{aligned}$$

where the vectors \(c_i\) represent the coefficients \(a_{0i}\), \(a_{ji}\), \(b_{ji}\), as follows: \(c_i = (a_{0i},a_{1i},b_{1i},a_{2i}, b_{2i},\cdots ,a_{Ni},b_{Ni},)^T\), so that, each block in the diagonal reads:

$$\begin{aligned} \dfrac{\partial F^i}{\partial c_i}\bigg |_{\theta } = \left( \begin{array}{llllll} V^{\theta _0} &{}\quad V^{\theta _0}\cos (\theta _0) &{}\quad V^{\theta _0}\sin (\theta _0) &{}\quad \cdots &{}\quad V^{\theta _0}\cos (N\theta _0) &{}\quad V^{\theta _0}\sin (N\theta _0) \\ V^{\theta _1} &{}\quad V^{\theta _1}\cos (\theta _1) &{}\quad V^{\theta _1}\sin (\theta _1) &{}\quad \cdots &{}\quad V^{\theta _1}\cos (N\theta _1) &{}\quad V^{\theta _1}\sin (N\theta _1) \\ \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots \\ V^{\theta _{2N}} &{}\quad V^{\theta _{2N}}\cos (\theta _{2N}) &{}\quad V^{\theta _{2N}}\sin (\theta _{2N}) &{}\quad \cdots &{}\quad V^{\theta _{2N}}\cos (N\theta _{2N}) &{}\quad V^{\theta _{2N}}\sin (N\theta _{2N}) \\ \end{array} \right) , \end{aligned}$$

where \(V^{\theta _k}\) is the differential matrix of \(P^i\) at the point \(\varphi (\theta _k)\), and, each nonzero block out of the diagonal is given by:

$$\begin{aligned} \dfrac{\partial F^i}{\partial c_{j}}\bigg |_{\theta } = \left( \begin{array}{llllll} I &{}\quad I\cos (\theta _0) &{}\quad I\sin (\theta _0) &{}\quad \cdots &{}\quad I\cos (N\theta _0) &{}\quad I\sin (N\theta _0) \\ I &{}\quad I\cos (\theta _1) &{}\quad I\sin (\theta _1) &{}\quad \cdots &{}\quad I\cos (N\theta _1) &{}\quad I\sin (N\theta _1) \\ \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots \\ I &{}\quad I\cos (\theta _{2N}) &{}\quad I\sin (\theta _{2N}) &{}\quad \cdots &{}\quad I\cos (N\theta _{2N}) &{}\quad I\sin (N\theta _{2N}) \\ \end{array} \right) , \end{aligned}$$

for \(i=0,1,2,3\) and \(j=(i+1)\)mod 4.

2.2.1 Initial conditions

We have already mentioned before (Sect. 2.1.2) that the invariant tori near \(L_{1,2}\) can be found by means of a continuation method starting from the Lyapunov periodic orbits that exists for the RTBP (that is, PERTBP for \(e=0\)), increasing the eccentricity till its value for the Sun–Jupiter system. If we are using multiple shooting, initial conditions have to be given for each curve \(\varphi _j\), \(j=0,\ldots ,3\). Let us see how we obtain them.

Given a Lyapunov periodic orbit (for \(e=0\)), we start by computing four different parameterisations for this orbit, each one with a time shift of \(\pi /2\) units of time,Footnote 1 that is, the time needed to go from one section to the next. In this way, the periodic orbit is seen as four invariant curves \(\varphi _j\), \(j=0,\ldots ,3\) that solve (5) when \(\omega =2\pi \omega _p\), being \(\omega _p\) the frequency of the periodic orbit. These curves are the starting point of the continuation process till the Sun–Jupiter eccentricity is reached.

2.3 Linear stability

The linear stability of an invariant curve \(\varphi \) of a discrete dynamical system \(\bar{x}=P(x)\), \(x\in {\mathbb R}^n\), is given by the linear skew product

$$\begin{aligned} \left\{ \begin{aligned} \overline{x}&=A(\theta )x,\\ \overline{\theta }&=\theta +\omega , \end{aligned} \right. \end{aligned}$$
(6)

where \(A(\theta )=D_{x}P(\varphi (\theta ))\). This system is called reducible when there exists a change of variables \(y=C(\theta )x\), continuous with respect to \(\theta \), such that the above system can be written as

$$\begin{aligned} \left\{ \begin{aligned} \overline{y}&=By, \\ \overline{\theta }&=\theta +\omega , \end{aligned} \right. \end{aligned}$$
(7)

where \(B=C^{-1}(\theta +\omega )A(\theta )C(\theta )\) does not depend on \(\theta \) (and it is usually called the reduced matrix). The dynamics of system (7) can be easily studied by computing the eigenvalues of B.

It is known (Jorba 2001) that if a skew product (6) is reducible, the matrix B and the change of variables C can be obtained by studying the following generalised eigenvalue problem: find the couples \((\lambda ,\psi )\) such that

$$\begin{aligned} A(\theta )\psi (\theta ) = \lambda T_{\omega }\psi (\theta ), \end{aligned}$$
(8)

where \(\lambda \in {\mathbb C}\) and \(\psi \) belongs to the space of continuous functions from \({\mathbb T}^1\) to \({\mathbb R}^n\) endowed with the sup norm. We note that, as this is an eigenproblem in an infinite dimensional space, the set of eigenvalues can be empty, or to contain infinitely many values. In this case, the eigenvalues are organised in circles in the complex plane (Jorba 2001).

To compute these eigenvalues, we rewrite (6) as

$$\begin{aligned} T_{-\omega } \circ A(\theta )\psi (\theta ) = \lambda \psi (\theta ) \end{aligned}$$
(9)

and we discretise the operator \(T_{-\omega } \circ A\) using truncated Fourier series. This allows to compute a finite set of eigenvalues/eigenvectors and to choose the right ones, \(\{(\lambda _i,\psi _i)\}_{i=1}^n\) so that the reduced matrix B is \(\textrm{diag}(\lambda _1,\ldots ,\lambda _n)\) and \(C=(\psi _1,\ldots ,\psi _n)\), see Jorba (2001) for more details.

If an eigenvalue, say \(\lambda _1\), is real and different from \(\pm 1\) the eigenfunction is the linear approximation to the corresponding invariant manifold. That is, the linear approximation to the invariant curve \(\varphi \) is given by

$$\begin{aligned} (\theta ,\tau )\mapsto \varphi (\theta )+\tau \psi _1(\theta ), \end{aligned}$$

which is tangent to the invariant manifold at \(\tau =0\). This is illustrated in Fig. 4.

Fig. 4
figure 4

Invariant curves around \(L_1\) (left) and \(L_2\) (right) in the section \(f=0\). The arrows are vectors that are tangent to the stable and unstable manifolds at each point of the invariant curve. In both plots, the green and blue arrows represent the vectors that are tangent to the stable manifold and the yellow and orange arrows, the ones that are tangent to the unstable manifold

2.3.1 Multiple shooting

Let us see how to adapt the previous methods to compute the linear stability of an invariant curve to a multiple shooting environment. We focus on the case where four sections have been used, but the methods can be easily adapted to any number of sections.

Let us denote by \(\varphi _j\) the curve contained in section \(\Sigma _{f_j}\), \(j=0,\ldots ,3\) such that (4) holds, and let us define \(A^i(\theta )=D_xP^i(\varphi _i(\theta ))\). If we consider \(\varphi _0\) as the invariant curve for the map \(P^3\circ P^2\circ P^1\circ P^0\) then its linear stability follows from the eigenproblem \(A^3 \cdot A^2 \cdot A^1 \cdot A^0\,u=\lambda \,T_{\omega }\,u\) which, due to the high instability of the curve, involves huge numbers and it is not suitable for numerical computations. Therefore, to avoid the product of these matrices we consider the following eigenproblem,

(10)

where \(\hat{A}^3=T_{-\omega } \cdot A^3\). It is easy to see that the eigenvalues \(\sigma \) of this problem are the 4th roots of the eigenproblem that corresponds to single shooting, that is, \(A^3 \cdot A^2 \cdot A^1 \cdot A^0\,u=\sigma ^4\,T_{\omega }\,u\).

As before, we discretise this problem by using truncated Fourier series. As it is explained in Jorba (2001), each eigenvalue and eigenvector is computed with some accuracy. For the case of multiple shooting, this situation is not different. Hence, it is necessary to choose the ones that are computed with higher precision, so that the representation of the reduced change of variables and the reduced matrix are as accurate as possible. We refer to the Section 3.2 of Jorba (2001) for the details in the computations, the basic idea is based on that the eigenvectors are in fact eigenfunctions represented by truncated Fourier series and their accuracy can be estimated by the size of the last Fourier coefficients. Figure 4 shows a plot of the stable/unstable directions of \(\varphi _0\).

2.4 Continuation

The computation of families of invariant tori usually starts with the computation of a first torus in the family followed by a continuation to obtain the family in the interested range. When dealing with a Lyapunov family, sometimes the initial torus is computed near the fixed point of the map where the family is born, using information from the linear dynamics around the point (Castellà and Jorba 2000; Gómez and Mondelo 2001; Gabern and Jorba 2004). Here, we have used a different approach, as explained in Sect. 2.1.2: we have computed a periodic orbit for \(e=0\) and we have continued it with respect to e till the eccentricity of Jupiter. Next, we have kept e constant and we have used the frequency of the invariant curve as the continuation parameter to compute the Lyapunov family of invariant curves.

The families of invariant curves are not continuous but Cantorian: if the family is parameterised, for instance by the frequency of the invariant curve, the invariant curves do not exist for an open set of values of the parameter but for a Cantor set of positive Lebesgue measure (Broer et al. 1996). The holes that conform this Cantor structure are given by the resonances of the frequency of the invariant curves. If the system is analytic, the size of these holes decreases exponentially with the order of the resonance (Jorba and Villanueva 1997b, a). Due to this Cantor structure, the continuation of a family of invariant curves can be tricky sometimes. If we are in a zone where all resonances are of high order, the holes are so small that are below the resolution of the double precision arithmetic of the computer so that the family looks continuous. On the other hand, near a low order resonance we expect to have a larger hole that can break the continuation process if we try to look for a torus inside. The standard solution for this difficulty is to choose a larger continuation step so that the next tori we try to compute is “at the other side” of the hole. For this reason, it is common to compute first the family with a low accuracy and with a continuation stepsize that is not too small. These results can be used later as initial points for a more accurate computation.

In this case, we have used a continuation step in the frequency of \(10^{-4}\) and an accuracy in the approximation of the invariant curve of \(10^{-9}\). They are quite small but the continuation has succeeded with these values. Once the family has been computed, it would be easy to increase the accuracy of some of these tori if needed: adding a suitable number of Fourier modes, a single step of the Newton process will be enough to match the level of accuracy of the numerical integrator of the ODE (Jorba and Zou 2005).

Figure 5 shows some of the computed tori around \(L_1\) and \(L_2\).

Fig. 5
figure 5

Illustration of the parallel shooting used in this work for the PERTBP: 4 sections in the independent variable. The red point is Jupiter

With the above specification of the continuation parameter, the continuation step and the tolerance value, we have computed 7270 invariant curves around \(L_1\), with rotation number \(\omega \in [0.394274086132195,1.121174086130501]\), and 4498 invariant curves around \(L_2\), with rotation number \(\omega \in [5.694237631679274,6.143937631678226]\). These invariant curves correspond to 2D tori for the flow, with two basic frequencies: one of them is always 1 and come from the eccentricity of Jupiter while the other is \(\omega /(2\pi )\), being \(\omega \) the rotation number of the corresponding invariant curve. This means that the second frequency is in the range [2.06275066974, 2.17844039787] (\(L_1\)) and [1.90626606621, 1.97783804413] (\(L_2\)).

For these tori, the eigenvalues related to the unstable direction are on the range \([3.60319538152 \times 10^6, 2.08973695728 \times 10^7]\) (\(L_1\)) and \([7.33764362520 \times 10^5, 2.6410930 0607 \times 10^6]\) (\(L_2\)), which means that, in the worst case, the instability will be related to the maximum 4th root of these values, which is given by 67.61186347293.

The continuation has stopped at some distance from \(L_{1,2}\), enough to study the dynamics of comet Oterma (Duarte and Jorba 2023), which is the main motivation for these computations. This number of computed tori was also used in Capiński and Duarte (2023) for the computation of a chain of Arnold diffusion.

3 Computation of the stable and unstable manifolds of a torus

The Lyapunov invariant tori near \(L_{1,2}\) have a stable and an unstable invariant manifold. As it has been discussed in Sect. 2.3, the linear approximation to these manifolds is given by the corresponding eigenfunctions of the eigenproblem (8). To produce a global approximation to these manifolds we follow the ideas in Simó (1990). To simplify the presentation, let us focus first in the case of an unstable manifold, so let \(\lambda \in {\mathbb R}\), \(\lambda >1\) (this is what happens near \(L_{1,2}\) so we do not discuss the case \(\lambda <-1\)) the unstable eigenvalue and \(\psi \) its eigenfunction, so that the linear approximation to the unstable manifold can be parametrised as in (9). A fundamental set of an invariant manifold is a piece of the manifold that spans the full manifold by the iteration (backward and forward) of the Poincaré map. Here, a fundamental set is given by the cylinder

$$\begin{aligned} (\theta ,\tau )\in {\mathbb T}\times [h_0,\,h_0\lambda ] \mapsto \varphi (\theta )+\tau \psi _1(\theta ){,} \end{aligned}$$

where \(h_0 \in \mathbb {R}\) is a parameter that should be chosen small enough such that the previous representation provides a good approximation of the manifold (note that the separation between this cylinder and the true manifold is of the order \(O(|h_0|^2)\)). This cylinder can be used to span the whole manifold by simply applying the dynamics to a suitable mesh of points on the cylinder. We note that both values \(\pm h_0\) have to be used to generate both “sides” of the manifold.

Let us now see how the ideas of fundamental domain and multiple shooting can be combined to produce a satisfactory visualisation of the invariant stable/unstable manifolds in the case of a highly unstable environment. In this case, let us call \(\sigma \) the unstable eigenvalue of (10), and \((\psi _0,\ldots ,\psi _3)\) the eigenfunction (we recall that \(\sigma ^4\) is an eigenvalue of (8), the eigenproblem for the single shooting case). The linear approximation to the invariant manifolds is given by

$$\begin{aligned} (\theta ,\tau )\mapsto \{(\varphi _j(\theta )+\tau \psi _j(\theta ))\}_{j=0}^3. \end{aligned}$$
(11)

Note that, in this case, the dynamics is as follows:

$$\begin{aligned} \begin{aligned} P^j(\varphi _j(\theta )+\tau \psi _j(\theta ))&= \varphi _{j+1}(\theta )+\tau \sigma \psi _{j+1}(\theta )+O_2(\tau ), \qquad j=0,1,2,\\ P^3(\varphi _3(\theta )+\tau \psi _3(\theta ))&= \varphi _0(\theta +\omega )+\tau \sigma \psi _0(\theta +\omega )+O_2(\tau ). \end{aligned} \end{aligned}$$
(12)

As it has been commented before, we will use the linear approximation to produce an approximation to a fundamental cylinder, \((\theta ,\tau )\in {\mathbb T}\times [h_0,\sigma h_0]\). To this end, we have chosen the value \(|h_0|=10^{-5}\). Then, we use a mesh of equispaced values in \(\theta \) and \(\tau \) on the fundamental domain, we use (11) to produce a mesh on the manifold and we apply the dynamics to grow the manifold.

As \(|h_0|\) is small, several iterates are needed to move away from the invariant curve. On the other hand note that, near the torus, the initial error - defined as the initial separation between the cylinder (whose location is known) and the manifold (whose location is not known) - in the approximation of the manifold does not grow when we apply the dynamics, since the remaining directions are attracting (the stable direction) or neutral (the directions of the family of tori). The error only starts to increase when we move away from the manifold.

Fig. 6
figure 6

Illustration on how the parallel shooting technique can be used together with the fundamental domain concept in order to have a more precise computation of the invariant manifolds of a torus, using only 2 sections for simplicity. I and II represent the sections and the numbers from 0 to 5 points in these sections. See text for full details

Fig. 7
figure 7

Slices of manifolds of the tori \(T^{L_2}_{-1330}\) (left column) and \(T^{L_1}_{-2565}\) (right column)

Fig. 8
figure 8

Slices of manifolds of the tori \(T^{L_2}_{-1330}\) (left column) and \(T^{L_1}_{-2565}\) (right column) in the region around Jupiter

Figure 6 shows, schematically, the computation of the invariant manifolds in a multiple shooting situation, in the case of two sections, namely I and II. Let \(Q^0:I \rightarrow II\) and \(Q^1:II \rightarrow I\) the mapping from one section to the other one given by the flow. The points labelled with the number 0 represent the tori, so there is one on each section. The continuous curves starting at point 0 represent their manifolds. The numbers along the curve (from 1 to 5) denote points on the manifolds. Points 1 are taken at a small distance \(h_0\) of the invariant curve 0 inside the linear approximation of the invariant curve. Point 2 in I is the image of point 1 in II under \(Q^1\) and Point 2 in II is the image of point 1 in I under \(Q^0\). The manifold is approximated by the straight line joining 1 and 2. The remaining points (from 3 to 5) are obtained in an analogous way. To produce a finer mesh on the manifold, we take a mesh of points in the lines joining 1 and 2 inside sections I and II, and sending this mesh using \(Q^{0,1}\) we find a mesh between points 2 and 3, and so on.

The computation of stable manifolds follows the same procedure as before, but using the inverse of the maps \(P^j\) (the stable manifold becomes unstable by the inverse map). Note that the inverse maps are easy to obtain since they are the result of integrating backward in time.

4 Results

Let us now present a number of figures showing slices of the stable and unstable manifolds for some tori around \(L_1\) and \(L_2\). All the figures presented here lie in \(\Sigma _{\pi }\).

In Figs. 7 and 8, the subfigures (a) and (b) are composed by the curves coming from \(\Sigma _{\frac{3\pi }{2}}\) for the stable manifold and from \(\Sigma _{\frac{\pi }{2}}\) for the unstable one; the subfigures (c) and (d) are composed, in addition to the previous ones, by the curves coming from \(\Sigma _{0}\) for both the stable and the unstable manifolds; and finally, the subfigures (e) and (f) are composed, in addition to the previous ones, by the curves coming from \(\Sigma _{\frac{\pi }{2}}\) for the stable manifold and from \(\Sigma _{\frac{3\pi }{2}}\) for the unstable one together with the ones coming from \(\Sigma _{\pi }\) for both the stable and the unstable manifolds.

Let us explain the last paragraph using other words. We start with an example and generalise it later. Consider Fig. 7a. It is obtained integrating a mesh of points on a fundamental cylinder approximating both the stable and the unstable manifolds of \(T^{L_2}\) lying in the section \(\Sigma _{f_3}\), i.e. it is obtained by applying \((P^3)^{-1}\) and \(P^1\) to the mesh on the fundamental cylinder approximating the stable and the unstable manifolds, respectively. Figures 7b, 8a and b are obtained the same way. For Figs. 7c, d, 8c and d, we apply, in addition to \((P^3)^{-1}: \Sigma _{f_3} \rightarrow \Sigma _{f_2}\) and \(P^1: \Sigma _{f_1} \rightarrow \Sigma _{f_2}\),

$$\begin{aligned} (P^3)^{-1} \circ (P^0)^{-1}: \Sigma _{f_0} \rightarrow \Sigma _{f_2} \mathrm {\ and\ } P^1 \circ P^0: \Sigma _{f_0} \rightarrow \Sigma _{f_2}, \end{aligned}$$

i.e. both are integrated a time \(\pi \) departing from the section \(\Sigma _{f_0}\), backwards for the points close to the stable manifold and forward for the ones close to the unstable one.

As for Figs. 7e, f, 8e and f the only difference is that we apply the ones before and

$$\begin{aligned} (P^3)^{-1} \circ (P^0)^{-1} \circ (P^1)^{-1}: \Sigma _{f_1} \rightarrow \Sigma _{f_2} \mathrm {\ and\ } P^1 \circ P^0 \circ P^3: \Sigma _{f_3} \rightarrow \Sigma _{f_2} \end{aligned}$$

together with

$$\begin{aligned} (P^3)^{-1} \circ (P^0)^{-1} \circ (P^1)^{-1} \circ (P^2)^{-1}: \Sigma _{f_2} \rightarrow \Sigma _{f_2} \mathrm {\ and\ } P^1 \circ P^0 \circ P^3 \circ P^2: \Sigma _{f_2} \rightarrow \Sigma _{f_2}, \end{aligned}$$

all of them, for the points close to the stable and the unstable manifold, respectively.

We have followed a similar strategy as Jorba (2001): Each torus is represented by an invariant curve in each temporal section, hence an approximation to the, say, unstable manifold is given by a shift in the unstable direction of this circle representing the torus. In the application covered in Jorba (2001) this shifted circle is iterated by the flow and, as the dynamics is not as unstable as the one in the context of \(L_{1,2}\) in the PERTBP, these iterations produce a good visualisation for the manifold. In the case of a highly unstable environment, we use the fundamental cylinder for this visualisation and integrate for less time, more points. More specifically, to produce Figs. 7, 8 and 9, the interpolation parameter \(\tau \) is discretised to produce different “circles” (the parameter \(\theta \) is also discretised) which will act as an approximation of the manifold in the given direction.

Although the tori are presented in Figs. 7, 8, 9 in pairs, this is not mandatory, as it is not true that they are related one-to-one, like in the PCRTBP. In other words, \(T^{L_1}_0\) for instance, may have some influence in (and/or be influenced by) \(T^{L_2}_0\), but not only this one, as other ones with closer values of \(\omega \). In fact, this is exactly what is used to compute a chain for the Arnold diffusion in the case of the PERTBP Capiński and Duarte (2023).

In Fig. 7, we can see how the stable and the unstable manifolds of the considered tori expand in all directions, while in Fig. 8 we consider only the expansion in the direction of Jupiter, in order to better visualise the folds it has in that region.

Fig. 9
figure 9

Slices of the manifolds of \(T^{L_1}_0\) and \(T^{L_2}_0\) (opposite-to-Jupiter direction) together with some slices in the direction of Jupiter (in red with interpolated points). On the left side, slices of the stable manifold of \(T^{L_1}_0\) and, on the right side, the stable manifold of \(T^{L_2}_0\)

For Fig. 9, the manifolds presented are the ones of \(T^{L_1}_0\) and \(T^{L_2}_0\). They are analogous to Figs. 7e, f, 8e and f, i.e. they present points which were integrated for a time \(\pi /2\), \(\pi \), \(3\pi /2\) and \(2\pi \) coming from \(\Sigma _{f_1}\), \(\Sigma _{f_0}\), \(\Sigma _{f_3}\) and \(\Sigma _{f_2}\) (\(\Sigma _{f_3}\), \(\Sigma _{f_0}\), \(\Sigma _{f_1}\) and \(\Sigma _{f_2}\)) close to the unstable (stable) manifold, with the difference that the only directions presented are the “opposite-to-Jupiter” ones. The curves presented in red represent a slice of the manifolds that originally go to Jupiter direction. This serves as an illustration of the phenomenon that there are some parts of these manifolds that transit between regions, even considering small time integrations such as \(2\pi \), which were not the case for the tori in Fig. 7. This is not an statement that they could never experience these type of transition, instead it is a comparison between different behaviours with the same integration times. Moreover, these slices transit between regions (going from Jupiter region from the opposite) guided precisely by the parts of these manifolds that initially grow in these opposite directions, illustrating the phenomenon that they act as guides for the dynamics.

5 Conclusions

In this work, we have shown how to use the multiple shooting technique to compute invariant tori in a highly unstable environment, to analyse the linear dynamics around them, and to compute their stable and unstable invariant manifolds.

The computation of invariant tori is done by defining four sections in the phase space and a map from each section to the next, with the goal of computing the four sections of a 2D torus of the flow with these sections. Therefore, we compute the four invariant curves given by these sections.

In addition, for the computation of the linear stability of the computed tori, we have shown how to adapt the computation of the eigenvalues and eigenvectors done to study the stability of invariant curves of maps to this multiple shooting environment.

Finally, how to use the concept of fundamental domain in order to have a better visualisation of the manifolds of the computed tori and how the use of this concept together with the multiple shooting technique leads to improved results were also shown.

We have also used continuation methods to obtain the families of tori near \(L_{1,2}\) in the suitable range to describe the dynamics of comet 39P/Oterma so that these calculations are used in following papers (Duarte and Jorba 2023; Capiński and Duarte 2023) to study this transition by showing how these tori and their invariant manifolds provide an accurate description of the trajectory of the comet from an orbit outside that of Jupiter to an inner one and vice versa, and to produce an initial guess for a diffusion orbit in this model.