OPTIMAL SIZING OF BATTERY ENERGY STORAGE FOR GRID CONNECTED AND