PLANNING AND DISPATCHING OF DISTRIBUTED ENERGY STORAGE