Photovoltaics

Overview

Photovoltaics (PV) is the technology of converting light energy directly into electrical energy using semiconductor materials. At the heart of PV system modeling is the ability to accurately predict the electrical performance of solar cells and modules under varying environmental conditions. This capability is essential for system design, performance analysis, bankability studies, and operational optimization.

The fundamental challenge in PV modeling is understanding how the current-voltage (IV) characteristics of a solar cell change with irradiance and temperature. The single diode model (equivalent circuit model) is the industry-standard approach, representing the cell as a current source in parallel with a diode, along with series and shunt resistances. While conceptually simple, accurately parameterizing this model and solving it efficiently requires sophisticated numerical methods.

Figure 1: Photovoltaic performance characteristics: (Left) IV curves shift vertically with changing solar irradiance; (Center) IV curves shift horizontally with changing temperature, significantly affecting open-circuit voltage; (Right) Power-Voltage curves showing the Maximum Power Point (MPP) tracking challenge.

Solar Position Calculations

Before modeling a PV module’s performance, you must determine how much sunlight reaches it. Solar position calculations determine the sun’s location in the sky (azimuth and elevation angles) for any given time and location on Earth. These calculations account for Earth’s orbital mechanics, axial tilt, atmospheric refraction, and even subtle effects like nutation.

The NREL SPA algorithm is the gold standard for solar position calculations, achieving accuracy better than 0.0003° between years 2000-6000. The SOLARPOSITION function implements this algorithm via the pvlib.solarposition module, providing azimuth, elevation, and apparent zenith angles for PV tracking systems and shading analysis.

Irradiance on Tilted Surfaces

Solar panels are rarely horizontal. The IRRADIANCE function calculates plane of array (POA) irradiance—the total solar radiation striking a tilted surface—by decomposing it into three components:

  • Beam (Direct) irradiance: sunlight that travels in a straight line from the sun to the surface.
  • Diffuse irradiance: sunlight scattered by the atmosphere.
  • Ground-reflected irradiance: sunlight bouncing off the ground (albedo).

Dozens of transposition models exist (Perez, Hay-Davies, Isotropic, etc.), each with different assumptions about sky radiance distribution. Accurate POA irradiance calculation is critical because errors propagate directly into power output predictions.

DC Power Modeling: PVWatts vs. Single Diode

Two approaches dominate PV DC power modeling:

PVWatts Model (Simplified)

The PVWATTS_DC function implements NREL’s PVWatts model, a simplified linear approach:

P_{dc} = \frac{G_{poa,eff}}{1000} \cdot P_{dc0} \cdot \left[1 + \gamma_{pdc}(T_{cell} - T_{ref})\right]

This model is fast and requires only a few parameters (nameplate power, temperature coefficient). It’s widely used for early-stage feasibility studies and annual energy predictions where detailed IV curve modeling is unnecessary.

Single Diode Model (Physics-Based)

The single diode model solves the Shockley diode equation to determine the IV relationship:

I = I_L - I_0 \left[\exp\left(\frac{V + I R_s}{nN_sV_{th}}\right) - 1\right] - \frac{V + I R_s}{R_{sh}}

where: - I_L is the light-generated current (photocurrent) - I_0 is the diode saturation current - R_s is the series resistance - R_{sh} is the shunt resistance - n N_s V_{th} is the modified ideality factor

The CALCPARAMS_CEC function computes these five parameters at arbitrary operating conditions using the California Energy Commission (CEC) model. This model adjusts reference parameters (measured at standard test conditions) based on effective irradiance and cell temperature, incorporating temperature-dependent bandgap energy.

Once parameters are known, the I_FROM_V function solves the implicit single diode equation for current at a specified voltage using Lambert W function techniques or numerical root-finding. This enables construction of complete IV and power-voltage curves for maximum power point tracking (MPPT) analysis.

Applications in Solar Engineering

These functions support critical workflows:

  • System Design: Sizing inverters and determining optimal tilt angles.
  • Performance Modeling: Predicting annual energy yield (kWh/year) for financial pro formas.
  • Degradation Analysis: Comparing measured vs. modeled performance to detect soiling, shading, or equipment failures.
  • Real-time Monitoring: Calculating expected power output for performance ratio (PR) tracking.

Native Excel Capabilities

Excel provides no native functions for photovoltaic modeling. Users typically resort to:

  • Manual formulas: Implementing IV curve equations cell-by-cell is tedious and error-prone.
  • Goal Seek: Can solve the implicit single diode equation for a single point, but cannot vectorize across multiple conditions.
  • VBA macros: Custom VBA implementations lack access to validated solar libraries and high-performance numeric solvers.

Python-based functions offer access to PVLib, the open-source standard for PV modeling maintained by Sandia National Laboratories. PVLib provides validated implementations of dozens of industry models, extensive databases of module and inverter parameters, and robust handling of edge cases (nighttime, shading, bifacial modules).

Third-Party Excel Add-ins

  • SAM (System Advisor Model): NREL’s free desktop application for techno-economic PV analysis. While not an Excel add-in, SAM can export detailed hourly performance data to Excel for further analysis.
  • PVsyst: Commercial PV simulation software widely used for bankable performance assessments. Offers Excel export but no direct Excel integration.
  • HelioScope: Cloud-based PV design platform with detailed shading and electrical modeling. Provides CSV exports compatible with Excel.

No true Excel add-ins provide real-time PV modeling with the depth of PVLib, making Python in Excel particularly valuable for solar engineers.

Tools

Tool Description
CALCPARAMS_CEC Calculate five CEC model parameters for the single diode equation at given irradiance and cell temperature.
I_FROM_V Calculate the device current at a given device voltage for a PV cell/module using the single diode model.
IRRADIANCE Calculate the plane of array irradiance components on a tilted surface using PVLib.
PVWATTS_DC Calculate the DC power output of a PV module using the PVWatts DC model.
SOLARPOSITION Calculate solar azimuth, elevation, and apparent zenith for given times and location.