A molecular-dynamics simulation that runs in this page. Atoms interact through a real Lennard-Jones potential, the force field they generate is drawn as you watch, and temperature is a dial you turn.
The interaction
Every pair of atoms feels one curve: hard repulsion when their electron clouds overlap, a shallow attractive well beyond it. That single shape, summed over neighbours, is enough to produce solids, liquids, gases, and the transitions between them.
The force field
The background wash and the arrows are not decoration. At every grid point the simulation drops in a test atom and measures what it would feel — the potential U and the force −∇U. That vector field is exactly what a machine-learned interatomic potential is trained to reproduce.
The temperature
Temperature here is not a slider on an animation speed — it is the width of the velocity distribution, maintained by a Langevin thermostat. Raise it and the lattice melts; the speed histogram tracks the Maxwell–Boltzmann curve while it happens.
Run it
Pick a starting state, then push it around. Drag an atom and feel the neighbours resist;
switch the pointer to the heat brush and melt a hole in a crystal. Everything on this page
is measured from the same trajectory, live — nothing is pre-recorded.
Run
Temperature script
A temperature ramp is running — the target T* is being driven automatically. Move the temperature slider to take back control.
Your system asks for reduced motion, so the simulation starts paused. Press Run when you want it moving.
The integrator went unstable and the system was rebuilt. That happens when the timestep is too long for the forces in play — shorten Δt, or switch the thermostat back on.
Hover an atom for its speed, energy and net force; click to pin it, double-click to release.
Keyboard: space run/pause · ↑ ↓ temperature ·
S single step · R rebuild.
PointerHeat and cool scale velocities inside a small disc; the thermostat pulls the region back afterwards.
Thermodynamics
System
Density, atom count and boundary rebuild the box; everything else takes effect on the running system.
Temperature
—
Pressure
—
Energy / atom
—
Diffusion D
—
Density
—
Elapsed t*
—
—
Temperature against time
Instantaneous T* from the kinetic energy. It fluctuates around the target by roughly 1/√N — that noise is physical, not numerical.
Energy per atom
Kinetic, potential, and their sum, all in ε — one quantity, one axis. With the thermostat off, the total line should be flat.
kineticpotentialtotal
Speed distribution
Measured speeds of the majority species against the two-dimensional Maxwell–Boltzmann law p(v) ∝ v·exp(−mv²/2kBT) at the current temperature. Nothing fits it — they simply agree.
measuredMaxwell–Boltzmann
Radial distribution g(r)
How much more likely you are to find an atom at distance r than in an ideal gas. Sharp repeating peaks mean a crystal; one broad peak decaying to 1 means a liquid; flat at 1 means a gas.
Mean-square displacement
How far atoms wander from where they started. A straight line means diffusion, and its slope is 4D in two dimensions; a line that flattens means the atoms are trapped in a lattice.
The pair potential itself
U(r) and F(r) for the chosen pair, drawn as stacked panels on a shared
r axis — two different units never share one y scale. The orange dot follows the
nearest-neighbour distance of whichever atom you are hovering.
Every chart on this page has a table twin, so no value is reachable only by colour or hover.
Method
What the simulation actually does
This is a real molecular-dynamics code, only small and two-dimensional. It is worth being
precise about what it computes and what it leaves out.
The potential
Lennard-Jones, U(r) = 4ε[(σ/r)12 − (σ/r)6], truncated at
2.5 σij and shifted so the energy is continuous there. Unlike pairs mix by
Lorentz–Berthelot, σij = (σi+σj)/2 and
εij = √(εiεj), with the cross term scalable so you can
drive demixing. Molecules add harmonic bonds; the ionic preset adds damped shifted-force
electrostatics rather than an Ewald sum, which is the standard cheap choice for a cutoff
code.
The integrator and the thermostat
BAOAB Langevin dynamics with one force evaluation per step; at zero friction it collapses
to plain velocity Verlet, so "no thermostat" is genuinely constant-energy. Verified
head-less: total energy drifts by 0.02 % of the kinetic energy over 8 000 NVE steps and
the drift falls as Δt², the Langevin thermostat reproduces its target temperature to
better than 1 %, and heavy and light species come out at the same temperature, as
equipartition demands.
Units
Reduced Lennard-Jones units — lengths in σ, energies in ε, masses in m, and
kB = 1. The physical read-outs map those onto argon (ε/kB = 119.8 K,
σ = 3.4 Å, m = 39.95 u), which fixes the time unit at τ = σ√(m/ε) = 2.15 ps and
the force unit at ε/σ = 4.87 pN. Change the substance and only the labels change; the
trajectory is identical.
What it is not
Two dimensions, not three: the phase diagram is qualitatively right but the numbers are
not argon's, and true long-range order is forbidden in 2D. There are no electrons, so no
bond breaking, no polarisation, no chemistry. A few hundred atoms is far below what a
finite-size study would need. It is a demonstration of mechanism, not a production
calculation.
Why this sits on a materials-ML page
A machine-learned interatomic potential has exactly one job: given the positions of the
atoms, return the energy and the forces — the two fields this page draws. Everything
downstream, every melting point and diffusion coefficient and phase boundary, comes from
integrating those forces. Watching a hand-written potential produce a melting transition
makes it concrete what a learned potential has to get right, and why force errors of a few
meV/Å are the currency of the field. The companion
force-field family tree
maps the methods that learn them.