[WIP] Add automated dispersion check to ohm_solver_em_modes analysis - #7060
Open
RemiLehe wants to merge 1 commit into
Open
[WIP] Add automated dispersion check to ohm_solver_em_modes analysis#7060RemiLehe wants to merge 1 commit into
RemiLehe wants to merge 1 commit into
Conversation
The parallel EM-modes (Alfven/whistler) analysis previously only produced a (k, omega) spectrum plot with the analytic R/L dispersion curves overlaid, requiring a human to visually confirm the physics. The only automated CI gate was the checksum regression, which validates reproducibility but not correctness of the dispersion relation. This adds check_parallel_dispersion(), which quantitatively verifies that, for the B_dir='z' case, spectral power peaks along the analytic R-mode dispersion (k l_i)^2 = (w/w_ci)^2 / (1 + w/w_ci) in the positive-frequency / positive-wavenumber quadrant (where the right-hand polarized component lives). It asserts on the median relative error in k, the fraction of frequency bands on the curve, and the peak signal-to-noise ratio. Validated on a local 1D run: median relative error 0.02, all bands within 15%, median SNR ~500 (well inside tolerances), while a phase-scrambled null spectrum correctly fails. The spectrum plot is still produced unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The parallel EM-modes (Alfven/whistler) analysis previously only produced a (k, omega) spectrum plot with the analytic R/L dispersion curves overlaid, requiring a human to visually confirm the physics. The only automated CI gate was the checksum regression, which validates reproducibility but not correctness of the dispersion relation.
This adds check_parallel_dispersion(), which quantitatively verifies that, for the B_dir='z' case, spectral power peaks along the analytic R-mode dispersion (k l_i)^2 = (w/w_ci)^2 / (1 + w/w_ci) in the positive-frequency / positive-wavenumber quadrant (where the right-hand polarized component lives). It asserts on the median relative error in k, the fraction of frequency bands on the curve, and the peak signal-to-noise ratio.
Validated on a local 1D run: median relative error 0.02, all bands within 15%, median SNR ~500 (well inside tolerances), while a phase-scrambled null spectrum correctly fails. The spectrum plot is still produced unchanged.