Why Battery Storage Calculations Fail: Modeling Peukert's Law, Inverter Tare Losses, and Depth of Discharge in TypeScript
Residential battery sizing often relies on a linear formula that can overestimate runtime by 30–50%. By incorporating Peukert’s law, inverter idle draw, and depth‑of‑discharge limits, a deterministic TypeScript engine can deliver accurate, side‑effect‑free predictions. The article explains the phys…
When homeowners plan for emergency power, the first calculation that pops up is the simple division of battery capacity by load: Runtime (h) = Battery Capacity (Wh) ÷ Load (W). This neat formula assumes that a battery will deliver its full rated energy regardless of how fast it is discharged. In reality, electrochemical cells and power electronics behave non‑linearly, and the naive approach can over‑promise by 30% to 50%.
Why the Linear Formula Falls Short
Three physical mechanisms distort the expected runtime:
- Peukert’s Law – As discharge current rises, internal resistance and ion diffusion slow the cell, reducing usable capacity.
- Inverter Tare Losses – Inverters draw a constant idle power (15–55 W) even when the output load is minimal, eating into the battery’s energy budget.
- Depth of Discharge (DoD) Limits – Lead‑acid batteries should not be drained beyond 50% and most lithium chemistries beyond 80–90% to avoid irreversible degradation.
Peukert’s Law in Numbers
Wilhelm Peukert first formalised the relationship between discharge rate and available capacity in 1897. The equation is:
t = H · (C / (I·H))k
where:
t– discharge time (h)H– rated hour rating (e.g., 20 h for lead‑acid, 1–5 h for LiFePO4)C– rated capacity at hour rating (Ah)I– continuous discharge current (A)k– Peukert exponent (dimensionless)
Typical exponents are:
- LiFePO4: 1.02–1.05 (almost linear)
- AGM/Sealed Lead‑Acid: 1.10–1.20
- Flooded Lead‑Acid: 1.25–1.40 (significant capacity loss at high loads)
When expressed in watt‑hours, the effective energy under a constant load becomes:
Eeffective = Vnom · C · [(C·Vnom) / (Pload·H)]k‑1
Inverter Efficiency and Tare Draw
Converting DC to AC introduces two losses:
- Conversion Efficiency – Typically 88% to 94% at full load.
- Fixed Tare Consumption – Inverters keep gate drivers, control logic, and transformers powered, drawing 15–45 W even when idle.
At low loads, the tare draw can account for more than half of the total battery drain. For example, running a 30 W CPAP machine on a 3 kW inverter, the tare may consume 20 W, leaving only 10 W for the load.
Deterministic TypeScript Modeling Engine
The article presents a side‑effect‑free TypeScript engine that accepts typed inputs and returns a structured runtime envelope. The core function, calculateBatteryRuntime, performs the following steps:
- Calculates the total continuous draw, adding inverter tare to the converted AC load.
- Computes the raw discharge current and applies the Peukert factor based on the chosen chemistry’s exponent.
- Clamps the factor to a realistic range (0.35–1.05) to avoid extreme values.
- Derives effective capacity and runtime, and flags warnings for DoD breaches or excessive discharge rates.
The TypeScript interface ensures immutability and type safety, making the engine suitable for integration into web dashboards or backend services.
Benchmark: Lead‑Acid vs. LiFePO4
To illustrate the impact, consider a 12 V 200 Ah (2,400 Wh) bank powering an 800 W load through a 92% efficient inverter with a 25 W tare draw. The total draw is 894.57 W, yielding a discharge current of 74.55 A.
Using the Peukert exponents:
- Flooded Lead‑Acid (k = 1.30, DoD = 50%): Effective energy ≈ 657 Wh, runtime ≈ 0.73 h (44 min).
- LiFePO4 (k = 1.03, DoD = 90%): Effective energy ≈ 2,160 Wh, runtime ≈ 2.41 h (145 min).
In contrast, the naive linear formula predicts 1.34 h for lead‑acid and 2.41 h for LiFePO4, over‑estimating the lead‑acid runtime by 83.5%.
Why Accurate Modeling Matters
Over‑estimating battery backup can lead to insufficient protection during outages, while under‑estimating may cause unnecessary oversizing and cost. Engineers, homeowners, and system integrators need reliable tools that reflect real‑world physics to make informed decisions.
Get the Code and Simulations
The full open‑source framework, along with interactive simulations, is available at the PowerLab Battery Backup Runtime Model. Developers can also explore the API contracts in the PowerLab Developer Documentation to embed the engine into custom applications.
Why it matters
Accurate runtime predictions prevent costly over‑design and protect critical loads during power outages, ensuring that battery systems deliver the promised backup time.
Key points
- Linear capacity division over‑estimates runtime by 30–50%.
- Peukert’s law captures non‑linear discharge behavior.
- Inverter idle draw can dominate total battery drain at low loads.
- Depth‑of‑discharge limits differ between chemistries and affect usable capacity.
- A deterministic TypeScript engine can compute realistic runtimes with warnings.
- Lead‑acid and LiFePO4 runtimes diverge dramatically under high loads.
Frequently asked questions
What is Peukert’s law?
Peukert’s law describes how a battery’s available capacity decreases as discharge current increases, expressed by the exponent k in the equation t = H·(C/(I·H))^k.
Why do inverters draw power when idle?
Inverters keep gate drivers, control logic, and transformers energized to be ready for load changes, resulting in a fixed no‑load consumption called tare draw.
How does depth of discharge affect battery life?
Draining a battery beyond its recommended DoD accelerates chemical degradation; lead‑acid should stay below 50%, while most lithium chemistries are safe up to 80–90%.
Can the TypeScript engine be used in a web app?
Yes, the engine is pure TypeScript with immutable inputs and returns a structured result, making it suitable for front‑end dashboards or back‑end services.





