Repository navigation
Hoverslam simulation: normalized units, as PSG - #2791
Merged
Merged
Conversation
The simulation integrated in SI, where the Tsit5 Atol of 1e-6 is 1e-6 m, m/s and kg on every component: very tight on the components near zero (z in an equatorial orbit, the Dv at the start) while the Rtol governs the rest. It now runs in normalized units, like PSG's Problem: the manager takes and logs SI inputs, and Reconfigure builds a HoverslamProblem scaled by the target radius, the circular speed there and the starting mass (so mu is 1), and normalizes the phases. The results are reported back in SI. Rhs checks the phase is normalized. Phase gets RescaleInPlace, for the hoverslam's pooled phases, which Rescale's copy would allocate on every cycle (MunLander's ShouldNotAllocate). Rescale is now a copy and RescaleInPlace. Brent stops within 2 rtol max(|t|, 1), whose floor is now one unit of time (several hundred seconds), so its rtol is divided by the time scale to keep the 2e-6 s floor for an ignition near now. Away from now it is tighter than before: the landing radius ends within 1e-6 m of the target instead of a few cm, for about one more root solve iteration. Over the 16 test scenarios a solve is 27% faster (38.3 to 28.0 ms), all of them faster. Against a 1e-10 tolerance reference, the ignition time stays within 2.5e-4 s, better in some scenarios and worse in others. Dv on Earth is looser, up to 0.014 m/s of 3,922 m/s, the velocity Atol being 1e-6 of 7.9 km/s. VerticalDropApolloMoon15Km, EarthJustAfterLiftoff and FalconNineAtBecoIgnitesBeforeApoapsis are re-pinned; the largest move is 2.1e-4 s on the Falcon 9 ignition. MunLanderTwoStage loses a stale comment about ~0.2 m/s of Dv chatter, and its Dv is re-pinned at 1e-5 instead of 1e-3.
Contributor
✅ Build Artifact 🚀MechJeb2-0bec9cf.zip (built from d6b6ddd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The simulation integrated in SI, where the Tsit5 Atol of 1e-6 is 1e-6 m, m/s and kg on every component: very tight on the components near zero (z in an equatorial orbit, the Dv at the start) while the Rtol governs the rest. It now runs in normalized units, like PSG's Problem: the manager takes and logs SI inputs, and Reconfigure builds a HoverslamProblem scaled by the target radius, the circular speed there and the starting mass (so mu is 1), and normalizes the phases. The results are reported back in SI. Rhs checks the phase is normalized.
Phase gets RescaleInPlace, for the hoverslam's pooled phases, which Rescale's copy would allocate on every cycle (MunLander's ShouldNotAllocate). Rescale is now a copy and RescaleInPlace.
Brent stops within 2 rtol max(|t|, 1), whose floor is now one unit of time (several hundred seconds), so its rtol is divided by the time scale to keep the 2e-6 s floor for an ignition near now. Away from now it is tighter than before: the landing radius ends within 1e-6 m of the target instead of a few cm, for about one more root solve iteration.
Over the 16 test scenarios a solve is 27% faster (38.3 to 28.0 ms), all of them faster. Against a 1e-10 tolerance reference, the ignition time stays within 2.5e-4 s, better in some scenarios and worse in others. Dv on Earth is looser, up to 0.014 m/s of 3,922 m/s, the velocity Atol being 1e-6 of 7.9 km/s.
VerticalDropApolloMoon15Km, EarthJustAfterLiftoff and FalconNineAtBecoIgnitesBeforeApoapsis are re-pinned; the largest move is 2.1e-4 s on the Falcon 9 ignition. MunLanderTwoStage loses a stale comment about ~0.2 m/s of Dv chatter, and its Dv is re-pinned at 1e-5 instead of 1e-3.