Skip to content

Moving Hermite basis 2/5: exact moving-basis terms and the fused pump frame - #57

Open
rogeriojorge wants to merge 2 commits into
adaptive/p1-basis-statefrom
adaptive/p2-moving-terms
Open

rogeriojorge wants to merge 2 commits into
adaptive/p1-basis-statefrom
adaptive/p2-moving-terms

Conversation

@rogeriojorge

Copy link
Copy Markdown
Member

Adds the exact rates for a moving and rescaled basis, and an oscillating-centre (pump) frame.

basis_rate_terms. Per axis, with C = n* g/(a_x a_y a_z):

-(u_dot/a) sqrt(2n) C_{n-1} - (a_dot/a)[(n+1) C_n + sqrt(n(n-1)) C_{n-2}]
  • In g this is -(a_dot/a)[n g_n + ...]. The +1 comes from the 1/a normalization.
  • Both terms only lower the index, so no closure is needed.

Pump frame.

  • uniform_acceleration returns u_dot = (q/m)(E0 + u x B0) and the uniform field F0.
  • Hermite_Fourier_system(..., F0=F0) uses E - E0 and u x (B - B0), so the shift and the uniform force cancel identically.
  • simulation(frame="pump") moves each centre this way. Width changes go through the remap (PR 3/5), not a continuous a_dot.
  • F0=None (the default) is bitwise the previous kernel.

Tested SHA 39987bf. Command: python -m pytest -q -n 2 tests. Result: 158 passed.

New tests:

  • basis_rate_terms matches 4th-order finite differences of exact quadrature projections of a non-Gaussian 3V f onto a moving, rescaled basis (all three axes, unequal orders) to 1e-10 relative.
  • The fused force equals the full force plus the shift term to 1e-12 (random 3-species state, uniform E and B).
  • Uniform electron-ion plasma oscillation in the pump frame to t = 1000:
    • g stays delta_n0 for both species to 1e-13;
    • the centres follow the analytic two-fluid solution to 1e-8;
    • total energy is conserved to 3e-9 at tolerance 1e-12, with 3.6k steps. The same run in a fixed basis needs 22.5k steps and drifts 2e-11.

Stack: base adaptive/base = integration/dark-baseline 9d0982d (main ab87385 + #48, #46, #13, #12, #9, #55, #50, #44, #18, #51). This lands on main after those foundation PRs and the earlier PRs of this stack (#56 first). Local results only (macOS, Python 3.12, JAX 0.11.2, x64); GitHub CI on this branch has not been checked yet.

basis_rate_terms gives the exact closure-free coefficient rates of a moving and
rescaled basis: -(u_dot/a) sqrt(2n) C_{n-1} - (a_dot/a)[(n+1) C_n + sqrt(n(n-1)) C_{n-2}]
per axis (the n+1 is the 1/a normalization of C). uniform_acceleration returns
u_dot = (q/m)(E0 + u x B0) and the uniform field F0; Hermite_Fourier_system(F0=...)
removes that force, so the shift and the uniform force cancel identically.
simulation(frame='pump') moves each species centre this way.
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