Mathematical models of electrical machines