Edge dW scan: unbracketed Newton in free_compute_wv_spline throws ConvergenceFailed

Đang mở
#648 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
julia

Hướng nghiên cứu

Read free_compute_wv_spline in src/ForceFreeStates/Free.jl and follow the call path through _handle_edge_dW_scan!, scan_edge_dW!, and findmax_dW_edge! in EulerLagrange.jl. Check how q_spline behaves over [dW_edge_scan_start, psilim], then reproduce the n = 1 edge scan if possible. Done means the scan completes when an unbracketed Newton solve would fail and existing converged cases retain the same roots.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Summary

free_compute_wv_spline (src/ForceFreeStates/Free.jl) inverts q(ψ) at each edge-scan node using an unbracketed Roots.Newton() started from a ψ-linear guess. On one equilibrium in a parameter scan, Newton did not converge. The whole run then aborted with Roots.ConvergenceFailed("Algorithm failed to converge") during the n = 1 edge δW scan.

The same code is still on develop, at about line 222.

Where

qi   = qedge + (intr.qlim - qedge) * ((i - 1) / npsi)
psii = ctrl.dW_edge_scan_start + (intr.psilim - ctrl.dW_edge_scan_start) * ((i - 1) / npsi)
psi_array[i] = find_zero((psi -> profiles.q_spline(psi) - qi, psi -> profiles.q_deriv(psi)),
                         psii, Roots.Newton())

Call path: _handle_edge_dW_scan! → scan_edge_dW! → findmax_dW_edge! (EulerLagrange.jl:1140) → free_compute_wv_spline (Free.jl:232).

Context

  • Build: 728a7e7d5 (develop).
  • Settings: n = 1, no wall, psihigh = 0.998, mpsi = 256, grid_type = "core_edge_packed", dW_edge_scan_start = 0.97, and psilim set from rational_offset_fraction = 0.2.
  • The equilibrium is an H-mode with q95 ≈ 4, where q rises steeply over the last few percent in ψ. The g-file's FPOL is single precision, and GPEC already warns about that.
  • The failure came from one point of a 96-point scan. Its neighbors, with slightly lower and slightly higher pedestal-region current, ran normally, so the failure looks like Newton's sensitivity to its starting guess rather than a bad equilibrium.
  • I can't attach the equilibrium publicly, but I can share it privately.

Likely cause

The target q values are spaced evenly in q, while the starting guesses are spaced evenly in ψ. Where q(ψ) is strongly convex near the edge, the guess sits far from the root. A Newton step can then overshoot past psilim, into the spline's ExtendExtrap region, or oscillate.

Suggested fix

Over [dW_edge_scan_start, psilim], q is monotonic and the root is bracketed by construction. A bracketed solve would always converge:

psi_array[i] = find_zero(psi -> profiles.q_spline(psi) - qi,
                         (ctrl.dW_edge_scan_start, intr.psilim), Roots.Brent())

Alternatively, keep Newton and fall back to the bracketed solve when it fails. Wherever Newton converges today, either option returns the same root, so no existing result changes.

Ngôn ngữ chính
Julia
Star
11
Fork
7
Merge trung bình
3 ngày 11 giờ
Pull request đã merge (30 ngày)
68

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OpenFUSIONToolkit/GPEC

Tất cả issue của OpenFUSIONToolkit/GPEC

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.