The Challenge of PV and Storage Sizing at the Design Stage

Sizing a photovoltaic system and paired battery storage for a commercial project involves an interlocking set of calculations: estimating annual yield from local irradiance data, sizing the array in DC kilowatts to hit a target solar fraction, sizing the inverter, checking string configuration against NEC 690.8, sizing the battery in kilowatt-hours based on backup duration or demand shaving goals, and verifying interconnection limits with the utility under IEEE 1547 and NEC 705. Getting this right in the early feasibility phase — before a detailed model is built in PVSyst or Helioscope — requires fast, reliable calculation tools.

AI combined with Python changes the economics of early-phase solar feasibility. With the right prompts and a small Python script, you can produce a first-pass sizing report in under an hour: array size, battery capacity, area check, simple payback, and utility compliance notes — ready to present to a client for go/no-go on a detailed design.

This article covers the calculation methods, Python automation patterns, key NEC and IEEE standards checkpoints, and the most effective AI prompt templates for PV and energy storage engineering.

PV Array Sizing: From Annual Load to DC Capacity

The fundamental PV sizing calculation works from the annual load backward to array size. The required PV capacity in DC kilowatts is:

PV_kWdc = (Annual_kWh × Target_Offset) / (Capacity_Factor × 8,760 hours)

The capacity factor — also called the performance ratio or AC/DC derate factor — accounts for inverter efficiency, temperature losses, wiring losses, shading, and soiling. For most commercial rooftop systems in the continental US, capacity factors range from 15–22% depending on climate zone. NREL PVWatts uses a default derate factor of approximately 86% for system losses.

For a project with an annual load of 1,200,000 kWh and a 70% solar offset target in a location with an 18% capacity factor:

annual_load_kwh = 1_200_000
target_offset = 0.70
capacity_factor = 0.18  # site-specific from PVWatts

required_kwh_from_pv = annual_load_kwh * target_offset
# = 840,000 kWh/year

pv_kWdc = required_kwh_from_pv / (capacity_factor * 8760)
# = 840,000 / (0.18 × 8,760) = 533 kWdc

print(f"Required PV capacity: {pv_kWdc:.0f} kWdc")

The next step is the area check. Standard commercial silicon PV panels produce approximately 150–200 W/m² at STC, meaning a typical installation requires 8–10 m² per kWdc after accounting for spacing and access requirements. A 533 kWdc system needs approximately 4,300–5,300 m² of unshaded roof or ground area. If your site has less than this, you either reduce the offset target or explore bifacial panels, which can push effective output 10–15% higher.

NEC 690.8 String Sizing Calculations

NEC 690.8 governs the maximum circuit current and voltage for PV source circuits and PV output circuits. The key requirements are:

  • NEC 690.8(A): Maximum circuit current = 125% × module short-circuit current (Isc) for each string. This is the rated current for conductor and OCPD sizing.
  • NEC 690.8(B): Maximum system voltage = sum of module open-circuit voltages (Voc) at the lowest expected ambient temperature, calculated using the temperature coefficient. For string inverter systems, this must stay below the inverter's maximum DC input voltage (typically 1000V DC for commercial systems under NEC 690.7).

AI prompt for string sizing: "Under NEC 690.8 and NEC 690.7, calculate the maximum string voltage and conductor ampacity for a string of 20 series-connected 400W modules. Module Voc = 49.2V at STC, temperature coefficient of Voc = −0.28%/°C. Lowest expected ambient temperature = −20°C. System is 1000V DC max. Show the temperature-corrected Voc calculation and confirm NEC compliance."

The temperature correction: Voc_corrected = Voc_STC × [1 + (Tcoeff × (Tmin − 25))] = 49.2 × [1 + (−0.0028 × (−20 − 25))] = 49.2 × 1.126 = 55.4V. For 20 modules in series: 55.4 × 20 = 1,108V — which exceeds the 1000V limit. The string must be reduced to 18 modules: 55.4 × 18 = 997V. AI catches this calculation instantly and flags the NEC 690.7 violation.

Battery Storage Sizing: kWh, C-Rate, and Capacity

Battery sizing for energy storage systems depends on the use case. The two most common commercial applications are backup power (covering critical loads for a defined duration) and demand charge shaving (reducing monthly peak demand at the utility meter).

For backup power sizing: Battery_kWh = Critical_Load_kW × Backup_Hours / Battery_Efficiency. A 200 kW critical load requiring 2-hour backup at 95% round-trip efficiency needs: 200 × 2 / 0.95 = 421 kWh of usable battery capacity. Most lithium iron phosphate (LFP) battery systems allow 80–90% depth of discharge, so nameplate capacity must be scaled up: 421 / 0.85 = 495 kWh nameplate.

For demand charge shaving: Battery sizing depends on the peak reduction target and the ramp rate. If the goal is to shave 100 kW of peak demand for 2 hours per day: Battery_kWh = 100 kW × 2 h = 200 kWh (usable). The C-rate — discharge rate relative to capacity — for this application is 0.5C (100 kW / 200 kWh), which is well within the 1C continuous discharge rating of most commercial lithium battery systems.

Prompt AI for economics: "Calculate simple payback for a 200 kWh battery system with $500/kWh installed cost, shaving 100 kW of demand per month at $12/kW-month demand charge. Also calculate annual energy savings if the battery completes one full cycle per day at $0.14/kWh energy rate. Show total annual savings and payback period."

Utility Interconnection and NEC Compliance Checkpoints

Any grid-connected PV or energy storage system must comply with interconnection requirements at two levels: the NEC installation code and the utility's technical interconnection standards (typically based on IEEE 1547-2018).

Key NEC compliance checkpoints for AI-assisted review:

  • NEC 690 — Solar Photovoltaic Systems: string sizing (690.8), rapid shutdown (690.12), ground-fault protection (690.5), system labeling (690.56), and interconnection point (690.64).
  • NEC 705 — Interconnected Power Production Sources: supply-side vs load-side interconnection (705.12), maximum backfeed current limits (120% rule for load-side connections), and disconnecting means requirements.
  • NEC 706 — Energy Storage Systems: disconnecting means (706.15), battery management system (BMS) requirements, and installation of lithium-ion systems per the listing and manufacturer instructions.
  • IEEE 1547-2018: voltage and frequency ride-through requirements, anti-islanding protection, reactive power capability for Category B and C inverters, and utility approval requirements for export systems above 10 kW.

Prompt AI for a compliance checklist: "Generate a utility interconnection compliance checklist for a 300 kWdc commercial PV system with 500 kWh battery storage. Include NEC 690, 705, and 706 checkpoints, IEEE 1547-2018 ride-through requirements, and items that require utility approval. Format as a table with Item, Standard Reference, Requirement, and Status columns."

Generating Client-Ready Feasibility Reports with AI

The final deliverable for an early-phase solar and storage project is a feasibility report that presents the sizing, economics, and compliance summary in a format accessible to building owners and decision-makers. AI dramatically speeds up the narrative drafting step.

After running the Python sizing calculations, prompt: "Write an executive summary for a PV and battery storage feasibility study. Project: 300 kWdc PV array with 500 kWh battery storage at a commercial warehouse. Annual load: 1,200,000 kWh. Projected solar offset: 65%. Annual energy savings: $117,600. Demand charge reduction: 100 kW per month at $12/kW = $14,400/year. Total annual savings: $132,000. Total system cost: $750,000 ($1.55/Wdc for PV + $250,000 for battery). Simple payback: 5.7 years. Compliance: NEC 690/705/706, IEEE 1547. Write for a non-technical audience, 2–3 paragraphs."

The AI output becomes the draft executive summary. Engineers review for accuracy, add project-specific details, and the report is ready for client presentation in a fraction of the time a manual draft would require. For recurring proposals, save the prompt template in your firm's library — varying only the project-specific numbers — for consistent, professional output every time.