Skip to content

Commit

Permalink
Rewrite and simplify ReturnFromMoon
Browse files Browse the repository at this point in the history
Reject the Sims-Flanaghan-inspired approach and just use two
Lambert phases, switch to SLP solver, improve the sliding windows
for the initial guess.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Nov 29, 2023
1 parent 50f1b11 commit 3dee06c
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 297 deletions.
4 changes: 1 addition & 3 deletions MechJeb2/OrbitalManeuverCalculator.cs
Expand Up @@ -362,10 +362,8 @@ public static (Vector3d dv, double dt) DeltaVAndTimeForMoonReturnEjection(Orbit
double moonSOI = moon.sphereOfInfluence;
(V3 r0, V3 v0) = o.RightHandedStateVectorsAtUT(ut);

double dtmin = o.eccentricity >= 1 ? 0 : double.NegativeInfinity;

(V3 dv, double dt, double newPeR) = solver.NextManeuver(primary.gravParameter, moon.gravParameter, moonR0,
moonV0, moonSOI, r0, v0, targetPrimaryRadius, 0, dtmin);
moonV0, moonSOI, r0, v0, targetPrimaryRadius, 0);

Debug.Log($"Solved PeR from calcluator: {newPeR}");

Expand Down

0 comments on commit 3dee06c

Please sign in to comment.