In the course of drying process of crop it is expected to strive for reducing the outlet energy loss, which depends mainly on the drying potential of the exhausting air. To calculate and optimize the drying prpcess a discretized mathematical model has been elaborated and validated for lucerne. The solution includes the temperature and moisture distribution of the air as well as of the material. A sophisticated computer program was developed for simple simulation and also for studying the behaviour of the system under the influence of parameter changes.