Mean anomaly as a function of the true anomaly elliptical orbits

In summary, the book Orbital mechanics by Curtis discusses the function M2evals, which is monotonically increasing except for a discontinuity at pi. This is due to the use of the arctan function, which yields "principle values" and causes a jump at pi/2. To correct for this, the arctan2 function can be used instead, which takes into account the quadrant of the angle and provides a continuous graph. With the use of arctan2, the plot of M2evals should meet the first half as intended.
  • #1
Dustinsfl
2,281
5
The book Orbital mechanics by Curtis says that the function (I labeled M2evals) is monotonically increasing. However, at pi, I have a discontinuity and the graph jumps below the negative axis when it should continue on; that is, the e = 0 should be the line y = x.

Code:
import pylab
import numpy as np

e = np.arange(0.0, 1.0, 0.15).reshape(-1, 1)
nu = np.linspace(0, 2 * np.pi, 50000)
M2evals = (2 * np.arctan(((1 - e) / (1 + e)) ** 0.5 * np.tan(nu / 2)) -
           e * (1 - e ** 2) ** 0.5 * np.sin(nu) / (1 + e * np.cos(nu)))

fig2 = pylab.figure()
ax2 = fig2.add_subplot(111)

for Me2, _e in zip(M2evals, e.ravel()):
    ax2.plot(nu.ravel(), Me2, label = str(_e))

pylab.legend()
pylab.xlim((0.0, 7.75))
pylab.ylim((-np.pi, np.pi))
pylab.savefig('eccentrueanomfunc.eps', format = 'eps', dpi = 1000)
pylab.show()

Here is the plot:
where the plot jumps down it is supposed to be shifted up to meet the first half.
What is wrong?
http://img96.imageshack.us/img96/5397/pfquestion.png
 

Attachments

  • pfquestion.png
    pfquestion.png
    27.3 KB · Views: 720
Last edited by a moderator:
Physics news on Phys.org
  • #2
The problem may lie in the arctan function which gives "principle values" as output.

Thus, arctan(tan(x)) does not yield x if x is an angle in the second or third quadrant. If you plot arctan(tan(x)) from x = 0 to x = Pi, you will find that it has a discontinuous jump at x = Pi/2.

I think you can correct for this by using the function arctan2(x1, x2). See http://docs.scipy.org/doc/numpy/reference/generated/numpy.arctan2.html

For your case, instead of writing arctan(arg), I believe you would write arctan2(1, 1/arg) where arg is the argument of your arctan function. That way, when arg becomes negative, arctan2 will yield an angle in the second quadrant rather than the fourth.

I'm not familiar with python, but it appears arctan2 is similar to a function in Mathematica which I have used in similar circumstances.

At least it would be easy to give it a try.
 
Last edited:
  • Like
Likes 1 person
  • #3
With some help of stackoverflow, I was able to implement your suggestion of arctan2 and it works as intended now.
 
  • #4
Good.
 
  • #5


There appears to be a mistake in the calculation of the mean anomaly as a function of the true anomaly for elliptical orbits. The function as described in the book by Curtis is supposed to be monotonically increasing, but there is a discontinuity at pi where the graph jumps below the negative axis. This is not consistent with the expected behavior of the function.

It is possible that there is an error in the equation used to calculate the mean anomaly, or there may be a mistake in the implementation of the equation in the code. It would be helpful to double check the equation and the code to identify and correct any errors.

Additionally, it is important to consider the physical significance of this discontinuity. If the mean anomaly is meant to be a continuous function, then this discontinuity may have implications for the accuracy of any calculations or predictions based on this function. Further investigation and analysis may be needed to fully understand the cause and potential impact of this discontinuity.
 

1. What is the definition of mean anomaly and true anomaly in elliptical orbits?

Mean anomaly refers to the angular distance between the position of an orbiting object and the position it would have if it were moving at a constant rate in a circular orbit with the same period. True anomaly, on the other hand, is the angular distance between the orbiting object and the point of closest approach to the central body.

2. How is mean anomaly calculated in elliptical orbits?

Mean anomaly is calculated by multiplying the eccentric anomaly (the angle between the semi-major axis and the point on the ellipse where the orbiting object is located) by the eccentricity of the orbit. This calculation takes into account the non-uniform motion of the object in the elliptical orbit.

3. What is the relationship between mean anomaly and true anomaly in elliptical orbits?

The relationship between mean anomaly and true anomaly in elliptical orbits is given by Kepler's equation, which states that the difference between the two is equal to the eccentricity multiplied by the sine of the eccentric anomaly (M = E - e*sin(E)). This equation allows for the conversion of mean anomaly to true anomaly and vice versa.

4. How does mean anomaly change over time in elliptical orbits?

In elliptical orbits, mean anomaly increases at a non-uniform rate as the orbiting object moves closer to and further away from the central body. This means that the rate of change of mean anomaly (known as mean motion) is not constant and varies throughout the orbit.

5. Why is mean anomaly used as a function of true anomaly in elliptical orbits?

Mean anomaly is used as a function of true anomaly in elliptical orbits because it provides a more accurate representation of the position of an orbiting object compared to using true anomaly alone. This is due to the non-uniform motion of the object in the elliptical orbit, which affects its position at any given time.

Similar threads

  • General Math
Replies
1
Views
2K
Back
Top