Current commercial vehicles' engines are complex systems with multiple degrees of freedom. In conjunction with current emissions regulations manufacturers are forced to combine highly developed engines with complex aftertreatment systems.A comprehensive simulation model including the engine and aftertreatment system has been set up in order to study and optimize the overall system. The model uses a phenomenological spray combustion model to predict fuel consumption and NO emissions. In addition physical models for the material temperatures and the reaction kinetics were generated for the aftertreatment system. Steady state and transient measurements were used to calibrate the engine as well as the aftertreatment model.The aim for a system-level optimization was a reduction of fuel consumption while meeting emission standards. Different parameters influencing the overall process of engine and aftertreatment have been chosen for optimization with parameter variations and the DoE method.Different configurations regarding length and insulation of the exhaust pipes have been studied and the best possible solution for reduction of NOx emissions has been evaluated.EGR temperature directly influences the engine process. The influence of EGR temperature on the overall process has been evaluated and the potential of reduced EGR temperature could be shown.Another important factor for the reduction of NOx is the volume of the catalyst brick which has been varied and optimized together with engine operating parameters using the neural-network-based model. Finally, reduced fuel consumption could be found taking into account emission restrictions.