An unified dynamic analysis of ship response to waves