Equilibrium - BUGFIX - Converge PEST Δ′ in the radial grid
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 6/100
Hướng nghiên cứu
The defect sits in the Jacobian formula in DirectEquilibrium.jl (equilibrium_solver), with the same check needed in arclength_fieldline_int in DirectEquilibriumArcLength.jl. Start by reproducing the mpsi 256 vs 1024 table for PEST and hamada on the Solovev case. Done means PEST and hamada Δ′ agree to 1e-3 relative and are flat in mpsi, with the harness re-pinned.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
On a direct (traced) equilibrium, Δ′ in PEST coordinates does not converge as mpsi grows. The same equilibrium in hamada coordinates does. Δ′ at Mercier index α is sensitive to coefficient error at the surface, amplified by roughly x^(−2α), so a small geometry error that is invisible in the energies shows up in Δ′.
Solovev, q0 = 1.2 (one rational at q = 2, α = 0.886), wall a = 0.05, etol 1e-10, eulerlagrange_tolerance 1e-12, Riccati, ldp grid. Run on #398's head (81006c3a6):
| mpsi | hamada | PEST | PEST + direct J |
|---|---|---|---|
| 256 | −148.86 | −151.76 | −151.90 |
| 1024 | −149.81 | −129.21 | −135.20 |
- Hamada moves 0.6% from 256 to 1024. PEST moves 15%, in the wrong direction.
- et₁ agrees across all six runs to 2e-6, so this is a Δ′-only defect.
- The exact-coefficient reference for this case is −150.73 (local analytic patch, settings differ slightly).
Likely sources
- J from a spline θ-derivative. PEST forms the Jacobian as
(1 + ff_deriv_val[4]) * y_out[end, 2] * 2π * psio(DirectEquilibrium.jl,equilibrium_solver), i.e. by differentiating a periodic cubic spline of ∫dl/B_p. Hamada does not need that derivative. Before #398, ⟨∂J/∂ψ⟩ from this formula was off by 88% rms against the exact Solovev value. - θ resolution of the traced surface. After #398 each surface is sampled only at the
mtheta + 1straight-fieldline nodes. A prototype that fixed this case to ≤1e-4 across mpsi 128–2048 in both PEST and hamada used 2048 field-line points per surface plus direct J. On #398, direct J alone recovers about a third of the gap at mpsi 1024.
Suggested approach
- Compute J directly at each θ node from the field there: J = 2π ψ₀ ∮(w dl/B_p) / w(θ), where w is the Jacobian weight (
power_bp,power_b,power_r,power_rc). Snippet below; it is a drop-in replacement for the one line above. - Then find the remaining error: rerun the table with
mthetadoubled and quadrupled, and with a tighter dense-output tolerance on the field-line solve. Whichever closes the PEST/hamada gap at mpsi 1024 is the second half of the fix. - Check
arclength_fieldline_int(DirectEquilibriumArcLength.jl) gets the same J.
rfac_j = sqrt(max(ff_val[1], 0.0)); eta_j = 2π * (theta + ff_val[2])
r_j = ro + rfac_j * cos(eta_j); z_j = zo + rfac_j * sin(eta_j)
direct_get_bfield!(bf_j, r_j, z_j, raw_profile.psi_in, raw_profile.sq_in, sqd_j, psio; derivs=1)
bp_j = sqrt(bf_j.br^2 + bf_j.bz^2); b_j = sqrt(bp_j^2 + (bf_j.f / r_j)^2)
w_j = bp_j^equil_params.power_bp * b_j^equil_params.power_b / (r_j^equil_params.power_r * rfac_j^equil_params.power_rc)
rzphi_nodes[ipsi, itheta, 4] = y_out[end, 5] / w_j * 2π * psio
(bf_j = DirectBField() and sqd_j = deriv1(raw_profile.sq_in) are allocated once before the ψ loop.)
Acceptance
- Solovev α 0.89: PEST and hamada Δ′ agree to ≤1e-3 relative at mpsi 256 and 1024, and each is flat in mpsi to the same level.
- DIII-D-like n = 1 Riccati: PEST and hamada Δ′ agree on all five surfaces once #506's profiles are in.
- Every direct-equilibrium PEST result moves, so the PR takes
!and re-pins the harness.
Dependencies
- Stacks on #398 (common straight-fieldline sampling; approved, needs its conflicts resolved). #398 removes the sparse-sampling noise that dominated before; this issue is what is left.
- Independent of #506 (#504), #517 and the crossing work (#481).
- Ngôn ngữ chính
- Julia
- Star
- 11
- Fork
- 7
- Merge trung bình
- 4 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 70
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenFUSIONToolkit/GPEC
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
OpenFUSIONToolkit/GPEC#644 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
OpenFUSIONToolkit/GPEC#643 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
PerturbedEquilibrium - FEATURE - Complete the resistive perturbed-equilibrium workflow from Galerkin and matched resultsCó thể đã có người làm @matt-pharr đã nhận 1 ngày trước. Đang mởfeature
OpenFUSIONToolkit/GPEC#635 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
test
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
OpenFUSIONToolkit/GPEC#633 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Tearing - FEATURE - Add a general modified Rutherford equation for island evolutionCó thể đã có người làm @StuartBenjamin đã nhận 1 ngày trước. Đang mởfeature
OpenFUSIONToolkit/GPEC#630 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của OpenFUSIONToolkit/GPEC
Issue tương tự
-
`ShallowWaterModel` allocates ~9 KiB per grid point per RK3 stage on the CPUCó thể đã có người làm @ali-ramadhan đã nhận hôm nay. Đang mởperformance 🏍️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CliMA/Oceananigans.jl#6421 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NCAR/musica#1118 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`AMSGrad` state starts at `epsilon` instead of zero, so zero gradients move parameters and small gradients are dampedCó thể đã có người làm @parth-patel010 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FluxML/Optimisers.jl#247 · 1 bình luận ·
-
README should say that row and column order must matchCó thể đã có người làm @SAUMYARSH đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
-
An unknown `wellformed` level is accepted, so a misspelled `:strict` skips the strict checksĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày