Coulomb explosion
A cold cloud of charge of one sign blows itself apart, and the tree follows it outward.
A cylinder of ions with no electrons to hold it together accelerates outward under its own space charge. With line charges (kernel="log", the 2D field 2 k_e Q(r) / r of the charge Q(r) inside a radius) a cold shell starting at r0 keeps its enclosed charge until another shell overtakes it, and then moves exactly: r = r0 f(t) with f'' = kappa / f, kappa = 2 k_e (q/m) Q(r0) / r0^2, so that t = sqrt(2 / kappa) (sqrt(pi) / 2) erfi(sqrt(ln f)). A uniform disk has the same kappa for every shell: it expands self-similarly and stays uniform. A Gaussian cloud has a larger kappa inside than outside, so the inner shells catch up with the outer ones: the flow folds over in phase space (wave breaking) and a dense shell, a collisionless shock, runs out at the edge of the cloud. Units k_e = q/m = 1, total charge 1, particles started on rings of equal charge (a quiet start); the fields come from the FMM of ElectrostaticSimulation(kernel="log", method="fmm").
Source: examples/coulomb_explosion.py. Run it yourself with python examples/coulomb_explosion.py [--output examples/output] [--quick] (needs pip install "tree-d-3d[examples]").
Animations
Section titled “Animations”
Loading figure…the Gaussian cloud exploding, with the cells of the quadtree the FMM builds every step; the particles are colored by their starting radius (blue inside, red outside, by the charge inside their starting radius), so the inner shells can be seen overtaking the outer ones. The tree is deepest where the charge piles up, in the shock.
Figures
Section titled “Figures”
Loading figure…the rms radius of the uniform disk against the exact self-similar solution, and their relative difference (the FMM’s truncation and the softening).

Loading figure…radius against radial velocity of the Gaussian cloud at four times, against the cold single-stream solution. Before the breaking time the particles lie on the curve; after it the exact curve folds back on itself (three streams at one radius), and the particles that have crossed feel a changed enclosed charge, so they leave it.

Loading figure…the charge density of the Gaussian cloud against radius, at the start and at the end: the peak at the edge is the shock.
--quick uses fewer particles (well under a minute); --smoke is the tiny configuration the test suite runs. Needs Plotly (pip install 'tree-d-3d[examples]').