Repository navigation
DCON/RDCON/STRIDE - BUGFIX - First ODE step next to a singular surface no longer than the distance to it - #375
Open
StuartBenjamin wants to merge 3 commits into
Conversation
… than the distance to it
The initial ZVODE step is psilow*1e-3 for every interval. When q0 < qlow moves psilow off the axis (to
q = qlow), that step is ~1e3 times the singfac_min/|n q'| offset at high-shear edge surfaces and the
corrector fails ("ZVODE1 integration failure"). Cap it at the distance to the surface. Unchanged where
psilow*1e-3 is already smaller.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o longer than the offset, and stop on LSODE failure ode_ideal_cross restarts LSODE with the axis step psilow*1e-3. When q0 < qlow moves psilow off the axis, that step is ~1e3 times the offset from high-shear edge surfaces and LSODE fails; ode_run then crossed the next surface from where the step failed, giving wrong energies and zero crossings or a run that never ends. Cap the restart step at the offset (as ode_sing_init does) and stop when LSODE fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… longer than the offset, and stop on LSODE failure The ideal, kinetic and resistive crossings restart LSODE with the axis step psilow*1e-3, as in RDCON. Cap the restart step at the offset (as ode_sing_init does) and stop when LSODE fails instead of crossing the next surface from where the step failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. DCON, RDCON and STRIDE start every ODE integration with the step
psilow*1e-3, including the restart just past each singular surface. Whenqlowis above q0, the codes move the start of the integration out to q =qlow(ψ ≈ 1e-2 instead of 1e-5). The first step then becomes about 1000 times thesingfac_min/|n q'|offset at high-shear surfaces near the edge.Fix. The first step next to a surface is now no longer than the distance to it: in STRIDE's interval integration and in the DCON/RDCON restarts, as
ode_sing_initalready does. DCON and RDCON also stop with a message when LSODE fails. Nothing changes wherepsilow*1e-3is already the smaller step.Tested on
docs/examples/DIIID_resistive_example(q0 = 1.20) withpsihigh = 0.999, n = 1–4 andsingfac_min= 1e-4 and 1e-5:qlow = 1.02(start stays at the axis), 24 runsqlow = 1.3, n = 3,singfac_min = 1e-5qlow = 1.3, n = 4,singfac_min = 1e-5qlow = 1.02value), RDCON −29.5 (= thesingfac_min = 1e-4value)qlow = 1.3, n = 2,singfac_min = 1e-4: STRIDE Δ′ against RDCON's Galerkin Δ′Run times are unchanged. At tight tolerances (1e-10), develop and this branch give the same energies on the example where both run. On our own equilibria with q0 just below
qlow, the fixed codes agree on the ideal energy (DCON / RDCON / STRIDE: 0.678 / 0.679 / 0.675 and 1.224 / 1.225 / 1.225). Their Δ′ agree within 3e-4 inside ψ_N = 0.95.One restart path still uses the axis step: a Gaussian-reduction restart before the first singular surface. No failure there has been seen.
🤖 Generated with Claude Code