This model simulates and compares two different ways to model a Li-ion battery pack. In the first model, four Li-ion cells are physically connected in series. This allows the user to use different parameters and initial conditions for each cell in the pack. In the second model, the number of cells in the pack is specified using the scalar n. The Li-ion battery model used in this example is an electrochemistry-based automotive battery, modeled based on the porous electrode theory which features battery state of charge, mass transport, Li+ intercalation / diffusion processes, and different electrode chemistries. A related webinar, Physical Models of Automotive Batteries for EV and HEV Vehicles is also available.