Optimization Of Energy Transfer During Active Balancing Of Lithium-Ion Batteries