# plotting Keplerian orbit from implicit radial and angular relationship

Recently I have been reading about Keplerian orbit and I came across the implicit relationship between $r$ and $\theta$ as: $\theta = \theta_{0} + L \int_{r_{0}}^{r} \frac{dr}{r^2} \frac{1}{\sqrt{2(E+1/r-L^2/2r^2)}}$

It's the equation of the path, that means by plotting this equation I should get an ellipse. If I have been provided with initial conditions on $r$, $\theta$, $\dot{r}$ and $\dot{\theta}$, then is it possible to derive all the parameters needed to integrate and plot an orbit numerically?

## 1 Answer

The orbit equation for gravity can actually be solved explicitly. It results in an expression for $r$ in terms of $\theta$ which can be written as

$r(\theta) = \frac{p}{1+\epsilon\cos(\theta+C)}$

where $p = \frac{L^2}{m\alpha}$ and $\epsilon = \sqrt{1+\frac{2L^2E}{m\alpha^2}}$

$\alpha$ can be seen as the strength of the gravitational field, and $L$ and $E$ are the angular momentum and energy respectively. $C$ here is the constant of integration and will depend on the initial position and initial velocity of the particle.

• Thanks J_Psi. So I know we can derive this parametric equation for ellipse. But my professor kind of want it from the implicit relationship numerically. Basically I was wondering what should I consider for lower and upper limit for integration in that above mentioned integral. Also I was also wondering there how do I treat E and L there, considering they are constant Sep 26, 2017 at 6:49
• The equation of the ellipse falls right out of the orbit equation that you mentioned. The orbit equation may not look as though it is able to be integrated, but it can be put into a nice form through u-substitution. As for the constants $E$ and $L$, they depend on the initial conditions according to $E =\frac{1}{2}m{v_0}^2−\frac{\alpha}{r_0}$ and $L = m\vec{r_0}\cdot\vec{v_0}$ where $\vec{r_0}$ and $\vec{v_0}$ are the initial position and initial velocity vectors respectively. Sep 27, 2017 at 3:32
• Oops, in the expression for $L$ it should be the cross product, not the dot product. Sorry about that. Sep 27, 2017 at 20:00