<p>Yes, that interpretation is correct. The given formula only denotes the (integral) acceleration seen by <em>a single</em> mass element at a certain time <span class="math-container">$t$</span> (as implicitly <span class="math-container">$\mathbf{r_i} = \mathbf{r_i(t)}$</span> where <span class="math-container">$i$</span> could be in your example of the system of the three bodies Earth, Sun and Jupiter either of those three).</p>
<p>In order to solve the overall system you have to calculate the acceleration on each mass element in an identical manner. You can get the evolution of the overall system by choosing sufficiently small time steps and forward integrating it. There are other, possibly more suitable methods, like implicit methods, which do not suffer so much from adding up small errors in the integration which will happen naturally due to discretization. A number of methods to solve <a href="https://en.wikipedia.org/wiki/N-body_simulation" rel="noreferrer">N-body problems</a> are listed on the corresponding wikipedia page with useful references or on <a href="https://www.usm.uni-muenchen.de/people/puls/lessons/numpraktnew/nbody/nbody_manual.pdf" rel="noreferrer">these lecture notes</a> along with its references. You will find a plethora of information on how to approach these types of problems when you search for &quot;N-body simulations&quot;.</p>

CC BY-SA 4.0
2022-08-03T15:21:50.437Z
I think I've got that. Could you have a look at my edit to confirm I'm on the right track? Thanks.
Peter
CC BY-SA 4.0
2022-08-03T15:32:16.040Z
yes, that's right. The accuracy depends on how small you choose your timesteps (and what actual integration method you choose). The numerics of solving these type of problems efficiently and with damped errors cover whole lecture series.
planetmaker
CC BY-SA 4.0
2022-08-03T21:20:15.020Z
I think the OP has just discovered why it’s so complicated (some say impossible) to calculate the long-term evolution of the Solar System…
Pierre Paquette
CC BY-SA 4.0
2022-08-03T11:38:15.850Z
2022-08-03T16:48:08.310Z
2022-08-03T16:48:08.310Z
planetmaker
<p>According to <a href="https://en.wikipedia.org/wiki/Orbit_modeling#:%7E:text=Cowell%27s%20method.,(the%20epoch%20of%20osculation)." rel="nofollow noreferrer">Wikipedia</a>:</p>
<p>“ ... for <span class="math-container">$n$</span> mutually interacting bodies, Newtonian forces on body <span class="math-container">$i$</span> from the other bodies <span class="math-container">$j$</span> are” given by the summation equation<span class="math-container">$$\ddot{\mathbf{r}}_{i}=\sum_{j=1,j\neq i}^{n}\frac{Gm_{j}\left(\mathbf{r}_{j}-\mathbf{r}_{i}\right)}{r_{ij}^{3}},$$</span></p>
<p>“with all vectors being referred to the barycenter of the system.”</p>
<p>The summed over accelerations denoted by the right side of this equation do not appear to take into account gravitational forces <em>between</em> the <span class="math-container">$j$</span> other bodies? In other words, all the accelerations are functions of <span class="math-container">$\mathbf{r}_{i}$</span>, the position vector of the body acted on by the <span class="math-container">$j$</span> other bodies. Is that interpretation correct?</p>
<p>EDIT</p>
<p>So if, for example, I wanted to calculate the Earth's acceleration due to the effect of the Sun and Jupiter, I would use the equation three times. Once with <span class="math-container">$i$</span> representing Earth to find the Earth's acceleration; once with <span class="math-container">$i$</span> representing the Sun to find the Sun's acceleration; and once with <span class="math-container">$i$</span> representing Jupiter to find Jupiter's acceleration. If I knew the initial position and velocity of the three bodies I could then numerically integrate these three equations to find positions and velocities after a certain time. Is that right?</p>

CC BY-SA 4.0
2022-08-06T22:20:34.937Z
Great question! For a rather inefficient example of how that might be done see `deriv_Newton_Only(X, t)` in the script in [this answer to *How to calculate the planets and moons beyond Newtons's gravitational force?*](https://space.stackexchange.com/a/23409/12102).
uhoh
CC BY-SA 4.0
2022-08-09T08:03:59.503Z
@uhoh - thanks for that. Using an Excel spreadsheet and Cowell's method I've managed to calculate the position of Phobos to within 308km of where JPL says it will be after 48 hours (about six orbits of Mars). I included the gravitational effects of all the planets and used a one minute time interval. I started off using a six hour time interval, and then wondered why my Phobos was hurtling off into the cosmos. The same spreadsheet predicts the position of Mars to within 5,911km after 687 days (using a six hour time interval).
Peter
CC BY-SA 4.0
2022-08-09T11:01:59.397Z
Excellent, sounds fun! It's quite a challenge integrating equations of motion and n-body interactions in Excel, did you use a spreadsheet or Virtual Basic for the calculation?
uhoh
CC BY-SA 4.0
2022-08-09T15:24:11.070Z
@uhoh - I used a single worksheet (no Visual Basic) and the leapfrog method of numerical integration. Nine columns for each of the planets and the Sun (three each for distance, velocity and acceleration), except for Mars where I had an additional column to give the Mars-Sun distance (using Pythagorean theorem). It was good fun but would have been much, much easier if I were able to code.
Peter
CC BY-SA 4.0
2022-08-09T22:07:04.293Z
Oh it's always really good to do something once the hard way, one gets an intimate, visceral appreciation for the details that is invaluable later. I can imagine what you did and I love it. *Hat's off to you!* Years ago I decided that learning Python would change my life and it really really did. It's free, ubiquitous, the internet is full of tutorials at all levels and a variety of styles. You get an error, paste the error in google and voila there's the solution! I can do anything I want now with little Python scripts, and I think you'd have the same results.
uhoh
CC BY-SA 4.0
2022-08-09T22:11:11.283Z
Since you are interested in scientific and numerical stuff, just get the Anaconda installation from https://anaconda.com because it brings a large library of scientific packages all at once. Python scripts are just text files. You can run them from a command window, or use and IDE like IDLE or Spyder. It literally changed my life! If I want to download a YouTube video I use python. If I want to modify an audio recording I use Python. If I want to solve a set of equations, make a 3D plot of data, count the number of words in a paper I wrote, I use Python.
uhoh
CC BY-SA 4.0
2022-08-10T19:09:01.003Z
@uhoh - Thanks for that. I actually ordered a beginner's guide to Python yesteday. I'm looking forward to replicating (if I can) my spreadsheet results using Python.
Peter
CC BY-SA 4.0
2022-08-10T20:10:56.410Z
Excellent! Note that there is a python tag for questions in both Astronomy SE and Space SE. If you get stuck scripting your calculations you may be able to explain what you're doing and get a speedy answer.
uhoh
<orbital-elements><ephemeris>
Question about Cowell's method
Peter
# Question about Cowell's method

(Asked by: username_0 on 2022-08-03)

According to [Wikipedia](https://en.wikipedia.org/wiki/Orbit_modeling#:%7E:text=Cowell%27s%20method.,(the%20epoch%20of%20osculation).):

“ ... for $n$ mutually interacting bodies, Newtonian forces on body $i$ from the other bodies $j$ are” given by the summation equation$$\ddot{\mathbf{r}}\_{i}=\sum\_{j=1,j\neq i}^{n}\frac{Gm\_{j}\left(\mathbf{r}\_{j}-\mathbf{r}\_{i}\right)}{r\_{ij}^{3}},$$

“with all vectors being referred to the barycenter of the system.”

The summed over accelerations denoted by the right side of this equation do not appear to take into account gravitational forces *between* the $j$ other bodies? In other words, all the accelerations are functions of $\mathbf{r}\_{i}$, the position vector of the body acted on by the $j$ other bodies. Is that interpretation correct?

EDIT

So if, for example, I wanted to calculate the Earth's acceleration due to the effect of the Sun and Jupiter, I would use the equation three times. Once with $i$ representing Earth to find the Earth's acceleration; once with $i$ representing the Sun to find the Sun's acceleration; and once with $i$ representing Jupiter to find Jupiter's acceleration. If I knew the initial position and velocity of the three bodies I could then numerically integrate these three equations to find positions and velocities after a certain time. Is that right?

**Tags:** orbital-elements, ephemeris
> **Comments:**
> **username_1**: Great question! For a rather inefficient example of how that might be done see `deriv_Newton_Only(X, t)` in the script in [this answer to *How to calculate the planets and moons beyond Newtons's gravitational force?*](https://space.stackexchange.com/a/23409/12102).  
> **username_0**: @uhoh - thanks for that. Using an Excel spreadsheet and Cowell's method I've managed to calculate the position of Phobos to within 308km of where JPL says it will be after 48 hours (about six orbits of Mars). I included the gravitational effects of all the planets and used a one minute time interval. I started off using a six hour time interval, and then wondered why my Phobos was hurtling off into the cosmos. The same spreadsheet predicts the position of Mars to within 5,911km after 687 days (using a six hour time interval).  
> **username_1**: Excellent, sounds fun! It's quite a challenge integrating equations of motion and n-body interactions in Excel, did you use a spreadsheet or Virtual Basic for the calculation?  
> **username_0**: @uhoh - I used a single worksheet (no Visual Basic) and the leapfrog method of numerical integration. Nine columns for each of the planets and the Sun (three each for distance, velocity and acceleration), except for Mars where I had an additional column to give the Mars-Sun distance (using Pythagorean theorem). It was good fun but would have been much, much easier if I were able to code.  
> **username_1**: Oh it's always really good to do something once the hard way, one gets an intimate, visceral appreciation for the details that is invaluable later. I can imagine what you did and I love it. *Hat's off to you!* Years ago I decided that learning Python would change my life and it really really did. It's free, ubiquitous, the internet is full of tutorials at all levels and a variety of styles. You get an error, paste the error in google and voila there's the solution! I can do anything I want now with little Python scripts, and I think you'd have the same results.  
> **username_1**: Since you are interested in scientific and numerical stuff, just get the Anaconda installation from https://anaconda.com because it brings a large library of scientific packages all at once. Python scripts are just text files. You can run them from a command window, or use and IDE like IDLE or Spyder. It literally changed my life! If I want to download a YouTube video I use python. If I want to modify an audio recording I use Python. If I want to solve a set of equations, make a 3D plot of data, count the number of words in a paper I wrote, I use Python.  
> **username_0**: @uhoh - Thanks for that. I actually ordered a beginner's guide to Python yesteday. I'm looking forward to replicating (if I can) my spreadsheet results using Python.  
> **username_1**: Excellent! Note that there is a python tag for questions in both Astronomy SE and Space SE. If you get stuck scripting your calculations you may be able to explain what you're doing and get a speedy answer.  

---

## 1 answers

### Answer by username_2 on 2022-08-03. Score: 7 | Accepted answer

Yes, that interpretation is correct. The given formula only denotes the (integral) acceleration seen by *a single* mass element at a certain time $t$ (as implicitly $\mathbf{r\_i} = \mathbf{r\_i(t)}$ where $i$ could be in your example of the system of the three bodies Earth, Sun and Jupiter either of those three).

In order to solve the overall system you have to calculate the acceleration on each mass element in an identical manner. You can get the evolution of the overall system by choosing sufficiently small time steps and forward integrating it. There are other, possibly more suitable methods, like implicit methods, which do not suffer so much from adding up small errors in the integration which will happen naturally due to discretization. A number of methods to solve [N-body problems](https://en.wikipedia.org/wiki/N-body_simulation) are listed on the corresponding wikipedia page with useful references or on [these lecture notes](https://www.usm.uni-muenchen.de/people/puls/lessons/numpraktnew/nbody/nbody_manual.pdf) along with its references. You will find a plethora of information on how to approach these types of problems when you search for "N-body simulations".

> **Comments:**
> **username_0**: I think I've got that. Could you have a look at my edit to confirm I'm on the right track? Thanks.  
> **username_2**: yes, that's right. The accuracy depends on how small you choose your timesteps (and what actual integration method you choose). The numerics of solving these type of problems efficiently and with damped errors cover whole lecture series.  
> **username_3**: I think the OP has just discovered why it’s so complicated (some say impossible) to calculate the long-term evolution of the Solar System…  

---

