Computing Mean Anomoly from Vector Confusion

  • Thread starter Thread starter tony873004
  • Start date Start date
  • Tags Tags
    Confusion Vector
AI Thread Summary
The discussion focuses on computing Mean Anomaly, which is an angle that indicates an object's position in its orbit relative to periapsis. The formulas for Mean Anomaly and Eccentric Anomaly are provided, highlighting the need for the position vector r, which is a Cartesian vector. The confusion arises from the fact that r is a vector, while the formulas require a scalar, leading to the realization that the modulus of r is used. The conversation also touches on the uniqueness of the angle derived from the position vector, noting that additional information, such as velocity, is necessary to resolve ambiguities in orbital mechanics. Ultimately, the participants conclude that understanding the angle's measurement from periapsis is crucial for accurate calculations.
tony873004
Science Advisor
Gold Member
Messages
1,753
Reaction score
143
I'm trying to compute Mean Anomoly. Mean Anomoly is an angle that describes where in an orbit an object is relative to its periapsis. The formula according to Wikipedia is

<br /> M = E - e \cdot \sin E<br />
where e is eccentricity (which I know), and E is Eccentric Anomoly.

According to Wikipedia, Eccentric Anomoly is
<br /> E = \arccos \frac{{1 - \left| r \right|/a}}{e}<br />
where a is Semi-Major Axis (which I know), e is eccentricity (which I know), and r is an orbiting body's position vector. If I solve for r, I'm home free.

According to Wikipedia, The orbital position vector r is a cartesian vector describing the position of the orbiting body. Wouldn't that mean that r would be express as something like 1.0i + 2.0j+3.0k? But I can't plug something like that into the formula for Eccentric Anomoly. I could use Pothagorean Theorum to solve for distance and use this number. But that turns the vector into a scalar, and I doubt that's the right way to do it. Direction is pretty important here.

I know the object's x, y, and z position wrt the reference frame. How do I turn r into something I can use in these formulas?
 
Mathematics news on Phys.org
The formula involves only the modulus of the vector r, doesn't it?
 
Modulus = absolute value??

In my example with 1.0i + 2.0j + 3.0k, I could do r=sqrt(1^2+2^2+3^2). But there are two points on the orbit that would have this same value for r. So I wouldn't know which one I computed.
 
tony873004 said:
Modulus = absolute value??
Yes.

In my example with 1.0i + 2.0j + 3.0k, I could do r=sqrt(1^2+2^2+3^2). But there are two points on the orbit that would have this same value for r. So I wouldn't know which one I computed.
IIRC, you are the author of an orbit simulation program, right? I'm a [exaggeration]novice[/exaggeration] when it comes at programming, so I don't understand the exact nature of your problem. Sorry. :redface:
 
Last edited:
Yes :biggrin: . And if you use the program, you'll notice on the orbital elements box I leave out Mean Anomoly, simply because I don't get it right. I see many references that give the same formulas as Wikipedia for Mean Anomoly. And they all have the variable r in them. r is a vector, not a scalar, which is why I'm confused as to how to turn an x,y,& z position into a single number that I can assign to r that conveys both distance and direction. From physics classes, I remember that any answer that is a vector is stated as a scalar plus either an angle, or with the ijk-hat method. But of course any programming language doesn't want to see hats in the code. And E=Arcos((1-ABS(15, northwest)/a)/(e)) will generate a syntax error.

Thanks for your help thus far :smile:
 
I have used your program before, and had fun generating all those patterns. :biggrin: But to fully appreciate a program such as this, I think I will need a decent understanding of celestial mechanics (I know it's not a necessity, but still I prefer it that way :) ). Keep up the good work, and I hope you get this problem solved.
 
I could be wrong here, because I have no clue about oribtal mechanics (if that's what it's called :smile:)

But, maybe this will help:
So you are trying to calculuate E

http://en.wikipedia.org/wiki/Eccentric_anomaly" by the following:

E = cos^{-1} \frac{1-\frac{| \vec r |}{a}}{e}

Looking up the definition of r and e we have:

http://en.wikipedia.org/wiki/Orbital_position_vector" :
\vec r

Since you are taking the modulus of this, you will return a scaler:
ie) | \vec r | = \sqrt{x^2+y^2+z^2}

This is the length of the vector. So assuming my geometry is correct (I haven't really worked with ellipses), you will have at least two spots where | \vec r | can be equal. For example if the ellipse was on 2d plane.

| \vec r_1 | = |\vec r_2 |
where:
\vec r_1 = (a,0,0)
\vec r_2 = (-a,0,0)

However, you are worried about a point on an ellipse, so you need some more information to make the angle unique (since \vec r by itself is not doing it).

Now if we look at e,
"[URL
Orbital Eccentricity[/URL] (e)

e = | \vec e |
where:

http://en.wikipedia.org/wiki/Eccentricity_vector" (\vec e)

\vec e = \frac{\vec v \times \vec h}{\vec \mu}-\frac{\vec r}{| \vec r |}
where:
\vec v = orbital velocity vector
\vec h = orbital angular momentum
\vec r = orbital position vector
\vec \mu = standard gravitational parameter

It would seem that at the point in question, \vec v would be unique, thus causing e = | \vec e | to be the unique quantity that is dependent on position.

:blushing: Like I said, I could be way off here.

EDIT: I don't know what's up with the LaTeX... I guess I have an error somewhere. I hope this is somewhat readable.
 
Last edited by a moderator:
The LaTeX is fine. It doesn't work in preview mode though. Thanks. I think I'm getting a grip on it now. Using
| \vec r | = \sqrt{x^2+y^2+z^2}

I'm getting good results. But I would expect the angle to increase from 0 to 2pi over the course of an orbit. Instead, it increases from 0 to pi and then back to 0. If I subtract this angle from 2pi anytime the object is in the 3rd or 4th quadrant (negative y value), then all is well.

It just seems from the referenced formulas that this type of a piecewise answer is not necessary. But since taking the absolute value of the vector will yield the same answer for two different positions, I guess it is.

One silly mistake I was making was forgetting that the angle is measured from periapsis (closest point) rather than as a longitude (angle from a fixed direction, usually the Vernal equinox). But in a circular orbit, where the only hint of eccentricity comes 5 places to the right of the decimal, this point is not well defined and it drifts all over the place, causing Mean Anomoly to do the same. Once given a little eccentricity, things begin to work a lot better.
 
Back
Top