How to optimize temperature in manufacturing