This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
Coulomb’s torsion balance experiments of 1785 established that two charges push or pull on each other with a force proportional to the product of the charges and inverse to the square of their distance. A box full of positive and negative point charges is the simplest picture of a classical plasma, and it shows two classic results of electrostatics. Earnshaw’s theorem (1842) states that no arrangement of charges is held in stable equilibrium by electrostatic forces alone, so any cluster of like charges flies apart unless something confines it. And opposite charges that are free to move find each other and neutralise, which in a real plasma is called recombination. Here 16 to 40 charges of unit mass move in a box of 800 by 800 pixels with elastic walls, every pair interacting.
What you see
Red dots are positive charges, blue dots negative ones, all of the same magnitude. Every preset starts with the charges at rest, so all motion comes from the Coulomb force. A light drag removes energy, and the charges settle into a final arrangement within about a minute.
Governing equation
Each charge feels the softened Coulomb force of all others and a linear drag,
with softening length pixels. The softening keeps the force finite: it vanishes at zero distance, so two opposite charges can pass through each other, and a pair sitting on top of each other has the lowest possible pair energy . The pair forces are summed directly over all pairs. The integrator is symplectic Euler with time step and 10 steps per frame, so one time unit takes 20 frames, a third of a second at 60 frames per second. Without drag it keeps the total energy constant to between 0.1 and 1.2 percent of the peak kinetic energy over a minute in all three presets.
Presets
Plasma: 20 positive and 20 negative charges at random positions. Neighbouring opposite charges fall toward each other within the first seconds, overshoot through the softened core and swing back. The drag drains this motion: after 10 seconds 14 of the 40 charges sit within 10 pixels of an opposite charge, after 30 seconds 38, after a minute 39, and the box is left with neutral pairs. Without drag the gas stays hot, and only 12 of 40 charges are paired after a minute.
Row of dipoles: eight pairs of opposite charges, 40 pixels apart, in a row with 80 pixels between neighbouring pairs. Each pair falls together within about a second, passes through itself and oscillates. The field of a neutral pair falls off as instead of , so the pairs hardly influence each other: no charge moves more than 35 pixels from its starting place, and after 30 seconds the oscillations have died out with the two charges of every pair less than 2 pixels apart.
Ring of like charges: 16 positive charges on a circle of radius 200 pixels. Nothing holds them together, so the ring expands, slowly at first, and the first charges reach the walls after 10 to 12 seconds. With drag the charges then come to rest along the walls: after a minute all 16 are within 11 pixels of a wall and the closest neighbours are 192 pixels apart, close to the 198 pixels of even spacing along the perimeter. It is the same reason why excess charge on a conductor gathers at its surface.
Parameters
Coulomb constant sets , the strength of the force between two unit charges. Larger values make every motion faster. It acts at once.
Drag sets . At 0 the energy is conserved and the charges never settle; at the default 0.05 the presets come to rest within a minute; larger values let them settle sooner. It acts at once.