Text this: Modeling and Simulation of a Vector-Controlled Synchronous Machine in Motoring and Generating Mode