Mathematical modelling and simulation of second life battery pack with heterogeneous state of health