As a little summer project I have tried to make a ballistic calculator for when I play football, (following an example from a book), just to learn some numerical methods while doing so. My problem is that I cant seem to find much on the Runge-Kutta 45 method (method recommended) for systems of differential equations.
My equations (simplified a bit) is
$ \cfrac{d^2x}{dt^2} = K_x(y) \cdot \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} \cdot \dot{x} + C_x(y) $
$ \cfrac{d^2y}{dt^2} = K_y(y) \cdot \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} \cdot \dot{y} + C_y(y) $
$ \cfrac{d^2z}{dt^2} = K_z(y) \cdot \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} \cdot \dot{z} + C_z(y) $
With the initial conditions being
$\dot{x}(0)=v_{x0}$,
$\dot{y}(0)=v_{y0}$,
$\dot{z}(0)=v_{z0}$.
$x(0)=x_0$,
$y(0)=y_0$,
$z(0)=z_0$.
I have rewritten the problem to
$ \cfrac{d^2x}{dt^2} = f(t, x, y, z, \dot{x}, \dot{y}, \dot{z}) $,
$ \cfrac{d^2x}{dt^2} = f(t, x, y, z, \dot{x}, \dot{y}, \dot{z}) $,
$ \cfrac{d^2x}{dt^2} = f(t, x, y, z, \dot{x}, \dot{y}, \dot{z}) $,
And from there changed the second orders to first orders by
$ \dot{x} = \xi $,
$ \dot{y} = \zeta $,
$ \dot{z} = \phi $,
$ \dot{\xi} = f1(t, x, y, z, \dot{\xi}, \dot{\zeta}, \dot{\phi}) $,
$ \dot{\zeta} = f2(t, x, y, z, \dot{\xi}, \dot{\zeta}, \dot{\phi}) $,
$ \dot{\phi} = f3(t, x, y, z, \dot{\xi}, \dot{\zeta}, \dot{\phi}) $
Which gives me the system
$\cfrac{d}{dt}[x, y, z, \xi, \zeta, \phi]^T = [\xi, \zeta, \phi, f1(t...), f2(t....), f3(t....)]^T $
I think my next step is to calculate the 6 rk45 K values for each of the 6 equations?, but im a bit lost in the whole method at this point, and literature is a bit vague on this topic (at least for what i have found so far)