Skip to content

Latest commit

 

History

History
173 lines (117 loc) · 7.08 KB

File metadata and controls

173 lines (117 loc) · 7.08 KB

Single Diode Equation

This section reviews the solutions to the single diode equation used in pvlib-python to generate an IV curve of a PV module.

The single diode equation describes the current-voltage characteristic of an ideal single-junction PV device:

I = I_L - I_0 \left(\exp \left(\frac{V + I R_s}{n Ns V_{th}} \right) - 1 \right)
    - \frac{V + I R_s}{R_{sh}}

where

  • I is electrical current in Amps
  • V is voltage in Amps
  • I_L is the photocurrent in Amps
  • I_0 is the dark, or saturation current, in Amps
  • R_{sh} is the shunt resistance in Ohm
  • R_s is the series resistance in Ohm
  • n is the diode (ideality) factor (unitless)
  • Ns is the number of cells in series. Cells are assumed to be identical.
  • V_{th} is the thermal voltage at each cell's junction, given by V_{th} = \frac{k}{q} T_K, where k is the Boltzmann constant (J/K), q is the elementary charge (Couloumb) and T_k is the cell temperature in K.

pvlib-python supports two ways to solve the single diode equation:

  1. Using the Lambert W function
  2. Bishop's algorithm

The :func:`pvlib.pvsystem.singlediode` function's method keyword allows the user to choose the solution method.

Lambert W-Function

When method='lambertw', the Lambert W function is used to find solutions (V, I). The Lambert W function is the converse relation of the function f \left( w \right) = w \exp \left( w \right), that is, if y \exp \left( y \right) = x, then y = W(x). As previously shown by Jain, Kapoor [1, 2] and Hansen [3], solutions to the single diode equation may be written in terms of W. Define a variable \theta as

\theta = \frac{R_s I_0}{n Ns V_{th} \left(1 + \frac{R_s}{R_{sh}} \right)} \exp \left(
    \frac{R_s \left( I_L + I_0 \right) + V}{n Ns V_{th} \left(1 + \frac{R_s}{R_{sh}}\right)}
    \right)

Then the module current can be written as a function of voltage, using the Lambert W-function, W \left(z \right).

I = \frac{I_L + I_0 - \frac{V}{R_{sh}}}{1 + \frac{R_s}{R_{sh}}}
    - \frac{n Ns V_{th}}{R_s} W \left(\theta \right)

Similarly, the voltage can be written as a function of current by defining a variable \psi as

\psi = \frac{I_0 R_{sh}}{n Ns V_{th}} \exp \left(\frac{\left(I_L + I_0 - I\right) R_{sh}}{n Ns V_{th}} \right)

Then

V = \left(I_L + I_0 - I\right) R_sh - I R_s - n Ns V_th W\left( \psi \right)

When computing V = V\left( I \right), care must be taken to avoid overflow errors because the argument of the exponential function in \psi can become large.

The pvlib function :func:`pvlib.pvsystem.singlediode` uses these expressions I = I\left(V\right) and V = V\left( I \right) to calculate I_{sc} and V_{oc} respectively.

To calculate the maximum power point \left( V_{mp}, I_{mp} \right) a root-finding method is used. At the maximum power point, the derivative of power with respect to current (or voltage) is zero. Differentiating the equation P = V I and evaluating at the maximum power current

0 = \frac{dP}{dI} \Bigr|_{I=I_{mp}} = \left(V + \frac{dV}{dI}\right) \Bigr|_{I=I_{mp}}

obtains

\frac{dV}{dI}\Bigr|_{I=I_{mp}} = \frac{-V_{mp}}{I_{mp}}

Differentiating V = V(I) with respect to current, and applying the identity \frac{dW\left( x \right)}{dx} = \frac{W\left( x \right)}{x \left( 1 + W \left( x \right) \right)} obtains

\frac{dV}{dI}\Bigr|_{I=I_{mp}} = -\left(R_s + \frac{R_{sh}}{1 + W\left( \psi \right)} \right)\Bigr|_{I=I_{mp}}

Equating the two expressions for \frac{dV}{dI}\Bigr|_{I=I_{mp}} and rearranging yields

\frac{\left(I_L + I_0 - I\right) R_{sh} - I R_s - n Ns V_{th} W\left( \psi \right)}{R_s + \frac{R_{sh}}{1 + W\left( \psi \right)}}\Bigr|_{I=I_{mp}} - I_{mp} = 0.

The above equation is solved for I_{mp} using Newton's method, and then V_{mp} = V \left( I_{mp} \right) is computed.

Bishop's Algorithm

The function :func:`pvlib.singlediode.bishop88` uses an explicit solution [4] that finds points on the IV curve by first solving for pairs (V_d, I) where V_d is the diode voltage V_d = V + I R_s. Then the voltage is backed out from V_d. Points with specific voltage or current are located using either Newton's or Brent's method, method='newton' or method='brentq', respectvely.

For example, to find the open circuit voltage, we start with an estimate given by

V_{oc, est} = n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)

We know that V_d = 0 corresponds to a voltage less than zero, and we can also show that when V_d = V_{oc, est}, the resulting current is also negative, meaning that the corresponding voltage must be in the 4th quadrant and therefore greater than the open circuit voltage (see proof below). Therefore the entire forward-bias 1st quadrant IV-curve is bounded because V_{oc} < V_{oc, est}, and so a bisection search between 0 and V_{oc, est} will always find any desired condition in the 1st quadrant including V_{oc}.

I = I_L - I_0 \left(\exp \left(\frac{V_{oc, est}}{n Ns V_{th}} \right) - 1 \right)
    - \frac{V_{oc, est}}{R_{sh}} \newline
I = I_L - I_0 \left(\exp \left(\frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{n Ns V_{th}} \right) - 1 \right)
    - \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
I = I_L - I_0 \left(\exp \left(\log \left(\frac{I_L}{I_0} + 1 \right) \right)  - 1 \right)
    - \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
I = I_L - I_0 \left(\frac{I_L}{I_0} + 1  - 1 \right)
    - \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
I = I_L - I_0 \left(\frac{I_L}{I_0} \right)
    - \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
I = I_L - I_L - \frac{n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
I = - \frac{n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)}{R_{sh}}

References

[1] "Exact analytical solutions of the parameters of real solar cells using Lambert W-function," A. Jain, A. Kapoor, Solar Energy Materials and Solar Cells, 81, (2004) pp 269-277. :doi:`10.1016/j.solmat.2003.11.018`

[2] "A new method to determine the diode ideality factor of real solar cell using Lambert W-function," A. Jain, A. Kapoor, Solar Energy Materials and Solar Cells, 85, (2005) 391-396. :doi:`10.1016/j.solmat.2004.05.022`

[3] "Parameter Estimation for Single Diode Models of Photovoltaic Modules," Clifford W. Hansen, Sandia Report SAND2015-2065, 2015 :doi:`10.13140/RG.2.1.4336.7842`

[4] "Computer simulation of the effects of electrical mismatches in photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988) :doi:`10.1016/0379-6787(88)90059-2`