Jump to content

# n-body gravity motion problem was solved a while ago apparently

## Recommended Posts

Hello dear KSP community,

The following paper (apparently from the Harvard NASA lab) describes a solution to the n-body gravity problem:

http://articles.adsabs.harvard.edu/cgi-bin/nph-iarticle_query?bibcode=1991CeMDA..50...73W&db_key=AST&page_ind=0&data_type=GIF&type=SCREEN_VIEW&classic=YES

So why wouldn't we apply this to the rails, in order to make interesting realistic slingshots possible? Like Mariner 10 or Voyager... Not like these aren't possible yet, but dynamic rails would be cool

Disclaimer: I didn't understand much about the paper, but from a purely computer-oriented perspective doing sums of sums in a linked list of gravitational bodies seems piece of cake compared to all HarvesteR&Co have already done, this is why I proposed it

##### Share on other sites

Because it's a series expansion, meaning you have to sum up an infinite number of terms to get a precise solution. By summing a finite number of terms you introduce an error, and you have to have some convergence criteria to control the error. Essentially, it becomes a numerical approach same as explicit integration of the problem numerically. This is very different from the rails approach of KSP which uses a closed form analytic expression and therefore always works within machine error.

##### Share on other sites

I'm not that great at mathematics. Can someone explain whether or not calculus allows you to accurately calculate infinite series? If so, aren't there integration and differentiation functions in programming languages?

##### Share on other sites

Some series you can calculate exactly, but there is no method for an arbitrary series. Only for approximations. And no, most programming languages do not have integration or differentiation routines. Only some specialized mathematical languages do, and even then there are some significant limitations. Numerical integration is actually a broad topic with many nuances.

##### Share on other sites

A real problem in KSP is that using N-body mathematics on the planets and bodies as they are now means that the entire Kerbol system is very unstable.

I recall a lot of guys making the system in Universe Sandbox, which does have accurate physics, and watching it all fall apart. Especially the Joolian system is impossible.

In other words, it takes a lot more than a rewrite of the physics engine to allow KSP to be similar to how KSP is now, while gaining the ability to have lagrane points and do gravity captures and so forth.

##### Share on other sites

I recall a lot of guys making the system in Universe Sandbox, which does have accurate physics, and watching it all fall apart. Especially the Joolian system is impossible.

That's fascinating! Can you share more details about this? Why is the Joolian system impossible?

##### Share on other sites

That's fascinating! Can you share more details about this? Why is the Joolian system impossible?

I guess the moons are to close together regarding their gravity. With n-body physic the moons would start interacting with each other, distorting orbits who would cause more close encounters resulting throwing things out.

Val is an obious target not sure how Laythe and Tylo would interact.

##### Share on other sites

I recall a lot of guys making the system in Universe Sandbox, which does have accurate physics, and watching it all fall apart.

Universe Sandbox is sloppy with its integration. I wouldn't trust it as a test of system's stability.

##### Share on other sites

A real problem in KSP is that using N-body mathematics on the planets and bodies as they are now means that the entire Kerbol system is very unstable.

I understood what makes it algorithmically difficult - integrating is hard (but there's RK4 etc...). However for this latter issue, keeping the planets on rails would be a solution

##### Share on other sites

You can still do interesting slingshots like those of Mariner 10 or Voyager. N-body physics wouldn't add anything to that.

N-body physics really only allows you to use Lagrange points. And even then you would need constant station-keeping since the L1/2/3 points are unstable. Also most of your orbits would change over time, so for example a low Munar orbit would probably impact the Moon if you time warped at 100,000x for a few seconds.

##### Share on other sites

And even then you would need constant station-keeping since the L1/2/3 points are unstable.

There are stable orbits around these points.

Also most of your orbits would change over time, so for example a low Munar orbit would probably impact the Moon if you time warped at 100,000x for a few seconds.

Doesn't work like that. Low orbits can drift a little, but they would still be safe.

##### Share on other sites

There are stable orbits around these points.

I could be wrong, but I thought this was only true for 3-body systems. In the n-body system represented by the solar system, there are no inherently stable orbits around the 3 in-line libration points.

Doesn't work like that. Low orbits can drift a little, but they would still be safe.

The real moon has very few stable low altitude orbits, not because of the influence of other gravitational bodies, but because its own gravitational field is pretty non-uniform due to large concentrations of mass underneath the surface.

##### Share on other sites

Not sure why everyone's got it in their heads that n-body implementation would mean taking the planets off-rails. Planets would stay as is but the ship would be affected by multiple things. The problem lies in making it reliable and consistent, you need to be able to go at 100,000x warp on an interplanetary trajectory without everything in LKO hurtling off into deep space. Try warping up extremely fast in Orbiter while in LEO and you'll see what I mean. The current rails system is a good tradeoff - you can still simulate gravitational slingshots and whatnot and have very predictable orbits, just at the cost of a little bit of accuracy in terms of where your ship would go, as it's not being perturbed by anything.

##### Share on other sites

The reason why there's no n-body physics in KSP is not that the KSP devs don't/didn't know the mathematical solution to it. The reason is that any solution to it is to computationally intensive to do it accurate enough at high timewarp for multiple craft to be useful in KSP. Even if applied only to ships and not to planets and moons.

Also n-body physics can not really be "applied to rails" because those two methods are pretty much mutually exclusive.

##### Share on other sites

Also n-body physics can not really be "applied to rails" because those two methods are pretty much mutually exclusive.

I meant applying it to the trajectory marker but thanks for pointing it out - however for clarity let's keep in mind planets wouldn't have to (shouldn't) use the n-body physics but would stay on rails, decreasing needed computation, not mentioning how current timewarp is incredibly less resource-intensive than physics-enabled modes which leaves a lot of margin for new systems to be implemented.

- Actually now that I think about it, wouldn't this (doing prediction) be the tricky part with n-body systems? (although not impossible at all since planets would remain on rails)

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

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