MULTIPURPOSE CONTROL AND PLANNING METHOD FOR BATTERY ENERGY STORAGE