How To Calculate Entropy Generation