Final version for energy balance, add the effect of specific heat