The calculation of periodic trajectories