NSE EOS Jacobians use cubic derivatives when linear interpolation is selected
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 74/100
Research direction
Start in nse_tabular/nse_table.H at the affected ranges 429-440, 496-539, and 549-592, then trace the callers in nse_tabular/nse_eos.H. Reproduce the reported derivatives at the supplied T, rho, and Ye with linear interpolation, and verify finite-difference checks in both linear and cubic modes away from cell boundaries.
Written by the indexing model from the issue text.
Description
Reviewed commit: 3ac0bda4f00da3eed0446beadfc1cd5c51b99a40
Suggested priority: Medium
Affected code: nse_tabular/nse_table.H:429-440, nse_tabular/nse_table.H:496-539, nse_tabular/nse_table.H:549-592; callers in nse_tabular/nse_eos.H.
Description
nse_interp() honors network.nse_table_interp_linear, but nse_interp_dT() and nse_interp_drho() always differentiate the cubic interpolant. The EOS inversion routines therefore use derivatives of a different composition function from the one used to evaluate their residuals.
Reproduction
Set linear interpolation and use T=5.18e9 K, rho=1.23e9 g/cm^3, Ye=0.472. Compare the returned abar derivatives to centered finite differences of nse_interp() with relative perturbation 1e-5:
| Derivative | Reported | Finite difference |
|---|---|---|
dabar/dT |
-1.072562604210832e-9 |
-1.097834698172967e-9 |
dabar/drho |
3.987522835638749e-10 |
4.095838820409504e-10 |
The discrepancies are approximately 2.3% and 2.6%. With cubic interpolation selected, the same check agrees closely.
Expected behavior / suggested fix
Differentiate the selected interpolant, or explicitly select matching value/derivative routines within the inversions. Add finite-difference checks in both modes, away from cell boundaries.
Impact and validation: An inconsistent Newton Jacobian can impair convergence. The derivative mismatch is reproduced; a linear-mode inversion failure is not claimed. See reproduction-output.txt
.
- Dominant language
- C++
- Stars
- 44
- Forks
- 47
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 10
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AMReX-Astro/Microphysics
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
AMReX-Astro/Microphysics#2104 · 3 comments ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 55/100
AMReX-Astro/Microphysics#2097 · 1 comment ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 72/100
AMReX-Astro/Microphysics#2096 ·
Maintainers usually reply within 1 day
-
ai-code-audit screening
Difficulty 4/5 3-5 days Newbie friendliness 66/100
AMReX-Astro/Microphysics#2095 · 1 comment ·
Maintainers usually reply within 1 day
-
ai-code-audit nse
Difficulty 3/5 1-2 days Newbie friendliness 68/100
AMReX-Astro/Microphysics#2075 ·
Maintainers usually reply within 1 day
All issues in AMReX-Astro/Microphysics
Similar issues
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusPossibly taken @leizhiyuan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/rocketmq-clients#1465 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
KhronosGroup/Vulkan-Tutorial#534 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
bug IO
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MrNeRF/LichtFeld-Studio#3824 ·
Maintainers usually reply within 1 day
-
pnnx: manual tanh GELU fusion loses the approximation modePossibly taken @ktz03 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Tencent/ncnn#7175 · 1 reaction ·
Maintainers usually reply within 1 day