Repository navigation
Maxwellians narrower than their Hermite basis, and a bump-on-tail example - #51
Open
rogeriojorge wants to merge 5 commits into
Open
rogeriojorge wants to merge 5 commits into
rogeriojorge wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This was referenced Sep 26, 2026
vth_s (default alpha/sqrt(2), the previous behaviour) gives the closed form c^n H_n(d/c) / sqrt(2^n n!) with c^2 = 1 - 2 vth^2 / alpha^2, computed by a three-term recurrence (no factorials). A thin beam can then share a wide basis, where its expansion stays convergent as it spreads.
The unrolled loop compiled in 21 s at Nn=256; the scan compiles in well under a second. Adds a finiteness test at Nn=256.
…vth < alpha/sqrt(2) The expansion of a Maxwellian of standard deviation vth in the basis with weight exp(-(v-u)^2/alpha^2) converges in that weighted norm iff vth < alpha; the coefficients decay like |1 - 2 vth^2/alpha^2|^(n/2). The matched Maxwellian has vth = alpha/sqrt(2), so broader-than-matched Maxwellians are admissible. Tests project shifted, anisotropic two-species Maxwellians with vth/alpha = 0.5, 1/sqrt(2), 0.85, 0.95 onto the basis by independent quadrature (Nn = 96), check the predicted decay rate, and show the series stops converging at vth = alpha. The bump-on-tail example's growth line is labelled as linear theory for orientation, not as evidence of nonlinear convergence.
rogeriojorge
force-pushed
the
feature/maxwellian-width-and-bump-example
branch
from
October 3, 2026 14:40
ff6a0a0 to
30e67c4
Compare
This was referenced Oct 4, 2026
…dth-and-bump-example
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.
Target: main. Head:
30e67c4(rebased on mainab87385; old headff6a0a0). No dependencies. Supersedes #24.Problem
compute_C_nmpassumed every Maxwellian has exactly its basis width.Change
compute_C_nmp(..., vth_s=None)takes physical thermal speeds separately from the basis widthsalpha_s. The defaultalpha_s/√2keeps the previous result.cⁿHₙ(d/c)/√(2ⁿn!), withc² = 1 − 2vₜ²/α², come from a three-term recurrence run as alax.scan. There are no factorials, and compile time does not depend on Nn.exp(-(v-u)²/α²). A Maxwellian of standard deviation σ has finite weighted norm∫ f²/F_biff σ < α, and its normalised coefficients decay like|1 − 2σ²/α²|^(n/2).Examples/1D_bump_on_tail.py(Nx 33, Nn 128, ν = 3, t = 100; about 9 s on a laptop CPU).Tests (local, macOS CPU, Python 3.12, jax 0.11.2, at
30e67c4)python -m pytest -q -n 2 tests: 19 passed.Tests in
tests/test_initialize_maxwellian.py:alpha_s/√2reproduce the old formula (rtol 1e-12).C_nmpequals the product of 1D coefficients projected by independent quadrature, to 1e-11 of the maximum.√|1−2σ²/α²|within 10%.Σ|g|²keeps growing.Example run:
python Examples/1D_bump_on_tail.pygives max|E_k| = 0.5298 and min f = −0.019, in 8.5 s wall time. This is a single resolution and not a convergence study.GitHub CI: see the checks on this head. The local results above are not CI results.
Owner decision
Please personally check the weighted-norm statement and the test fixtures before merging.