Repository navigation
DCON/RDCON/STRIDE - BUGFIX - sing_lim: take qlim from the edge q and psilim from the outermost crossing - #363
Open
StuartBenjamin wants to merge 1 commit into
Conversation
With sas_flag, qlim came from qmax and Newton started at the grid point nearest qlim anywhere. When q inside is above the edge q (e.g. an i-file q that rises toward the axis), qlim landed above the edge q and psilim next to the axis (psihigh 2e-5: RDCON/STRIDE on a sliver, ZVODE failures). qlim now steps from q(psihigh) and Newton starts in the outermost interval holding qlim; unchanged when q peaks at the edge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StuartBenjamin
marked this pull request as ready for review
October 31, 2026 18:48
This branch has not been deployed
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.
Problem. With
sas_flag,sing_limsets qlim from qmax and starts the Newton search for psilim at the grid point whose q is nearest qlim, anywhere in the plasma. When q peaks inside the plasma rather than at the edge (e.g. q ≈ 5.2 at the axis and 4.75 at the edge), qlim lies above every edge q and psilim converges next to the axis (psilim ≈ 2e-5). RDCON and STRIDE then solve on a sliver: the ODE integration fails and no rational surfaces are found.Fix. Same change in dcon/sing.f, rdcon/sing.f and stride/sing.F: qlim steps down from min(q(psihigh), qhigh) instead of min(qmax, qhigh), and Newton starts in the outermost grid interval that holds qlim. When q peaks at the edge (qmax = q(psihigh)), qlim and the Newton start are unchanged, so normal equilibria give bit-identical results.