Prediction of relative maotion of ships in waves