Investigation of AC loss of permanent magnet of SPM motor considering hysteresis and eddy-current losses