If you search for a rooftop solar calculator online, two frustrating things usually happen: first, most sites lock the result behind a sales lead form; second, the ones that actually compute numbers often overstate 25-year savings by 20%–25%.
Those inflated numbers aren't minor rounding errors. They happen because naive calculators multiply systemKw * sunHours * 365 * gridRate * 25 — ignoring three real-world physics and billing constraints that every serious energy simulator must model.
Here are the three modeling bugs that distort solar ROI calculators, and a 65-line zero-dependency TypeScript engine that fixes all three.
Bug #1: Ignoring Performance Ratio (Thermal, Inverter & Soiling Derate)
A 5 kW DC rooftop array is rated under Standard Test Conditions (25°C cell temperature, 1,000 W/m² irradiance). On an actual roof at 55°C in summer, silicon efficiency drops, DC-to-AC inverters lose 3%–5%, and dust/shading/wiring take another cut.
In real PV engineering (matching NREL PVWatts defaults), the composite Performance Ratio (PR) sits around 0.78–0.82.
| Model (5 kW, 5 Peak Sun Hrs) | Formula | Monthly Output | Annual Output | Error |
|---|---|---|---|---|
| Naive (No Derate) | 5 * 5 * 30 | 750 kWh | 9,125 kWh | +25% Overstated ❌ |
Realistic (PR = 0.80) | 5 * 5 * 30 * 0.80 | 600 kWh | 7,300 kWh | Accurate Baseline ✅ |
Bug #2: Assuming Flat Panel Output for 25 Years (Zero Degradation)
Solar panels degrade slightly every year due to UV exposure and thermal cycling — typically 0.50% to 0.60% per year for modern monocrystalline modules.
In Year 1, output is 100%. By Year 20, output is (1 - 0.0055)^19 ≈ 90.05%. Across a 25-year lifetime, ignoring degradation overstates total generated kWh by ~6.5% — which matters directly when computing cumulative payback and Net Present Value.
Bug #3: Treating Self-Consumed Power and Grid Export Equally (Net Metering Gap)
Under older 1:1 net metering, every exported kWh earned the full retail tariff. Today, many utilities (California NEM 3.0, parts of Europe, Australia, and several Indian DISCOMs) credit exported daytime electricity at a lower feed-in rate than the retail import tariff.
Splitting solar generation into:
-
selfConsumptionRatio(valued atimportRatePerKwh) -
1 - selfConsumptionRatio(valued atexportRatePerKwh)
makes the blended effective value per solar kWh far more realistic:
text effectiveRate = (selfConsumptionRatio × importRate) + ((1 - selfConsumptionRatio) × exportRate)