How Can I Calculate the Distance of an Object in an Elliptical Orbit Over Time?

AI Thread Summary
To calculate the distance of an object in an elliptical orbit over time, one must derive the equation using Kepler's laws of planetary motion. The process involves calculating the mean anomaly and solving Kepler's equation to find the eccentric anomaly, which relates to the mean anomaly. While an analytic solution does not exist, numerical methods like Newton's method can be employed for approximation. A practical approach includes using a spreadsheet to compute the eccentric anomaly and then plotting the normalized radius as a function of time. This method allows for visualizing the distance from the central body, such as the Sun, at any given time.
Texas2011
Messages
2
Reaction score
0
What would the equation be for the distance of an object orbiting another object in an elliptical orbit with time as the variable? How would I derive this equation?

A comet would be an example. I am looking for the equation that would plot the distance from the sun at any given time.
 
Astronomy news on Phys.org
Welcome to PF!

The short answer is that, depending on your background, it may be a little bit involved. You can get a short summary of what is needed at [1]. If you want a more thorough introduction there should be plenty of astronomy textbooks to choose from at various levels. If you have specific questions to this derivation or to astronomy in general you are of course free to ask them here.

[1] http://en.wikipedia.org/wiki/Kepler's_laws_of_planetary_motion#Position_as_a_function_of_time
 
Although I did it in college and generally understand it, it has been a while since I have tried to use polar coordinates and calculus. I will probably have to devote some time if I want to understand the derivation.

If I wanted to plot the distance as a function of time with t=0 being the closest the object would get, how would I do it? I appreciate your help.
 
I'm wondering if there is an analytic solution. I've seen this question asked before, but never answered. Googling for "eliptical orbit distance as a function of time" returns a thread from this forum started by me 4 years ago.
 
Texas2011 said:
If I wanted to plot the distance as a function of time with t=0 being the closest the object would get, how would I do it? I appreciate your help.
Follow the steps in the WP article. To do step #2, you will have to do some kind of iterative method such as Newton's method: http://en.wikipedia.org/wiki/Newton's_method

tony873004 said:
I'm wondering if there is an analytic solution.
No, there isn't.
 
Texas2011 said:
...I am looking for the equation that would plot the distance from the sun at any given time.

bcrowell said:
...No, there isn't.
With no equation, you'll have to plot it using numerical methods. Here's my attempt. In Gravity Simulator, I created 10 planets with semi-major axes of 100,000,000 km from the Sun. This gives them a period of 200 days. I gave them eccentricities of 0.0 to 0.9. I then output their positions to Excel once a day for 200 days. I then computed their distances from their positions and plotted the results. Along the x-axis, time is expressed as a fraction of 200 days, so 1 means 200 days. Along the y-axis, I expressed distance is a fraction of semi-major axis, so 1 = 100,000,000 km. These 2 axes should scale to any planet at any distance.

http://orbitsimulator.com/BA/distanceVStime.GIF
 
Texas2011 said:
If I wanted to plot the distance as a function of time with t=0 being the closest the object would get, how would I do it?

If you have access to a spreadsheet or similar you can fairly easy make such a plot based on an approximation of the radius.

First you have mean anomaly

M = \frac{2 \pi T}{P}

where T is the time since last periapsis passage and P is period, both values expressed in same time unit. From M you now have to solve Keplers equation to get eccentric anomaly E which relates to mean anomaly M as

M = E -e\sin E

In a program you would normally solve this equation numerically by iteration until a desired accuracy is obtained. In a spreadsheet you can instead use a fixed approximation like (taken from [1])

E \approx M+\left(e-\frac{e^3}{8}\right)\sin M + \frac{1}{2}e^2 \sin 2M + \frac{3}{8}e^3 \sin 3M

if eccentricity is not too large, or you can set up a fixed number of fast converging iterations, like using Newton's method (see for instance [2]) to get

E_{i+1} = E_i + \frac{M+e\sin E_i - E_i}{1-e\cos E_i}

with all angles in radians and E_0 = M for e < 0.8 and E_0 = \pi otherwise. In a spreadsheet you can set up a fixed number of successive columns to calculate E_i and then use the last approximation as E.

From eccentric anomaly E you can calculate the normalized radius as

\rho = \frac{r}{a} = 1 - e \cos E

where a is the semi-major axis. In a spreadsheet you can now plot \rho as a function of time or mean anomaly. Notice that I skipped calculating the so-called true anomaly and went straight to radius. The true anomaly would for instance be needed in addition to the radius if you wanted to plot the 2D position instead of only the radius.

As you can see, apart from finding a good approximation for E, the rest is rather simple. Feel free to ask if some of the above is too hazy for you.


[1] Orbital Motion, A.E. Roy, Adam Hilger, 1988.
[2] Weisstein, Eric W. "Kepler's Equation." From MathWorld -- http://mathworld.wolfram.com/KeplersEquation.html
 
Back
Top