Optimal control of a positional model of electric power systems with a regulator