Skip to content

Commit 1a42153

Browse files
committed
DOC: move proof that estimated Voc is in q4
* closes pvlib#518 * add singlediode.rst and add to index
1 parent 611f409 commit 1a42153

File tree

3 files changed

+100
-41
lines changed

3 files changed

+100
-41
lines changed

docs/sphinx/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Contents
8181
api
8282
comparison_pvlib_matlab
8383
variables_style_rules
84+
singlediode
8485

8586

8687
Indices and tables

docs/sphinx/source/singlediode.rst

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
.. _singlediode:
2+
3+
Single Diode Model
4+
==================
5+
6+
This section reviews the solutions to the single diode model used in
7+
pvlib-python to generate an IV curve of a PV module.
8+
9+
pvlib-python supports two ways to solve the single diode model, by passing the
10+
a ``method`` keyword to the :func:`pvlib.pvsystem.singlediode` function:
11+
12+
1. Lambert W-Function
13+
2. Bishop's Algorithm
14+
15+
Lambert W-Function
16+
------------------
17+
When ``method='lambertw'``, the Lambert W-Function is used as previously shown
18+
by Jain and Kapoor [1]. The following algorithm can be found on
19+
`Wikipedia: Theory of Solar Cells
20+
<https://en.wikipedia.org/wiki/Theory_of_solar_cells>`_ given the basic single
21+
diode model equation.
22+
23+
.. math::
24+
25+
I = I_L - I_0 \left(\exp \left(\frac{\left(V + I R_s \right)}{n Ns V_{th}} \right) - 1 \right)
26+
- \frac{\left(V + I R_s \right)}{R_{sh}}
27+
28+
Lambert W-function is the inverse of the function
29+
:math:`f \left( w \right) = w \exp \left( w \right)` or
30+
:math:`w = f^{-1} \left( w \exp \left( w \right) \right)` also given as
31+
:math:`w = W \left( w \exp \left( w \right) \right)`. Rearranging the single
32+
diode equation above with a Lambert W-function yields the following.
33+
34+
.. math::
35+
36+
z = \frac{R_s I_0}{n Ns V_{th} \left(1 + \frac{R_s}{R_{sh}} \right)} \exp \left(
37+
\frac{R_s \left( I_L + I_0 \right) + V}{n Ns V_{th} \left(1 + \frac{R_s}{R_{sh}}\right)}
38+
\right)
39+
40+
The the module current can be solved using the Lambert W-function.
41+
42+
.. math::
43+
44+
I = \frac{I_L + I_0 - \frac{V}{R_{sh}}}{1 + \frac{R_s}{R_{sh}}}
45+
- \frac{n Ns V_{th}}{R_s} W(z)
46+
47+
48+
Bishop's Algorithm
49+
------------------
50+
The function :func:`pvlib.singlediode.bishop88` uses an explicit solution [2]
51+
that finds points on the IV curve by first solving for pairs :math:`(V_d, I)`
52+
where :math:`V_d` is the diode voltage :math:`V_d = V + I*Rs`. Then the voltage
53+
is backed out from :math:`V_d`. Points with specific voltage, such as open
54+
circuit, are located using the bisection search method, ``brentq``, bounded
55+
by a zero diode voltage and an estimate of open circuit voltage given by
56+
57+
.. math::
58+
59+
V_{oc, est} = n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)
60+
61+
We know that :math:`V_d = 0` corresponds to a voltage less than zero, and
62+
we can also show that when :math:`V_d = V_{oc, est}`, the resulting
63+
current is also negative, meaning that the corresponding voltage must be
64+
in the 4th quadrant and therefore greater than the open circuit voltage
65+
(see proof below). Therefore the entire forward-bias 1st quadrant IV-curve
66+
is bounded, and a bisection search within these points will always find
67+
desired condition.
68+
69+
.. math::
70+
71+
I = I_L - I_0 \left(\exp \left(\frac{V_{oc, est}}{n Ns V_{th}} \right) - 1 \right)
72+
- \frac{V_{oc, est}}{R_{sh}} \newline
73+
74+
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)
75+
- \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
76+
77+
I = I_L - I_0 \left(\exp \left(\log \left(\frac{I_L}{I_0} + 1 \right) \right) - 1 \right)
78+
- \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
79+
80+
I = I_L - I_0 \left(\frac{I_L}{I_0} + 1 - 1 \right)
81+
- \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
82+
83+
I = I_L - I_0 \left(\frac{I_L}{I_0} \right)
84+
- \frac{n Ns V_{th} \log \left(\frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
85+
86+
I = I_L - I_L - \frac{n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)}{R_{sh}} \newline
87+
88+
I = - \frac{n Ns V_{th} \log \left( \frac{I_L}{I_0} + 1 \right)}{R_{sh}}
89+
90+
References
91+
----------
92+
[1] A. Jain, A. Kapoor, "Exact analytical solutions of the
93+
parameters of real solar cells using Lambert W-function", Solar
94+
Energy Materials and Solar Cells, 81 (2004) 269-277.
95+
96+
[2] "Computer simulation of the effects of electrical mismatches in
97+
photovoltaic cell interconnection circuits" JW Bishop, Solar Cell (1988)
98+
https://doi.org/10.1016/0379-6787(88)90059-2

pvlib/pvsystem.py

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,52 +1963,12 @@ def singlediode(photocurrent, saturation_current, resistance_series,
19631963
open-circuit.
19641964
19651965
If the method is either ``'newton'`` or ``'brentq'`` and ``ivcurve_pnts``
1966-
are indicated, then :func:`pvlib.singlediode.bishop88` is used to
1966+
are indicated, then :func:`pvlib.singlediode.bishop88` [4] is used to
19671967
calculate the points on the IV curve points at diode voltages from zero to
19681968
open-circuit voltage with a log spacing that gets closer as voltage
19691969
increases. If the method is ``'lambertw'`` then the calculated points on
19701970
the IV curve are linearly spaced.
19711971
1972-
The ``bishop88`` method uses an explicit solution from [4] that finds
1973-
points on the IV curve by first solving for pairs :math:`(V_d, I)` where
1974-
:math:`V_d` is the diode voltage :math:`V_d = V + I*Rs`. Then the voltage
1975-
is backed out from :math:`V_d`. Points with specific voltage, such as open
1976-
circuit, are located using the bisection search method, ``brentq``, bounded
1977-
by a zero diode voltage and an estimate of open circuit voltage given by
1978-
1979-
.. math::
1980-
1981-
V_{oc, est} = n Ns V_{th} \\log \\left( \\frac{I_L}{I_0} + 1 \\right)
1982-
1983-
We know that :math:`V_d = 0` corresponds to a voltage less than zero, and
1984-
we can also show that when :math:`V_d = V_{oc, est}`, the resulting
1985-
current is also negative, meaning that the corresponding voltage must be
1986-
in the 4th quadrant and therefore greater than the open circuit voltage
1987-
(see proof below). Therefore the entire forward-bias 1st quadrant IV-curve
1988-
is bounded, and a bisection search within these points will always find
1989-
desired condition.
1990-
1991-
.. math::
1992-
1993-
I = I_L - I_0 \\left(\\exp \\left(\\frac{V_{oc, est}}{n Ns V_{th}} \\right) - 1 \\right)
1994-
- \\frac{V_{oc, est}}{R_{sh}} \\newline
1995-
1996-
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)
1997-
- \\frac{n Ns V_{th} \\log \\left(\\frac{I_L}{I_0} + 1 \\right)}{R_{sh}} \\newline
1998-
1999-
I = I_L - I_0 \\left(\\exp \\left(\\log \\left(\\frac{I_L}{I_0} + 1 \\right) \\right) - 1 \\right)
2000-
- \\frac{n Ns V_{th} \\log \\left(\\frac{I_L}{I_0} + 1 \\right)}{R_{sh}} \\newline
2001-
2002-
I = I_L - I_0 \\left(\\frac{I_L}{I_0} + 1 - 1 \\right)
2003-
- \\frac{n Ns V_{th} \\log \\left(\\frac{I_L}{I_0} + 1 \\right)}{R_{sh}} \\newline
2004-
2005-
I = I_L - I_0 \\left(\\frac{I_L}{I_0} \\right)
2006-
- \\frac{n Ns V_{th} \\log \\left(\\frac{I_L}{I_0} + 1 \\right)}{R_{sh}} \\newline
2007-
2008-
I = I_L - I_L - \\frac{n Ns V_{th} \log \\left( \\frac{I_L}{I_0} + 1 \\right)}{R_{sh}} \\newline
2009-
2010-
I = - \\frac{n Ns V_{th} \\log \\left( \\frac{I_L}{I_0} + 1 \\right)}{R_{sh}}
2011-
20121972
References
20131973
-----------
20141974
[1] S.R. Wenham, M.A. Green, M.E. Watt, "Applied Photovoltaics" ISBN

0 commit comments

Comments
 (0)