Thermal efficiency of a heat engine