S
S
Sergey Subbotin2018-02-24 19:00:48
Java
Sergey Subbotin, 2018-02-24 19:00:48

Orbit calculation method?

Hello.
I am writing a gravity simulator for android.
At first, I counted each next coordinate using the Runge-Kutta method..
Two problems.
1. The device does not export such calculations
2. Error
There is an idea to implement it this way.
Read the entire orbit at once.
That is, to change the parameters of the ellipse under the influence of other bodies. Am I thinking right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tomatho, 2018-02-25
@exformat

The Runge-Kutta method should be enough.
You can use any other method of numerical solution of differential equations suitable for such a problem.
What is an ancient device? Or... How many steps do you have, how much accuracy do you need?
Another possible problem: you did not write out the equations correctly, or you do not correctly apply the Runge-Kutta method. For example, instead of the squared radius, in the usual form of the equations there should be a cubed radius, and since the radius is calculated through the root, the cubed root will be obtained.
An ellipse can only be calculated for two bodies. For three bodies there is no longer an ellipse.
Ellipse / hyperbola / parabola for two bodies and their initial conditions (position, velocity, mass) can be found on the English version of Wikipedia on the Kepler orbit page.
But this is already furious geometry. And to do all this correctly and accurately is not an easy task. I somehow wanted to do it, then spat. But I just wanted to add a "predictable" trajectory of the body during its addition to the simulation.
To be more precise, this one: https://github.com/HermannBjorgvin/Gravity-Experiments
The Runge-Kutta method can be not only of the fourth order, but also higher. The higher the order, the higher the accuracy.
Lagrange points can also be found on ellipses, most likely, only there you need to either find them yourself, or find literature where this is described.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question