Calculate Entropy Generation