The unified theory of electrical machines