-
-
Notifications
You must be signed in to change notification settings - Fork 503
Add Runge-Kutta 6th Order Method as calculation option #2839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces RK6SimulationStepper for higher-order Runge-Kutta integration and RKStepperChoice enum to select between RK4 and RK6 methods. Updates simulation engine, options, preferences, and GUI panels to support user selection of RK method for flight computations.
Corrected the reference URL in RK6SimulationStepper to remove duplicate 'https://' and updated the RK6StepperChoice description to clarify its accuracy and performance compared to RK4.
The error was a non-ascii character in the citation of the RK6 Method source. |
For developers, see this thread regarding uses and benefits of the RK6 analysis. |
Very cool, I've been wanting this for a while. Thanks a lot! I currently don't have time to do a code review though... |
The code is actually very simple since it's pretty much the same as the RK4 one, except for a change of coefficients and of course adding a couple more. The rest of the additions are simply to add it as a GUI option and as a setting - copying the GeodeticComputationMethod structure that was already implemented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, meant it to go in the code
Sorry - where can I see your requested changes ? I saw the comment that was edited afterwards, but I'm not following what you had in mind. Thx ! |
core/src/main/java/info/openrocket/core/preferences/ApplicationPreferences.java
Outdated
Show resolved
Hide resolved
core/src/main/java/info/openrocket/core/simulation/SimulationOptions.java
Outdated
Show resolved
Hide resolved
Just ignore the "oops" comment. github doesn't seem to want to let me delete it. |
Should be fixed ! |
This is a really nice piece of work, thanks. Now that I've looked at it, I see you've addressed my concern about slowing down the sim by leaving both steppers in place and letting the user decide -- great. We could use some unit testing on it; just the existing sim tests but with RK6 would do that. We are right on the verge of the final 24.12 release. I'd like this to go in after that release. |
Sounds great ! I will try to write a couple unit tests - as you suggested. Sounds good on the release - I was never thinking of replacing RK4 for sure, just as another option for high-stakes simulations requiring high-fidelity results etc - possibly may be useful to add also an option to change the default time step as another high-fidelity option. |
Forgot something -- please have the new option read from/written to the .ork file. |
Great point - didn't think of that. Will do + unit tests. |
Extended SimulationTest and DisableStageTest to include tests using the RK6 Runge-Kutta stepper. These tests verify correct simulation behavior and abort conditions when using the RK6 integrator, ensuring consistency with existing stepper options.
Tests have been added cloning the RK4 ones - all pass ! Also added is writing and reading from an ORK file - default for unspecified simulations is RK4. |
Included the <rungekuttamethod>rk4</rungekuttamethod> element in the simulation example to document the specification of the Runge-Kutta integration method.
This reverts commit 8bb2783.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also modify fileformat.txt
to reflect the addition of the simulation stepper method. You can add a new version, version 1.11
and add Introduced with OpenRocket 25.XX.
as the title (we will replace 'xx' with the release version when time comes.
core/src/main/java/info/openrocket/core/file/openrocket/OpenRocketSaver.java
Outdated
Show resolved
Hide resolved
Updated the XML element and handler from <rungekuttamethod> to <simulationsteppermethod> for clarity and consistency. Also updated fileformat.txt to document the new element in version 1.11.
core/src/main/java/info/openrocket/core/preferences/ApplicationPreferences.java
Outdated
Show resolved
Hide resolved
core/src/main/java/info/openrocket/core/simulation/RK6SimulationStepper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/info/openrocket/core/util/RKStepperChoice.java
Outdated
Show resolved
Hide resolved
swing/src/main/java/info/openrocket/swing/gui/main/SimulationPanel.java
Outdated
Show resolved
Hide resolved
swing/src/main/java/info/openrocket/swing/gui/simulation/SimulationOptionsPanel.java
Outdated
Show resolved
Hide resolved
Renamed RKStepperChoice to SimulationStepperMethod throughout the codebase for clarity and consistency. Updated all references, method names, and UI labels accordingly. Added AdvancedRollControl simulation extension and provider for enhanced roll control functionality.
All set with the requested changes @SiboVG. |
Irrelevant to this PR
LGTM. I added some small changes in the end, and removed the AdvancedRollControl examples (irrelevant to this PR). @JoePfeiffer do you still have anything to add for this PR? |
Thanks a ton for the contribution @MDNich. See you in the next PR! 😉 |
Anytime ! Thank you ! |
Add RK6 Calculation method. Follows Butcher Tableau from Table 2 of this article.
Also adds menu options and a table column, as well as a disclaimer tooltip for the RK6 option.