AN OPTIMAL SCHEDULING OF ENERGY STORAGE UNITS IN