I-V Solver¶
This module collects the functions that solves I-V characteristics, including:
- Generate the IV characteristics from known J01, J01 , n1, n2
- Get J01 and J02 values from band gap or known EQEs using a detailed balance model
- Add series resistance into a known I-V characterisitcs
- Solve the I-V characteristics of multi-junction cell from the known I-Vs of each subcell
-
pypvcell.ivsolver.
calculate_j01
(eg_in_ev, temperature, n1, n_c=3.5, n_s=1, approx=False)[source]¶ Calculate the saturation radiative recombination current J01 from known band gap using the following expression:
\[J_{01}=\frac{2\pi q (n_c^2+n_s^2)}{\mbox{h}^3 \mbox{c}^2}\int_{0}^{E_g} \frac{E^2 dE}{\exp\left(\frac{E}{kT}\right)-1}\]If the parameter
approx
is set True, it uses an approximation of the above equation to calculate J01:\[J_{01}=\frac{2\pi k T q(n_c^2+n_s^2)}{\mbox{h}^3\mbox{c}^2}\exp(\frac{-E_g}{nkT})\left(E_g^2+2E_gkT+2k^2T^2\right)\]Parameters: - eg_in_ev (float) – band gap in eV
- temperature (float) – temperature in K
- n1 (float) – ideality factor
- n_c (float) – refractive index of the cell
- n_s (float) – refractive index of the surroundings
- approx (bool) – Set
true
to use approximation
Returns: the value of J01
Return type: float
-
pypvcell.ivsolver.
calculate_j01_from_qe
(qe: pypvcell.spectrum.Spectrum, n_c=3.5, n_s=1, threshold=0.001, step_in_ev=1e-05, lead_term=None, T=300)[source]¶ Calculate j01 from known absorptivity or QE using the following expression:
\[J_{01}=\frac{2\pi q (n_c^2+n_s^2)}{\mbox{h}^3 \mbox{c}^2}\int_{0}^{\infty} \frac{a(E)E^2 dE}{\exp\left(\frac{E}{kT}\right)-1}\]Parameters: - T (float) – temperature in Kelvin
- n_c (float) – the refractive index of the material
- n_s (float) – the refractive index of surroundings
- qe (Spectrum) – QE or absorptivity.
- threshold (float) – ignore the QE whose values are under the threshold
- step_in_ev (float) – meshgrid size when doing numerical integration trapz()
Returns: j01
Return type: float
-
pypvcell.ivsolver.
one_diode_v_from_i
(current, j01, rad_eta, n1, temperature, jsc)[source]¶ Calculate the voltage from demand current. This implementation drops the element that does not have log value, i.e. any log(x) that x<0
Parameters: - current (numpy.ndarray) – demand current
- j01 (float) – saturation current density
- rad_eta (float) – radiative efficiency
- n1 (float) – diode factor
- temperature (float) – temperature in K
- jsc (float) – Jsc. It has to be a positive value.
Returns: voltage, current, indexes that the values were kept
Return type: tuple(numpy.ndarray, numpy.ndarray, numpy.ndarray)
-
pypvcell.ivsolver.
solve_iv_range
(v_i, i_min, i_max, disc_num=1000)[source]¶ Calculate the voltages of a series-connected solar cells I-Vs for each current point Im:
\[V_{tot}(I_m)=\sum_{i=1}^N V_i(I_{m})\]Parameters: - v_i (list[tuple(numpy.ndarray,numpy.ndarray)]) – a list of (voltage, current) tuple of subcells
- i_min (float) – The minimum of the range of the current
- i_max (float) – The maximum of the range of the current
- disc_num (float) – The number of points of current to be discretized
Returns: voltage, current
Return type: tuple(numpy.ndarray, numpy.ndarray)
-
pypvcell.ivsolver.
solve_iv_range_obj
(subcells: typing.List, i_min, i_max, disc_num=1000)[source]¶ Calculate the voltages of a MJ cell from a given range of J and subcells. It finds a new V(J) such that V(J)=sum(V_i(J_i)), where V_i(J_i) is the J-V characteristics of the subcell i. This function only does one-run without iterating. The algorithm is the same as
solve_iv_range()
but this function takesSolarCell
objects as input rather than a list of (V,J) tuples.Parameters: - subcells (list[solarcell.SolarCell]) – A list of SolarCell objects
- i_min (float) – The minimum of the range of the current
- i_max (float) – The maximum of the range of the current
- disc_num (float) – number of descretions between i_min and i_max
Returns: voltage, current
Return type: tuple(numpy.ndarray, numpy.ndarray)
-
pypvcell.ivsolver.
solve_mj_iv_obj_with_optimization
(subcells, i_max=None, disc_num=1000, verbose=0)[source]¶ Solve the I-V of MJ cell from given subcells, namely
\[V_{tot}(I_m)=\sum_{i=1}^N V_i(I_{m})\]This function automatically choose the appropriate values of current
Parameters: - subcells – a list of SolarCell objects
- i_max – the maximum
- disc_num (int) – number of discretization
- verbose (int) – display the intermediate results
Returns: solved (voltage, current)
Return type: tuple(numpy.ndarray, numpy.ndarray)
-
pypvcell.ivsolver.
solve_ms_mj_iv
(v_i, ill_power)[source]¶ Calculate the efficiency of mechanical stack solar cell. It adds up the maximum power of each subcell and divde them by the illumination power.
Parameters: - v_i (float) – Voltage and current are 1D numpy arrays. The current density is in W/m^2
- ill_power – the illumnation power in W/m^2
Returns: efficiency
Return type: float