Energy equation for the analysis of magnetization relaxation to equilibrium