A similar approach as in https://www.mathworks.com/matlabcentral/fileexchange/65493-full-state-feedback-controller-tuning-using-pso, but this time to synthesize a servo drive, i.e. a position control task is solved.
Cons: finite time in the cost function.
Pros: optimized for a nonlinear plant, under specific reference and disturbance.
Create scripts with code, output, and formatted text in a single executable document.