Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions MechJebLib/Maneuvers/InterplanetaryTransfer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ private void NLPFunction(double[] x, double[] fi, double[,] jac, object? obj = n
DualV3 vsoi2helio = v2soi2 + vsoi2 / _targetToHelioScale.VelocityScale;

// solve from the burn to the soi1 interface
(DualV3 vi1, DualV3 vf1) = Izzo.Solve(1.0, r0Burn, rsoi1, dt2, _direction1, rtol: 1e-12);
// (use prograde/retrograde sense of the initial parking orbit--shortway/longway produces issues--might need to pick some other
// axis if we hit issues)
(DualV3 vi1, DualV3 vf1) = Izzo.Solve(1.0, r0Burn, rsoi1, dt2, _direction1, rtol: 1e-12, h: V3.Cross(_r0, _v0));

// solve the heliocentric trajectory from soi1 to soi2
// (this uses prograde/retrograde sense from the rsoi1helio x vsoi1helio plane since shortway/longway has a 180
Expand Down Expand Up @@ -332,22 +334,22 @@ private void NLPFunction(double[] x, double[] fi, double[,] jac, object? obj = n

var best = new Solution(V3.zero, 0.0, 0.0, 0.0, double.PositiveInfinity, double.PositiveInfinity);

_direction1 = TransferGeometry.ShortWay;
_direction1 = TransferGeometry.Prograde;
_direction2 = TransferGeometry.Prograde;
Solution sol1 = RunOptimizer(x0short, bndl, bndu, optguard);
best = UpdateBestSolution(sol1, best);

_direction1 = TransferGeometry.LongWay;
_direction1 = TransferGeometry.Retrograde;
_direction2 = TransferGeometry.Prograde;
Solution sol2 = RunOptimizer(x0short, bndl, bndu, optguard);
best = UpdateBestSolution(sol2, best);

_direction1 = TransferGeometry.ShortWay;
_direction1 = TransferGeometry.Prograde;
_direction2 = TransferGeometry.Retrograde;
Solution sol3 = RunOptimizer(x0long, bndl, bndu, optguard);
best = UpdateBestSolution(sol3, best);

_direction1 = TransferGeometry.LongWay;
_direction1 = TransferGeometry.Retrograde;
_direction2 = TransferGeometry.Retrograde;
Solution sol4 = RunOptimizer(x0long, bndl, bndu, optguard);
best = UpdateBestSolution(sol4, best);
Expand Down
6 changes: 3 additions & 3 deletions MechJebLibTest/PSGTests/AscentTests/KerbinTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ private void MainSailTinCanVacuum()

psg.PrimalFeasibility.ShouldBeZero(1e-5);
solution.Vgo(t0).ShouldEqual(2603.1239482534565, 1e-3);
// there's about 8 seconds extra burntime here due to throttling down, which these tests may be very sensitive to
solution.Tgo(t0).ShouldEqual(554.04809755858685, 1e-3);
// there's about 14 seconds extra burntime here due to throttling down, which these tests may be very sensitive to
solution.Tgo(t0).ShouldEqual(560.53674689893228, 1e-3);

(V3 rf, V3 vf) = solution.TerminalStateVectors();
}
Expand Down Expand Up @@ -68,7 +68,7 @@ private void MainSailTinCanAtmo()
psg.PrimalFeasibility.ShouldBeZero(1e-5);
solution.Vgo(t0).ShouldEqual(3521.7544134539125, 1e-3);
// there's about 110 seconds extra burntime here due to throttling down, which these tests may be extremely sensitive to
solution.Tgo(t0).ShouldEqual(394.66454166378765, 1e-3);
solution.Tgo(t0).ShouldEqual(388.2458105314372, 1e-3);

(V3 rf, V3 vf) = solution.TerminalStateVectors();
}
Expand Down
Loading
Loading