Jump to content

How to predict a planet's distance in the future?


Rayder

Recommended Posts

Hello all,

I've been doing some research on how planets move through their orbit and I've hit a snag. I'd like to calculate for example, what Duna's distance to the sun will be at a specific time and date in the future. Such as, what distance will Duna be from the sun at 'Time = 2y 120d'.

Since we have all the orbital parameters available to us, I figured we'd be able to calculate it. Alas, its turning out to be more difficult. I've probably stumbled upon the equation somewhere but not realised what I'm reading.

Link to comment
Share on other sites

My Bible: http://www.braeunig.us/space/orbmech.htm#position

The game data files/wiki should contain each planet's mean anomaly at game start.

The time elapsed divided by the orbit period gives you the number of orbits. Multiply by 2π to get that in terms of mean anomaly and add to the first part. (if the answer is over 2π, keep subtracting 2π until it's in the 0-2π range).

Now convert mean anomaly to true anomaly (via eccentric anomaly). You will need the orbits eccentricity for this (again, this should be available from the wiki or possibly even in-game). Edit: ah, actually it may be that converting mean anomaly to eccentric anomaly and then true anomaly requires iteration (e.g. Newton-Raphson method) rather than a single calculation. I did write a bit of a Java program to work out where all the planets would be given a time point from a save, but that was many months ago and I seem to keep forgetting important details. At least I can link to it:

https://github.com/ElWanderer/kOS_scripts/blob/MissionBuilder-draft/src/com/elwanderer/missionbuilder/OrbitUtils.java

If you have the true anomaly, you can plug this into an equation that gives the orbital radius at that point, if you already have the semimajor axis and eccentricity (equation 4.43 in the link above).

Edited by ElWanderer
mean anomaly to true anomaly may be the complicated way around :(
Link to comment
Share on other sites

@ElWanderer is right, the tricky step is the mean anomaly -> eccentric anomaly conversion; everything else is plug-and-chug.

But if you have the current Excel, I’ve got your back. Just follow these three easy steps:

1. Use the spreadsheet

2. …

3. Profit!

…Actually, that’s a lie. There’s more than three steps. But you’re a smart dude (I mean, you play KSP, right?) Just read the instructions first so you know how to set the time. You’ll find the anomaly values and radial positions for all the bodies on the “Body Info” tab on row 24.

Link to comment
Share on other sites

36 minutes ago, Pecan said:

Isn't Duna in a perfectly circular obit?

Nope. ;)

It's pretty darn close, though.  Orbital eccentricity is only 0.051. So although it's not perfectly circular,  for all practical gameplay purposes it might as well be.

In fact, except for Eeloo, all of the planets are close enough to circular that I've never had any gameplay reason to need to treat them otherwise. (Yes, even Moho. Its inclination is an issue, certainly, but in my experience, the eccentricity isn't.)

I'm a little curious what the OP's use case is? i.e. given that Duna's pretty darn close to circular, what's the situation that requires calculating it exactly? (Or is it just for fun / curiosity?)

Link to comment
Share on other sites

On 11/11/2018 at 3:45 AM, Snark said:

... what's the situation that requires calculating it exactly? (Or is it just for fun / curiosity?)

Indeed, it is mostly for curiosity / fun.

I've been messing about with gate orbits and they're dependent on the excess velocity, which changes depending on the apoapsis of your transfer orbit (ie. the distance the planet will be when you arrive).

Since the planet will be at a different distance at each transfer window, it was just finding a formula to plug in some numbers and get C3 out. After some investigations yes @Snark is correct: Duna doesn't change much. The difference is less than ~50dV for the whole ejection and insertion. The bigger differences come into play with Jool and Eeloo, which can be on the order of hundreds of deltaV depending on where they are in the orbit. Duna more or less was just used as an example.

Edited by Rayder
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...