Modeling, Investigation, and Mitigation of AC Losses in IPM Machines with Hairpin Windings for EV Applications