Optimal use of second life battery for peak load management and improving the life of the battery | Synapse