Creating a Gravitational 2 body simulation

Click For Summary

Discussion Overview

The discussion revolves around creating a simulation for the gravitational two-body problem, focusing on the numerical solution of the governing equations. Participants explore different approaches to modeling the system, including the use of reduced mass and the direct application of gravitational forces.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant describes their approach to defining the position vectors and the center of mass in the context of the two-body problem, expressing a need to solve the equations numerically.
  • Another participant suggests that using the real gravitational force is more beneficial if both position vectors are to be tracked separately, as opposed to using the reduced mass approach.
  • Concerns are raised about the complexity of the equations when using separate position vectors, with one participant noting the difficulty in solving the equations due to the interdependence of the variables.
  • It is pointed out that even with the reduced mass, the equations still involve multiple components, which can complicate the solution process.
  • A suggestion is made for the original poster to focus on computational physics and consider taking a course in numerical methods for solving ordinary differential equations, highlighting the importance of energy conservation in modeling gravitational dynamics.
  • Another participant emphasizes the need for careful selection of resources when learning about numerical methods, particularly regarding symplectic methods like Verlet for accurate simulations.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to modeling the gravitational two-body problem, with some advocating for the use of reduced mass and others favoring the direct application of gravitational forces. The discussion remains unresolved regarding the optimal method for simulation.

Contextual Notes

Participants note the complexity of the equations involved and the potential challenges in solving them, particularly when considering the interdependence of position vectors and the need for numerical methods.

Who May Find This Useful

This discussion may be useful for students and practitioners interested in computational physics, numerical methods for differential equations, and gravitational dynamics simulations.

Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
I am trying to create a simulation for a gravitational 2 body problem.
But I am kind of having trouble to define the equations that can be solve numerically. From an inertial frame I defined the position of the two objects as the ##\vec{r_1}## and ##\vec{r_2}## with masses ##m_1## and ##m_2##.

Let the ##\vec{R}_{CM}## be the position of the CM of the objects. Now from the perspective of the CM, we can write position vectors of the objects in terms of ##\vec{r'}_1## and ##\vec{r'}_2##.

$$\vec{r'}_1 = \frac{-m_2}{m_1 + m_2} \vec{r}~~(1)$$

and $$\vec{r'}_2 = \frac{m_1}{m_1 + m_2} \vec{r}~~(2)$$where

##\vec{r}= \vec{r'}_2 - \vec{r'}_1##

Now in this case we can use the reduced mass and define the force on this mass. So we have,

##\vec{F} = \mu \ddot{\hat{r}} = -\frac{Gm_1m_2}{r^2} \hat{r}##Now I need to solve this equation and put back into the (1) and (2) right ?
 
Last edited:
Technology news on Phys.org
If you want to keep track of both position vectors separately then using the real gravitational force is more useful. The reduced mass is great if you want to treat it as one-body problem.
 
mfb said:
If you want to keep track of both position vectors separately then using the real gravitational force is more useful.
$$m_1\ddot{\mathbf{r}}_1=-\frac{Gm_1m_2(\mathbf{r}_1-\mathbf{r}_2)}{|\mathbf{r}_1-\mathbf{r}_2|^3}\tag{1}$$

$$m_2\ddot{\mathbf{r}}_2=-\frac{Gm_1m_2(\mathbf{r}_2-\mathbf{r}_1)}{|\mathbf{r}_2-\mathbf{r}_1|^3}\tag{2}.$$

I am new at this topic and in the above equations the left side has ##r1## but right has ##r2## and ##r1##, so It seemed harder for me to solve it in this way. Thats kind of why I tried to use reduced mass.
 
Arman777 said:
I am new at this topic and in the above equations the left side has ##r1## but right has ##r2## and ##r1##, so It seemed harder for me to solve it in this way.

It seems but it isn't. Even using the reduced mass you actually have three equations - one for each component of the displacement vector. In each of these equations you have one component on the left side but all three components on the right side. With separate positions you have 6 instead of three equations but the basic principle doesn't change.
 
  • Like
Likes   Reactions: Arman777
DrStupid said:
It seems but it isn't. Even using the reduced mass you actually have three equations - one for each component of the displacement vector. In each of these equations you have one component on the left side but all three components on the right side. With separate positions you have 6 instead of three equations but the basic principle doesn't change.
I see...I guess before jumping into these topics I should focus on the computational physics part, solving DE equations on computer.
 
I see you are a university undergraduate: can you take a course in numerical methods for solving ordinary differential equations? Or take a book in that subject out of the library? I wouldn't advise finding your way through this topic yourself. As a last resort, use a search engine with that topic , but be careful where you go from there; this one looks OK, although it doesn't seem to go far enough to cover the importance of simplectic methods (e.g. Verlet) in modelling physical systems (TL;DR the methods you cover earlier do not conserve energy, which is obviously quite important for modelling gravitational dynamics).

 
  • Like
Likes   Reactions: DEvens
pbuk said:
I see you are a university undergraduate: can you take a course in numerical methods for solving ordinary differential equations? Or take a book in that subject out of the library? I wouldn't advise finding your way through this topic yourself. As a last resort, use a search engine with that topic , but be careful where you go from there; this one looks OK, although it doesn't seem to go far enough to cover the importance of simplectic methods (e.g. Verlet) in modelling physical systems (TL;DR the methods you cover earlier do not conserve energy, which is obviously quite important for modelling gravitational dynamics).
Thanks for your thought. I ll look into them. I am studying Mark Newman Compt physics, which seems good enough for me
 

Similar threads

Replies
3
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 19 ·
Replies
19
Views
3K
Replies
1
Views
1K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K