Dynamic behavior of electrical machines