A method for air path control of a diesel combustion engine, comprising an EGR valve and a VGT turbine, the method comprising: - providing a cost function of a measured delta pressure between engine intake and engine exhaust manifold; - estimating an NOx emission level in the engine outlet; - estimating an oxygen level in the engine outlet; - determining constraint functions of a distance between estimated NOx emission level, estimated oxygen level and turbine speed, and a maximum turbine speed, a maximum NOx emission level and a minimum oxygen level respectively; - determining a gradient of the cost function as a function of a delta pressure set point; - determining a gradient of the constraint functions as a function of estimated NOx emission level, turbine speed and oxygen level; - real time controlling the NOx emission level and delta pressure to respective desired NOx and delta pressure set points by adjusting the EGR valve and/or the VGT turbine, - wherein the delta pressure set point is adjusted according to an integration of a gradient direction of the cost function selected from the determined one or more of the gradients, o wherein the determined gradients are prioritized in the order of turbine speed, oxygen level and NOx emission level and o wherein NOx emission level and or a turbine speed and or oxygen levels are constrained; and - wherein the adjusted delta pressure set point is perturbed in an extremum seeking operation on the cost function and wherein the gradient is selected as being the most sensitive to the perturbation. - providing a cost function of a measured delta pressure between engine intake and engine exhaust manifold; - estimating an NOx emission level in the engine outlet; - estimating an oxygen level in the engine outlet; - determining constraint functions of a distance between estimated NOx emission level, estimated oxygen level and turbine speed, and a maximum turbine speed, a maximum NOx emission level and a minimum oxygen level respectively; - determining a gradient of the cost function as a function of a delta pressure set point; - determining a gradient of the constraint functions as a function of estimated NOx emission level, turbine speed and oxygen level; - real time controlling the NOx emission level and delta pressure to respective desired NOx and delta pressure set points by adjusting the EGR valve and/or the VGT turbine, - wherein the delta pressure set point is adjusted according to an integration of a gradient direction of the cost function selected from the determined one or more of the gradients, o wherein the determined gradients are prioritized in the order of turbine speed, oxygen level and NOx emission level and o wherein NOx emission level and or a turbine speed and or oxygen levels are constrained; and o wherein the determined gradients are prioritized in the order of turbine speed, oxygen level and NOx emission level and o wherein NOx emission level and or a turbine speed and or oxygen levels are constrained; and - wherein the adjusted delta pressure set point is perturbed in an extremum seeking operation on the cost function and wherein the gradient is selected as being the most sensitive to the perturbation.