You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recompute the spectral radius every 25 steps by default in ROCK2/ROCK4/RKC (#3952)
When no user eigen_est is provided, the spectral radius is estimated by
power iteration. Previously this ran on every step (several extra f
evaluations per step even with the warm-started eigenvector). Add an
eigen_est_interval option so the power iteration only reruns every
eigen_est_interval accepted steps, plus always on the first step, after
step rejections, and at derivative discontinuities. A stale estimate that
under-resolves the stability region self-corrects through a rejection, so
there is no silent loss of stability.
The default is 25, matching the classical RKC (Sommeijer-Shampine-Verwer)
and ROCK Fortran codes; pass eigen_est_interval = 1 to restore the
previous recompute-every-step behavior.
Benchmarked across linear heat, Allen-Cahn, Brusselator, and time-ramping
diffusion, in-place and out-of-place, at abstol=reltol in {1e-4,1e-6,1e-8}
with the internal power iteration:
- slowly varying spectral radius (the common parabolic case): 10-44%
fewer f evaluations at identical accuracy and identical accepted-step
counts; up to 1.39x faster wall clock on nonlinear RHS problems.
- an interval sweep {1,2,5,10,25,50,100} shows the knee near 10-25;
25 captures ~95% of the available saving.
- rapidly ramping spectral radius: a stale estimate costs a few extra
rejections and up to ~25% more f evaluations at loose tolerance, but
always converges (retcode Success); users with fast-varying stiffness
can set eigen_est_interval = 1.
Convergence orders are unchanged (added as tests). Adds an
eigen_est_interval testset asserting the default is 25, that it spends
fewer f evaluations than interval 1 at equal accuracy, and that the
order is preserved.
Claude-Session: https://claude.ai/code/session_015WU5V4PXt8SZ3BpjxdtM7d
Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments