Dynamic energy and mass flow optimisation models for the elaboration of cost functions for VOC and NOx emission reduction: methodological issues