<?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>Forem: Tinashe Nedi</title>
    <description>The latest articles on Forem by Tinashe Nedi (@tinashe_).</description>
    <link>https://forem.com/tinashe_</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3825997%2Fd9c81ed2-7c21-4570-ba4b-ea7acab92ed5.png</url>
      <title>Forem: Tinashe Nedi</title>
      <link>https://forem.com/tinashe_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/tinashe_"/>
    <language>en</language>
    <item>
      <title>Why I stopped using flat $/kWh to size commercial battery storage.</title>
      <dc:creator>Tinashe Nedi</dc:creator>
      <pubDate>Tue, 31 Mar 2026 13:03:58 +0000</pubDate>
      <link>https://forem.com/tinashe_/why-i-stopped-using-flat-kwh-to-size-commercial-battery-storage-2a0a</link>
      <guid>https://forem.com/tinashe_/why-i-stopped-using-flat-kwh-to-size-commercial-battery-storage-2a0a</guid>
      <description>&lt;p&gt;I've been building energy APIs for about four years. The thing that kept bothering me wasn't the code — it was watching tools I respected give completely wrong BESS cost estimates because they multiplied system size by a flat dollars-per-kilowatt-hour figure.&lt;/p&gt;

&lt;p&gt;That's not how battery storage costs work. And it matters a lot when someone is deciding whether to spend $800,000 on a system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with flat $/kWh
&lt;/h2&gt;

&lt;p&gt;Most BESS calculators I've seen do something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="c1"&gt;# What most tools do — this is wrong
&lt;/span&gt;&lt;span class="n"&gt;system_cost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;capacity_kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;cost_per_kwh&lt;/span&gt;  &lt;span class="c1"&gt;# e.g. 500 kWh * $400 = $200,000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The issue is that battery storage has two fundamentally different cost components that scale differently:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Energy cost&lt;/strong&gt; — scales with kWh (how much you can store)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Power cost&lt;/strong&gt; — scales with kW (how fast you can charge/discharge)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A 500 kWh system with a 250 kW inverter has a completely different cost structure than a 500 kWh system with a 500 kW inverter. The flat $/kWh model treats them identically.&lt;/p&gt;

&lt;h2&gt;
  
  
  The NREL ATB two-component model.
&lt;/h2&gt;

&lt;p&gt;NREL's Annual Technology Baseline (ATB) 2024 separates these correctly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Total Cost ($/kW) = [BatteryPack ($/kWh) × Duration (h)] + BOS ($/kW)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where BOS (balance of system) covers the inverter, controls, and &lt;br&gt;
installation — costs that scale with power capacity, not energy capacity.&lt;/p&gt;

&lt;p&gt;For LFP at moderate scenario (2024 values from Cole, Ramasamy &amp;amp; Turan 2025, NREL/TP-6A40-93281):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# The correct model
&lt;/span&gt;&lt;span class="n"&gt;pack_cost_per_kwh&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;241&lt;/span&gt;   &lt;span class="c1"&gt;# $/kWh — energy component
&lt;/span&gt;&lt;span class="n"&gt;bos_cost_per_kw&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;339&lt;/span&gt;   &lt;span class="c1"&gt;# $/kW  — power component
&lt;/span&gt;&lt;span class="n"&gt;duration_hours&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;4.0&lt;/span&gt;   &lt;span class="c1"&gt;# hours
&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_bess_capex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;power_kw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;duration_h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;energy_kwh&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;power_kw&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;duration_h&lt;/span&gt;
    &lt;span class="n"&gt;energy_cost&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;energy_kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;pack_cost_per_kwh&lt;/span&gt;
    &lt;span class="n"&gt;power_cost&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;power_kw&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;bos_cost_per_kw&lt;/span&gt;
    &lt;span class="n"&gt;total_cost&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;energy_cost&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;power_cost&lt;/span&gt;
    &lt;span class="n"&gt;cost_per_kwh&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;total_cost&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;energy_kwh&lt;/span&gt;  &lt;span class="c1"&gt;# effective $/kWh
&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;energy_kwh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;     &lt;span class="n"&gt;energy_kwh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;energy_cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;energy_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;power_cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;power_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;total_cost_usd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="n"&gt;total_cost&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;effective_per_kwh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cost_per_kwh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# varies with duration!
&lt;/span&gt;    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# 500 kW, 4-hour system
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;calculate_bess_capex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# total: $920,500  |  effective: $460/kWh
&lt;/span&gt;
&lt;span class="c1"&gt;# Same energy, 2-hour system (1000 kW inverter)
&lt;/span&gt;&lt;span class="n"&gt;result2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;calculate_bess_capex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="c1"&gt;# total: $1,143,000  |  effective: $571/kWh
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same total energy stored. 24% cost difference. That's the error you make with flat $/kWh.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why duration changes the effective cost per kWh
&lt;/h2&gt;

&lt;p&gt;Here's the relationship visualized:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsne28ikdpg15o4sf87w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsne28ikdpg15o4sf87w.png" alt="Effect of Discharge Duration on LFP Battery Energy Costs" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The longer the discharge duration, the lower the effective $/kWh — because you're spreading the fixed power costs (BOS) over more stored energy. This is why 6-8 hour systems often pencil out better for large industrial loads even though the upfront cost is higher.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round-trip efficiency convention — another source of errors
&lt;/h2&gt;

&lt;p&gt;One more thing that trips people up: manufacturer specs often quote DC-DC round-trip efficiency (0.92–0.95 for LFP). But commercial buildings are billed on AC metered output, so you need the AC-AC figure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# DC-DC (what manufacturers advertise)
&lt;/span&gt;&lt;span class="n"&gt;rte_dc_dc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.93&lt;/span&gt;

&lt;span class="c1"&gt;# AC-AC (what actually matters for your electricity bill)
&lt;/span&gt;&lt;span class="n"&gt;rte_ac_ac&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.85&lt;/span&gt;  &lt;span class="c1"&gt;# LFP — from NREL ATB 2024b and PNNL-33283
&lt;/span&gt;
&lt;span class="c1"&gt;# The difference matters for savings calculations
&lt;/span&gt;&lt;span class="n"&gt;annual_cycles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;365&lt;/span&gt;
&lt;span class="n"&gt;usable_kwh&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;

&lt;span class="n"&gt;dc_dc_throughput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;annual_cycles&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;usable_kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;rte_dc_dc&lt;/span&gt;  &lt;span class="c1"&gt;# 136,380 kWh
&lt;/span&gt;&lt;span class="n"&gt;ac_ac_throughput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;annual_cycles&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;usable_kwh&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;rte_ac_ac&lt;/span&gt;  &lt;span class="c1"&gt;# 124,100 kWh
&lt;/span&gt;
&lt;span class="c1"&gt;# At $0.18/kWh, that's a $2,207/year difference in projected savings
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I wrapped all of this into a FastAPI service that also handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Load Duration Curve sizing (Neubauer &amp;amp; Simpson 2015, NREL/TP-5400-63162)&lt;/li&gt;
&lt;li&gt;LCOS calculation per PNNL-33283&lt;/li&gt;
&lt;li&gt;IRA 2022 §48E ITC stacking (base 30% + up to 20% in adders)&lt;/li&gt;
&lt;li&gt;Demand charge savings with state-level rates from OpenEI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every output includes the source equation and the paper it comes from. The API is live on RapidAPI if you want to try it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bethelhash/solar-bess-sizing-api" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; | &lt;br&gt;
&lt;a href="https://rapidapi.com/bethelnedi/api/solar-bess-sizing-dispatch-optimization-api" rel="noopener noreferrer"&gt;RapidAPI&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Sources: Cole, Ramasamy &amp;amp; Turan (2025) NREL/TP-6A40-93281 · &lt;br&gt;
Mongird et al. (2022) PNNL-33283 · Neubauer &amp;amp; Simpson (2015) &lt;br&gt;
NREL/TP-5400-63162 · IRA 2022 §48E&lt;/em&gt;&lt;/p&gt;

</description>
      <category>solar</category>
      <category>python</category>
      <category>api</category>
      <category>fastapi</category>
    </item>
  </channel>
</rss>
