Jump to content

Barycenters and non-spherical Volumes of Influence (an idea for binary planets/stars)


Recommended Posts

As we all know, a system such as the Earth-Moon system is actually a 2-body system, where any orbiting spacecraft has to account for the gravity of the Moon as well as the gravity of the Earth. Currently, the way KSP avoids this problem is by using Spheres of Influence. This is a perfectly reasonable simplification, and I'm quite happy with how it works. However, it has one important limitation: it only makes sense in systems where the barycenter (center of mass) is inside the larger object, and the smaller object essentially "orbits" the larger one.

In systems such as the Pluto-Charon system, where both objects are of similar mass, the barycenter can actually be in the space between both objects, meaning that they are both essentially orbiting the same point in empty space. What I think should be implemented in this case is a invisible, collision-less, and otherwise impossible to interact with Barycenter object. For two object with equal mass, the relative SOI's would look something like this:

(Please excuse my amazing paint skillz)

barycenterdiagram.jpg

So any ship approaching the Red-Blue system would first enter into orbit around the system's barycenter (whose gravitational mass would be the sum of the two planets' masses), and then possibly encounter the SOI of one of the two planets. I know that this isn't actually what happens in a real two-body system, but I think it's a good enough approximation.

Two important things to note are that 1) the barycenter would ALWAYS have to be inside the SOI of one of the planets/moons, otherwise nonsensical (from a physics standpoint) things would happens, and 2) the interface between the SOI's of the two objects would be located at their L1 Lagrange point (however, since this system isn't a full 3-body simulation, Lagrange points would still be impossible, sorry).

For a system where (for example) one object has half the mass of the other, the SOIs would look something like this:

unevenbarycenter.jpg

I know that this isn't actually what happens in a real two-body system, but I think it's a good enough approximation, and would allow the devs to add interesting features like double planets such as Pluto-Charon, and more importantly would further my personal crusade to get binary/multiple star systems added in the game (which I posted about here: http://forum.kerbalspaceprogram.com/showthread.php/39185-A-hopefully-more-reasonable-suggestion-for-future-expansion-of-the-universe?p=505403&viewfull=1#post505403) xD

Either way, I think it's a cool idea, but tell me what you think. ALSO: all of this reasoning is with nothing more than a single semester of AP mechanics, so if I have an error in my pseudo-physics reasoning, please let me know.

EDIT:

Changed the name to reflect the new ideas in the thread and not mention N-body

The following is a summary of the last 12 pages of discussion.

The barycenter model in it's original incarnation had an irredeemable flaw, that in the equal mass case it is possible to approach the barycenter to an arbitrarily small distance, potentially producing ridiculous gravity assists and other bugs similar to when Kerbol didn't have a surface. There are two possible way to fix this:

First, some terminology: m is mass, r is distance. Anything with a 1 in it has to do with Body 1, and vice versa. In cases where the masses aren't equal, Body 1 is the larger body. The mass ratio is m1/m2. A Volume of Influence (VOI) is basically a Sphere of Influence generalized to have an arbitrary shape.

1) Use the original system, but only in situations where the mass ratio is 4 or greater. This has the benefit of being easier to implement, but has the obvious drawback that it doesn't work for every situation.

2) The HemiSOI/Horn model:

In this case, the barycenter would be divided into an inner and outer region. The inner barycenter region would be divided into a Body 1 VOI and a Body 2 VOI. In the equal mass case, it would look something like this:

semicircle_barycenterdiagram.jpg

Note: the radius of the inner barycenter region is pretty arbitrary, but I've chosen it to be the distance between L2 and the barycenter.

Thanks to Horn Brain, we generalized this system to cases of unequal mass. The boundary line between the two VOI's in this system is defined by r1/r2 = (m1/m2)^(2/5)

The VOI's would look something like this: (picture credit goes to Horn Brain)

Javascript is disabled. View full album

We've done an error analysis on the Horn system, and it gives reasonable error in both magnitude and direction. If you want to see more about the error, look in the thread. The obvious drawback to this system is that it would require the devs to at least partially change the SOI logic. Anyways, if you have any questions/comments, don't be afraid to post in the thread.

Edited by chaos_forge
Link to comment
Share on other sites

...1) the barycenter would ALWAYS have to be inside the SOI of one of the planets/moons, otherwise nonsensical (from a physics standpoint) things would happens...

Could you elaborate? It occurs to me that the barycenter should be inside it's own SOI so that any trajectory passing right through the barycenter should behave as if it's traveling through the center of mass of both objects, no? Also why are the SOIs of the two objects always touching? For a system like the twelve colonies they should be seperate shouldn't they?

Link to comment
Share on other sites

Could you elaborate? It occurs to me that the barycenter should be inside it's own SOI so that any trajectory passing right through the barycenter should behave as if it's traveling through the center of mass of both objects, no?

I don't think so, it has to do with the fact that when you're far away from the two objects, they're both pulling you in roughly the same direction, whereas when you're close to them, they're pulling in opposite directions. It's a similar thing to what happens when you have a huge hollow sphere: anything on the outside of the sphere would experience a force pulling it towards the center of the sphere, but once you're inside the sphere, you actually have a net force of zero acting on you.

That phenomenon is easiest to see in the case where the two objects are of equal size, since in that case the barycenter coincides with the L1 point. Imagine a line passing through the barycenter and the center of both planets. In real life, the L1 point is an unstable equilibrium: if you are at rest on the right side of the barycenter, you should fall to the right (towards the red planet). However, if the barycenter was in its own SOI, it would be possible to find a point to the right of the barycenter where you would fall back towards the barycenter (to the left), in the opposite direction of what *should* happen.

That's what I meant when nonsensical things would happen.

EDIT: TL;DR: You can only orbit the barycenter when you're farther away from it than the two planets

Also why are the SOIs of the two objects always touching? For a system like the twelve colonies they should be seperate shouldn't they?

My reasoning for the SOI's to always be touching is based on the aforementioned behavior of the L1 point, and also on the reasoning that since they HAVE to be touching in the case of equal mass, it makes sense for them to be touching in other cases. My reasoning for this is more of an intuitive decision and harder to explain, but if you give me some time I might be able to form a coherent argument.

EDIT: Having the SOI's touch each other also guarantees that the barycenter will never be in its own SOI

Edited by chaos_forge
Link to comment
Share on other sites

I understand now, but in the special case of two stars of exactly equal mass, there still should be an infinitesimally small passage between SOIs so that in the unlikely event that a ship travels through the barycenter then the ship is pulled equally in both directions. This in effect means that in the special case of equal stars the barycenter should be inside its own SOI. In every other case the SOIs can touch just to make things simple.

Link to comment
Share on other sites

I really like this idea, I'm sure there's things that could be tweaked with it, but the general idea makes sense and would probably work for KSP.

Devs, please? Pretty please? At least consider it? xD

EDIT: Apparently this is my 100th post! Hurrah! :D

Link to comment
Share on other sites

Uhh... I honestly have no clue about what to think of this, it looks good on paper, but some physicist in the back of my head is screaming "No, this model can be exploited for horribly unrealistic effects!"

Of course, I would just like to say that if a person who knew what they were doing had a nice enough environment to work in with enough scratch paper, table space, and other mathematical resources, that person could eventually figure out how to calculate a rail system for N-body physics.

Link to comment
Share on other sites

I'm sure that there'd be exploitations of the system in order to achieve unrealistic effects, but that's one of the curses of having a system without n-body physics. :rolleyes:

The only way to really know what those exploitations and any physics issues might be is to actually test it in-game. Paper is good for planning, but the actual experiment will often take unexpected turns. :) I'd be really interested to see how this actually functions if anyone does it.

Edited by OrbitusII
fixed tense
Link to comment
Share on other sites

WOW. That's one of few very good ideas on the development forum. Would it work for 3 or more bodies? It seems not, because the SOIs would screw each other up.

Well that's ok. The usual way a trinary system behaves is where a pair and a single orbit a common barycenter with the pair having a barycenter of its own. There's also a hypothetical figure-of-eight arrangement but no one has ever observed it yet. It seems it's extremely unlikely that it can form.

Link to comment
Share on other sites

The exploitation that I can see off the top of my head is doing gravity assists extremely close to the Barycenter in the case of two equal masses (sorry if I explained that badly)

I'm actually a prospective physics major, so once I have the time (hopefully later today) I'll do some math to see how closely this model matches reality

Link to comment
Share on other sites

WOW. That's one of few very good ideas on the development forum. Would it work for 3 or more bodies? It seems not, because the SOIs would screw each other up.

In theory, you'd just have minmus orbiting "Kerbin + Mun" Barycenter.

Of course, I think this also claims that Kerbin rotates around the Mun while the Mun rotates around kerbin. (The Barycenter will be very close to kerbin, but to keep it "stable" that means kerbin needs to move around said center.)

(It appears to be mass center, so (1 / ((9.7600236 / 529.15793) + 1)) = 0.9818895927760384785963456534583

(1 - ANS) * 12000000 = 217.325km

So Kerbin's orbit would be changed by 217.325km (err, wow)

RMS isn't much better

529.15793 + 9.7600236

538.9179536

SQRT((529.15793) ^ 2 + (9.7600236) ^ 2) / 538.9179536

0.98205659676604809847742049577729

Perhaps something akin to

(1-(1/(1 + (1/54)^1.25)))*1200000

8142.022681168805296252160480469

(1-(1/(1 + (1/54)^1.25)))

0.0067850189009740044135434670670575

(1-(1/(1 + (1/2)^1.25)))

0.29599685885717724602342750529076

Now the barycenter is much closer to kerbin (as it needs to be).

*I know that the moon pulls on the earth and should possibly cause a small "orbit around a barycenter" but that seems excessive. (And this is KSP so the values are much larger)

*Addendum, it would include the radius of the planet; kerbin is 600km. (Still... it seems excessive)

*What we should be seeing for most of KSP's bodies is nearly zero deviation from their already existing orbits. (Using the Barycenter in Barycenter Model). Only a significant mass should shift it away allowing that "circulating" orbit. (You can see it with aki)

http://www.atlasoftheuniverse.com/orbit3.gif

Looking further at the systems, most (figure of 8 excluded) can be done using barycenters if you can have strongly elliptical orbits for planets about said barycenter (currently they're circular orbits; in the model I'm using)

Edited by Fel
Link to comment
Share on other sites

IOf course, I think this also claims that Kerbin rotates around the Mun while the Mun rotates around kerbin. (The Barycenter will be very close to kerbin, but to keep it "stable" that means kerbin needs to move around said center.)

If the barycenter of the system is actually inside the larger body, I think the current barycenter-less system is enough. This system is only for similar (same order of magnitude) masses.

Note: this happens with (as far as I know) every planet+moon system in KSP, including Duna+Ike. This would have to be added to new systems, or maybe if Duna and Ike were moved farther apart.

EDIT: Oh and Fel, I'm not sure what you're doing to calculate the location of the barycenter, but the easiest way to do it is with the formula

r = d / (1 + m1/m2), where

r = distance from center of body 1 to barycenter

d = distance from center of body 1 to center of body 2

m1 = mass of body 1

m2 = mass of body 2

Edited by chaos_forge
Link to comment
Share on other sites

If the barycenter of the system is actually inside the larger body, I think the current barycenter-less system is enough. This system is only for similar (same order of magnitude) masses.

Note: this happens with (as far as I know) every planet+moon system in KSP, including Duna+Ike. This would have to be added to new systems, or maybe if Duna and Ike were moved farther apart.

It'd be more productive to adapt the system to be in "constant use"; (Else you'll have "weird physics" happening when the engine tries to juggle the two systems.

Also, should our "barycenter" be more akin to gravity centers rather than mass centers?

i.e.

M1 / (R - R2) ^ 2 = M2 / (R - R1) ^ 2

(R - R1) ^ 2 / (R - R2) ^ 2 = (M2 / M1)

(R - R1) / (R - R2) = SQRT(M2 / M1)

R2 / (R - R2) = SQRT(M2 / M1)

R2 = R / (SQRT(M1 / M2) + 1)

(Actually, I think I've confused myself.)

EDIT: Oh and Fel, I'm not sure what you're doing to calculate the location of the barycenter, but the easiest way to do it is with the formula

r = d / (1 + m1/m2), where

r = distance from center of body 1 to barycenter

d = distance from center of body 1 to center of body 2

m1 = mass of body 1

m2 = mass of body 2

I was trying to calculate how far off kerbin would be, the model would say that bodies rotate around the barycenter rather than the central body. (Given that the barycenter is in constant flux; and to model what was seen in "http://www.atlasoftheuniverse.com/orbits.html" it'd mean rotating about the center)

Edited by Fel
Link to comment
Share on other sites

Ok I've thought about this a little and I may have come across a serious limitation of this way of doing things.

Consider this image. It's to scale with the exception of the barycenter SOI and the size of the ship.

NFFnvSu.png

You can see the stars are very close to eachoter, which means that the SOIs have to be very small. That means that a ship in such a low orbit around the barycenter would orbit it in perfect circles, but in reality the orbit would become perturbed rather quickly. Now I'm not an astrophysicist so I have no clue as to how quickly the ship would be ejected from the system or collide with one of the stars, It could be as soon as a few orbits or a few million years, but I'm pretty sure that such a low orbit wold be unstable in reality.

Actually I'm not even sure whether any scientists have even created any simulations for this kind of thing. As far as I can see planetary stability for multiple star systems is still a contentious topic.

Link to comment
Share on other sites

It'd be more productive to adapt the system to be in "constant use"; (Else you'll have "weird physics" happening when the engine tries to juggle the two systems.

The beauty of the system is that it uses the same physics as the current planet physics system in KSP. The Barycenter object would be like a normal planet, except without a surface, and the two planets would orbit 'on rails' around the barycenter (IE they would be the barycenter's children/moons) and the barycenter would orbit around the star. The only code that would have to be modified would be possibly if the barycenter can't exist in another planet's SOI while still being its parent (I have no idea how the planet system works in KSP), but that functionality could be added to the general "planet" object with no bad consequences. Thus, there would be no juggling of the two systems. The barycenter would exist within the current system, simply as an extension of it.

Also, should our "barycenter" be more akin to gravity centers rather than mass centers?

Well in Newtonian physics at least, gravitational mass and inertial mass are the same so both 'gravity center' and 'mass center' would mean the same thing.

EDIT:

You can see the stars are very close to eachoter, which means that the SOIs have to be very small. That means that a ship in such a low orbit around the barycenter would orbit it in perfect circles, but in reality the orbit would become perturbed rather quickly.

Yes, this is a valid concern, but I'll take orbits being more stable than they should be as a small price to pay for an approximation of n-body physics. After all, with the current single-body physics, orbits are also more stable than they should be.

Edited by chaos_forge
Link to comment
Share on other sites

Also, should our "barycenter" be more akin to gravity centers rather than mass centers?

Well in Newtonian physics at least, gravitational mass and inertial mass are the same so both 'gravity center' and 'mass center' would mean the same thing.

If you want to ignore all of vector analysis, sure.

Your model has a massive flaw in that The closer an object is to the "main body" the closer the "mass center" is to the main body; but the farther away objects actually MOVE the "mass center" further out. (A close body should have a greater impact than a body that is several Gm away)

You can do whatever calculations you need to properly calculate where the effective center should be; on a supercomputer if you like, once you know where they are you program it into the game (there is no reason to calculate it continuously).

I'd also add that there is no reason to have a "Sphere of Influence" rather than a "bulb of influence"; having two additional "spheres of influence" on the sides to help transfer from 1 "sphere/bulb" to the other.

Edited by Fel
Link to comment
Share on other sites

Ok so after doing some math I've figured out some things. First, I'll present a diagram which I'll refer to throughout the post:

barycenterdiagram_extended.jpg

The acceleration due to gravity is G*m/r^2, but we'll choose a system of units such that G=1 to simplify things. We'll also arbitrarily decide that the mass of each planet is 1 and the distance between the two planets is 2. Based on the relative SOI sizes of Duna and Ike, I've estimated that the SOI of our barycenter would have a radius of 20. r is the distance from our spacecraft to the barycenter.

In this diagram, the barycenter's SOI is divided into two regions: an inner region and an outer region. We'll begin by examining the Outer region because it's easier.

In real n-body physics, a spacecraft on the y-axis would experience an acceleration of 2*r / sqrt(r^2 + 1)^3

and a spacecraft on the x-axis would experience an acceleration of 2*(r^2 + 1) / (r^4 -2r^2 +1)

Both of these functions approach 2/r^2 asymptotically, so the farther you get from the barycenter, the better the approximation works. The maximum error you can get, at the interface between the inner and outer regions (r=2) is 48%, while doubling the distance from the spacecraft to the barycenter leads to the error being reduced by a factor of more than 3.5, to 17% error. Taking r=8 gives us an error of 3%. While the error is not negligible, I think that it's good enough for our purposes, and most importantly, the behavior of a craft in the outside region is not qualitatively different from a craft in real life (apart from super-stable orbits, but we already have several simplifications in KSP that give us more stable orbits, so I don't think another one would be that big of a deal).

As for the inside region, this presents a more serious problem, because there are qualitative differences in the behavior of a craft in this region: for example, a craft in the inside region should be pulled away from the y-axis in real life, but in our barycenter model, it would be pulled towards the y-axis and also the acceleration as you approach the barycenter should go to zero, but in our simplified model, it instead goes to infinity. As both Fel and Cpt. Kipard have suggested, a possible solution to this would be to have spheres of influence that look more or less like this:

semicircle_barycenterdiagram.jpg

However, I don't like this solution because it would require the devs to change the current behavior of SOI's in-game (as far as I know, semicircular SOI's are not allowed in KSP so far). Another possible solution would be to possibly have a system of several concentric SOI's, but I haven't had time to look into that possibility today. I'll make another post tomorrow if I can figure out a system of concentric SOI's that produces reasonably low error.

Note: all of these anomalous behaviors are most prominent when the mass of the two planets is equal, and the errors produced by the simplified model are reduced as the difference between the masses increases

Edited by chaos_forge
Link to comment
Share on other sites

This is what you're trying to get:

FsxaFcV.png

This is what you're actually getting:

irIFdSj.png

The big problem is that your piecewise function breaks off the axis. Along most of the line connecting the centers of the two gravitating bodies, your piecewise function is okay â€â€*except for a single point where it goes to minus infinity. But just off that line connecting the centers, your piecewise function gives completely bonkers results, compared to real life.

I honestly think this would be worse than the status quo. Even if the developers wrote a lot of conditionals to get around the singularity at the center, there are still those discontinuities where the laws of physics would go cuckoo for Cocoa Puffs, resulting in really weird, unphysical orbits that would leave you staring slack-jawed at the map view.

Link to comment
Share on other sites

I must admit, when I saw the title I was getting my flamethrower ready for another battle with the "L1 can be approximated with an invisible planet" crowd, but I am glad to have been pleasantly surprised by this suggestion. It certainly *seems* more reasonable than the former... But I currently don't know enough about n-body physics to say whether or not it'd be semi-realistic or preferable. Certainly, CaptainArbitrary's observation punches a big hole in the idea, but would people really notice? Is there perhaps a way to circumvent that behavior? I don't know, but it'd be neat if somebody could expound on this idea and pitch it to the devs.

Note that I am not condoning this as a way of implementing legrange points (which it wouldn't really do). It seems like a better way of having binary systems of large planets, planet-moon systems, or even stars later on down the road. That's something I'd certainly like to see even if it has to work well with the current patched conics model.

Link to comment
Share on other sites

Forgive me if this has already been mentioned.

Adding new zones can be done ad infinium. Consider what happens when you have so many zones that you're making an SOI transition exactly once per frame; you're close to doing a full N-body simulation, assuming your zones are set up correctly. You can get a lot of granularity by adding a zone, say, at 0.05g gravity potential intervals. The issue is you start stressing the patched conics system since you're constantly doing SOI changes. You'll have to crank up the conic prediction limit, you'll get more precision issues, et cetera. The range of orbits considered "stable" is decreased because elliptical orbits (and even some circular ones) will transition a bunch of SOIs. The current system makes it easy to tell when an orbit will be stable, but with additional zones you'll likely lose a lot of satellites when making a long warp to align with a planet. Basically, yes, you can do this, but even perfectly executed it has gameplay problems. I argue this kind of gameplay is very realistic, because orbital perturbations are a real problem, but without something like Kerbal Alarm Clock integrated into the game, it won't work well as a stock feature.

Link to comment
Share on other sites

This would be perfectly acceptable for a game with the current realism of KSP. Without doing proper N-body (which would make the current physics engine cry because of multi-part ships rather than a single parented entity) this would be the best approach for an improvement.

I would however point out that your pictures showing the spacecraft orbiting the barycenter nicely runs into a critical flaw. I point you to Roche Lobes

Roche Lobes are a means of expressing the gravitational lines of equipotential. In a two body system with the barycenter outside of one of the bodies, that would be the result. What you propose is to basically have the Roche Lobes be the spheres of influence, which as I said WOULD be a nice alternative to trying to do full N-body, but those spheres would get real complex real fast. The alternative to simplify that would be to have a simple circle SOI around both bodies which is basically what we have now.

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...