Jump to content

parabolic trajectories in KSP


flart
 Share

Recommended Posts

Why KSP engine doesn't support parabolic trajectories? (You can try to put e = 1 into HyperEdit and see disappearing ship)

What meaning of negative Apoapsis? I understand what it is about hyperbolic trajectories, but still, what its physical meaning?

  lim   Ap = +∞       
e → 1⁻

  lim   Ap = −∞       
e → 1⁺

It is the reason why you get NaN if you put e = 1, but something wrong there. How it works in big science?

Edited by flart
Link to comment
Share on other sites

HyperEdit is not a part of KSP, it's a mod, with its own limits and behavior.
KSP definitely supports any patched conics orbits, including para- and hyperbolic ones.

What it doesn't support from box — Lagrange points.

If "Apoapsis" value indicates altitude, rather than radius, then it can be negative (i.e. underground).

Edited by kerbiloid
Link to comment
Share on other sites

Moving to KSP Discussion.

12 hours ago, flart said:

Why KSP engine doesn't support parabolic trajectories?

The thing to bear in mind about a parabolic trajectory is that, properly speaking, it can only happen if net energy is exactly zero.  I mean, exactly.  If it's even 0.00000000000001 erg negative, then you've got a (very eccentric) ellipse.  If it's even 0.00000000000001 erg positive, you've got a hyperbola.

So, a parabolic trajectory is an interesting mathematical abstraction, but in practice it never comes up.  (Especially since "exactly" is a concept that doesn't work well on computers, whose representation of floating-point numbers has necessarily finite precision.)

I don't know how they've coded the internals of KSP, but clearly their orbit-calculation-and-drawing code is going to need to have an "inflection point" in it-- i.e. "below this point it's an ellipse, above this point it's a hyperbola".  Those kinds of inflection points often spell trouble for software, because you can end up with weird, buggy-looking behavior when a system is straddling microscopically close to the boundary, with the result that you get weird "flickery" behavior as the system oscillates between the two.

12 hours ago, flart said:

(You can try to put e = 1 into HyperEdit and see disappearing ship)

Which is a perfect example of software having trouble with boundary conditions.  I don't know anything about how HyperEdit is implemented (or how the KSP code deals with the result), but I wouldn't be surprised if, by doing that, you end up causing a divide-by-zero error somewhere in the code. :wink:

Therefore, in general the way one handles that sort of thing in code is to put some sort of "safety margin" around the inflection point, so that the system won't transition from state A to state B unless/until it goes a smidgeon past the boundary-- that way you don't get flickering if there's a microscopic oscillation (which there always is).

Like I said, I don't know how they did code it, but that's how I would code it, if I were writing it.  And if that's the case, that would have the deliberate effect of preventing a state that sits perfectly on the boundary, in order not to get that buggy-looking behavior.

In other words:  not only is a perfectly parabolic trajectory never going to come up in practice, but I'd be surprised if the code doesn't explicitly have some sort of safeguards specifically to prevent anything from sitting too close to that boundary.

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.

 Share

×
×
  • Create New...