Simulation of the dynamic behaviour of tunable lasers