Motions, resistance and propulsion of a ship in longitudinal regular waves