ivcurves.precise.get_precise_i#

ivcurves.precise.get_precise_i(il, io, rs, rsh, n, vth, ns, atol, num_pts)#

Calculates precise solutions to the single diode equation for the given parameters, with an error of at most atol.

Parameters:
  • il (numeric) – Light-generated current \(I_L\) (photocurrent) [A]

  • io (numeric) – Diode saturation \(I_0\) current under desired IV curve conditions. [A]

  • rs (numeric) – Series resistance \(R_s\) under desired IV curve conditions. [ohm]

  • rsh (numeric) – Shunt resistance \(R_{sh}\) under desired IV curve conditions. [ohm]

  • n (numeric) – Diode ideality factor \(n\)

  • vth (numeric) – Thermal voltage of the cell \(V_{th}\) [V] The thermal voltage of the cell (in volts) may be calculated as \(k_B T_c / q\), where \(k_B\) is Boltzmann’s constant (J/K), \(T_c\) is the temperature of the p-n junction in Kelvin, and \(q\) is the charge of an electron (coulombs).

  • ns (numeric) – Number of cells in series \(N_s\)

  • atol (numeric) –

    The error of each of the returned solution pairs is at most atol.

    Each returned voltage, current pair is a solution to the single diode equation. Because we are working with inexact numbers, these pairs are rarely exact solutions to this equation. Here, an error of at most atol means that for a given \((V, I)\) pair,

    \[\left| I_L - I_0 \left[ \exp \left( \frac{V+I R_s}{n N_s V_{th}} \right) - 1 \right] - \frac{V + I R_s}{R_{sh}} - I \right| < \text{atol}\]

  • num_pts (int) – Number of points calculated on IV curve.

Returns:

(vv, precise_i)vv and precise_i are numpy arrays of mpmath floats of length num_pts.

Return type:

tuple of numpy arrays

Notes

Uses pvlib.pvsystem.singlediode() to generate solution pairs, then uses lambert_i_from_v() to sharpen the precision of the solutions if necessary.