Global and local optimization of food quality in batch thermal processes