Design, operation and testing of synchronous machines