Calculating elliptic orbits in Cartesian coordinates

In summary, the conversation discusses trying to plot the orbits of planets in three dimensions using orbital elements. The speaker shares their code for plotting in two dimensions and asks for help with adding the inclination and longitude of ascending node. The other person suggests using True Anomaly, which can be found using Mean Anomaly and eccentricity, and provides a link to correct approximations for Keplerian Elements. The speaker thanks them and shares a successful result. They also ask how the other person solved for the True Anomaly, and if there is an easier way to approximate it.
  • #1
AbsentMinded
3
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
  • #2
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
 
  • #3
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
 
  • #4
Awesome, I'll give this a try, thank you.
 
  • #6
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
 
  • #7
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?
 

1. How do you calculate the elliptic orbit of a celestial body in Cartesian coordinates?

To calculate the elliptic orbit of a celestial body in Cartesian coordinates, you will need to use Kepler's laws of planetary motion and Newton's laws of motion. First, determine the position and velocity of the celestial body at a specific point in time. Then, use these values to calculate the orbital parameters, including the semi-major axis, eccentricity, and orbital period. Finally, use these parameters to plot the elliptic orbit in Cartesian coordinates.

2. What is the difference between an elliptic orbit and a circular orbit?

An elliptic orbit is a type of orbit in which the distance between the celestial body and its orbiting object varies throughout the orbit. This results in an oval-shaped path. A circular orbit, on the other hand, is a type of orbit in which the distance between the celestial body and its orbiting object remains constant throughout the orbit, resulting in a circular path.

3. How do you determine the shape of an elliptic orbit?

The shape of an elliptic orbit is determined by its eccentricity, which is a measure of how much the orbit deviates from a perfect circle. The closer the eccentricity is to 0, the more circular the orbit will be. The closer it is to 1, the more elongated or elliptical the orbit will be.

4. Can you calculate the elliptic orbit of any celestial body?

Yes, the elliptic orbit can be calculated for any celestial body that is orbiting another object, whether it be a planet, moon, or man-made satellite. However, the accuracy of the calculations may vary depending on the complexity of the system and the accuracy of the initial data.

5. Are there any limitations to calculating elliptic orbits in Cartesian coordinates?

One limitation of calculating elliptic orbits in Cartesian coordinates is that it assumes the celestial bodies are point masses, meaning they have negligible size and shape. This is not always the case, especially for large objects like planets, which can affect the accuracy of the calculations. Additionally, the calculations do not take into account external forces, such as the gravitational pull of other objects, which can also impact the accuracy of the results.

Similar threads

Replies
7
Views
3K
  • Astronomy and Astrophysics
Replies
3
Views
3K
Replies
13
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Astronomy and Astrophysics
Replies
8
Views
6K
  • Astronomy and Astrophysics
Replies
3
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
5K
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Astronomy and Astrophysics
Replies
28
Views
6K
Back
Top