Page **4** of **5**

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 10:18 am**

by **Cuchulainn**

How quickly does Eq 11 converge?

I don't think the formula was built for speed

Bessel's result was a landmark.

It is essentially a Fourier series and as mentioned it gives incorrect answers for certain values of the eccentricity (in Boost C++). So, in practice implementing series is probably NOT the best approach.

However, closed solutions are used to think about the *qualitative* properties of the solution such as distribution of zeroes, asymptotics. There is no rule to say that they should be used for numerical computation.
Classic iterative methods may be unpredictable in how long it takes to converge. Non-iterative methods (e.g. Fibonacci) converge in a fixed number of steps based on desired tolerance.You know* a priori* the number of function evaluations to achieve a given accuracy.
Ex. To give an idea, Brent minimisation converges in ~ 9 iterations of the Kepler equation to O(1.0e-15) accuracy.
I think Mathematica (and Maple?) support KE?

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 12:21 pm**

by **Traden4Alpha**

Yes it's a very interesting approach.

And now that I see this was a physics problem all along -- having bounds on the parameter space and geometric/physical interpretation of the solution space that would not occur in the full math problem -- I can see why negative eccentricity and multiple solutions was not what you sought.

What is curious to me is that as a numerical computation, Bessel and iteration both share the property of requiring convergence time. Of course they differ in that Bessel's terms can be computed in parallel whilst iteration is strictly sequential.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 12:59 pm**

by **outrun**

Disclosing 'eccentricity' was a good hint!

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 4:10 pm**

by **Cuchulainn**

Yes it's a very interesting approach.

And now that I see this was a physics problem all along -- having bounds on the parameter space and geometric/physical interpretation of the solution space that would not occur in the full math problem -- I can see why negative eccentricity and multiple solutions was not what you sought.

What is curious to me is that as a numerical computation, Bessel and iteration both share the property of requiring convergence time. Of course they differ in that Bessel's terms can be computed in parallel whilst iteration is strictly sequential.

I think the parallel solution will be slower..

```
double KeplerExact(double eps, double x)
{
int N = 1e4; // Truncated series
double result = 0.0;
double tmp;
for (int n = 1; n < N; ++n)
{
tmp = 2.0*boost::math::cyl_bessel_j(n, n*eps)/n;
result += tmp*std::sin(n*x);
}
result += x;
return result;
}
```

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 4:36 pm**

by **Traden4Alpha**

Disclosing 'eccentricity' was a good hint!

Indeed!

Yet both that hint and Cuch's hint about "conics" made me think of systems such as rolling cones, which may be doubled-ended and can certainly have rotation angles on [-∞,∞], making both negative eccentricity and multiple-solutions both valid and a critical part of a robust answer to the brainteaser.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 4:43 pm**

by **Traden4Alpha**

Yes it's a very interesting approach.

And now that I see this was a physics problem all along -- having bounds on the parameter space and geometric/physical interpretation of the solution space that would not occur in the full math problem -- I can see why negative eccentricity and multiple solutions was not what you sought.

What is curious to me is that as a numerical computation, Bessel and iteration both share the property of requiring convergence time. Of course they differ in that Bessel's terms can be computed in parallel whilst iteration is strictly sequential.

I think the parallel solution will be slower..

```
double KeplerExact(double eps, double x)
{
int N = 1e4; // Truncated series
double result = 0.0;
double tmp;
for (int n = 1; n < N; ++n)
{
tmp = 2.0*boost::math::cyl_bessel_j(n, n*eps)/n;
result += tmp*std::sin(n*x);
}
result += x;
return result;
}
```

That seems likely.

And even if one Bessel call were as fast as one iteration, there'd be the simple issue with all parallel vs. sequential versions of an algorithm in which parallel consumes more total computational resources but it can have lower latency to a solution.

If one must solve Kepler's in a microsecond, a GPU version of Bessel might be best. But if one needs to continuously solve a million Kepler's per second, then iteration might offer better throughput.

So where's the specifications document?

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 5:58 pm**

by **outrun**

Kepler is not really useful for practical orbits, more a math trick. E.g. when I worked on light intensity forward curves for energy company I simple downloaded a table with 4000 oscillation terms from Nasa which would correct for all the platens wobbles many decades out.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:13 pm**

by **Cuchulainn**

Yes it's a very interesting approach.

And now that I see this was a physics problem all along -- having bounds on the parameter space and geometric/physical interpretation of the solution space that would not occur in the full math problem -- I can see why negative eccentricity and multiple solutions was not what you sought.

What is curious to me is that as a numerical computation, Bessel and iteration both share the property of requiring convergence time. Of course they differ in that Bessel's terms can be computed in parallel whilst iteration is strictly sequential.

I think the parallel solution will be slower..

```
double KeplerExact(double eps, double x)
{
int N = 1e4; // Truncated series
double result = 0.0;
double tmp;
for (int n = 1; n < N; ++n)
{
tmp = 2.0*boost::math::cyl_bessel_j(n, n*eps)/n;
result += tmp*std::sin(n*x);
}
result += x;
return result;
}
```

That seems likely.

And even if one Bessel call were as fast as one iteration, there'd be the simple issue with all parallel vs. sequential versions of an algorithm in which parallel consumes more total computational resources but it can have lower latency to a solution.

If one must solve Kepler's in a microsecond, a GPU version of Bessel might be best. But if one needs to continuously solve a million Kepler's per second, then iteration might offer better throughput.

So where's the specifications document?

One example that immediately springs to mind is to compute the position of the Earth relative to the Sun in heliocentric polar coordinates [$](r,\theta)[$] at any time [$]t[$] since perihelion.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:25 pm**

by **Cuchulainn**

Kepler is not really useful for practical orbits, more a math trick. E.g. when I worked on light intensity forward curves for energy company I simple downloaded a table with 4000 oscillation terms from Nasa which would correct for all the platens wobbles many decades out.

Well, there goes 400 years of physics down the drain in one sentence.

I was always led to believe GPS satellites are based on Kepler's laws. Or are we talking about different things?(?)

One of my uni buddies was designer at Motorola, he said Classical Mechanics worked fine.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:30 pm**

by **outrun**

It's just that in real life we have many body problems, the physics is the same, but the solutions have to be numerical instead of analytical, right?

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:32 pm**

by **Traden4Alpha**

Kepler is not good enough for GPS -- they need Einstein to get the accuracy.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:34 pm**

by **Cuchulainn**

/dbl

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:38 pm**

by **Cuchulainn**

Kepler is not good enough for GPS -- they need Einstein to get the accuracy.

Interesting. Do you have a link?

Actually, up at Myvatn was a retired American prof talking about his day with Atlas (D?) in the 50s/60s and the very issue of time synchronisation. They let the satellite broadcast the 'time'. There is no day or night up there.

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:44 pm**

by **Cuchulainn**

It's just that in real life we have many body problems, the physics is the same, but the solutions have to be numerical instead of analytical, right?

yes; Kepler is 2-body, but probably a good approximation as gravity decays awful fast.

My take: Kepler's equation is a luvly ellipse but it must be approximated numerically?

### Re: Going off on a tangent (kind of) : find y

Posted: **May 20th, 2017, 7:58 pm**

by **outrun**

It's just that in real life we have many body problems, the physics is the same, but the solutions have to be numerical instead of analytical, right?

yes; Kepler is 2-body, but probably a good approximation as gravity decays awful fast.

My take: Kepler's equation is a luvly ellipse but it must be approximated numerically?

You might like this, NASA's low accuracy approximations for the positions of the planets with the method described in this dos:"

Keplarian elements" (your equation is in it at 8.36) here are the numerical factors [url=ttps://ssd.jpl.nasa.gov/txt/p_elem_t1.txt](table with coeficients)[/url]