Skip to content

RDCON - BUGFIX - Galerkin vacuum matrix keeps its imaginary part - #310

Merged
matt-pharr merged 1 commit into
developfrom
bugfix/rdcon-galerkin-complex-wv
Oct 15, 2026
Merged

matt-pharr merged 1 commit into
developfrom
bugfix/rdcon-galerkin-complex-wv

Conversation

@StuartBenjamin

@StuartBenjamin StuartBenjamin commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #295 (this PR's base branch): merge after it.

RDCON's Galerkin Δ′ uses a real vacuum matrix. free_get_wvac calls mscvac with complex_flag=.FALSE., so the Galerkin edge condition sees only Re(W_v). On an up-down asymmetric equilibrium Im(W_v) is not small, and the free-boundary Δ′ comes out wrong. This is the Galerkin counterpart of the STRIDE complex_flag change in #295, and it builds on #295's conjugation (without it, the imaginary part would enter in the wrong frame). It is a one-line change.

Evidence (TokaMaker DIII-D-like H-mode i-file, n = 1, mpsi 512, mtheta 512, no wall):

Δ′(2/1) Δ′(3/1)
RDCON, develop + #295 8.139 −3.988
RDCON, this PR 8.167 −3.935
STRIDE, develop + #295 (reference) 8.172 −3.936

Stock examples: solovev_resistive (up-down symmetric, so Im(W_v) = 0) gives a byte-identical delta_gw.out. DIIID_resistive runs with rpec_flag, which replaces the vacuum edge, so its outputs are unchanged as well.


🤖 Generated with Claude Code

free_get_wvac called mscvac with complex_flag=.FALSE., so the Galerkin Delta' saw only Re(wv) and, on up-down asymmetric equilibria, missed the frame fix of the previous commits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@StuartBenjamin StuartBenjamin self-assigned this Oct 13, 2026
@StuartBenjamin
StuartBenjamin marked this pull request as ready for review October 13, 2026 21:23
@matt-pharr
matt-pharr changed the base branch from bugfix/dcon-vacuum-theta-frame to develop October 15, 2026 09:38

@matt-pharr matt-pharr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the record, not using an i-file does not produce quite as clean agreement between rdcon and stride, though this PR does move us monotonically towards stride:


Δ′ results (DIII-D resistive example, rpec_flag=f, mpsi=512, mtheta=512; STRIDE with dmlim and mthvac matched to RDCON)

q=2 q=3
RDCON before, LU 7.031 (−2.04 %) −3.774 (−16.5 %)
RDCON PR, LU 7.060 (−1.63 %) −3.729 (−15.1 %)
RDCON before, Cholesky 7.038 (−1.94 %) −3.431 (−5.9 %)
RDCON PR, Cholesky 7.065 (−1.57 %) −3.397 (−4.9 %)
STRIDE (reference) 7.178 −3.239

However, this is a correct change and I do not see anything downstream that this might break so I am going to approve + merge to develop.

@matt-pharr
matt-pharr merged commit fbe6e91 into develop Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants