-
-
Notifications
You must be signed in to change notification settings - Fork 235
Add Cash-Karp 5th order Runge-Kutta method #2771
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
Closed
Closed
Conversation
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
Implements the classic Cash-Karp 5/4 embedded Runge-Kutta method: - 6-stage explicit method with 5th order accuracy - Embedded 4th order method for error estimation - Adaptive step size control - Both constant and mutable cache implementations Added components: - CashKarp5 algorithm struct in algorithms.jl - CashKarp5ConstantCache tableau with rational and float coefficients - CashKarp5Cache mutable cache structure - perform_step! methods for both cache types - initialize! methods for proper integration setup - Convergence test to verify 5th order accuracy - Export in module interface The method provides an alternative to DP5 and BS5 for applications requiring 5th order accuracy with different stability properties. References: Cash, J.R. and Karp, A.H. (1990). A variable order Runge-Kutta method for initial value problems with rapidly varying right-hand sides. ACM Transactions on Mathematical Software, 16(2), 201-222. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
- Add get_fsalfirstlast method for CashKarp5Cache - Mark CashKarp5 as non-FSAL algorithm via isfsal trait This fixes the MethodError that occurred when initializing the integrator. Even though CashKarp5 is not FSAL, the get_fsalfirstlast method is still required by the integrator initialization process. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
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.
Summary
Implements the classic Cash-Karp 5/4 embedded Runge-Kutta method, adding a well-known 5th order method that was previously missing from OrdinaryDiffEq.jl.
Changes
Method Details
Test Plan
Background
The Cash-Karp method was identified as missing from OrdinaryDiffEq.jl based on discussions about classical RK methods. While DP5 and BS5 provide similar functionality, Cash-Karp offers different stability properties and is widely referenced in numerical analysis literature.
References
Cash, J.R. and Karp, A.H. (1990). A variable order Runge-Kutta method for initial value problems with rapidly varying right-hand sides. ACM Transactions on Mathematical Software, 16(2), 201-222.
🤖 Generated with Claude Code