Optimal allocation of static and dynamic reactive power support for enhancing power system security