Design of battery energy storage system