In this paper, a general approach to the description of the magnetic field and temperature distribution in electrical machines using the spectral element analysis is presented. In the spectral element method, higher order Legendre-Gauss-Lobatto polynomials are applied to describe the different fields. The magnetic flux distribution is derived using the magnetic vector potential, and nonlinear magnetic material is modeled based on its BH curve. The thermal model is based on the heat equation. The magnetic and thermal domains are coupled by the ohmic and iron losses, and the latter is computed using the loss separation model of Bertotti. The results are compared with the finite element method, and a good agreement is obtained for both the spatial magnetic flux density and the temperature distributions.