pvfit.modeling.simulation.dc.double_diode package¶
Submodules¶
pvfit.modeling.simulation.dc.double_diode.equation module¶
-
pvfit.modeling.simulation.dc.double_diode.equation.FF(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, minimize_scalar_bounded_options=None, newton_options=None)¶ Compute fill factor (unitless fraction).
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as P_mp().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of P_mp() with the addition of:
- FF fill factor I_sc_A short-circuit current
-
pvfit.modeling.simulation.dc.double_diode.equation.I_at_V(*, V_V, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute terminal current from terminal voltage using Newton’s method.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as current_sum_at_diode_node(), but with removal of I_A and addition of:
- newton_options (optional) options for Newton solver
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of current_sum_at_diode_node() with the addition of:
- I_A terminal current
- Compute strategy:
- Compute initial condition for I_A with explicit equation using R_s_Ohm==0.
- Compute using Newton’s method.
-
pvfit.modeling.simulation.dc.double_diode.equation.I_at_V_d1(*, V_V, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute 1st derivative of terminal current with respect to terminal voltage at specified terminal voltage.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as I_at_V()).
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of I_at_V() with the addition of:
- I_d1_V_S 1st derivative of terminal current w.r.t terminal voltage
Notes
This derivative is needed for R_oc_Ohm and R_sc_Ohm calculations.
-
pvfit.modeling.simulation.dc.double_diode.equation.P_at_V(*, V_V, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute terminal power from terminal voltage.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as I_at_V().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of I_at_V() with the addition of:
- P_W terminal power
-
pvfit.modeling.simulation.dc.double_diode.equation.P_mp(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, minimize_scalar_bounded_options=None, newton_options=None)¶ Compute maximum terminal power.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as power_from_voltage(), but with removal of V_V.
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- P_mp_W maximum power V_mp_V voltage at maximum power I_mp_A current at maximum power V_oc_V voltage at open circuit
- Compute strategy:
- Compute solution bracketing interval as [0, Voc].
- Compute maximum power on solution bracketing interval using scipy.optimize.minimize_scalar().
-
pvfit.modeling.simulation.dc.double_diode.equation.R_oc(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute resistance at open circuit in Ohms.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as P_mp().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- R_oc_Ohm resistance at open circuit V_oc_V open-circuit voltage
-
pvfit.modeling.simulation.dc.double_diode.equation.R_sc(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute resistance at short circuit in Ohms.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as P_mp().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- R_sc_Ohm resistance at short circuit I_sc_A short-circuit current
-
pvfit.modeling.simulation.dc.double_diode.equation.V_at_I(*, I_A, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute terminal voltage from terminal current using Newton’s method.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as current_sum_at_diode_node(), but with removal of v_V and addition of:
- newton_options (optional) options for Newton solver
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of current_sum_at_diode_node() with the addition of:
- v_V terminal voltage
- Compute strategy:
- Compute initial condition for V_V with explicit piecewise linear approximation to I-V curve using the tangent lines passing through the I-V curve at Isc and Voc.
- Compute using Newton’s method.
-
pvfit.modeling.simulation.dc.double_diode.equation.V_oc(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, newton_options=None)¶ Compute open-circuit voltage (terminal voltage where terminal current is zero).
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as current_sum_at_diode_node(), with the exception of V_V and I_A
- Outputs (device-level, at each combination of inputs):
- dict containing:
- V_oc_V open-circuit voltage
- # Compute strategy:
- Use V=0-centered second degree polynomial approximation of the (V=Voc, I=0)-substituted DDM equation to get an initial approximation Voc that must be greater than the true Voc.
- If that Voc approximation causes large negative current in the I-V curve, then bisect Voc and iterate with the new centering point.
- Solve using Newton’s method that must reliably converge to Voc from a starting Voc that is greater than the true value, because of the curvature of the function to be zeroed.
-
pvfit.modeling.simulation.dc.double_diode.equation.current_sum_at_diode_node(*, V_V, I_A, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S)¶ Computes the sum of the currents at the diode’s anode node in the 7-parameter double-diode equation (DDE) equivalent-circuit model at a single temperature and irradiance.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Observables at operating condition (device-level):
- V_V terminal voltage I_A terminal current
- Model parameters at operating condition (device-level):
- N_s integer number of cells in series in each parallel string T_degC effective diode-junction temperature I_ph_A photocurrent I_rs_1_A first diode reverse-saturation current n_1 first diode ideality factor I_rs_2_A second diode reverse-saturation current n_2 second diode ideality factor R_s_Ohm series resistance G_p_S parallel conductance
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- I_sum_A sum of currents at high-voltage diodes node V_diode_V voltage at high-voltage diodes node n_mod_1_V first modified diode ideality factor n_mod_2_V second modified diode ideality factor
-
pvfit.modeling.simulation.dc.double_diode.equation.iv_params(*, N_s, T_degC, I_ph_A, I_rs_1_A, n_1, I_rs_2_A, n_2, R_s_Ohm, G_p_S, minimize_scalar_bounded_options=None, newton_options=None)¶ Compute I-V curve parameters.
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Same as P_mp().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing the outputs of FF() with the addition of:
- R_oc_Ohm resistance at open circuit R_sc_Ohm resistance at short circuit
pvfit.modeling.simulation.dc.double_diode.equation_h module¶
WARNING: This code is experimental and not subject to semantic versioning.
This is to be incorporated into equation.py. Set R_h_Ohm = 0 to “fall back” to standard DDE.
-
pvfit.modeling.simulation.dc.double_diode.equation_h.I_at_V(*, V_V: Union[float, numpy.float64, numpy.ndarray], N_s: Union[int, numpy.int32, numpy.ndarray], T_degC: Union[float, numpy.float64, numpy.ndarray], I_ph_A: Union[float, numpy.float64, numpy.ndarray], I_rs_1_A: Union[float, numpy.float64, numpy.ndarray], n_1: Union[float, numpy.float64, numpy.ndarray], I_rs_h_A: Union[float, numpy.float64, numpy.ndarray], n_h: Union[float, numpy.float64, numpy.ndarray], R_h_Ohm: Union[float, numpy.float64, numpy.ndarray], R_s_Ohm: Union[float, numpy.float64, numpy.ndarray], G_p_S: Union[float, numpy.float64, numpy.ndarray], newton_options: Optional[dict] = None) → dict¶ Compute terminal current from terminal voltage using Newton’s method.
Parameters: - V_V – Terminal voltage [V].
- N_s – Number of cells in series in each parallel string [·].
- T_degC – Temperature of device [°C].
- I_ph_A – Photocurrent [A].
- I_rs_1_A – Reverse-saturation current of main diode [A].
- n_1 – Ideality factor of main diode [·].
- I_rs_h_A – Reverse-saturation current of diode in series with resistor [A].
- n_h – Ideality factor of diode of diode in series with resistor [·].
- R_h_Ohm – Series resistance of resistor in series with diode [Ω].
- R_s_Ohm – Series resistance [Ω].
- G_p_S – Parallel conductance [S].
- newton_options – Options for Newton solver (see scipy.optimize.newton).
Returns: result –
- I_A
Terminal current [A].
- I_sum_A
Sum of currents at diode’s anode node [A].
- T_K
Temperature of device [K].
- V_1_V
Voltage at high-voltage side of main diode node [V].
- n_1_mod_V
Modified ideality factor for main diode [V].
- V_h_V
Voltage at high-voltage side of diode in series with resistor [V].
- n_h_mod_V
Modified ideality factor for diode in series with resistor [V].
Return type: dict
Notes
All parameters are at the device level, where the device consists of N_s PV cells in series in each of N_p strings in parallel. Inputs must be broadcast compatible. Output values are numpy.float64 or numpy.ndarray.
Compute strategy:
1) Compute initial condition for I_A with explicit equation using R_s_Ohm==0. 2) Compute using scipy.optimize.newton.
-
pvfit.modeling.simulation.dc.double_diode.equation_h.current_sum_at_diode_node(*, V_V: Union[float, numpy.float64, numpy.ndarray], I_A: Union[float, numpy.float64, numpy.ndarray], N_s: Union[int, numpy.int32, numpy.ndarray], T_degC: Union[float, numpy.float64, numpy.ndarray], I_ph_A: Union[float, numpy.float64, numpy.ndarray], I_rs_1_A: Union[float, numpy.float64, numpy.ndarray], n_1: Union[float, numpy.float64, numpy.ndarray], I_rs_h_A: Union[float, numpy.float64, numpy.ndarray], n_h: Union[float, numpy.float64, numpy.ndarray], R_h_Ohm: Union[float, numpy.float64, numpy.ndarray], R_s_Ohm: Union[float, numpy.float64, numpy.ndarray], G_p_S: Union[float, numpy.float64, numpy.ndarray]) → dict¶ Computes the sum of the currents at the high-voltage node of the main diode in the 8-parameter double-diode equation (DDE) equivalent-circuit model.
Parameters: - V_V – Terminal voltage [V].
- I_A – Terminal current [A].
- N_s – Number of cells in series in each parallel string [·].
- T_degC – Temperature of device [°C].
- I_ph_A – Photocurrent [A].
- I_rs_1_A – Reverse-saturation current of main diode [A].
- n_1 – Ideality factor of main diode [·].
- I_rs_h_A – Reverse-saturation current of diode in series with resistor [A].
- n_h – Ideality factor of diode of diode in series with resistor [·].
- R_h_Ohm – Series resistance of resistor in series with diode [Ω].
- R_s_Ohm – Series resistance [Ω].
- G_p_S – Parallel conductance [S].
Returns: result –
- I_sum_A
Sum of currents at high-voltage node of main diode [A].
- T_K
Temperature of device [K].
- V_1_V
Voltage at high-voltage node of main diode [V].
- n_1_mod_V
Modified ideality factor for main diode [V].
- V_h_V
Voltage at high-voltage node of diode in series with resistor [V].
- n_h_mod_V
Modified ideality factor for diode in series with resistor [V].
Return type: dict
Notes
All parameters are at the device level, where the device consists of N_s PV cells in series in each of N_p strings in parallel. Inputs must be broadcast compatible. Output values are numpy.float64 or numpy.ndarray.
pvfit.modeling.simulation.dc.double_diode.model module¶
-
pvfit.modeling.simulation.dc.double_diode.model.auxiliary_equations(*, F, T_degC, I_sc_A_0, I_rs_1_A_0, n_1_0, I_rs_2_0_A, n_2_0, R_s_Ohm_0, G_p_S_0, E_g_eV_0, N_s, T_degC_0=25.0)¶ Computes the auxiliary equations at F and T_degC for the 8-parameter DDM-G.
- Inputs (any broadcast-compatible combination of scalars and numpy arrays):
- Same as current_sum_at_diode_node().
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- I_ph_A photocurrent I_rs_1_A first diode reverse-saturation current n_1 first diode ideality factor I_rs_2_A second diode reverse-saturation current n_2 second diode ideality factor R_s_Ohm series resistance G_p_S parallel conductance N_s integer number of cells in series in each parallel string T_degC temperature
-
pvfit.modeling.simulation.dc.double_diode.model.current_sum_at_diode_node(*, V_V, I_A, F, T_degC, I_sc_A_0, I_rs_1_A_0, n_1_0, I_rs_2_0_A, n_2_0, R_s_Ohm_0, G_p_S_0, E_g_eV_0, N_s, T_degC_0=25.0)¶ Computes the sum of the currents at the diode’s anode node in the implicit 8-parameter global double-diode equivalent-circuit model (DDM-G).
- Inputs (any broadcast-compatible combination of python/numpy scalars and numpy arrays):
- Observables at operating condition(s) (device-level):
- V_V terminal voltage I_A terminal current F effective irradiance ratio on diode junction T_degC temperature
- Parameters at reference condition (device-level):
- I_sc_A_0 short-circuit current I_rs_A_1_0 first diode reverse-saturation current n_1_0 first diode ideality factor I_rs_A_2_0 second diode reverse-saturation current n_2_0 second diode ideality factor R_s_Ohm_0 series resistance G_p_S_0 parallel (shunt) conductance E_g_eV_0 material band gap N_s integer number of cells in series in each parallel string T_degC_0 (optional) temperature at reference condition
- Outputs (device-level, at each combination of broadcast inputs, return type is numpy.float64 for all scalar inputs):
- dict containing:
- I_sum_A sum of currents at diode’s anode node T_K temperature of diode junction (in Kelvin) V_diode_V voltage at diode’s anode node n_mod_1_V first modified diode ideality factor n_mod_2_V second modified diode ideality factor