NOx and N2O formation in HCCI engines