<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 曾小旭</title>
    <description>The latest articles on DEV Community by 曾小旭 (@jackzx).</description>
    <link>https://dev.to/jackzx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4198508%2F34a89da2-abc1-4f4f-9886-42b03f919834.jpg</url>
      <title>DEV Community: 曾小旭</title>
      <link>https://dev.to/jackzx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jackzx"/>
    <language>en</language>
    <item>
      <title>The battery sizing formula is right about 80% of the time — and wrong in ways that matter</title>
      <dc:creator>曾小旭</dc:creator>
      <pubDate>Wed, 21 Oct 2026 13:48:18 +0000</pubDate>
      <link>https://dev.to/jackzx/the-battery-sizing-formula-is-right-about-80-of-the-time-and-wrong-in-ways-that-matter-198a</link>
      <guid>https://dev.to/jackzx/the-battery-sizing-formula-is-right-about-80-of-the-time-and-wrong-in-ways-that-matter-198a</guid>
      <description>&lt;p&gt;true description: "Why most LiFePO4 sizing calculators give you a number you can't ship, and the three corrections that fix it." tags: energy, solar, batteries, opensource, sustainability cover_image: &lt;a href="https://jackzx71.github.io/bess-sizing-toolkit/demo/" rel="noopener noreferrer"&gt;https://jackzx71.github.io/bess-sizing-toolkit/demo/&lt;/a&gt;&lt;br&gt;
Every battery sizing guide gives you the same formula:&lt;/p&gt;

&lt;p&gt;kWh = load (kW) × hours ÷ efficiency ÷ depth of discharge&lt;br&gt;
That math is not wrong. It's just incomplete in three specific ways, and each gap ends up costing you money — either in undersized systems or in quotes that can't be delivered.&lt;/p&gt;

&lt;p&gt;Correction 1 — Depth of discharge depends on chemistry, not on optimism&lt;br&gt;
LFP can be sized at 80% depth of discharge. Lead-acid should stay at 50%.&lt;/p&gt;

&lt;p&gt;Running lead-acid at 80% doesn't just reduce usable capacity, it roughly halves cycle life. The battery still meets its spec sheet on day one. You find out in year three.&lt;/p&gt;

&lt;p&gt;Same nameplate, same 26 kWh, 1.6× difference in usable energy depending on chemistry.&lt;/p&gt;

&lt;p&gt;Correction 2 — Capacity moves away from rated temperature&lt;br&gt;
Below roughly 10 °C, usable capacity falls. Below −20 °C it falls hard. Below about 35 °C, LFP capacity falls too — which matters more in the Middle East than cold climate derating does in northern Europe.&lt;/p&gt;

&lt;p&gt;If a sizing calculation doesn't have a temperature step in it, it's incomplete. An "8-hour backup battery" at 25 °C is not an 8-hour battery at −20 °C.&lt;/p&gt;

&lt;p&gt;Correction 3 — The answer needs to be a buildable size&lt;br&gt;
Worked example: 5 kW load, 4 hours backup, 95% efficiency, 80% DoD.&lt;/p&gt;

&lt;p&gt;5 × 4 ÷ 0.95 ÷ 0.80 = 26.32 kWh&lt;br&gt;
26.32 kWh is a calculation. The next size you can actually ship might be 30 kWh. The inverter at 1.2× continuous load is 6 kW.&lt;/p&gt;

&lt;p&gt;Quoting 26.32 kWh in a proposal means the installer has to round it themselves — and they usually round down, or they have to order a custom configuration that costs three weeks.&lt;/p&gt;

&lt;p&gt;What I built&lt;br&gt;
I put these three corrections into a small dependency-free library, mostly because I kept re-deriving them in spreadsheets:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
复制&lt;br&gt;
npm install bess-sizing-toolkit&lt;br&gt;
js&lt;br&gt;
复制&lt;br&gt;
const BESS = require("bess-sizing-toolkit");&lt;/p&gt;

&lt;p&gt;BESS.sizeBatteryCapacity({&lt;br&gt;
  loadKw: 5,&lt;br&gt;
  backupHours: 4,&lt;br&gt;
  efficiency: 0.95,&lt;br&gt;
  dod: 0.8,&lt;br&gt;
  temperatureFactor: 0.85   // cold site&lt;br&gt;
});&lt;br&gt;
// {&lt;br&gt;
//   nominalKwh: 26.32,&lt;br&gt;
//   deratedKwh: 30.96,      // after the cold derate&lt;br&gt;
//   buildableKwh: 35,       // rounded to a real module size&lt;br&gt;
//   inverterKw: 6,&lt;br&gt;
//   steps: [...],           // every intermediate value + the formula&lt;br&gt;
//   warnings: [...]         // chemistry / derate / rounding sanity checks&lt;br&gt;
// }&lt;br&gt;
The part I'd point at first is steps. Most calculators return a single number, which makes it impossible for an engineer or a customer to check your arithmetic. This one returns every intermediate value with the formula used, so the number can be defended — or refuted — in a meeting.&lt;/p&gt;

&lt;p&gt;It also covers solar yield (performance ratio, degradation, self-consumption value), C&amp;amp;I storage payback from a peak-valley tariff spread, and a small rule of thumb for deciding whether storage is even warranted: if daytime load ÷ annual PV generation is above 60%, batteries rarely pay for themselves.&lt;/p&gt;

&lt;p&gt;16 tests, zero dependencies, runs in Node and the browser (MIT).&lt;/p&gt;

&lt;p&gt;Live demo: &lt;a href="https://jackzx71.github.io/bess-sizing-toolkit/demo/" rel="noopener noreferrer"&gt;https://jackzx71.github.io/bess-sizing-toolkit/demo/&lt;/a&gt;&lt;br&gt;
Source and tests: &lt;a href="https://github.com/jackzx71/bess-sizing-toolkit" rel="noopener noreferrer"&gt;https://github.com/jackzx71/bess-sizing-toolkit&lt;/a&gt;&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/bess-sizing-toolkit" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/bess-sizing-toolkit&lt;/a&gt;&lt;br&gt;
The part I'm least sure about&lt;br&gt;
The 0.85 temperature factor I used as a default is conservative and generic. Real derating depends on cell chemistry, enclosure, thermal management and how long the battery sits cold before discharge. If you have field measurements for a specific cell type and climate, that's the number I'd most like to replace.&lt;/p&gt;

&lt;p&gt;Happy to be told the physics is wrong.&lt;/p&gt;

</description>
      <category>hardware</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
