Jump to content

Computing orbital parameters using only what KSP stock provides


ZeroG

Recommended Posts

So, I've been working on an interesting math problem and was wondering if anyone else had tried this. I wanted to figure out using only what stock KSP actually provides in-game to determine orbital parameters of the planets. KSP provides things like masses and radii, and you can mouse-over a planet in map view to get its current altitude and velocity, but no angles or eccentricities are provided anywhere.

Bottom line, I'd like to get a value for semi-major axis and eccentricity for every planet on my own. Yes, I know there are reference values on the wiki, and it's possible to figure it out by inspecting the game's files, but I wanted to know how you could calculate such a thing. I got as far as being able to calculate a semi-major axis based on one reading of a planet's altitude and velocity; I rearranged the orbital speed equation to provide the semi-major axis when given velocity and radius, but I still don't know how to get eccentricity.

I thought about taking two readings and using a solution to Lambert's problem, but I don't really have a good fix on the positions; all I get is the distance from Kerbol, but no angle that I can fix a position on. Another route I tried to go down was to use the semi-major axis to calculate the orbital period, then grab the radius/velocity once, then again exactly half-way through the orbit as timed by the clock; Kepler's second law says I'll get two equivalent areas that way, and their total makes up the total area within the orbit, but I couldn't figure a way to relate that back to the eccentricity.

I learned a lot trying this exercise, but I seem to be stuck. Any orbital mechanics experts out there who know how to do something like this or can tell me it's a lost cause?

Link to comment
Share on other sites

Get your periapsis and apoapsis height, add the planet radius and solve the equation system, you'll get major semiaxis and eccentricity

rperi  =a (1-e)

rapo  =a (1+e)

You can't find out the longitude of periapsis or longitude of ascending node without getting it from some in-game display because any longitude is relative. You can find out the argument of perihelion (i.e. angular distance between the perihelion and ascending node.)
To find out the inclination you would define the highest latitude your vessel reaches. Unlikely this could be done visually because 3d engines deforms the picture very much.

Edited by kerbiloid
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...