How this works

A 1D electrostatic particle-in-cell (PIC) solver tracks thousands of macro-particles split into two counter-streaming beams over a uniform neutralizing ion background. Each step: charge is deposited to a grid, the field is found from Gauss's law by direct integration, the field is gathered back to each particle, and particles are pushed with their charge-to-mass ratio.

The left panel is phase space — position on the horizontal axis, velocity on the vertical axis. The two beams start as flat horizontal bands; a resonant ripple grows and the bands fold into the characteristic "cat's eye" vortex of the nonlinear two-stream instability. The right panel plots total electrostatic field energy on a log scale, which should rise in a straight line during the linear growth phase before saturating once the beams trap each other.