Calculation of Internal Energy