# How to get true anomaly from time?

An exercise that was left unsolved from last year's class gives me this equation :

$$t-t_{p} = \sqrt{\frac{a^3}{\mu}}*(\arcsin(X) - e*X)$$ where : $$X = \frac{\sqrt{1-e^2}*\sin(v)}{1+e*\cos(v)}.$$ It uses the following notations :

• $t$ is current time on orbit
• $t_{p}$ is time at perigee
• $a$ is the semimajor axis
• $\mu$ is the standard gravitationnal parameter, with $\mu = GM$
• $e$ is the eccentricity of the orbit
• $v$ is the true anomaly

To finish the software I started writing, I would need to extract the true anomaly, $v$, knowing that all other parameters are given, but after a long time trying I still have no clue.

First, I think it can be reduced to an equation in the form of $\alpha*\arcsin(X) + \beta*X + \gamma = 0$ but I couldn't find any reference to solve such an equation anywhere online, and WolframAlpha doesn't give anything useful.

Also, I thought I could use a power series or a Taylor series to approximate a result, but it looks like it brings more trouble than solves anything...

If anyone has skills to help, I'd be grateful ! Thank you

EDIT : I fixed my program, if anyone is interested, here is the implementation. Thanks to everyone who helped !

• chat.stackexchange.com/transcript/message/41819101#41819101
– uhoh
Dec 18, 2017 at 18:45
• It's possible that the use of arcsin in the question is incorrect.
– uhoh
Dec 19, 2017 at 20:25
• @uhoh - It is correct. The parameter $X$ is the sine of the eccentric anomaly $E$. Rewriting Kepler's equation in terms of $X$ yields $M = \sqrt{\mu/a^3}(t-t_p) = \arcsin X - e X$, which is the first equation. The second equation is the correct expression of the sine of the eccentric anomaly in terms of the true anomaly. Jan 15, 2018 at 6:43
• This question asks for true anomaly from the time, but much if not all of the discussion is about the opposite (and simpler) problem of getting the time from the true anomaly. The notoriously awkward part, Kepler's problem, is very old, and a recent good and economical example of its solution is by Nijenhuis, 1991, accompanied by a complete and workable implementation (in Pascal, from 1991, but easily portable e.g. to C). For further methods and discussion see scicomp.stackexchange.com/questions/17562 . May 13 at 18:20

An exercise that was left unsolved from last year's class gives me this equation : $$t-t_{p} = \sqrt{\frac{a^3}{\mu}}*(\arcsin(X) - e*X)$$ where : $$X = \frac{\sqrt{1-e^2}*\sin(v)}{1+e*\cos(v)}.$$

This is just Kepler's equation $M = E-e\sin E$, but written in terms of $X = \sin E$, where $E$ is the eccentric anomaly. We don't have a derivation of Kepler's equation on this site, so here goes. I'll start with a picture.

The above image portrays a body $P$ in an elliptical orbit about a body $F$ that occupies one of the foci of the ellipse. The ellipse has a semi-major axis $a$ along the horizontal axis and an eccentricity $e$. The center of the ellipse and its circumscribing circle are at $C$. The vertical projection of the current location onto the circumscribing circle is denoted $P'$.

Kepler's second law says that the area of the elliptical sector $ZFP$ is a linear function of time: $A(ZFP) = k(t-t_p)$, where $A(ZFP)$ is the area in question, $k$ is some constant, $t$ is the time at which the orbiting object reaches the position $P$, and $t_p$ is the time of periapsis passage. In a full orbit, the area swept by that elliptical sector is the area of the ellipse: $A(2\pi) = \pi a b$. Thus $\pi a b = kT$, where $T$ is the orbital period,or $k = \frac{\pi a b}T$. Kepler's third law combined with Newtonian gravity in turn tells us that $\frac{2\pi}T = \sqrt{\frac \mu {a^3}}$, where $\mu$ is the system's gravitational coefficient $G(M+m)$. Defining $n = \sqrt{\frac \mu {a^3}}$, we have $$A(ZFP) = \frac12ab\,n(t-t_p)\tag{1}$$

We need an expression for $A(f)$. To get there, it's best to introduce the concept of eccentric anomaly. This is portrayed in the image as the angle $E$. This is formed by projecting the point $P$ vertically to the intersection with the circumscribing circle, denoted $P'$. Given a point $x,y'$ on the circumscribing circle expressed relative to the center $C$, the corresponding point on the ellipse $x,y$ results by scaling the $y$ coordinate by $\frac b a$: $y=\frac b a y'$. This scaling means that the area of the elliptical sector $ZCP$ is the area of the circular sector $ZCP'$ scaled by the same scale factor. Since the area of the circular sector $ZCP$ is $\frac 1 2 a^2 E$ with $E$ expressed in radians, the area of the elliptical sector $ZCP$ is $\frac 1 2 ab E$.

The area in question, that of the elliptical sector $ZFP$, is the area of the elliptical sector $ZCP$ less the area of the triangle $FCP$. The latter is $\frac12 \, ae \, b\sin E$ (1/2 * base * height), or $\frac12 ab\,e\sin E$. Thus $A(ZFP) = \frac12 ab (E - e\sin E)$. Combining this with equation (1) yields $$E-e\sin E = n(t-t_p) \equiv M \tag{2}$$

This is Kepler's equation. It provides a simple mechanism for computing time as a function of position. Computing position as a function of time requires inverting this transcendental function of the two variables $E$ and $e$. This inverse function cannot be expressed in terms of the elementary functions.

A very simple, guaranteed to work, method to find $E$ given $M$ and $e$ is to use the fixed point iteration scheme $E_{n+1} = M + e\sin E_n$. Any starting guess $E_0$ will do, but typically $M$ is used as the initial guess. This converges for all $M$ and all eccentricities between 0 (inclusive) and 1 (exclusive). The convergence is very slow, particularly for large eccentricities. A better approach is to use Newton's method, which exhibits quadratic convergence when it converges. A good initial guess is needed for large eccentricities to ensure convergence. Even better approaches, and even better initial guesses than $E_0=M$ have been found over the centuries. Kepler's equation is the subject of hundreds of scientific papers.

Inverting Kepler's equation gives us the eccentric anomaly as a function of time. But what about the true anomaly $f$? The relationship between $E$ and $f$ is easily found using the tangent half angle formula, $\tan^2 \frac x2 = \frac{1-\cos x}{1+\cos x}$. The coordinates of the point $P$ with respect to the focus $F$ are $x=a(\cos E-e)=r\cos f$, $y=a\sqrt{1-e^2}\sin E = r \sin f$. Thus $$\tan^2 \frac f 2 = \frac{1+e}{1-e} \,\tan^2 \frac E 2$$ (Deriving this requires deriving $r=a(\cos E - e)$, not shown.) Since the true anomaly and eccentric anomaly are always on the same side of the $x$ axis, the tangents of their half angles will always have the same sign, yielding $$\tan \frac f 2 = \sqrt{\frac{1+e}{1-e}} \,\tan \frac E 2 \tag{3}$$

What about using $X=\sin E$ instead of $E$, as is done in the question? That's a "don't do that, then" kind of situation (from the joke, "Doctor, it hurts when I hit myself like this:《 bonk 》.") This only gets less than half of the ellipse, and the convergence of $\arcsin X - e X = M$ is terrible (if it converges at all). Use Kepler's equation (equation (2)) to solve for $E$, then solve for the true anomaly $f$ (alternatively written as $\nu$ or $\theta$) via equation (3).

edit: @DavidHammen has just posted a much more thorough and insightful answer, which also points out some problems applying Newton's method to the current form.

I'm pretty sure there are has never been an analytical expression discovered to solve $\nu(t-t_p)$, but solving using Newton's method applied to

$$\sqrt{\frac{a^3}{\mu}}*(\arcsin(X) - e*X) - (t-t_p) = 0$$

should converge nicely to values of $X$ (or of course $\nu$ if you do the replacement) in a half-dozen iterations, at least for an elliptical orbit.

I haven't actually verified your equations though, just taking your word for it.

You could also calculate an array of points solving for time, flip it, and interpolate with a spline, but the accuracy is not predictable/reliable.

• Well, a group of students actually found the solution ! It's a shame the correction wasn't distributed back then... I emailed the teacher but she didn't reply, she must be very busy as she just finished writing her thesis Dec 12, 2017 at 7:03
• @Magix I think that would be pretty big news indeed if they had found one and it checked out.
– uhoh
Dec 12, 2017 at 8:22
• I will keep you updated if I ever get a response so that we can share the Nobel prize ;-) Dec 12, 2017 at 20:50
• @Magix that look like it uses analytical solutions to cubic equations and so may be trying to solve an approximation using only the first few terms of a Taylor series, rather than an exact solution.
– uhoh
Dec 18, 2017 at 3:03
• Newton's method will be problematic here, for multiple reasons. (1) You don't know the sign of the derivative. (2) The derivative goes to $\pm\infty$ at $X=\pm1$. (3) And it changes sign at those points. It's much better to use the eccentric anomaly itself rather than the sine of the eccentric anomaly. Jan 15, 2018 at 13:27