calculate totalEnergy