A computational model for the mathematical simulation of the working cycle of diesel engines is presented. The modeling considers the processes taking place in the cylinder as well as in the admission and exhaust ducts. The simulation of the processes in the cylinder is formulated according to the single zone combustion model and assuming chemical equilibrium in the species of the working fluid. This model can be applied to simulate engine using hydrocarbon fuels having carbon, hydrogen, oxygen and nitrogen in its molecular structure. The possibility of the air humity variation was also considered in the model. The processes in the admission and exhaust ducts were simulated by assuming that the flows in the ducts are unidimensional and the method of characteristics was employed to solve the partial differential equations that govern the propagation of the perturbations in a compressible medium. The model takes into account the heat transfer and friction between the gas and the ducts walls. Results are presented for a single cylinder diesel engine. A parametric study was conducted to evaluate the influence of the engine speed, the air-fuel ratio, the valve timing and the admission duct length on the engine performance and efficiency.