Text this: Optimization and Control of Electrical Machines