SMS dit: Mathematical Approaches to Modeling, Optimally Designing, and Controlling Electric Machine