Algorithmic Approach for Slot Filling Factors Determination in Electrical Machines