Skip to content

PALC: avoid a NaN Secant tangent on zero-length steps - #360

Open
ParadaCarleton wants to merge 1 commit into
bifurcationkit:masterfrom
ParadaCarleton:secant-nan-tangent
Open

ParadaCarleton wants to merge 1 commit into
bifurcationkit:masterfrom
ParadaCarleton:secant-nan-tangent

Conversation

@ParadaCarleton

@ParadaCarleton ParadaCarleton commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

When the step size shrinks below the floating-point resolution of the current point, PALC's corrector can converge to a point equal to the current one in every coordinate, and the Secant tangent through the two equal points is 0/0, so the next tangent and predictor are NaN. This makes corrector! refuse such a step for a Secant tangent and set stopcontinuation, so the branch ends at the last point it moved to with a finite tangent and predictor (stalled_step). A Bordered tangent is computed at one point and stays defined, so it keeps its current behaviour. The added test in test/continuation/palc_secant_stall.jl refuses every corrector past λ = 1/2 with dsmin = floatmin(Float32) and checks that the continuation stops below 1/2 with a finite tangent and predictor.

…inuation at the current point, so the secant through two equal points never makes a NaN tangent
@rveltz

rveltz commented Oct 21, 2026

Copy link
Copy Markdown
Member

Hi

I agree with this but I never saw that in practice. How did you come up with this?

I'd be happy to merge but the only point is the test new.u == current.u which in big dimension seems a lot to ask. The corrector would fail anyway so why adding this?

ParadaCarleton added a commit to ParadaCarleton/BifurcationKit.jl that referenced this pull request Oct 22, 2026
@ParadaCarleton

Copy link
Copy Markdown
Contributor Author

I agree with this but I never saw that in practice. How did you come up with this?

Result of #356 (setting dsmin to floatmin, so when the step size gets very small it can underflow). No longer practically relevant since I closed that suggestion, but nothing wrong with fixing it anyway I suppose.

This branch has not been deployed

No deployments
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.

2 participants