Battery
Battery stack: open-circuit voltage rising linearly with state of charge, internal resistance, starting full.
- electrical
- Modelica Standard Library
- 2 ports
- 6 parameters
batteryStackLibraryElectricalDescription
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.
Also in this example:Voltage sensorGroundHeat capacitorTemperature sensorResistor (thermal)DC currentSupercapacitorPower sensor
Ports
Conserving terminals 2
-
+
pPositive terminal. Current into p charges the pack; discharge current is negative.
-
−
nNegative terminal.
Parameters
-
Cells in series
Ns96≥ 1
Number of cells in series. Scales voltage and resistance.
-
Cells in parallel
Np1≥ 1
Number of cells in parallel. Scales capacity and divides resistance.
-
Cell capacity
Q5 A·h≥ 0
Capacity of one cell, in ampere-hours.
-
Cell voltage when full
OCVmax4.2 V≥ 0
Open-circuit voltage of one cell at SOC = 1, in volts.
-
Cell voltage when empty
OCVmin2.5 V≥ 0
Open-circuit voltage of one cell at SOC = 0, in volts. Must be below OCVmax.
-
Cell resistance
Ri0.005 Ω≥ 0
Internal resistance of one cell, in ohms.
Equations
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.Electrical.Batteries.BatteryStacks.CellStackAssumptions 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.