Repository navigation
Dougherty: Francisquez LBO-G cross-species moments (dougherty_g, beta) - #73
Open
rogeriojorge wants to merge 65 commits into
Open
rogeriojorge wants to merge 65 commits into
rogeriojorge wants to merge 65 commits into
Conversation
…ion/dark-baseline
…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.
A [species.<name>] table with charge, mass, density, vth, drift and an optional density perturbation replaces hand-built Hermite-Fourier coefficients. The electric field solves Gauss's law, and Ns, qs, Omega_cs, alpha_s and u_s follow from the species. Old-style TOML files are unchanged.
plot(output) shows the field and kinetic energy exchange, energy conservation, the strongest field modes, the Hermite spectrum of each species over time, the phase-space perturbation of each species and, in 2D, the field in the plane. The CLI saves input.png next to the TOML. diagnostics now also returns electric_energy and magnetic_energy.
Landau damping and two-stream are described entirely in their TOML files and run with spectrax input.toml; their scripts shrink to a few lines. The growth- and damping-rate scans reuse those files through load_parameters overrides, so two duplicated TOML files and their index arithmetic go away.
…dth-and-bump-example
…ation/dark-baseline
With adaptive_time_step=False and many saves on step ends, Diffrax 0.7.2 RecursiveCheckpointAdjoint gives gradients a few percent off (2.5% for 201 saves at dt = 0.01). Add a strict-xfail regression test against ForwardMode, a passing test of the exact workaround (checkpoints = max_steps) and a docstring warning.
ode_rtol and ode_atol default to ode_tolerance, so existing runs are bitwise unchanged. FlooredPIDController adds an absolute error floor per state component (pytree, None = no floor) so round-off far below a component's own scale cannot drive the step size; floor=None is exactly PIDController.
twothirds_mask and rfft_weights alias the internal functions so companion codes and user diagnostics need not import private names.
…to integration/dark-baseline
…egration/dark-baseline
…ugherty_g) #71's default is the LBO-EM form (momentum rate matches Morse, temperature-difference rate 2x Morse). LBO-G with beta=0 matches both; opt-in, default unchanged bitwise.
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.
Compares #71 with Francisquez, Juno, Hakim, Hammett, Ernst, JPP 88, 905880303 (arXiv:2109.10381).
Tests: conservation (pair and spectral, round-off), eq 2.8/2.9 formulas, Morse rates (EM = 2x, G = 1x), end-to-end temperature relaxation at the Morse rate, TOML.