Routine source code Permanent magnet synchronous motor MATLAB simulation Yuan Lei