One satellite, two planets and movement

In summary, Rapidrain is trying to write a program that simulates the flight of a satellite near two large planets. The satellite's mass is negligible and the program uses the potential energy from each planet, as well as the satellite's kinetic energy, to calculate its next position and velocity. However, there is a slight decrease in total energy over a short period of time, and Rapidrain is looking for ways to reduce this decrease. One suggestion is to look into Euler's three body problem and use numerical techniques, such as Euler's method, Runge-Kutta integrators, and Euler-Cromer method, to solve the second order initial value problem. Another approach is to offset the calculation of position and velocity by half a time step using
  • #1
Rapidrain
31
0
I am trying to write a program to show the flight of a satellite in the neighbourhood of two large planets. In all of this the mass of the satellite is negligible.

I have the potential energy from planet1 = pe1 and
the potential energy from planet2 = pe2 and
the kinetic energy of the satellite = ke

Using the sum of the two planets' acc vectors to create a ! single ! acc vector I can calculate the next position using the current position, the velocity vector and the movement caused by the ! single ! acc vector.

This is good; (it works fine in a single planet and satellite model).

The new velocity vector can also be similarly deduced adding the induced velocity from the acc vector to the original velocity vector.

This is also good; (it also works fine in a single planet and satellite model).

However Total Energy is just a bit off. Using my model with a short sliver of time I have a decrease of total energy by a factor 6.5 * 10**-4. Not a really big number but I want to find how I can reduce it to 0.0.

I have three possibilities of tweaking the model to reach change in TE = 0.0 :

1. only increase the velocity and thereby the kinetic energy

2. only increase the distance from the two planets and thereby the potential energy

3. increase both vel and dist (in a certain proportion) to increase both KE and PE

Does physics, nature, mathematics or logic define which of these three paths to explore?
 
Physics news on Phys.org
  • #2
This is known as Euler's three body problem. I suggest you loop that up and think whether you really need to do what you are doing.
 
  • #3
Sorry voko, but I don't understand what you mean by "loop that up".

And really need to do what I am doing? Please explain.
 
  • #4
Find the information on Euler's three body problem. Wikipedia has a page on that. If English is not your native language, you may want to search for the information in your language.
 
  • #5
Again Voko, what do you mean by 'loop that up'? Is this the designation of how one solves Euler's three bodies?
 
  • #6
"Look that up" = "find that information". Do not re-invent the wheel.
 
  • #7
voko said:
This is known as Euler's three body problem.
Also known as "the problem of two fixed centers".

That, however, is not the cause Rapidrain's problem. The issue is how position and velocity are being updated. What follows is a very brief tutorial in numerical techniques to solve an ordinary differential equation (ODE).

First off, Rapidrain, you are trying to solve what's called a second order initial value problem. Second order means you have first (velocity) and second (acceleration) derivatives, initial value means you know the position and velocity at the start time and want to find them at some end time.

First order ODE techniques

A large number of techniques for solving first order initial value problems exist. You can take advantage of these by converting this second order ODE to a first order ODE. Any second order ODE can be re-expressed as a first order ODE by creating a doubled-up state vector that comprises the zeroth and first derivatives. For example, ##\dot x(t) = v(t), \ddot x(t) = a(t)## becomes ##u(t) = (x(t), v(t)), \dot u(t) = (v(t), a(t))##.

The simplest first order ODE solver is Euler's method: ##u(t+\Delta t) = u(t) + \Delta t\, \dot u(t)##. You should never use Euler's method. However, it is important to understand how it works because almost every other integration technique can be viewed as making smarter Euler-type steps.

For a second order ODE, Euler's method becomes
[tex]\begin{aligned}
\vec x(t+\Delta t) &= \vec x(t) + \Delta t \, \vec v(t) \\
\vec v(t+\Delta t) &= \vec v(t) + \Delta t \, \vec a(t)
\end{aligned}[/tex]

There are a slew of first order ODE solvers that are far better than Euler's method. Runge-Kutta integrators take a number of intermediate steps between t and t+Δt before arriving at an estimate for u(t+Δt). Predictor/corrector methods keep a history of old values so that it can predict u(t+Δt) using one algorithm and the correct it using another. Google Runge-Kutta, multistep method, and predictor-corrector for more info.


Second order ODE techniques

An alternate approach is to take advantage of the fact that this is a second order problem that you are trying to solve. The equivalent of Euler's method for a second order ODE is to take steps via
[tex]\begin{aligned}
\vec v(t+\Delta t) &= \vec v(t) + \Delta t \, \vec a(t) \\
\vec x(t+\Delta t) &= \vec x(t) + \Delta t \, \vec v(t+\Delta t)
\end{aligned}[/tex]
This is called the Euler-Cromer method, the symplectic Euler method, plus a whole bunch of other names. The only difference between this approach and the basic Euler method is the order in which position and velocity are updated. Simply switching to updating velocity first makes a *huge* difference. The basic Euler method doesn't even come close to conserving energy. This approach does.

However, Euler-Cromer is still lousy. A simple mod to this approach is to offset the calculation of position and velocity by half a time step. This is what leapfrog, position verlet, and velocity verlet integration do. Google these names for more info. Even more advanced are the Gauss-Jackson techniques.

I'd suggest trying a variant of position verlet. You'll have to bootstrap this by computing the acceleration vector at t=0.
[tex]\begin{aligned}
\vec x(t+\Delta t/2) &= \vec x(t) + \frac 1 2 \Delta t \, \vec v(t) \\
\vec v(t+\Delta t/2) &= \vec v(t) + \frac 1 2 \Delta t \, \vec a \\
& \text{compute and save midpoint acceleration}\,\vec a = f(\vec x(t+\Delta t/2)) \\
\vec v(t+\Delta t) &= \vec v(t+\Delta t/2) + \frac 1 2 \Delta t \, \vec a \\
\vec x(t+\Delta t) &= \vec x(t+\Delta t/2) + \frac 1 2 \Delta t \, \vec v(t+\Delta t)
\end{aligned}[/tex]
This is no more expensive computationally than Euler-Cromer (the expense is typically in the derivative computations) but it is far more accurate.
 
  • #8
D H said:
Also known as "the problem of two fixed centers".

That, however, is not the cause Rapidrain's problem. The issue is how position and velocity are being updated. What follows is a very brief tutorial in numerical techniques to solve an ordinary differential equation (ODE).

As you most certainly know, solving ODEs might be wholly unnecessary in this problem. Which would eliminate the problem entirely. That is the whole point behind my urging Rapidrain to study the classical approach.
 
  • #9
Very good DH. This helps much more than "go look it up".

Question though : your equations show : x(t + del*t) = x(t) + del*t*v(t)

shouldn't the right side also have the distance covered by acceleration :

x(t) + del*t*v(t) + (1/2)*acc(t)*(del*t)**2 ??

I'll give your algorithm a try.
 

What is the concept behind one satellite orbiting two planets?

The concept behind one satellite orbiting two planets is known as a double planet system. This occurs when two celestial bodies are of similar size and orbit around a shared center of mass, also known as a barycenter. The two planets exert gravitational forces on each other, causing them to orbit around the barycenter rather than around one another.

How does the movement of the satellite change in a double planet system?

In a double planet system, the movement of the satellite is more complex than in a traditional single planet system. The satellite may experience varying gravitational forces from the two planets, causing its orbit to be irregular and sometimes even unstable. This can result in the satellite changing its speed, direction, and distance from the barycenter.

Can a satellite be in a stable orbit around two planets?

Yes, it is possible for a satellite to be in a stable orbit around two planets in a double planet system. This stability is dependent on the distance between the two planets, the mass of the planets, and the mass and position of the satellite. If these factors are just right, the satellite can maintain a stable orbit around the barycenter of the two planets.

How does the distance between the two planets affect the satellite's orbit?

The distance between the two planets plays a critical role in the stability and movement of the satellite. If the distance is too close, the gravitational forces may be too strong and cause the satellite's orbit to become unstable. On the other hand, if the distance is too far, the gravitational forces may be too weak, and the satellite may drift away from the barycenter and into space.

Are there any known double planet systems in our solar system?

There are currently no known double planet systems in our solar system. However, there is a proposal to classify the Earth-Moon system as a double planet system due to the large size and comparable mass of the Moon compared to Earth. Other potential double planet candidates include Pluto and its moon Charon, and the dwarf planet Eris and its moon Dysnomia.

Similar threads

  • Classical Physics
Replies
4
Views
1K
Replies
86
Views
4K
  • Introductory Physics Homework Help
Replies
1
Views
813
  • Classical Physics
Replies
5
Views
1K
Replies
9
Views
2K
  • Introductory Physics Homework Help
Replies
8
Views
3K
  • Introductory Physics Homework Help
Replies
4
Views
3K
  • Introductory Physics Homework Help
Replies
5
Views
1K
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
3
Views
1K
Back
Top