Calculation of overall energy change