Skip to content

Hou-Li-type exponential Hermite filter skipping n <= 2 (exposed spectrum) - #61

Open
rogeriojorge wants to merge 5 commits into
adaptive/p5-hypercollisionfrom
lane-a/hou-li-filter
Open

rogeriojorge wants to merge 5 commits into
adaptive/p5-hypercollisionfrom
lane-a/hou-li-filter

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Hou-Li-type exponential Hermite filter that skips n <= 2 (stacked on #60).

What

  • filter_spectrum(Nn, Nm, Np, order=36, keep=2) returns the exposed shape s(n) = (n/(N-1))**order for n > keep, and exactly 0 for n <= keep, summed over the velocity axes. Shape (Np, Nm, Nn), like hypercollision_spectrum.
  • exponential_filter(Ck, strength, s) applies exp(-strength*s) between steps. Hou & Li use strength = order = 36. With zero strength the state is returned unchanged, bitwise.
  • RHS form: pass s as "collision_matrix" with nu = rate. Over a time dt this is the filter with strength = rate*dt, and it needs no driver change.
  • With keep = 2, every moment of total degree <= 2 (density, momentum, full pressure tensor) is untouched for any basis centre and width.

Tests (local only) in tests/test_filter.py:

  • the spectrum values, shape and zero block;
  • bad order and keep values are refused;
  • zero strength is a bitwise identity;
  • low moments change by less than 1e-14 relative in a shifted, rescaled 3V basis while the tail is damped;
  • the RHS form equals -rate*s*C exactly.

Full suite at 7b94668: python -m pytest -q -n 2 tests gave 191 passed (macOS, Python 3.12, JAX 0.11.2, diffrax 0.7.2). GitHub CI does not run on PRs that do not target main.

Dependencies: #56–#60. Merge after #60.

Open question: default order 36 (Hou-Li) vs a gentler order for RHS use. The physics study using it, with strength and order varied, is in Dark-SPECTRAX branch lane-a.

…ectrum exposed

filter_spectrum(Nn, Nm, Np, order, keep=2) gives s(n) = (n/(N-1))**order for n > keep, summed over
axes; exponential_filter(Ck, strength, s) applies exp(-strength*s) between steps (zero strength is
bitwise identity). Passed as collision_matrix with nu = rate it is the equivalent RHS damping.
Moments of total degree <= 2 are untouched for any basis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant