Battery based energy storage and its analysis