Calculate Entropy and Internal Energy