neuoy / KSPTrajectories

A Kerbal Space Program mod to display trajectory predictions, accounting for atmospheric drag, lift, etc.
GNU General Public License v3.0
144 stars 47 forks source link

Draw landing zone ellipse #37

Closed neuoy closed 5 years ago

neuoy commented 10 years ago

Or any other method to indicate how reliable the impact position is. For example by performing multiple predictions with slighly varying starting conditions to see if the trajectory is affected by the chaos theory.

Starstrider42 commented 10 years ago

The starting conditions are probably pretty well constrained. A more useful source of error to allow for would be deviation of angle of attack from what's put into the calculator. For example, I sometimes have to use SAS on reentry and keep my capsule pointed retrograde by hand, which according to FAR means my AoA can deviate by up to 3 degrees from true retrograde.

So it might be useful to update the settings screen to allow for errors on the angle of attack, with a default of e.g. ±2 degrees. Then just run a dozen or so simulations with the "true" AoA drawn from a Gaussian or something (how computationally intensive are Trajectories simulations?).

neuoy commented 10 years ago

I was more thinking about making the computations three times (middle, min, max) ; I don't see a need to run it more, and it could become too expensive (I don't have numbers to provide on that point yet, but I plan to make measurements to see if things can be optimized). The ellipse small axis could just be computed as a fixed ratio of the big axis. Actually, in KSP, since there is no wind, I think it's really very precise on the "left/right" axis.

Starstrider42 commented 10 years ago

With stock drag, yes. With FAR, though, any deviation in heading (bearing? whatever it's called) will tend to push your craft sideways as well. I'm guessing it's a bigger deal for gliders than for capsules, but it should happen with both.

Besides, FAR does have a wind API; it's only a matter of time before somebody uses it.

neuoy commented 10 years ago

OK, I haven't encountered a case where sideway precision mattered (even with spaceplanes), but sure, a craft with vertical wings (or tail stabilizers or whatever) will deviate if not heading straight. That would make 5 predictions then, or 4 if we assume lateral precision is symetrical (center, right, down, up). In any case, it needs to be an option that can be turned on/off, so even if it lags, players can use it to see the estimation, then disable it during flight.

Aquilux commented 7 years ago

I gave this some thought and I feel like it may not be that hard to implement actually, and would only need a "Maximum AoA" input from the user (0-90 degrees from the velocity axis) The landing ellipse itself will be constrained by three points:

  1. The first point is constrained by the maximum range achievable within the specified AoA range along the current heading. This specifies the ellipse's furthest extent.

  2. The second point is defined by the maximum deflection possible within the specified AoA and assuming that this deflection is applied entirely to diving towards the planet. This is the shortest trajectory to the ground and specifies the ellipse's closest extent.

  3. The last two points are maximum cross range. This trajectory is similar to a ballistic trajectory as no lift is being directed up or down. Instead, maximum deflection is being applied laterally along the flight path to give you the extent and position of the widest extent of your ellipse.

This implementation has two drawbacks. First it assumes that once traveling straight down the craft will no longer deflect its trajectory, and second it does not account for craft with high enough lift to change it's trajectory more than 90 degrees laterally. This can probably be solved by generating intermediate trajectories between each case and drawing a curve sequentially through all landing locations and filling the inner area of the resulting shape. I would think two extra points (1/3 - 2/3, and 2/3 - 1/3 comprises in force between each case). I imagine a craft with enough lift would distort the shape out of an ellipse and may not need any points involving maximum deflection down to draw it's potential range, but I'd wager it's simpler to area fill a complex shape than it is to decide when to change methods.

If this does get implemented, I'd like to request that a secondary window be made available to display the landing zone shape on a lat-long grid in relation to the target you can already specify when not in map view. Also I would be exceptionally grateful if a marker could be added to indicate where to point the nose for the proper L/D max AoA.

fat-lobyte commented 5 years ago

If somebody wants to implement this, please go right ahead. I currently have no plans to do it.