Skip to content

ForceFreeStates - FEATURE - Accept the fixed kinetic source in solve(EulerLagrangeProblem) - #550

Merged
matt-pharr merged 5 commits into
developfrom
feature/solve-fixed-kinetic
Oct 26, 2026
Merged

matt-pharr merged 5 commits into
developfrom
feature/solve-fixed-kinetic

Conversation

@matt-pharr

@matt-pharr matt-pharr commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Release note

  • Audience: users
  • Numerical impact: none (harness @ ddad504)
  • Migration: none

solve(EulerLagrangeProblem, Forward()) now runs kinetic stability problems with kinetic_source = "fixed", which previously only worked from a gpec.toml deck. The "calculated" source still needs the [KineticForces] profiles and remains deck-only. Kinetic runs with Riccati() or Galerkin() now fail immediately with a clear message.

Regression report

Regression Report: diiid_n1
Ref 1: develop  @ 10459f3 (2026-10-26)
Ref 2: feature/solve-fixed-kinetic  @ ddad504 (2026-10-26)
       env: julia 1.12.6, x86_64-linux-gnu, manifest aa94b997 (pinned), 8 threads/4 BLAS, jit build
Quantity                                      develop          feature/solve-fixed-kinetic  Diff       Status
total energy Re(et[1])                        8.006123e-01     8.006123e-01                 0.0e+00    OK
total energy Im(et[1])                        7.924925e-05     7.924925e-05                 0.0e+00    OK
plasma energy Re(ep[1])                       -1.372261e+00    -1.372261e+00                0.0e+00    OK
vacuum energy Re(ev[1])                       2.172874e+00     2.172874e+00                 0.0e+00    OK
# singular surfaces                           5                5                            0.0e+00    OK
PE plasma energy                              3.320677e+00     3.320677e+00                 0.0e+00    OK
PE toroidal torque                            1.119454e-04     1.119454e-04                 0.0e+00    OK
NTV torque FGAR [N·m]                         5.483495e-01     5.483495e-01                 0.0e+00    OK
...
Summary: 53 unchanged

Regression Report: solovev_kinetic_calculated
Quantity                  develop        feature/solve-fixed-kinetic  Diff     Status
vacuum energy Re(ev[1])   1.054785e+01   1.054785e+01                 0.0e+00  OK
||xi_clebsch_alpha||      7.717981e-03   7.717981e-03                 0.0e+00  OK
total energy Re(et[1])    1.827879e+00   1.827879e+00                 0.0e+00  OK
total energy Im(et[1])    -1.326825e+00  -1.326825e+00                0.0e+00  OK
plasma energy Re(ep[1])   -8.719975e+00  -8.719975e+00                0.0e+00  OK
# singular surfaces       2              2                            0.0e+00  OK
...
Summary: 17 unchanged

Notes for reviewers

  • The "fixed" source builds its X-shaped test matrices in build_kinetic_matrix_splines without the KineticForces callback. The axis-validity boundary is 0.0 when no profiles are loaded and is only used in the "calculated" branch. So the placeholder KineticForcesControl() and nothing profiles that solve passes are never read on this path. The solve guard now rejects only kinetic_source = "calculated".
  • solve checks Riccati()/Galerkin() + kinetic_factor > 0 before the metric and matrices are built. The deeper guards stay for the deck path, and the Riccati messages now match the Galerkin one.
  • The ForceFreeStatesControl docstring now describes the "calculated" source instead of calling it unimplemented.
  • New parity test in runtests_solve_api.jl: solve(...; kinetic_factor=1e-3) against main on the coarse Solovev fixture. It checks et[1] and psilim to rtol=1e-12, plus nzero, the mode range and the kinetic singular surfaces. The rejection tests match on the error message.
  • Test - TEST - Add deck/API parity tests with the known drifts marked broken #546 (deck/API parity tests) marks this case @test_broken. Whichever of Test - TEST - Add deck/API parity tests with the known drifts marked broken #546 and ForceFreeStates - FEATURE - Accept the fixed kinetic source in solve(EulerLagrangeProblem) #550 merges second turns it into a pass and drops the duplicate.

🤖 Generated with Claude Code

@matt-pharr matt-pharr self-assigned this Oct 20, 2026
@matt-pharr
matt-pharr requested a review from jaesun57 October 20, 2026 13:22
@github-actions github-actions Bot added the feature New capability label Oct 20, 2026
@matt-pharr
matt-pharr requested review from logan-nc and removed request for jaesun57 October 20, 2026 13:29
@matt-pharr
matt-pharr force-pushed the feature/solve-fixed-kinetic branch from fb1a739 to dc408ec Compare October 23, 2026 09:44
matt-pharr and others added 2 commits October 23, 2026 11:52
…EulerLagrangeProblem)

solve() rejected every kinetic_factor > 0, although the "fixed" source builds
its matrices without kinetic profiles. Only kinetic_source = "calculated" is
now refused. Align the Riccati and Galerkin Forward-only error messages, and
add a deck/API parity test at kinetic_factor = 1e-3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… solves and describe the calculated kinetic source

solve() now rejects kinetic_factor > 0 with Riccati() or Galerkin() before the
metric and matrices are built, and the ForceFreeStatesControl docstring
describes what the "calculated" kinetic source is instead of calling it
unimplemented.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matt-pharr
matt-pharr force-pushed the feature/solve-fixed-kinetic branch from dc408ec to 0d7b8fe Compare October 23, 2026 09:52
…on instead of failing in the edge scan

solve_el never checked the solver's return code, so a solve that stopped short
(e.g. the step size underflowing) was stored as if it had reached the end of its
interval, and the forward sweep later failed in findmax_dW_edge! with a
MethodError. solve_el now errors with the ψ reached, the target and the return
code. Covers the forward solve and the Riccati propagator solves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read in full. Ready to approve from my read; nothing to add. The "fixed" source path genuinely never reads the placeholder control or the nothing profiles (the axis-validity boundary is only consulted on the "calculated" branch), and the three rejection tests match on message text so a reworded guard cannot pass by accident.

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 0d7b8fe on the comment review above. Nothing outstanding from my read.

@matt-pharr
matt-pharr merged commit 2842dfc into develop Oct 26, 2026
7 of 8 checks passed
@matt-pharr
matt-pharr deleted the feature/solve-fixed-kinetic branch October 26, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants