Optimization of a propulsion plant for a submarine based on first principles