Simulation methods for the temporal and frequency dynamics of optical communication systems