Modeling and Simulation of Battery Systems