Repository navigation
RDCON - BUGFIX - Galerkin F built from the factored spline used by the asymptotics - #303
Merged
Merged
Conversation
…e asymptotics gal_get_fkg took F from fmats_gal (cubic spline of Fbar) while the singular-surface series (sing_mmat/sing1_mmat) and the resonant lsode integrals use fmats (cubic spline of its Cholesky factor L). Between knots spline(L L^H) /= spline(L) spline(L)^H, so the big solution is not a solution of the Galerkin operator; the residual is singular at the surface and Delta' depended on nx, dx, cutoff, sing_order and gal_tol. Build F = (Q L)(Q L)^H from fmats instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 13, 2026
Merged
StuartBenjamin
marked this pull request as draft
October 13, 2026 07:24
StuartBenjamin
requested review from
matt-pharr
and removed request for
d-burg
October 13, 2026 08:19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartBenjamin
marked this pull request as ready for review
October 13, 2026 09:27
StuartBenjamin
marked this pull request as ready for review
October 13, 2026 09:27
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.
RDCON's Galerkin solve and the asymptotic series at each rational surface used two different splines of F.
gal_get_fkgbuilt F fromfmats_gal, a spline of F.sing_mmat/sing1_mmatusefmats, a spline of its Cholesky factor L (F = L Lᴴ). Between grid points these differ, so the big asymptotic solution does not exactly solve the Galerkin operator. The residual is singular at the surface, and Δ′ picks up an error that jumps with purely numerical settings (nx, dx1/dx2, gal_tol). 3/1 is hit hardest because its Δ′ is a large cancellation.Fix
gal_get_fkgbuilds F = (QL)(QL)ᴴ fromfmats, with Q = diag(m − nq), so both parts use the same F.fmats_galis now used only for thebin_fmatdiagnostic. Side effect: withdelta_mband > 0, the F entries outside the band were left undefined; they are now zero. (K and G outside the band are still unset, a separate older issue.)Results
D3D-like TokaMaker i-file (mpsi 257, n = 1, sing_order 8, LU), one numerical setting changed at a time:
Shipped examples, Δ′ range over nx 128–1024:
Not improved: DIIID 4/1 (−23.3 to −24.1 on develop, −24.0 to −25.2 here) and the edge surfaces. DIIID 5/1 spreads more here (−3767 to −4570, develop −3383 to −3415), and 6/1 is unconverged in both. All runs still have the
sing_mmatslot typo that #304 fixes.Scripts: rdcon_galerkin_spline_scripts.zip (python with numpy, xarray, netCDF4, matplotlib):
run_examples.shandplot_examples.pydo the same for the shipped examples.No dependencies; merges cleanly with #301.
🤖 Generated with Claude Code