Calculating The Total Entropy Generated