You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
auto mpsi under-resolves the edge, giving spurious dW and Delta-prime #302
With grid_type = log_asymptotic and automatic radial resolution (mpsi = 0), the
optimal-mpsi heuristic allocates very few edge grid points (about a dozen near the
boundary). The resulting edge under-resolution produces spurious ideal dW and
Delta-prime values, especially when a near-separatrix rational surface is captured.
Workaround: set a fixed mpsi (e.g. mpsi = 256), which resolves the edge and gives
stable dW / Delta-prime.
The fix should make the automatic mpsi selection allocate adequate edge resolution
(or warn when the edge is under-resolved). Note this is an auto-mpsi problem, not
log_asymptotic itself: log_asymptotic with a fixed mpsi is fine.
@logan-nc I scanned psi_accuracy with log_asymptotic + auto-mpsi and compared against ldp + fixed mpsi=256, checking the least-stable eigenvalue et[1] (the correct value, cross-checked against fortran DCON and the parallel-integration test, is ~0.80):
grid / setting
N_edge
mpsi
et[1]
ldp, mpsi=256
—
256
0.8006
correct
log_asymptotic auto, psi_accuracy=1e-3 (default)
5
210
0.6851
wrong, −14%
log_asymptotic auto, psi_accuracy=1e-4
8
631
0.8074
~ok
log_asymptotic auto, psi_accuracy=1e-5
13
1012
0.8020
converged
log_asymptotic auto, psi_accuracy=1e-6
23
1060
0.8021
converged
So you were right that psi_accuracy is the knob -- the default 1e-3 insufficiently populates the edge (N_edge=5) and gives a spurious δW, tightening to 1e-5 converges to the ldp value.
Cost is the problem -- the converged auto-grid needs mpsi ≈ 1012, and that total is dominated by N_mid=950, not the edge. The edge count grows much more slowly with psi_accuracy than the mid does, so to get enough edge points you over-resolve the mid and end up ~4x the total knots for the same answer that ldp gets in 256. In other words the inefficiency here is the N_edge/N_mid imbalance in make_optimal_mpsi, not core-packing in ldp.
Until this issue is resolved in a new PR, I'll keep ldp + fixed mpsi=256 for the baseline in our #295 merge since it's both correct and ~4x cheaper. Once auto-mpsi resolves the edge efficiently, log_asymptotic + auto-mpsi can go back to being the default and I'll re-pin the regression. Does this sound good to you?
Activity
EQUIL - IMPROVEMENT - Update DIII-D-like example: edge-matched equili…
d-burg commentedon Jun 25, 2026
@logan-nc I scanned
psi_accuracywithlog_asymptotic+ auto-mpsi and compared againstldp+ fixedmpsi=256, checking the least-stable eigenvalue et[1] (the correct value, cross-checked against fortran DCON and the parallel-integration test, is ~0.80):So you were right that
psi_accuracyis the knob -- the default 1e-3 insufficiently populates the edge (N_edge=5) and gives a spurious δW, tightening to 1e-5 converges to theldpvalue.Cost is the problem -- the converged auto-grid needs mpsi ≈ 1012, and that total is dominated by N_mid=950, not the edge. The edge count grows much more slowly with
psi_accuracythan the mid does, so to get enough edge points you over-resolve the mid and end up ~4x the total knots for the same answer thatldpgets in 256. In other words the inefficiency here is the N_edge/N_mid imbalance inmake_optimal_mpsi, not core-packing inldp.Until this issue is resolved in a new PR, I'll keep
ldp+ fixedmpsi=256for the baseline in our #295 merge since it's both correct and ~4x cheaper. Once auto-mpsi resolves the edge efficiently,log_asymptotic+ auto-mpsi can go back to being the default and I'll re-pin the regression. Does this sound good to you?