In this paper, we propose a control Lyapunov function based on a nonlinear controller for a turbocharged diesel engine. A model-based approach is used which predicts the experimentally observed engine performance for a biodiesel. The basic idea is to develop an inverse optimal control and to employ a Lyapunov function in order to achieve good performances. The obtained controller gain guarantees the global convergence of the system and regulates the flows for the variable geometry turbocharger as well as exhaust gas recirculation systems in order to minimize the N Ox emission and the smoke of a biodiesel engine. Simulation of the control performances based on professional software and experimental results show the effectiveness of this approach.