In this course, we cover the advanced optimization of surface-mounted permanent magnet synchronous motors using parallel finite element computing in EMDLAB. The goal is to learn how to write code for high-level optimization tasks. We will also compare the obtained results with those generated by Ansys Maxwell.