Simulating ship motions in the time domain