ivcurves.compare_curves.score_curve#

ivcurves.compare_curves.score_curve(known_curve_params, fitted_curve_params, vth, num_pts, atol)#

Calculates the total score for a given fitted curve.

This score encodes how good an approximation the fitted curve is for the curve with the known parameters. If the score is small, then the fitted curve is close to the known curve.

Parameters:
  • known_curve_params (list) –

    A list of parameters representing a given IV curve. The list items should be in the order [il, io, rs, rsh, n, ns].

    ilnumeric

    Light-generated current \(I_L\) (photocurrent) [A]

    ionumeric

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

    rsnumeric

    Series resistance \(R_s\) under desired IV curve conditions. [ohm]

    rshnumeric

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

    nnumeric

    Diode ideality factor \(n\)

    nsnumeric

    Number of cells in series \(N_s\)

  • fitted_curve_params (list) –

    A list of parameters representing a given IV curve. Should be passed in the order [il, io, rs, rsh, n, ns].

    ilnumeric

    Light-generated current \(I_L\) (photocurrent) [A]

    ionumeric

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

    rsnumeric

    Series resistance \(R_s\) under desired IV curve conditions. [ohm]

    rshnumeric

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

    nnumeric

    Diode ideality factor \(n\)

    nsnumeric

    Number of cells in series \(N_s\)

  • 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).

  • num_pts (int) – Number of points we want to compare between the two curves.

  • atol (float) – The error of each of the solution pairs found is at most atol. (See ivcurves.precise.get_precise_i().) Each solution pair is a point on the curve.

Returns:

score – A measure for how close the two inputted curves are to each other.

Return type:

mpmath float

Notes

The user inputs parameters that they’ve fitted to a particular known IV curve. The curve from these fitted parameters is compared to the known IV curve. A sampling of points on the fitted curve are chosen. To get an associated point on the known curve, we draw a line from the origin that passes through the point on the fitted curve. This line will intersect the known curve; this point of intersection is what we compare the fitted point to. We then find the distance between these two points, using the definition of distance given in find_distance. The sum of the distances for each pair of associated points is the score.