Some questions regarding proportions in a two-body problem

  • Thread starter Thread starter Ostsol
  • Start date Start date
AI Thread Summary
The discussion revolves around programming an n-body simulation, specifically modeling the Earth-Moon system. The main challenge is determining the starting conditions, particularly the Earth's velocity, to ensure a stable simulation. The user discovered that the Earth's velocity should be inversely proportional to the Moon's velocity based on their masses, which stabilizes the simulation. While the math behind celestial mechanics can be complex, resources like the Princeton course on n-body simulations provide valuable guidance. The conversation highlights the importance of accurate initial parameters and the center of mass in achieving realistic orbital paths.
Ostsol
Messages
12
Reaction score
0
I am programming an n-body simulation, but to test my program, I decided to start with two bodies. Specifically, I decided to model the Earth-Moon system. The issue I have is that Kepler's laws involve only the motion of one of the two bodies. From my understanding, the other is assumed to be static or of such mass that its motion is insignificant. That leaves me working with Newtonian gravitation and motion.

My problem is the starting conditions. Wikipedia tells me the mass of the Earth and Moon, and the orbital radius and velocity of the Moon. Simply inputting these parameters does not create a stable simulation, though. The entire system slowly moves. I was obvious that I was not accounting for the Earth's motion in my starting conditions. It was not obvious as to how I should determine the Earth's velocity.

Because my maths are effectively pre-calculus (I took single-variable calculus over a decade ago and have forgotten most of it), it is difficult to understand the maths behind celestial mechanics. Eventually, though, after playing with some numbers I found that the velocity of the Earth should be of a proportion to the Moon's that is inverse to the proportion of their masses. Basically:

v_e{}/v_m{}=m_m{}/m_e{}

Where v and m are velocity and mass, respectively; and the subscripts m and e are the Moon and the Earth, respectively. The Earth's velocity obviously points in the opposite direction as the Moon's. This creates a stables simulation regardless of the values input and the distances involved. As long as these proportions remain the same, the bodies trace the same orbital paths each time.

Now I'm sure that this proportion may be derived from the relevant formulae by those who have sufficient competence in the maths involved, but that's not me. I was unable to find this information on Wikipedia or in various Google searches, though perhaps that's not surprising. My questions therefore are: is this proportion documented somewhere and are there any others that I should be aware of?

Thank you.

-Daniel
 
Physics news on Phys.org
The math for doing an n-body simulation is pretty simple. All you need are Newton's laws. It's the algorithm that you have to be careful with. I did my first program using the information at this site:

http://www.cs.princeton.edu/courses/archive/spring11/cos126/assignments/nbody.html

Although it's for Java, you can still use the info to write the program in any language you like. Also, the instructions at the link site are for x and y coordinates only. But it's pretty easy to add the Z coordinates once you understand how it works.
 
Yes, the simulation was relatively easy to create. I even incorporated RK4 integration based on some information I found elsewhere in these forums. The problem is figuring out the starting parameters for bodies of arbitrary mass and orbital radii.
 
I seed my simulation with the ephemerides generated at the Horizons web site. I then calculate the center of mass for the bodies I am simulating and set that coordinate at 0,0,0 adjusting the coordinates and velocities of the other bodies accordingly.
 
Thread 'Question about pressure of a liquid'
I am looking at pressure in liquids and I am testing my idea. The vertical tube is 100m, the contraption is filled with water. The vertical tube is very thin(maybe 1mm^2 cross section). The area of the base is ~100m^2. Will he top half be launched in the air if suddenly it cracked?- assuming its light enough. I want to test my idea that if I had a thin long ruber tube that I lifted up, then the pressure at "red lines" will be high and that the $force = pressure * area$ would be massive...
I feel it should be solvable we just need to find a perfect pattern, and there will be a general pattern since the forces acting are based on a single function, so..... you can't actually say it is unsolvable right? Cause imaging 3 bodies actually existed somwhere in this universe then nature isn't gonna wait till we predict it! And yea I have checked in many places that tiny changes cause large changes so it becomes chaos........ but still I just can't accept that it is impossible to solve...
Back
Top