Adaptive pitch control for ships with diesel mechanical and hybrid propulsion