changing orbital parametrs to/from position and velocity

camelopardis

Donator
Donator
Joined
Mar 18, 2009
Messages
19
Reaction score
0
Points
1
Hello,

I am making a game like 'Frontier', from David Braven, and i need to obtain position and velocity from the orbital parameters and vice-versa.

I've seen that the Orbiter manual comes with equations to obtain orbital parameters from the position and velocity, but i have a doubt with the equation of the eccentricity vector: Is the 'v' in that formula the length of the velocity vector?

Regarding the conversion in the other way, i.e. position and velocity from orbital parameters, i have found a web (http://www.braeunig.us/space/orbmech.htm) and perhaps i will be able to get the equations from there, but the solution for the true anomaly says it is valid for small eccentricities only (the error of the order of e^3). Perhaps it will suffice for me, but does anyone know a better equation for the true anomaly, or a complete equation for the position of a orbiter in function of time?

Thanks in advance
 

martins

Orbiter Founder
Orbiter Founder
Joined
Mar 31, 2008
Messages
2,448
Reaction score
462
Points
83
Website
orbit.medphys.ucl.ac.uk
True anomaly cannot be calculated from mean anomaly in closed form, but there are many approximations (of which the Braeunig site gives a simple one). The easiest way is usually an iterative solution. If you start from Kepler's equation (Eq. 4.35 on that page), then you can obtain iterative solutions for E (eccentric anomaly) for example with

E_{i+1} = M + e sin E_i

or (probably with faster convergence)

E_{i+1} = E_i + \frac{M + e sin E_i - E_i}{1 - e cos E_i}

(Newton's method). A good starting point can also reduce the number of iterations required. For example for small eccentricities, E_0 = M is a good choice.

Just google for Kepler's equation, and you should find enough references.

Edit: If you do want a closed form approximation, this page gives a few series expansions: http://mathworld.wolfram.com/KeplersEquation.html
 

camelopardis

Donator
Donator
Joined
Mar 18, 2009
Messages
19
Reaction score
0
Points
1
Thanks for the quick response.

- dumb question deleted -

Also, about the eccentricity vector equation in the Orbiter manual, is that 'v^2' the length of the velocity vector (squared)?
 
Last edited:

simonpro

Beta Tester
Beta Tester
Joined
Feb 10, 2008
Messages
1,042
Reaction score
7
Points
0
So you have a,e,i,OHM,ohm and M and you want v,r?

If so then I suggest reading chapter 2 of Spacecraft Dynamics and Control by Sidi, specifically page 26. They go into detail on how to do this there, and the method used works perfectly.

(edit) And they do the reverse method on the next page.
 

camelopardis

Donator
Donator
Joined
Mar 18, 2009
Messages
19
Reaction score
0
Points
1
Thanks Martin

---------- Post added at 05:52 PM ---------- Previous post was at 12:16 PM ----------

I've got the orbits working! I thought i would need hundreds of iterations, but 10 or so gives already a good result.

Now for the part of converting position and velocity to orbit parameters...
 
Top