One-Diode Model: Fitting a Solar Cell's J-V Curve

The current of a solar cell follows the one-diode model – an implicit equation that has to be solved at every voltage. Fitting it to a measured J-V curve gives the diode factor, the saturation current density and the series and shunt resistances – here is how.

Setup

Upload your data and then plot the data. Like that Sci-Eval knows the column for the current density and voltage. To learn more, check the guided tour:

Take the tour

The physics

On Sci-eval the function for the 1-diode-model is stored as follows.

\(0 = J_{0} \left(e^{\frac{q \left(- J_{diode} r_s + V\right)}{A T k_B}} - 1\right) - J_{diode} + J_{ph} + \frac{- J_{diode} r_s + V}{R_{sh}}\)

This is an implicit function as \(J_{diode}\) is on both sides of the equation. Implicit functions are written such that they equate to 0. More common in textbooks the equation is written as

\( J_{diode} = J_{0} \left(e^{\frac{q \left(- J_{diode} r_s + V\right)}{A T k_B}} - 1\right) + \frac{- J_{diode} r_s + V}{R_{sh}} + J_{ph} \)

which represents a diode (in parallel) with an intrinsic shunt resistance \(R_{sh}\) and an intrinsic series resistance \(r_s\). \(J_{diode}\) is the current density of the diode, \(J_{0}\) the saturation current density, \(A\) the diode ideality factor, \(J_{ph}\) the photo current density, \(T\) the temperature,\(V\) the applied voltage, \(q\) the elemental charge and \(k_B\) the Boltzmann constant. Fitting can be tricky as

  1. the function is implicit and therefore needs to be solved numerically for each iteration step.
  2. it is an exponential function and therefore can easily vary over several orders of magnitude.

Fitting the data

The 1-diode-equation equation varies over several orders of magnitude. Therefore, it is advised to fit the data on a logarithmic scale. Otherwise the data points with the largest current-densities have orders of magnitude stronger influence on the residuals as the smallest current-densities. On the top of the page for the 1-diode-model the scale can be choosen to be 'log' or 'log-abs'. Here we choose 'log-abs' (see Figure 1). We take the absolute values so that it is possible to calculate the logarithm of negative current densities (e.g. in reverse bias).

Figure 1: Setting the y-scale for fitting to log-abs.

For the log-abs scale the summed squared residuals are minimized given as follows:

\(S = \sum_{i=1}^{N} \left( \ln\left|J_{diode}(V_{i})\right| - \ln\left|J_{i}\right| \right)^{2}\)

In addition, an automatic filter is added for the dependent variable (see Figure 2). This filter (or in general all filters, if you add one manually) are applied for the measured data but as well for the fitted data during the least-squares minimization. In particular, values outside the filters are clamped to the filter edges. This prevents uncontrolled residuals due to divergent values caused by taking the logarithm of very small current densities. The auto-filter (when choosing the log-abs scale), takes the smallest value from the absolute uploaded (measured) data.

Figure 2: Automatically applied filter on the dependent variable (here J_diode) to protect against divergent values when taking the logarithm of the current densities.

Dark J-V curve

In order to fit your data, you have to define starting parameters (Figure 3). The parameters need to be a reasonable choice as the algorithm searches for the local minimum of the minimized sum of squared residuals. In addition, you can choose which parameters you want to keep constant (equal to the initial guess) during fitting, by unticking the 'do fit?' checkbox. Here, we fit a JV curve measured in the dark at 300 K. Hence, we set \(J_{ph}\) to 0 and \(T\) to 300 K and untick 'do fit?'.

Figure 3: Before the fit can start, you have to set values as starting parameters.

Upper and lower bounds can also be set to the parameters, so that these are confined during the fitting. We dont want to fit unreasonable resistances and therefore we set the lower bounds to zero (Figure 3). For the 1-diode-model also bounds for other paremters can be set, however, the fit is generally rather robust for these parameters. Finally, we tick 'fit log?' for \(J_0\). In that case the parameter is varied on the log-scale, which is selected as \(J_0\) can vary over several orders of magnitude.

Illuminated J-V curve

For illuminated curves, the procedure is very similar compared to the fitting of a dark J-V curve. For \(J_{ph}\) 'do fit' is checked and a reasonable start value needs to be entered. Especially for illuminated curves it is important to have the auto-filter on the log-abs scale mentioned above. The reason is that the modelled/fitted curve has a varying \(V_{OC}\) and it can happen that it coincides with a measurement voltage point. In that case the evaluated/fitted current density would diverge and consequently the residual as well.

Results

On the bottom of the fitting-page the task results are displayed. Clicking on a finished task opens the results (see Figure 4). It shows the fitted parameters, the results table with the measured and fitted JV curve, and the fitting statistics. The used y-scale is written back into the fitting statistics. Parameters can be copied and pasted on top of the fitting-page as reasonable starting parameters - potentially for another fit of another JV curve.

Figure 4: Fit results for the dark JV curve on a log-abs scale. It shows the fitted parameters, the fitted curve and the fit statistics.

Figure 5 and Figure 6 show the fitted parameters for the linear and the logarithmic scale, respectively.

Figure 5: Fit parameters using the linear scale.
Figure 6: Fit parameters using the log-abs scale.

Figure 7 shows the comparison of both fits. In this example, both curves represent a decent fit. However, a difference can be seen for small voltages (and therefore small current densities) around 0.2 V. This regime is controlled by the shunt resistance and to a lesser extent by the diode factor. Due to the small current densities, this part of the curve does not have a significant influence on the residuals on the linear scale, which is the reason for a stronger deviation (red curve). On the log-abs scale, residuals for small and large current densities are weighted similar, enforcing a better fit in that part of the curve compared to the linear scale. As a consequence, the slightly larger diode factor (and smaller shunt resistance) predicted by the log-abs fit can be trusted (compare Figure 5 and Figure 6).

Figure 7: Comparison of the fitted curve using the linear or log-abs scale. In particular for smaller current-densities (around 0.2 V), a better fit is achieved with the log-abs scale. Figure made with the Figure Studio of Sci-Eval.

Fitted with

More examples

Browse all examples