Enhanced loss model algorithm for interior permanent magnet synchronous machines