Development of algorithms for optimum allocation of reactive power in transmission and distribution systems