Calculation of temperature change