We describe a three-dimensional code modelling the propagation of charged b
eams in accelerator devices. The inclusion of space charge fields is taken
into account by means of the Lienard-Wiechert retarded potentials. As an il
lustration of the capabilities of the program, the results of a simulation
are given that, describe the beam dynamics from the cathode to the undulato
r through the whole accelerating system. Evidence of bunching in the undula
tor, as an indication of SASE is observed. (C) 1999 Elsevier Science B.V. A
ll rights reserved.