Jump to content

How are SoI sizes calculated by KSP?


Recommended Posts

I have noticed for a while now that the Sphere of Influence around certain bodys felt wrong. In the case of going away from a heavy planet or moon, it is nearly impossible to "just" escape the body, as the escape speed of the body is so high, that once you are in the SoI of the parent, your orbit is highly modified. For instance, escaping Tylo from low orbit, in retrograde position puts you on or under Vall's orbit immediately, the in-between orbit cannot be achieved. Or another example, it takes only 100m/s from barely escaping Kerbin, all the way to a Duna transfer orbit. Or escaping Slate (Outer Planets Mod) prograde, immediately throws you out of the parent's SoI too, which can't be right.

In short, it felt like the vessels "clings" to the body it is orbiting for way too long.

Now I assumed that the SoI determines the equilibrium point where the gravitational pull of ie. Mun exceeds that of Kerbin, and therefore you go into another SoI. That means that the gravity pull at the SoI boundary from both bodys should be equal right? Well, no, Kerbin's gravity is more then double that of the Mun, at the Kerbin altitude of the Mun (12000km). Leaving Mun for Kerbin, you now see the effect stated in the beginning; I stay in Mun's SoI for too long, thereby giving the trajectory a sort of "dead zone" where you cannot have your resulting Pe end up.

Anyway I verified a few other "common" ways of calculating an SoI from the M1 and M2 masses of both objects:

The "SoI calculation" in the Kerbal Wiki came to 6120 2430 km (edit: this is indeed the value KSP uses in-game)

The orbital L1 calculation (Hill Sphere) came to 2115km

So I hope that someone can enlighten me what formula is used to determine SoI boundaries, so I can stop worrying about bugs in KSP in this matter.

Or worrying about discontinuities in the Gravioli sensor when changing SOI's. (i can understand 20% discontinuity from the patched conics approximation, but not 400% as in some cases...)

This also with the objective of having some guidelines for modders to take into account when placing heavy planets or moons close to others (looking at you, Slate ;) )

Edited by Martijn404
Link to comment
Share on other sites

Im not sure whether the formula from the KSP wiki page about SoIs is correct, or used in game. edit: it is correct

As I mentioned, I plugged in the numbers from this formula and came to a completely different result then the KSP SOI (6210km).

I looked up where this formula came from, it's in Orbital Mechanics, equation (12.17), and that formula is for a definition "The points measured with respect to the gravitational centers where the ratio of perturbative to primary gravitational accelerations of the centers are equal. So this deals not with primary gravitational accelerations but with perturbations thereof.

The section above that, "Sphere of Gravitation", seems to be much more applicable to what KSP terms a Sphere of Influence.

Edited by Martijn404
most of it is wrong
Link to comment
Share on other sites

For instance, escaping Tylo from low orbit, in retrograde position puts you on or under Vall's orbit immediately, the in-between orbit cannot be achieved.

It can, just not as you would expect. And what the heck is Slate?

Link to comment
Share on other sites

Im not sure whether the formula from the KSP wiki page about SoIs is correct, or used in game.

As I mentioned, I plugged in the numbers from this formula and came to a completely different result then the KSP SOI (6210km).

I looked up where this formula came from, it's in Orbital Mechanics, equation (12.17), and that formula is for a definition "The points measured with respect to the gravitational centers where the ratio of perturbative to primary gravitational accelerations of the centers are equal. So this deals not with primary gravitational accelerations but with perturbations thereof.

Let's work a pair of bodies to check the formula:

Sun and Kerbin

r=a(m/M)^(2/5)

= 13,599,840,256 * (5.2915793x10^22/1.7565670x10^28)^(2/5)

= 84,159,286m

This matches the in-game value, so I'm inclined to say that the formula is correct.

Edit: Let's work the Mun and Kerbin, too, since that's the one you used:

r=a(m/M)^(2/5)

= 12,000,000 * (9.7600236x10^20/5.2915793x10^22)^(2/5)

= 2,429,559m

Which also matches the in-game value. I suspect you're applying the formula incorrectly.

Edited by Red Iron Crown
Link to comment
Share on other sites

Thanks Red Iron Crown, I dont know why but now I see i had M1 and M2 wrong-way-round in my calcs :blush: apparantly triple-checking my formulas isnt enough... im embaressed now

I will correct my original results.

With regards to the mentioned effects though, I guess it is just the patched conics approximation that causes these sort of effects.

Link to comment
Share on other sites

With regards to the mentioned effects though, I guess it is just the patched conics approximation that causes these sort of effects.

Certainly. The patched conic approximation assumes that gravity from all outside influences are equal everywhere inside an SoI and can be ignored, but this is obviously not so in real life and results in a discontinuity in gravitational force when crossing an SoI boundary, sometimes a significant one.

(Don't be embarrassed, everyone messes up the math from time to time and it's hard to see one's own errors.)

Link to comment
Share on other sites

Certainly. The patched conic approximation assumes that gravity from all outside influences are equal everywhere inside an SoI and can be ignored, but this is obviously not so in real life and results in a discontinuity in gravitational force when crossing an SoI boundary, sometimes a significant one.

(Don't be embarrassed, everyone messes up the math from time to time and it's hard to see one's own errors.)

thanks again, I was staring myself blind on whether I did apply the (^2/5) to the correct part, missing the big obvious "youre dividing by the wrong STARMASS"

So now at least i know where these mysterious lines come from in the middle of the blue part of the porkchop plot in the Launch Window Planner... patched conics artifacts.

tR2w8sz.png

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