Skip to content

Battery ​

Battery pack: strings of cells, each an open-circuit voltage that follows the state of charge (a table), a series resistance R0 and one RC branch for the slow polarisation voltage. The state of charge integrates the current against the pack capacity. Discharge stops at SOC min and charging at SOC max, and optional current limits cap the discharge and charge currents: the pack then delivers no more than allowed, and a load that insists on more pulls the terminal voltage down. Wired output: the state of charge in pu. Monitors the current (A / kA), terminal voltage (V / kV) and SOC (% / pu). Use it as the DC source of a battery energy-storage system, an electric vehicle or a UPS. Takes no part in the load flow.

Category: Single-Phase / Sources

How it works ​

The pack is Ns cells in series per string and Np strings in parallel. Each cell is the standard first-order equivalent circuit: an open-circuit voltage that depends on the state of charge, a series resistance R0 and one RC branch. At the terminals that gives

v=NsOCV(SOC)−vRC−R0i,τ1dvRCdt=R1i−vRC

with the pack resistances R0 and R1 the cell values times Ns/Np, and i positive when the pack discharges. The state of charge integrates the current against the pack capacity Q=NpQcell:

dSOCdt=−i3600Q

with Q in Ah. The open-circuit voltage comes from the Cell OCV(SOC) table, interpolated linearly and held flat beyond its ends. The default table is a typical nickel-manganese-cobalt cell, 3.0 V empty to 4.15 V full. For an iron-phosphate (LFP) cell, use a flatter curve around 3.3 V.

  • R0 sets the instant voltage step when the current changes.
  • The RC branch is the slow polarisation: under a steady load the voltage keeps sagging by R1i over a few τ1. When the load stops, it relaxes back towards the open-circuit voltage with the same time constant.

Limits ​

  • SOC bounds. At or below SOC min the pack stops discharging, and at or above SOC max it stops charging. Current in the other direction is always allowed, so a charger can lift an empty pack off its lower bound.
  • Current limits. I max discharge and I max charge cap the pack current; 0 means no limit.

When the current passes a limit, the pack holds it at the allowed value from the next time step on, like a battery management system limiting its contactor current. It returns to normal once the circuit draws less. The terminal voltage then goes wherever the external circuit takes it, so a load that insists on more current pulls the DC bus down, and at an SOC bound the pack behaves as an open circuit in the blocked direction.

Notes ​

  • The wired soc output is the state of charge in pu (0–1), for dispatch logic or a battery management system built from control blocks.
  • Real packs hold minutes to hours of energy, far longer than a typical EMT run. To see the state of charge move within a short run, scale the capacity down.
  • The model has no temperature dependence, no ageing and no hysteresis between charge and discharge.

Ports ​

PortKindSignalNotes
pElectrical terminal—
nElectrical terminal—
socControl outputReal

Parameters ​

Config ​

ParameterTypeDefaultUnitsDescriptionID
Cells in seriesNumber200—Number of cells in series in each string. Scales the open-circuit voltage and the resistances.n_series
Strings in parallelNumber1—Number of parallel strings. Scales the capacity and divides the resistances.n_parallel
Cell capacityNumber50Ah (also mAh)Capacity of one cell. The pack holds this times the number of parallel strings.capacity
SOC(0)Number50% (also pu)State of charge at t = 0.soc_init
Measure currentChoice: Off / OnOff—Emit the pack current out of the + terminal (positive = discharging) as an observable. The signal name and unit are on this row.measure_current
Positive directionChoice: +ve in / +ve out+ve out—Sign convention for this current. '+ve out' (default) is positive when current flows out of the + terminal (discharging). '+ve in' flips the sign.current_dir
Measure voltageChoice: Off / OnOff—Emit the terminal voltage V(+) - V(-) as an observable. The signal name and unit are on this row.measure_voltage
Measure SOCChoice: Off / OnOff—Emit the state of charge as an observable. The signal name and unit are on this row. The wired `soc` output is always available, in pu.measure_soc

Cell ​

ParameterTypeDefaultUnitsDescriptionID
Cell OCV(SOC)Table8 rows (SOC (pu), OCV (V))—Open-circuit voltage of one cell against its state of charge, linearly interpolated and held flat outside the table. SOC in pu (0 = empty, 1 = full), voltage in volts per cell. The default is a typical nickel-manganese-cobalt (NMC) cell.ocv_table
R0Number0.5mΩ (also Ω)Series (ohmic) resistance of one cell: the instant voltage step when the current changes.r0
R1Number0.25mΩ (also Ω)Resistance of the cell's RC branch: the polarisation voltage that builds up under load and relaxes when it stops. 0 = no RC branch.r1
τ1Number10s (also ms, min)Time constant R1·C1 of the RC branch. 0 = no RC branch.tau1

Limits ​

ParameterTypeDefaultUnitsDescriptionID
SOC minNumber10% (also pu)Discharge stops at or below this state of charge; charging is still allowed.soc_min
SOC maxNumber95% (also pu)Charging stops at or above this state of charge; discharging is still allowed.soc_max
I max dischargeNumber0A (also kA)Largest pack discharge current. 0 = no limit.i_max_discharge
I max chargeNumber0A (also kA)Largest pack charge current. 0 = no limit.i_max_charge

Signal Names ​

ParameterTypeDefaultUnitsDescriptionID
Current nameTextI_batA (also kA)Signal name for the pack current out of the + terminal (positive = discharging). Blank = skip.current_name
Voltage nameTextV_batV (also kV)Signal name for the terminal voltage. Blank = skip.voltage_name
SOC nameTextSOC% (also pu)Signal name for the state of charge. Blank = skip.soc_name

Observables ​

Default nameKindRecorded whenDescriptionID
set by Current nameSignalMeasure current is onPack current out of the + terminal, positive when discharging, scaled to the chosen unit (A / kA). The direction switch keeps this sign by default and flips it the other way.branchCurrent
set by Voltage nameSignalMeasure voltage is onTerminal voltage V(+) - V(-), scaled to the chosen unit (V / kV).terminalVoltage
set by SOC nameSignalMeasure SOC is onState of charge, in % or pu.soc_level