Kepler problem with Runge-Kutta

In summary, The student is asking about how to solve a Kepler's problem. The student has difficulty understanding the equations and does not understand what a vector is. The student asks for help understanding the equations and for help finding the initial value and the position of Earth at the beginning of the problem.
  • #1
nikolafmf
114
0

Homework Statement



Solve the Kepler problem by Runge-Kutta method, where initial conditions x(0)=x0, y(0)=y0, vx(0)=vx0, vy(0)=vy0

Homework Equations



dvx/dt = -GMx/(x2+y2)3/2 (1)
dvy/dt = -GMy/(x2+y2)3/2 (2)
dx/dt = vx (3)
dy/dt = vy (4)

The Attempt at a Solution



First of all, Runge-Kutta solves equations which have this form:

dv/dt = f(t,v).

But equations (1) and (2) are of the form dv/dt = f(x(t), y(t)). They don't have v on the right side and t is implicit. So, problem arises when I compute k2, k3 etc. For example:

k1 = f(t_n, v_n)
k2 = f(t_n + 1/2h, v_n+1/2hk_1)
k3 = f(t_n+ 1/2h, v_n+1/2hk_2)

Now, if I am right, k1 = k2= k3=k4 in my case, because I have not v on the right side of the equation. If that is true, then Runge-Kutta reduces to ordinary Euler method and brings nothing new. My question is, are really k1 = k2= k3=k4? And if they are not equal, where is my mistake?

Or, I can ask otherwise, how can I implement the Runge-Kutta method to Kepler problem?
 
Last edited:
Physics news on Phys.org
  • #2
You have a system of 4 first order differential equations with the vector u = (x, y, vx, vy) being the independent state, written in short as

du/dt = f(u,t)

and it is this system that your RK method solves. This means that the equations defining the particular RK-method you are using (RK4 in your case) must be considered vector equations, that is, in your case each ki is a 4-element vector and an expression like un+(h/2)k1 means "multiply the k1 vector with the scalar (h/2) and add it to the vector un".

When you write code for this you may of course choose to write out the vector operations explicitly as scalar operations on four different variables if you do not have convenient access to a vector library.
 
  • #3
Filip, thank you very much for your response. But I still can't see that du/dt=f(u,t).
If u=(x,y,vx,vy), then du/dt = (vx, vy, -GMx/(x^2+y^2)^(3/2), -GMx/(x^2+y^2)^(3/2)), right? Then what function of u is it? I see that it is a function of the components of u, but not of u itself. And, t doesn't even appear here (at least not explicitely).
Again, thank you for your time.
 
  • #4
nikolafmf said:
If u=(x,y,vx,vy), then du/dt = (vx, vy, -GMx/(x^2+y^2)^(3/2), -GMx/(x^2+y^2)^(3/2)), right?

That is correct (well, the last component should be proportional with y and not x, but I assume that is just a typo).

Then what function of u is it? I see that it is a function of the components of u, but not of u itself. And, t doesn't even appear here (at least not explicitely).

The vector u is just a convenient notation for the complete state - a notion used by the RK scheme you mentioned part of. If you are unsure about what a vector is you probably want to refer to a textbook for some background (see [1] for a brief overview). You are free to translate each vector equation, like k1 = f(u), to the corresponding set of 4 equations, like

k1[0] = f(un)[0] = (vxn, vyn, -GMx/(xn2+yn2)(3/2), -GMy/(xn2+yn2)(3/2))[0] = vxn,
k1[1] = f(un)[1] = ... = vyn,
k1[2] = f(un)[1] = ... = -GMx/(xn2+yn2)(3/2), and
k1[3] = f(un)[3] = ... = -GMy/(xn2+yn2)(3/2)

where I have used the code-like notation "vector" to mean "the i-th component of vector" for i = 0, 1, 2, 3. So, for each of k1 to k4 you can write up such 4 scalar expressions.

You are correct that time t does not explicitly appear in the field, that is, f(u, t) = f(u). This is quite common in dynamical systems and a system with this characteristic is called an autonomous system (see for instance [2]).[1] http://en.wikipedia.org/wiki/Euclidean_vector
[2] http://en.wikipedia.org/wiki/Autonomous_system_(mathematics [Broken])
 
Last edited by a moderator:
  • Like
Likes Simon Jug
  • #5
I must solving a Kepler's problem (for elliptical orbit, for Earth) with Runge-Kutta 4th methods in MATLAB, but I don't know what is my differential equation and how I can solving it, what I must put it in differential equation for initial value.

For examples when I change a steps I must get where will be a Earth on his orbit.

And for last value I must get the correct value for period of Earth, 365.24 days, and position of Earth return in started position.
 

1. What is the Kepler problem in the context of Runge-Kutta?

The Kepler problem is a mathematical model used to describe the motion of a particle under the influence of a central force, such as the gravitational force. In the context of Runge-Kutta, this problem involves finding the trajectory of a particle in a two-body system, where one object is much more massive than the other.

2. How is the Runge-Kutta method used to solve the Kepler problem?

The Runge-Kutta method is a numerical technique used to approximate the solutions of differential equations. In the context of the Kepler problem, this method is used to solve the equations of motion for the particle and compute its trajectory over time.

3. What are the advantages of using Runge-Kutta to solve the Kepler problem?

Compared to other numerical techniques, the Runge-Kutta method offers a higher order of accuracy and better stability, making it a reliable method for solving complex problems like the Kepler problem. It also allows for a flexible timestep, which can be adjusted to improve the accuracy of the solution.

4. Are there any limitations to using Runge-Kutta for the Kepler problem?

While the Runge-Kutta method is a powerful tool for solving the Kepler problem, it does have some limitations. For example, it can be computationally expensive and time-consuming for systems with a large number of particles. Additionally, it may not always accurately capture the long-term behavior of the system.

5. Can the Runge-Kutta method be applied to other problems in astrophysics?

Yes, the Runge-Kutta method can be applied to a wide range of problems in astrophysics, such as calculating the orbits of planets, stars, and galaxies. It can also be used to simulate the evolution of complex systems, such as star clusters and galactic collisions.

Similar threads

  • Advanced Physics Homework Help
Replies
4
Views
6K
  • Programming and Computer Science
Replies
15
Views
2K
  • Advanced Physics Homework Help
Replies
3
Views
1K
Replies
5
Views
310
  • Calculus and Beyond Homework Help
Replies
14
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • Differential Equations
Replies
6
Views
3K
Back
Top