Atoms interacting through the Lennard-Jones potential, integrated with the Verlet algorithm. Start as a crystal, then heat it to melt into a liquid, or cool the liquid and watch it re-freeze. Colour shows particle speed. Ported from my undergrad computational-physics C/OpenGL coursework.
Temperature vs time
Quench the liquid fast and it can stay liquid below its freezing point, then snap into a solid all at once.
Why it lagsLeft to crystallise, atoms settle into a triangular lattice, each ringed by six neighbours: the densest 2D packing.
…and its defectsIn the crystal atoms only vibrate in place; melt it and they wander past one another. That wandering is what a liquid is.
The difference