Permanent Magnet Synchronous Machines And Drives Matlab Codes