SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 10:18 am

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?
 
User avatar
Traden4Alpha
Posts: 23951
Joined: September 20th, 2002, 8:30 pm

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

May 20th, 2017, 12:21 pm

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.
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 20th, 2017, 12:59 pm

Disclosing 'eccentricity' was a good hint!
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 4:10 pm

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;
}
 
User avatar
Traden4Alpha
Posts: 23951
Joined: September 20th, 2002, 8:30 pm

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

May 20th, 2017, 4:36 pm

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.
 
User avatar
Traden4Alpha
Posts: 23951
Joined: September 20th, 2002, 8:30 pm

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

May 20th, 2017, 4:43 pm

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?
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 20th, 2017, 5:58 pm

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.
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 7:13 pm

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.
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 7:25 pm

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.
Last edited by Cuchulainn on May 20th, 2017, 7:33 pm, edited 3 times in total.
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 20th, 2017, 7:30 pm

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?
 
User avatar
Traden4Alpha
Posts: 23951
Joined: September 20th, 2002, 8:30 pm

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

May 20th, 2017, 7:32 pm

Kepler is not good enough for GPS -- they need Einstein to get the accuracy.
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 7:34 pm

/dbl
Last edited by Cuchulainn on May 20th, 2017, 8:23 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 7:38 pm

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.
Last edited by Cuchulainn on May 20th, 2017, 8:04 pm, edited 3 times in total.
 
User avatar
Cuchulainn
Topic Author
Posts: 62081
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

May 20th, 2017, 7:44 pm

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?
 
User avatar
outrun
Posts: 4573
Joined: April 29th, 2016, 1:40 pm

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

May 20th, 2017, 7:58 pm

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]
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On