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 'Gauss' law seems to imply instantaneous electric field propagation'
Imagine a charged sphere at the origin connected through an open switch to a vertical grounded wire. We wish to find an expression for the horizontal component of the electric field at a distance ##\mathbf{r}## from the sphere as it discharges. By using the Lorenz gauge condition: $$\nabla \cdot \mathbf{A} + \frac{1}{c^2}\frac{\partial \phi}{\partial t}=0\tag{1}$$ we find the following retarded solutions to the Maxwell equations If we assume that...
Maxwell’s equations imply the following wave equation for the electric field $$\nabla^2\mathbf{E}-\frac{1}{c^2}\frac{\partial^2\mathbf{E}}{\partial t^2} = \frac{1}{\varepsilon_0}\nabla\rho+\mu_0\frac{\partial\mathbf J}{\partial t}.\tag{1}$$ I wonder if eqn.##(1)## can be split into the following transverse part $$\nabla^2\mathbf{E}_T-\frac{1}{c^2}\frac{\partial^2\mathbf{E}_T}{\partial t^2} = \mu_0\frac{\partial\mathbf{J}_T}{\partial t}\tag{2}$$ and longitudinal part...
Thread 'Recovering Hamilton's Equations from Poisson brackets'
The issue : Let me start by copying and pasting the relevant passage from the text, thanks to modern day methods of computing. The trouble is, in equation (4.79), it completely ignores the partial derivative of ##q_i## with respect to time, i.e. it puts ##\partial q_i/\partial t=0##. But ##q_i## is a dynamical variable of ##t##, or ##q_i(t)##. In the derivation of Hamilton's equations from the Hamiltonian, viz. ##H = p_i \dot q_i-L##, nowhere did we assume that ##\partial q_i/\partial...
Back
Top