We calculate the temporal evolution of distributions of relativistic electrons subject to synchrotron and adiabatic processes and Fermi-like acceleration in shocks. The shocks result from Kelvin-Helmholtz instabilities in the jet. Shock formation and particle acceleration are treated in a self-consistent way by means of a numerical hydrocode. We show that in our model the number of relativistic particles is conserved during the evolution, with no need of further injections of supra-thermal particles after the initial one. From our calculations, we derive predictions for values and trends of quantities like the spectral index and the cutoff frequency that can be compared with observations.