# Runge-Kutta method - Orbital mechanics

Tags:
1. Oct 19, 2015

### Triathlete

1. The problem statement, all variables and given/known data
Given: Initial orbital elements of a satellite

a=6652.555663km;

e=0.075;

i=28.5 degrees;

Ω=40 degrees;

w=30 degrees;

n=0 degrees;

1. Convert orbital elements to position and velocity vectors

2. Use these vectors to initialize the Runge-Kutta method

3. Set up the Runge Kutta method to integrate equations in vector-matrix form

4. Numerically integrate the equations of motion for 5400 seconds, in increments of 10 seconds.

5. Plot position and velocity of the satellite over the 5400 seconds.

2. Relevant equations

r = √(x2+y2+z2)
¨r = −(µ/r3)r

3. The attempt at a solution

I have calculated the starting position and velocity vectors in MATLAB which results in:

v =

-7.2785
2.1832
3.4483

r =

1.0e+03 *
2.3443
5.4969
1.4681

but I am not sure what I am supposed to use as my vector-matrix equations for the Runge-Kutta integration. I know the two body equation of motion(shown above) will be used in it's component forms, but I'm supposed to use state space or something? I have yet to take system dynamics and controls so this concept is completely foreign to me. Any help would be very much appreciated.

2. Oct 19, 2015

### Krylov

Yes, for each component of $\mathbf{r} = (x,y,z)$ you have a second order ODE. You need to convert each of these second order ODEs into a two-dimensional system of first order ODEs. So if you start with
\begin{align*} \ddot{x} &= f(x,y,z)\\ \ddot{y} &= g(x,y,z)\\ \ddot{z} &= h(x,y,z) \end{align*}
then one way to proceed is to write
$$\dot{x} = v_x, \qquad \dot{v}_x = f(x,y,z)$$
and similarly for the other components. This way, you end up with a system of the form
$$(\dot{x},\dot{v}_x,\dot{y},\dot{v}_y,\dot{z},\dot{v_z}) = F(x,y,z)$$
with $F : \mathbb{R}^6 \to \mathbb{R}^6$ defined by
$$F(x,v_x,y,v_y,z,v_z) := (v_x,f(x,y,z),v_y,g(x,y,z),v_z,h(x,y,z))$$
This is the form in which "ode45" expects the system. The state space in this case may be taken as $\mathbb{R}^6$. Please consult the tutorial on "ode45" in case you are not familiar with the syntax. There is also the function "odeToVectorField" but I have never used it.