Optimizing heater power in a thermal process