Pitch control for ships with diesel mechanical and hybrid propulsion