How to optimise battery performance and minimise losses