Finding the equilibrium state of a physical system by minimizing its potential energy