Calculation of total energy

Calculation of total energy