How To Calculate Total Energy