An efficient code to solve the Kepler equation

0 downloads 0 Views 2MB Size Report
27th AAS/AIAA Space Flight Mechanics Meeting. February 9, 2017. 1 ..... Celestial Mechanics and Dynamical Astronomy. • Fukushima, Toshio, 1996: A method ...
Solving the Kepler equation with the SDG-code Virginia Raposo-Pulido, Jesús Peláez SDG-UPM, E.T.S.I. Aeronáutica y del Espacio

27th AAS/AIAA Space Flight Mechanics Meeting February 9, 2017

1

Overview: Kepler equation Kepler equation provides the position of the object orbiting around a body for some specific time. Hyperbolic orbits: 𝑥 = 𝑒 𝑠𝑖𝑛ℎ 𝑦 − 𝑦

Elliptical orbits: 𝑥 = 𝑦 − 𝑒 𝑠𝑖𝑛 𝑦 Unknown parameter  y=E

Unknown parameter  y=H

Known parameters  x=M ; 𝑒

Known parameters  x=MH ; 𝑒

Approaches

Gooding (1986)

Nijenhuis (1991)

Fukushima (1996)

E starter estimation

X

X

X

E bounds estimation

Iterative method No iterative method

X

X

X

Mortari & Elipe (2014)

Approaches

Gooding (1988)

Fukushima (1997)

Avendaño (2015)

H starter estimation

X

X

X

X

X

X

X

H bounds estimation

X

Iterative method No iterative method

Solving the Kepler equation with the SDG-code

X

2

Motivation • Take advantage of the full potential of the symbolic manipulators.

• Efficient solving of Kepler equation estimating a good initial seed for the eccentric and hyperbolic anomaly:

* To improve the computational time * To reach the machine error accuracy with hardly iterations

• Appropriate algorithm in the singular corner of the Kepler equation: * Neighborhood of M =0 and e =1 * To avoid convergence problems in the numerical method

• The advantage of the good behavior of the modified Newton-Raphson method when the initial seed is close to the looked for solution.

• Applicability to other problems: Lambert’s problem

Solving the Kepler equation with the SDG-code

3

Code solution: The N-R methods • Modified NR method: Solution of the equation defined by a successive approximation method starting from the seed (yo): 𝑦𝑖+1 = 𝑦𝑖 + Δ𝑦𝑖 , 𝑖ϵ ℵ Second order Taylor expansion about 𝑦𝑖 :



𝑓 𝑦𝑖+1 = 𝑓 𝑦𝑖 + Δ𝑦𝑖 = 0 1

𝑓 𝑦𝑖+1 ≈ 𝑓 𝑦𝑖 + 𝑓′ 𝑦𝑖 Δ𝑦𝑖 + 2 𝑓 ′′ 𝑦𝑖 Δ𝑦𝑖 2 = 0

−𝑓 ′ 𝑦𝑖 + 𝑓 ′ 𝑦𝑖 2 − 2𝑓 𝑦𝑖 𝑓 ′′ 𝑦𝑖 2𝑓(𝑦𝑖 ) ∆𝑦𝑖 ≈ = − 𝑓 ′′ 𝑦𝑖 𝑓′(𝑦𝑖 ) ± | 𝑓 ′ 𝑦𝑖 2 − 2𝑓 𝑦𝑖 𝑓 ′′ 𝑦𝑖 |

+ → 𝑓 ′ 𝑦𝑖 > 0 − → 𝑓 ′ 𝑦𝑖 < 0

• Generalization of the modified N-R method  Root-finding method of Laguerre (Conway 1986) Tolerances double  1.1*10-15

∆𝑦𝑖 ≈ −

𝑛𝑓(𝑦𝑖 )

𝑓′(𝑦𝑖 ) ± | 𝑛 − 1 [(𝑛 − 1)𝑓 ′ 𝑦𝑖

𝑓 𝑦𝑖 ≡ 0 2

− 𝑛𝑓 𝑦𝑖 𝑓 ′′ 𝑦𝑖 ]|

Kepler equation for elliptic or

quadruple  1.0*10-24

hyperbolic orbit

Classical N-R method

Modified N-R method

Conway method

n=1

n=2

n=5

Solving the Kepler equation with the SDG-code

4

Code solution: The seed value (elliptic orbits) 1. The Kepler equation for elliptic orbits:

4. For each interval a fifth degree polynomial pi(x) is defined to interpolate y

𝑦 ↔ 𝑥 = 𝑦 − 𝑒sin𝑦 𝑦 𝑥 ≈ pi x = 𝑎𝑜𝑖 + 𝑎1𝑖 𝑥 + 𝑎2𝑖 𝑥 2 + 𝑎3𝑖 𝑥 3 + 𝑎4𝑖 𝑥 4 + 𝑎5𝑖 𝑥 5

with 𝑥 ∈ 0, 𝜋 when 𝑦 ∈ 0, 𝜋

2. The y-domain [0, π] is discretized in 23 intervals: 𝑦1 = 0 𝑦𝑖−1 =

(𝑖 − 1)𝜋 𝑖 = 3, … 25 24

3. The x-domain is discretized according to the Kepler equation

5. Six boundary conditions are imposed to determine the coefficients of pi(x) 𝑝𝑖 𝑥𝑖 = y 𝑥𝑖 = 𝐸𝑖

𝑝𝑖 𝑥𝑖+1 = y 𝑥𝑖+1 = 𝐸𝑖+1

𝑝′𝑖 𝑥𝑖 = y′(𝑥𝑖 )

𝑝′𝑖 𝑥𝑖+1 = y′(𝑥𝑖+1 )

𝑝′′𝑖 𝑥𝑖 = y′′(𝑥𝑖 )

𝑝′′𝑖 𝑥𝑖+1 = 𝑦′′(𝑥𝑖+1 )

6. Given e and x=M, the starting value yo is estimated: 𝑦0 = 𝐸0 = 𝑝𝑖 (𝑥 = 𝑀)

* If x > π  x = 2π – χ y = 2π - η Solving the Kepler equation with the SDG-code

5

Code solution: The seed value (hyperbolic orbits) 1. A change of variable is done in the Kepler equation:

𝑦 ∈ 5, ∞ → 𝑆 ∈ 74.2, ∞ → 𝑥 ∈ 69.2, ∞

𝑆 = sinh 𝑦 ↔ 𝑥 = 𝑒𝑆 − ln|𝑆 + 1 + 𝑆 2 |

with 𝑥 ∈ 0, ∞ when 𝑦 ∈ 0, ∞

and 𝑆 ∈ 0, ∞

e𝑆 (𝑒 = 2)

Asymptotic expansion 𝑥 𝑆 = 1+𝜑 , 𝜑 ≪1 𝑒

300



ln|𝑆 + 1 + 𝑆 2 | 5.8 5.7 5.6

250 5.5 5.4 5.3

2. The y-domain is divided in 2 intervals:

Replacing in the main equation  𝜑 𝑥, 𝑒

𝑦 ∈ 0, 5 → 𝑆 ∈ 0, 74.2 → 𝑥 ∈ 0, 69.2

5(𝑖 − 1) 𝑦𝑖 = 𝑖 = 1, … 26 25

5.2 5.1 150 50

fifth degree polynomial (6 boundary conditions)

 (𝑆𝑖 , 𝑥𝑖 )

200

Asymptotic expansion 𝑥 𝑆 = 1+𝜑+𝜉 𝑒 𝜉 ≪ 1, 𝜉 ≤ 𝜑

75

100 S

150

5 50

100 S

Replacing in the main equation  𝜉 𝑥, 𝑒, 𝜑

𝑒=1

𝑆0 𝑥 ≈ pi x = 𝑎𝑜𝑖 + 𝑎1𝑖 𝑥 + 𝑎2𝑖 𝑥 2 + 𝑎3𝑖 𝑥 3 + 𝑎4𝑖 𝑥 4 + 𝑎5𝑖 𝑥 5 Solving the Kepler equation with the SDG-code

75

6

150

Analysis of the singularity I  Problem statement: Kepler equation has a singular behavior in the neighborhood of e = 1 and M = 0  Goal: Describe numerically the exact solution (yv) with enough accuracy to be part of the seed used to start the N-R process.  Solution: Apply an asymptotic expansion in power of the small parameter

𝜀 ≪1

𝜀 = 1 – e (elliptic orbits) 𝜀 = e – 1 (hyperbolic orbits)

Inner region:

𝑥≈𝜀

Intermediate region: 𝑥 ≈

2

𝑥
0.75 M < 0.15

e ≤ 0.75 M ≥ 0.15

ALGORITHM

ALGORITHM

𝜺 =1-e M < 0.001𝜺3/2

Eo = 𝜀𝜂(𝜉)

𝜺 =1-e M ≥ 0.001𝜺3/2 Ei=(i-1)π /12 Mi = Ei - esinEi

Eo = 𝜺3/2𝜎(𝜒)

E Apply N-R method

5th degree polynomial

Solving the Kepler equation with the SDG-code

Eo = pi M

9

SDG-code for hyperbolic orbits A PRIORI DATA

(e, MH) (ɛtol chosen)

REGION OF THE PLANE

Singular corner e < 1.25 MH < 0.15 e ≥ 1.25 MH ≥ 0.15

ALGORITHM

ALGORITHM

𝜺 =e-1 MH < 0.001𝜺3/2

Ho = 𝜀𝜂(𝜉)

𝜺 =1-e MH ≥ 0.001𝜺3/2

Ho = 𝜺3/2𝜎(𝜒)

MH < 69.2 MH ≥ 69.2

Apply N-R method

Change of variable

So 5th degree polynomial So = pi MH Asymptotic expansion So = M𝑒H 1 + 𝜑 + 𝜉

Solving the Kepler equation with the SDG-code

Apply N-R method

S

10

S

Results: elliptic orbits An efficient code to solve the Kepler equation. Elliptic case. V. Raposo-Pulido; J. Peláez Monthly Notices of the Royal Astronomical Society 2017 doi: 10.1093/mnras/stx138

11

Accuracy analysis: SDG-code • Considering the true solution (yv), we study the residual (𝜌) and the absolute error (𝜀𝑎𝑏𝑠 ) of the numerical solution (yc) 12 polynomials

23 polynomials

double precision

𝑦𝑐 = 𝑦𝑣 + 𝜀𝑎𝑏𝑠 𝜌 = |𝑦𝑐 − 𝑒sin𝑦𝑐 − 𝑥| |𝜺𝒂𝒃𝒔 | =

𝜌 |1 − 𝑒cos𝑦𝑣 |

quadruple precision

Solving the Kepler equation with the SDG-code

12

Results: double precision

SDG–code (Conway)

SDG–code (CNR)

SDG–code (MNR)

Gooding

Nijenhuis

Fukushima

Mortari & Elipe

0 (%)

1.263

1.263

1.263

0.499

0

0.099

0.099

1 (%)

98.631

98.599

98.737

0

0

0

0.050

2 (%)

0.106

0.138

0

98.144

0

1

71.162

3 (%)

0

0

0

0

50.024

52.605

28.686

≥ 4 (%)

0

0

0

1.357

49.976

46.296

0.003

Maxim. value

2

2

1

18

6

9

4

Mean value

0.988

0.989

0.987

2.205

4.500

3.495

2.284

Points

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

Computational time

40.779 sec

40.591 sec

41.012 sec

41.200 sec

42.136 sec

59.872 sec

44.173 sec

Iterations

Solving the Kepler equation with the SDG-code

13

Results: quadruple precision

SDG–code (Conway)

SDG–code (CNR)

SDG–code (MNR)

Gooding

Nijenhuis

Fukushima

Mortari & Elipe

0 (%)

0.161

0.161

0.161

0.499

0

0.099

0.099

1 (%)

34.865

33.588

99.839

0

0

0

0.049

2 (%)

64.974

66.251

0

98.144

0

1

1.5*10-4

3 (%)

0

0

0

0

50.024

52.605

87.036

≥ 4 (%)

0

0

0

1.357

49.976

46.296

12.815

Maxim. value

2

2

1

25

6

9

17

Mean value

1.648

1.661

0.998

2.304

4.500

3.495

3.125

Points

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

~ 4 millions

Computational time

87.840 sec

81.916 sec

83.190 sec

64.335 sec

63.071 sec

260.926 sec

129.824 sec

Iterations

Solving the Kepler equation with the SDG-code

14

Gooding / Nijenhuis – significant figures

double precision

quadruple precision

Gooding

Nijenhuis

Solving the Kepler equation with the SDG-code

15

Fukushima / Mortari & Elipe – significant figures

double precision

quadruple precision

Fukushima

Mortari & Elipe

Solving the Kepler equation with the SDG-code

16

SDG-code (MNR method) – significant figures

double precision

quadruple precision

Solving the Kepler equation with the SDG-code

17

Results: hyperbolic orbits

18

Results: double precision SDG–code (MNR)

Gooding

Fukushima

Avendaño

0 (%)

0.517

0.498

0

0

1 (%)

40.076

0

0

0.116

2 (%)

58.615

99.453

0

82.107

3 (%)

0

0

2.198

0.906

≥ 4 (%)

0.792

0.049

97.802

16.871

Maxim. value

6

38

20

-

Mean value

1.612

2.001

6.108

-

Points

~ 40000

~ 40000

~ 40000

~ 40000

Computational time

4.017 sec

2.703 sec

10.708 sec

-

Iterations

𝑒 ∈ 0, 10

does not always converge

M𝐻 ∈ 0, 100

Solving the Kepler equation with the SDG-code

19

Results: quadruple precision SDG–code (MNR)

Gooding

Fukushima

Avendaño

0 (%)

0.498

0.498

0

0

1 (%)

97.369

0

0

0

2 (%)

1.342

99.453

0

63.169

3 (%)

0

0

0.512

31.962

≥ 4 (%)

0.791

0.049

99.488

4.869

Maxim. value

5

64

21

20

Mean value

1.035

2.009

6.351

2.417

Points

~ 40000

~ 40000

~ 40000

~ 40000

Computational time

5.236 sec

3.531 sec

15.237 sec

3.500 sec

Iterations

𝑒 ∈ 0, 10

M𝐻 ∈ 0, 100

Solving the Kepler equation with the SDG-code

20

References • W. NG, Edward, 1979: A general algorithm for the solution of Kepler’s equation for elliptic orbits. Celestial Mechanics. • Conway, Bruce A, 1986: An improved algorithm due to Laguerre for the solution of Kepler’s equation. Celestial Mechanics. • Serafin, RA, 1986: Bounds on the solution to Kepler’s equation. Celestial Mechanics. • Gooding, RH and Odell, AW, 1988: The hyperbolic Kepler equation (and the elliptic equation revisited). Celestial Mechanics.

• Nijenhuis, Albert, 1991: Solving Kepler’s equation with high efficiency and accuracy. Celestial Mechanics and Dynamical Astronomy. • Colwell, Peter, 1993: Solving Kepler’s equation over three centuries. Richmond, Va: Willmann-Bell. • Markley, F Landis, 1995: Kepler equation solver. Celestial Mechanics and Dynamical Astronomy. • Fukushima, Toshio, 1996: A method solving Kepler’s equation without transcendental function evaluations. Celestial Mechanics and Dynamical Astronomy. • Fukushima, Toshio, 1997: A method solving Kepler’s for hyperbolic case. Celestial Mechanics and Dynamical Astronomy. • Mortari, Daniele and Elipe, Antonio, 2014: Solving Kepler’s equation using implicit functions. Celestial Mechanics and Dynamical Astronomy. • Avendaño, Martín et al., 2015: Anew method for obtaining approximate solutions of the hyperbolic Kepler’s equation.

Solving the Kepler equation with the SDG-code

21

Thank you for your attention

Solving the Kepler equation with the SDG-code

22