Optimal rotor flux shape for multi-phase permanent magnet synchronous motors