solving a system of 2nd order differential equations with 3 variables

377 Views Asked by At

I'm creating a simulator for spacecraft that models orbital mechanics. It's simple enough to find the magnitude and direction of gravitational force, but I want to be able to time accelerate without losing accuracy like in Kerbal Space Program, so I need direct functions of time rather than calculating frame-by-frame.

So, ultimately, I need to solve this system: $$ \frac{\mathrm{d}^2x}{\mathrm{d}t^2}=-\frac{Gmx}{(x^2+y^2)^\frac{3}{2}} $$ $$ \frac{\mathrm{d}^2y}{\mathrm{d}t^2}=-\frac{Gmy}{(x^2+y^2)^\frac{3}{2}} $$ where $G$ and $m$ are constants.

From these two equations, I need to find x and y as functions of t (there will obviously be some initial values to plug in). I've taken multivariable calc and diff eq., but I don't remember having done anything quite like this. Any suggestions on how to approach this, or equations of this form in general, for that matter? I could do this easily if it was only one dimension.

And maybe there's an better way to do this that uses conics instead of calculus, but that's more of a programming question.

It has been half a year since I've had a calculus course, so it is quite possible I've forgotten something. I have been unable to find any help on the internet, however, though I know I'm not the first one to do this.