A 1 in diameter steel rod (A=0.785 in², E=29,000 ksi) 10 ft long carries 15 kips. σ=15/0.785=19.1 ksi and δ=15×120/(0.785×29,000)=0.079 in. L goes in inches because E is in ksi.
Now the same rod sits between rigid walls with a 0.02 in gap, unloaded, and warms 50°F (α=6.5×10−6 /°F). Free expansion would be 6.5×10−6×120×50=0.039 in. The first 0.02 in closes the gap; the remaining 0.019 in is prevented, so σ=E⋅δ/L=29,000×0.019/120=4.6 ksi compression.
Check it stuck: a set from Mechanics of Materials, the knowledge area this unit teaches.