App 19 — Energy & Forces Sandbox
Drag atoms in a small toy crystal and watch predicted energy and force vectors update live — forces are computed as F = −∂E/∂r, never written by hand
Drag any atom to displace it
Atomic positions & force vectors
Green arrows show the force on each atom — they always point toward lower energy (steepest descent direction)
The relation in action
# Lennard-Jones-style toy potential
E = Σ_pairs 4ε[(σ/r)¹² − (σ/r)⁶]
# Force on atom i — autodiff, never hand-coded
F_i = −∂E/∂r_i