Battery

Battery stack: open-circuit voltage rising linearly with state of charge, internal resistance, starting full.

  • electrical
  • Modelica Standard Library
  • 2 ports
  • 6 parameters
BlockBatteryKindbatteryStackLibraryElectrical

Description

A battery pack of Ns series by Np parallel identical cells. The open-circuit voltage rises linearly with state of charge (SOC) from OCVmin when empty to OCVmax when full, behind a fixed internal resistance.

The pack starts full (SOC = 1). SOC is the integral of the terminal current divided by the pack capacity.

Example

Battery, supercapacitor, and a heating load A battery cell heats a temperature-dependent resistor while a power sensor measures it, and a supercapacitor charges at 1 A.

Cell 4.2 VPowerHeater 4 ΩBody 100 J/KBody temperatureGroundSupercap 1 FCharger 1 Av supercapGround (supercap)
In Gradara, select a Battery block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:Voltage sensorGroundHeat capacitorTemperature sensorResistor (thermal)DC currentSupercapacitorPower sensor

Ports

Conserving terminals 2

  • +p

    Positive terminal. Current into p charges the pack; discharge current is negative.

  • −n

    Negative terminal.

Parameters

  • Cells in seriesNs96

    ≥ 1

    Number of cells in series. Scales voltage and resistance.

  • Cells in parallelNp1

    ≥ 1

    Number of cells in parallel. Scales capacity and divides resistance.

  • Cell capacityQ5 A·h

    ≥ 0

    Capacity of one cell, in ampere-hours.

  • Cell voltage when fullOCVmax4.2 V

    ≥ 0

    Open-circuit voltage of one cell at SOC = 1, in volts.

  • Cell voltage when emptyOCVmin2.5 V

    ≥ 0

    Open-circuit voltage of one cell at SOC = 0, in volts. Must be below OCVmax.

  • Cell resistanceRi0.005 Ω

    ≥ 0

    Internal resistance of one cell, in ohms.

Equations

Modelica
i = p.i, p.i + n.i = 0
dSOC/dt = i / (Np · Q · 3600), SOC(0) = 1
OCV = Ns · (OCVmin + SOC · (OCVmax − OCVmin))
p.v − n.v = OCV + (Ns · Ri / Np) · i

Implementation

Modelica Standard Library 4.1.0Modelica.Electrical.Batteries.BatteryStacks.CellStack
MSL documentation

Assumptions and limitations

  • SOC is held between 0 and 1 without stopping the run: an empty pack keeps supplying current at Ns · OCVmin, and charging a full pack has no effect on SOC.
  • No RC transient, temperature effects, self-discharge, or aging. The initial SOC cannot be changed.

Used in

These larger examples use it too. Open them from Examples in the app.

  • EV drivetrain

See also

Select a block in Gradara and press F1 to open its page offline.