Unified Theory of Electrical Machines