<p>One uses the so called eccentricity vector, also called (up to a factor) Laplace-Runge-Lenz vector. </p>

<p>Given the position <span class="math-container">$$\vec{r} = \begin{bmatrix}x\\ y\\ z\end{bmatrix}$$</span> of the object at given time <span class="math-container">$t$</span> and its velocity <span class="math-container">$$\vec{v} = \begin{bmatrix}u\\ v\\ w\end{bmatrix}$$</span> both with respect to an inertial coordinate system cantered at the origin of the gravitational field, the eccentricity of the orbit (Keplerian case) can be calculated by first computing the eccentricity vector:</p>

<p>Step 1: Calculate the angular momentum <span class="math-container">$$\vec{L} = \vec{r} \times \vec{v}$$</span>
Step 2: Calculate the eccentricity vector <span class="math-container">$$\vec{e} = \frac{1}{\mu}\, \big(\,\vec{v} \times \vec{L}\,\big) - \frac{\vec{r}}{|r|}$$</span>
Step 3: Calculate eccentricity
<span class="math-container">$$e = |\vec{e}| = \sqrt{\vec{e} \circ \vec{e}\,}$$</span> where <span class="math-container">$\cdot \circ \cdot$</span> is the dot product, e.g. 
<span class="math-container">$$|r| = \sqrt{\vec{r} \circ \vec{r}\,} = \sqrt{x^2 + y^2 + z^2}$$</span></p>

CC BY-SA 4.0
2019-01-05T12:41:19.910Z
I would like to thank you as well for your answer as it covered the same approach (using the angular momentum). But as I can only give the green price to one saving hand, I have decided to give it to mistertribs. Thank you!
Stijn
CC BY-SA 4.0
2019-01-06T03:44:45.307Z
@Stijn Thank you, no problem, mistertribs was the first to point in the right direction, so he should get the credit.
Futurologist
CC BY-SA 4.0
2019-01-03T18:31:36.943Z
2019-01-03T18:31:36.943Z
Futurologist
<p>For a school project I am making a gravitational computer model. As I want to Milankovitch cycles, I need to calculate the eccentricity of an orbit after the model has completed its simulation.</p>

<p>I have thought about calculating the eccentricity using the aphelion and parohelion height, but these are not available as it is a simulation and as it therefore stores the data for one point on the ellipse.</p>

<p>The data I have after the model has completed:<br>
X,Y,Z coordinates of points that it has saved<br>
X,Y,Z velocities of points that it has saved  </p>

<p>I have been able to calculate the semi-major axis using the vis-viva equation. I have tried to get the value using the vis-viva equation but I got stuck as I think I need at least the Aphelion or Parohelion to calculate the eccentricity.</p>

<p><strong>My question: Does anyone know how  to calculate the eccentricity at any given point in the orbit using the velocity and coordinates (without simulating all points around it)?</strong> </p>

<p><strong>If not, does anyone maybe have a better idea/suggestion that I can try to gain the eccentricity values?</strong></p>

CC BY-SA 4.0
2019-01-03T16:32:20.707Z
Hi, it's not clear what your inputs are - how do you even verify your model is generating a stable orbit if you don't know how to identify apogee and perigee?  But, assuming your data show a stable pattern (the  x-y-z position and velocity data follow some reasonably repeatable path),  why not fit your data to a curve (ellipse) and calculate the eccentricity from that?
Carl Witthoft
<orbital-mechanics><eccentricity>
Calculation of Eccentricity of orbit from velocity and radius
Stijn
# Calculation of Eccentricity of orbit from velocity and radius

(Asked by: username_0 on 2019-01-03)

For a school project I am making a gravitational computer model. As I want to Milankovitch cycles, I need to calculate the eccentricity of an orbit after the model has completed its simulation.

I have thought about calculating the eccentricity using the aphelion and parohelion height, but these are not available as it is a simulation and as it therefore stores the data for one point on the ellipse.

The data I have after the model has completed:  
X,Y,Z coordinates of points that it has saved  
X,Y,Z velocities of points that it has saved

I have been able to calculate the semi-major axis using the vis-viva equation. I have tried to get the value using the vis-viva equation but I got stuck as I think I need at least the Aphelion or Parohelion to calculate the eccentricity.

**My question: Does anyone know how to calculate the eccentricity at any given point in the orbit using the velocity and coordinates (without simulating all points around it)?**

**If not, does anyone maybe have a better idea/suggestion that I can try to gain the eccentricity values?**

**Tags:** orbital-mechanics, eccentricity
> **Comments:**
> **username_1**: Hi, it's not clear what your inputs are - how do you even verify your model is generating a stable orbit if you don't know how to identify apogee and perigee?  But, assuming your data show a stable pattern (the  x-y-z position and velocity data follow some reasonably repeatable path),  why not fit your data to a curve (ellipse) and calculate the eccentricity from that?  

---

## 1 answers

### Answer by username_2 on 2019-01-03. Score: 1

One uses the so called eccentricity vector, also called (up to a factor) Laplace-Runge-Lenz vector.

Given the position $$\vec{r} = \begin{bmatrix}x\\ y\\ z\end{bmatrix}$$ of the object at given time $t$ and its velocity $$\vec{v} = \begin{bmatrix}u\\ v\\ w\end{bmatrix}$$ both with respect to an inertial coordinate system cantered at the origin of the gravitational field, the eccentricity of the orbit (Keplerian case) can be calculated by first computing the eccentricity vector:

Step 1: Calculate the angular momentum $$\vec{L} = \vec{r} \times \vec{v}$$
Step 2: Calculate the eccentricity vector $$\vec{e} = \frac{1}{\mu}\, \big(\,\vec{v} \times \vec{L}\,\big) - \frac{\vec{r}}{|r|}$$
Step 3: Calculate eccentricity
$$e = |\vec{e}| = \sqrt{\vec{e} \circ \vec{e}\,}$$ where $\cdot \circ \cdot$ is the dot product, e.g.
$$|r| = \sqrt{\vec{r} \circ \vec{r}\,} = \sqrt{x^2 + y^2 + z^2}$$

> **Comments:**
> **username_0**: I would like to thank you as well for your answer as it covered the same approach (using the angular momentum). But as I can only give the green price to one saving hand, I have decided to give it to mistertribs. Thank you!  
> **username_2**: @Stijn Thank you, no problem, mistertribs was the first to point in the right direction, so he should get the credit.  

---

