Calculation of thermal expansion