Determining force from potential energy