tips for optimizing permanent magnet generators