Calculating elliptic orbits in Cartesian coordinates

Click For Summary

Discussion Overview

The discussion revolves around calculating elliptic orbits in Cartesian coordinates, specifically focusing on incorporating three-dimensional aspects such as inclination and longitude of the ascending node into the existing two-dimensional orbital calculations. Participants share methods and pseudocode related to plotting orbits based on orbital elements.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Exploratory

Main Points Raised

  • One participant describes a function for plotting orbits using semi-major axis, eccentricity, and argument of periapsis, but struggles with incorporating inclination and longitude of ascending node into the z-coordinate.
  • Another participant provides a formula for calculating heliocentric positions, detailing how to derive the coordinates X, Y, and Z based on true anomaly, longitude of the ascending node, and argument of perihelion.
  • Multiple posts reiterate the same formulas for heliocentric distances and emphasize the need for true anomaly, suggesting that it can be derived from mean anomaly and eccentricity.
  • A participant suggests finding the eccentric anomaly as an alternative approach and provides a link to a related discussion.
  • One participant expresses gratitude for the provided formulas and confirms that they worked perfectly for their calculations.
  • A later reply inquires about the method used to solve for true anomaly, specifically asking if Bessel functions were involved and if there are easier approximation methods available.

Areas of Agreement / Disagreement

Participants generally agree on the formulas for calculating heliocentric positions, but there is no consensus on the best method for deriving true anomaly or the use of Bessel functions, as this remains an open question.

Contextual Notes

Some limitations include the dependence on specific definitions of orbital elements and the unresolved nature of the true anomaly calculation methods.

AbsentMinded
Messages
3
Reaction score
0
I have a function to plot the orbits of planets based on their orbital elements (Semi-major Axis, Eccentricity, Argument of periapsis, Inclination, and longitude of ascending node). I have the x and y coordinates working great using only the semi-major axis, eccentricity, and argument of periapsis. Now I'm having trouble taking things into the third dimension with the inclination and longitude of ascending node. I know I need to get the distance from the longitude of the ascending node, and multiply it by sin(inclination), but I'm having trouble. Here's what I have so far:


apoapsis = (1+eccentricity)*SemiMajor;
periapsis = (1-eccentricity)*SemiMajor;
Semi-Minor = sqrt(apoapsis*periapsis);
SunFocus = sqrt((SemiMajor)^2-(SemiMinor)^2);
xc = SunFocus*cos(ArgOfPeriapsis);
yc = SunFocus*sin(ArgOfPeriapsis);
x = xc + SemiMajor*cos(time)*cos(ArgOfPeriapsis) - SemiMinor*sin(time)*sin(ArgOfPeriapsis);
y = yc + SemiMajor*cos(time)*sin(ArgOfPeriapsis) + SemiMinor*sin(time)*cos(ArgOfPeriapsis);
z = ?

This is psuedocode of a Matlab function. The inputs are the 5 orbital elements listed above (no mean anomaly for now). The orbits plot perfectly in two dimensions for every object I've thrown at it (plantes, dwarfs, comets, etc.), but I really want to get the inclination in there for 3 dimensions. Any help would be greatly appreciated.
 
Physics news on Phys.org
This works for Heliocentric positions where:

R,X,Y,Z-Heliocentric Distances
TA - True Anomaly
N - Longitude of the Ascending Node
w - Argument of the Perihelion

R = a * (1 - e ^ 2) / (1 + e * Cos(TA))
X = R * (Cos(N) * Cos(TA + w) - Sin(N) * Sin(TA+w)*Cos(i)
Y = R * (Sin(N) * Cos(TA+w) + Cos(N) * Sin(TA+w)) * Cos(i))
Z = R * Sin(TA+w) * Sin(i)

TA can be found using Mean Anomaly and eccentricity.

Correct approximations for Keplerian Elements can be found at the bottom of the site:

JPL Keplerian Elements
 
This works for Heliocentric positions where:

R,X,Y,Z-Heliocentric Distances
TA - True Anomaly
N - Longitude of the Ascending Node
w - Argument of the Perihelion

R = a * (1 - e ^ 2) / (1 + e * Cos(TA))
X = R * (Cos(N) * Cos(TA + w) - Sin(N) * Sin(TA+w)*Cos(i)
Y = R * (Sin(N) * Cos(TA+w) + Cos(N) * Sin(TA+w)) * Cos(i))
Z = R * Sin(TA+w) * Sin(i)

TA can be found using Mean Anomaly and eccentricity.

Correct approximations for Keplerian Elements can be found at the bottom of the site:

http://ssd.jpl.nasa.gov/?planet_pos
 
Awesome, I'll give this a try, thank you.
 
Philosophaie said:
This works for Heliocentric positions where:

R,X,Y,Z-Heliocentric Distances
TA - True Anomaly
N - Longitude of the Ascending Node
w - Argument of the Perihelion

R = a * (1 - e ^ 2) / (1 + e * Cos(TA))
X = R * (Cos(N) * Cos(TA + w) - Sin(N) * Sin(TA+w)*Cos(i)
Y = R * (Sin(N) * Cos(TA+w) + Cos(N) * Sin(TA+w)) * Cos(i))
Z = R * Sin(TA+w) * Sin(i)

TA can be found using Mean Anomaly and eccentricity.

Correct approximations for Keplerian Elements can be found at the bottom of the site:

http://ssd.jpl.nasa.gov/?planet_pos

That worked perfectly, thank you!http://imgur.com/5Zafkj1
http://imgur.com/5Zafkj1
 
AbsentMinded said:
That worked perfectly, thank you!http://imgur.com/5Zafkj1
http://imgur.com/5Zafkj1

How did you solve for the TA? Did you use Bessel Functions? Is there any easy way to approximate it?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 8 ·
Replies
8
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
13
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K