ForceFreeStates - BUG - Fixed-boundary zero-crossing check can reject genuine Newcomb crossings

Open
#558 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
julia

Research direction

Start with src/ForceFreeStates/FixedBoundaryStability.jl:71-86 and compare its crossing check with the Fortran behavior documented in GPEC#292. Then run a fixed-boundary Solov'ev q0 scan at default and tightened tolerances, including a pole case. Done means Julia finds the same genuine crossings at both tolerance settings while still rejecting the pole.

Written by the indexing model from the issue text.

Description

check_for_zero_crossings! (src/ForceFreeStates/FixedBoundaryStability.jl:71-86) is a line-for-line port of the Fortran ode_output_monitor test. When crit changes sign between two accepted ODE steps, it interpolates u linearly to the estimated root and accepts the crossing only if the midpoint value lies between the endpoints and |crit_mid| < 0.5*min(|crit|,|crit_prev|). Accepted steps can be long where crit is strongly nonlinear, so a genuine Newcomb zero crossing can fail this test and be discarded.

In the Fortran code this defect is reproduced and documented in GPEC#292: for fixed-boundary Solov'ev cases near q0 ≈ 1.03, DCON misses crossings at its default tolerances and finds them only after the tolerances are tightened. The Julia check has the same logic, so the same failure is expected, but I have not yet run the Julia q0 scan.

Simply relaxing the magnitude test is not the fix, because the sign change can also come from a pole of crit, which must not be counted. A robust check brackets the root, for example by bisection on the integrator's dense output, and distinguishes a zero (|crit| decreasing towards the bracket point) from a pole (|crit| growing).

Acceptance: a fixed-boundary Solov'ev q0 scan where Julia reports the same crossings at default and at tightened tolerances, with a pole case that is still rejected.

Chris&AI

Dominant language
Julia
Stars
11
Forks
7
Avg merge
4d 1h
Merged PRs (30d)
68

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenFUSIONToolkit/GPEC

All issues in OpenFUSIONToolkit/GPEC

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.