Tableau implementation for Tsit5 with generic RK interpolation#3028
Merged
ChrisRackauckas merged 8 commits intoSciML:masterfrom Feb 3, 2026
Merged
Conversation
Add Tsit5 tableau in ExplicitRK format with interpolation support: - construct_tsit5_interp_matrix: interpolation coefficient matrix with dispatch for compiled floats and high-precision types - constructTsit5ExplicitRK: Tsit5 Butcher tableau for ExplicitRK solver - Generic RK interpolation via B_interp matrix in ExplicitRKTableau - _ode_addsteps! and _ode_interpolant dispatches for dense output - L2 convergence order tests verifying >= 4th order interpolation Based on PR SciML#2913 by KeshavVenkatesh and SriramV739, rebased and cleaned up to address review feedback. Co-Authored-By: Keshav Venkatesh <[email protected]> Co-Authored-By: SriramV739 <[email protected]> Co-Authored-By: Chris Rackauckas <[email protected]>
Performance fixes for generic RK interpolation: - Eliminate heap-allocated Vector for polynomial weights in both generic_rk_interpolant and generic_rk_interpolant! by computing b_i values inline during the weighted sum accumulation - Add @inline to eval_poly_derivative for better inlining in hot path - Remove unnecessary @Assert in hot interpolation path Add ExplicitRK with Tsit5 tableau to the main dense output regression tests (test/regression/ode_dense_tests.jl): - 1D and 2D regression tests with tolerance checks - Derivative tests up to order 3 with left-derivative verification - In-place interpolation with idxs parameter Co-Authored-By: Chris Rackauckas <[email protected]>
Instead of computing bi values inline each call, store a pre-allocated Vector in ExplicitRKConstantCache that gets updated in-place, avoiding heap allocation in the interpolation hot path. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.5 <[email protected]>
When B_interp is nothing (e.g. default ExplicitRK with Dormand-Prince), fall back to Hermite interpolation instead of throwing. Also skip the custom _ode_addsteps! in this case so k contains only the 2 entries Hermite expects. For the out-of-place interpolant, compute bi weights inline to support ForwardDiff.Dual Θ values. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.5 <[email protected]>
0793f31 to
424f103
Compare
Use module-qualified access instead of `using` to import the function. This avoids issues with `using SubModule: function` when SubModule is re-exported from a parent module on Julia 1.10. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.5 <[email protected]>
On Julia 1.10, the [sources] section in Project.toml is not supported, so package resolution pulls OrdinaryDiffEqExplicitRK from the registry rather than the local lib/ version. This means constructTsit5ExplicitRK (added in this PR) is not available until a new release is made. Wrap the Tsit5 ExplicitRK tests in an isdefined check to gracefully skip them when the function is not available. Once this PR is merged and a new version of OrdinaryDiffEqExplicitRK is released, the tests will run on Julia 1.10 as well. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Claude Opus 4.5 <[email protected]>
This reverts commit 5453466.
This reverts commit 3001602.
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.
Summary
constructTsit5ExplicitRK()to create a Tsit5 Butcher tableau for the genericExplicitRKsolverconstruct_tsit5_interp_matrix()with dispatch for compiled floats and high-precision typesB_interpmatrix:_ode_addsteps!and_ode_interpolantdispatches for dense outputB_interpfield toExplicitRKConstantCacheto store interpolation coefficientsBased on #2913 by @KeshavVenkatesh and @SriramV739, rebased onto current master as a single clean commit with all review feedback addressed:
_ode_interpolant/_ode_addsteps!dispatches for dense output integration with OrdinaryDiffEqCoreTest plan
🤖 Generated with Claude Code