Magnet Shape Optimization of Surface-Mounted Permanent-Magnet Motors to Reduce Harmonic Iron Losses