Skip to content

NTV torque psi-quadrature over-refines at rational surfaces, dominating runtime #303

Description

@d-burg

In KineticForces, the outer psi-integration of the NTV torque integrand tpsi(psi)
uses adaptive quadrature. The integrand has near-singular resonant peaks at each
rational surface, and the adaptive quadrature over-refines there with no maxevals
cap, dominating runtime (about 30 min for a single n=1 case vs about 2 min for the
rest of the pipeline). Instrumentation showed ~1375+ tpsi evaluations clustered at
the rational surfaces (q = 2,3,4,5,6).

Proper fix: panel the psi-integral at the rational surfaces (handle the integrable
resonant peaks per-interval) rather than brute-force adaptive refinement; optionally
add a maxevals cap.

Interim mitigation already applied to the DIII-D-like example: relaxed
atol_psi / rtol_psi to 1e-2 (about 4x faster) and removed leftover per-evaluation
debug prints in Torque.jl.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions