Stator winding second-order thermal model including end-winding thermal effects