Skip to content
Tutorials Center
My learning

Topics

Lesson 42 of 45 · Projects and Practice

Project: model, fit and optimize a solar cell

Build a single-diode solar cell model with series and shunt resistance, extract efficiency and fill factor, fit it to noisy data and study temperature and irradiance effects.

Solar-cell engineers, module manufacturers and energy modelers all use the same simple circuit to describe a cell: a current source, a diode and two resistors. In this project you will build that single-diode model, extract the headline numbers from it, fit its four parameters to noisy "measured" data (the way a lab does), and then explore how temperature and light intensity change the picture.

What you will learn

  • How to solve the implicit single-diode equation numerically.
  • How to compute V_oc, I_sc, P_max, FF and efficiency from a curve.
  • How to fit model parameters to measured I-V data with least squares.
  • Why V_oc falls with temperature and why efficiency changes with irradiance.
  • How to read the effect of series and shunt resistance from a fit.

The circuit

Single-diode equivalent circuit with current source, diode, shunt resistance and series resistance
Caption: The photocurrent I_L flows in parallel with the diode and the shunt resistance; the series resistance sits between the junction and the terminals.

The terminal current satisfies

J = J_L − J_0 ( e^((V + J R_s) / (n V_T)) − 1 ) − (V + J R_s)/R_sh

Because J appears on both sides, we cannot solve it algebraically without special functions. A root finder solves it point by point: for each voltage V, find the J that makes the left side equal the right side. We work per unit area (A/cm², Ω·cm²), so the cell size drops out.

Step 1: simulate and extract

Python Step 1: model and figures of merit

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Step 2: fit the model to "measured" data

A lab measures a cell and wants the four hidden parameters J_L, J_0, R_s and R_sh. The standard approach is nonlinear least squares: adjust the parameters until the model matches the data. Because J_0 spans many orders of magnitude, fit its logarithm. Here we generate "measurements" from known parameters with 0.3% noise and see whether the fit recovers them.

Python Step 2: fit parameters to noisy data

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Two cautions that every experimentalist learns. First, the fit is only as good as the data range: R_sh is set by the nearly flat low-voltage region and R_s by the steep region near V_oc, so data must cover both. Second, the ideality factor n and J_0 are strongly correlated; fixing n (as here) or fitting data at several temperatures avoids a family of equally good but physically different answers.

Step 3: temperature and irradiance

Cells in the field are not at 25 °C and 1 sun. Temperature raises the intrinsic carrier density, and with it J_0, so V_oc falls. A standard estimate is J_0 ∝ T³ e^(−E_g/(kT)). Light intensity scales J_L linearly, while V_oc grows only logarithmically, and series resistance losses scale with current squared, so efficiency actually rises with moderate concentration until R_s losses win.

Python Step 3: temperature and light

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Challenges

  1. Add a second diode (n = 2) to represent recombination in the depletion region and see how it affects the fill factor.
  2. Use the model to find the R_s that costs 1 percentage point of absolute efficiency.
  3. Compare Si (1.12 eV) with GaAs (1.42 eV): how does the temperature coefficient of V_oc differ?
  4. Build a 60-cell module by multiplying voltages by 60 and see what a single shaded cell does to the string current.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Which parameter is mainly set by the steep part of the I-V curve near V_oc?

    Near V_oc the current is small and the curve's slope is set by the diode plus R_s.
  2. 2. Why fit log₁₀ J₀ instead of J₀?

    Parameters of widely different scale make least-squares problems hard; fitting the log avoids that.
  3. 3. As temperature rises, V_oc of a silicon cell

    J₀ increases roughly exponentially with temperature, lowering V_oc by about 2 mV/K for silicon.
  4. 4. A low shunt resistance mainly

    Leakage paths bypass the junction and bend the curve near the low-voltage end, reducing FF and V_oc.

Summary

  • The single-diode model with R_s and R_sh describes real cells; solve it numerically with a root finder.
  • Extract V_oc, J_sc, P_max, FF and efficiency from the simulated curve.
  • Fit the parameters with least squares (log-scale for J₀) and check the fit range covers both ends of the curve.
  • V_oc falls with temperature; efficiency changes with irradiance because of the logarithm in V_oc and the series-resistance loss.

Next: Glossary of semiconductor devices