A General Mathematical Formulation for Winding Layout Arrangement of Electrical Machines