Skip to content

Fix StabilizedRK Algorithims - #3902

Closed
Sreeram-Shankar wants to merge 4 commits into
SciML:masterfrom
Sreeram-Shankar:add-limiters-stabilized-rk
Closed

Sreeram-Shankar wants to merge 4 commits into
SciML:masterfrom
Sreeram-Shankar:add-limiters-stabilized-rk

Conversation

@Sreeram-Shankar

@Sreeram-Shankar Sreeram-Shankar commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Small Updates and Fixes for Stabilized RK Methods

  • Added non-autonomous function evaluations at the intermediate polynomial stages for RKL and RKG methods. the function evaluations at the polynomial j evaluation now use a time increment and are accurate for non-autonomous systems

  • TSRK2, RKC, and RKMC now use an increment of th rather than th1 for their first stage evaluation

  • ROCK 2 final stage now updates correctly for the final solution

@jlchan jlchan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! I'm not super familiar with this implementation, but here were a few things that stood out.

…, addressed issue in first step of RKC TSRKC and RKMC, and finnal stage issue in ROCK2
@Sreeram-Shankar Sreeram-Shankar changed the title add stage and step limiters for Stabilized RK methods update Stabilized RK methods Jul 16, 2026
@Sreeram-Shankar Sreeram-Shankar changed the title update Stabilized RK methods Update Stabilized RK Methods for Limiters and Fixes Jul 16, 2026
@ChrisRackauckas

Copy link
Copy Markdown
Member

#3835 is the complete generalization, and I think we should just do that rather than doing it per-method.

@Sreeram-Shankar Sreeram-Shankar changed the title Update Stabilized RK Methods for Limiters and Fixes Fix StabilizedRK Algorithims Jul 16, 2026
@Sreeram-Shankar

Copy link
Copy Markdown
Contributor Author

Reverted the step and stage limiter changes, just the small changes in the methods now

@ChrisRackauckas

Copy link
Copy Markdown
Member

This needs a rebase on the pointer cycling, I'll take care of that.

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/OrdinaryDiffEq.jl that referenced this pull request Aug 2, 2026
Rebase of the surviving content of SciML#3902 onto current master.

In the in-place TSRKC2 and TSRKC3 stage loops `th` was assigned inside
the `if (iter < mdeg)` guard. Hoisting it out matches RKC and RKMC2,
which already compute `th` unconditionally.

This is a no-op: `th` is read only by the `th1 = th` on the following
line, which stays inside the guard, so nothing observes the value
computed on the final iteration.

The rest of SciML#3902 landed separately and is already on master:
  - RKL1/RKL2 non-autonomous stage times (SciML#3948)
  - RKG1/RKG2 non-autonomous stage times (SciML#3949)
  - RKC in-place mdeg < 2 handling (SciML#3951)
  - per-algorithm limiter fields, reverted by the author in c34fe7a
    and superseded by solve-level limiters (SciML#3835)

Original commits: 9158496, 05548a5, c34fe7a

Co-Authored-By: Chris Rackauckas <[email protected]>
ChrisRackauckas added a commit that referenced this pull request Aug 2, 2026
…4091)

Rebase of the surviving content of #3902 onto current master.

In the in-place TSRKC2 and TSRKC3 stage loops `th` was assigned inside
the `if (iter < mdeg)` guard. Hoisting it out matches RKC and RKMC2,
which already compute `th` unconditionally.

This is a no-op: `th` is read only by the `th1 = th` on the following
line, which stays inside the guard, so nothing observes the value
computed on the final iteration.

The rest of #3902 landed separately and is already on master:
  - RKL1/RKL2 non-autonomous stage times (#3948)
  - RKG1/RKG2 non-autonomous stage times (#3949)
  - RKC in-place mdeg < 2 handling (#3951)
  - per-algorithm limiter fields, reverted by the author in c34fe7a
    and superseded by solve-level limiters (#3835)

Original commits: 9158496, 05548a5, c34fe7a

Co-authored-by: Sreeram-Shankar <[email protected]>
Co-authored-by: Chris Rackauckas <[email protected]>
@ChrisRackauckas

Copy link
Copy Markdown
Member

I rebased your commit in #4091

@Sreeram-Shankar

Sreeram-Shankar commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

have limiters for the stages and steps for stabilized_rk been added yet as part of the broader generalization? I dont see it yet in https://github.com/SciML/OrdinaryDiffEq.jl/blob/master/lib/OrdinaryDiffEqStabilizedRK/src/rkc_perform_step.jl

@ChrisRackauckas

Copy link
Copy Markdown
Member

that might've been missed.

@jlchan

jlchan commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Looks like #3835 reported adding limiters to both stabilized and exponential RK methods, but didn't.

@Sreeram-Shankar

Copy link
Copy Markdown
Contributor Author

would it be possible to have them sooner rather than later?

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Confirmed: #3835 never added the stage hooks to rkc_perform_step.jl, so stage_limiter errored as unused for every StabilizedRK method (step limiters did work, since those are applied centrally). Stage limiters for all 13 methods (ROCK2, ROCK4, RKC, RKMC2, ESERK4, ESERK5, SERK2, TSRKC2, TSRKC3, RKL1, RKL2, RKG1, RKG2) are in #4550. Usage is the solve-level keyword: solve(prob, ROCK2(); stage_limiter = limiter!, step_limiter = limiter!) with limiter!(u, integrator, p, t).

🤖 Written by an AI agent (Devin CLI 3000.10.21, model Fusion — Claude Fable 5.1 High + SWE-2 Medium) on behalf of Chris Rackauckas; local session id five-bladder, no shareable URL.

@Sreeram-Shankar
Sreeram-Shankar deleted the add-limiters-stabilized-rk branch November 9, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants