Simulation of Multiphase Battery Systems