Thermal analysis of induction and synchronous reluctance motors