Minimization of torque ripple in permanent magnet motors: a closed form solution | Synapse