Skip to content

Commit d2d4d91

Browse files
committed
add function
1 parent 4089dd9 commit d2d4d91

1 file changed

Lines changed: 90 additions & 1 deletion

File tree

pvlib/pvarray.py

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import numpy as np
1212
from scipy.optimize import curve_fit
13-
from scipy.special import exp10
13+
from scipy.special import exp10, lambertw
1414

1515

1616
def pvefficiency_adr(effective_irradiance, temp_cell,
@@ -394,3 +394,92 @@ def huld(effective_irradiance, temp_mod, pdc0, k=None, cell_type=None,
394394
k[5] * tprime**2
395395
)
396396
return pdc
397+
398+
399+
def batzelis(effective_irradiance, temp_cell,
400+
isc0, voc0, imp0, vmp0, alpha_sc, beta_voc):
401+
"""
402+
Compute maximum power point, open circuit, and short circuit
403+
values using the Batzelis method.
404+
405+
Batzelis's method [1]_ is a fast method of computing the maximum
406+
power current and voltage. The calculations are rooted in the
407+
single-diode equation, but only typical datasheet information
408+
is required.
409+
410+
Parameters
411+
----------
412+
effective_irradiance : numeric, non-negative
413+
Effective irradiance incident on the PV module. [Wm⁻²]
414+
temp_cell : numeric
415+
PV module operating temperature. [°C]
416+
isc0 : float
417+
Short-circuit current at STC. [A]
418+
voc0 : float
419+
Open-circuit voltage at STC. [V]
420+
imp0 : float
421+
Maximum power point current at STC. [A]
422+
vmp0 : float
423+
Maximum power point voltage at STC. [V]
424+
alpha_sc : float
425+
Short-circuit current temperature coefficient at STC. [1/K]
426+
beta_voc : float
427+
Open-circuit voltage temperature coefficient at STC. [1/K]
428+
429+
Returns
430+
-------
431+
dict
432+
The returned dict-like object always contains the keys/columns:
433+
434+
* i_sc - short circuit current in amperes.
435+
* v_oc - open circuit voltage in volts.
436+
* i_mp - current at maximum power point in amperes.
437+
* v_mp - voltage at maximum power point in volts.
438+
* p_mp - power at maximum power point in watts.
439+
440+
Notes
441+
-----
442+
The ``alpha_sc`` and ``beta_voc`` temperature coefficient parameters
443+
must be given as normalized values.
444+
445+
References
446+
----------
447+
.. [1] E. I. Batzelis, "Simple PV Performance Equations Theoretically Well
448+
Founded on the Single-Diode Model," Journal of Photovoltaics vol. 7,
449+
no. 5, pp. 1400-1409, Sep 2017, :doi:`10.1109/JPHOTOV.2017.2711431`
450+
"""
451+
452+
t0 = 298.15
453+
delT = temp_cell - (t0 - 273.15)
454+
lamT = (temp_cell + 273.15) / t0
455+
g = effective_irradiance / 1000
456+
lnG = np.log(g)
457+
458+
# Eq 9-10
459+
del0 = (1 - beta_voc * t0) / (50.1 - alpha_sc * t0)
460+
w0 = lambertw(np.exp(1/del0 + 1)).real
461+
462+
# Eqs 27-28
463+
alpha_imp = alpha_sc + (beta_voc - 1/t0) / (w0 - 1)
464+
beta_vmp = (voc0 / vmp0) * (
465+
beta_voc / (1 + del0) +
466+
(del0 * (w0 - 1) - 1/(1 + del0)) / t0
467+
)
468+
469+
# Eq 26
470+
eps0 = (del0 / (1 + del0)) * (voc0 / vmp0)
471+
eps1 = del0 * (w0 - 1) * (voc0 / vmp0) - 1
472+
473+
# Eqs 22-25
474+
isc = g * isc0 * (1 + alpha_sc * delT)
475+
voc = voc0 * (1 + del0 * lamT * lnG + beta_voc * delT)
476+
imp = g * imp0 * (1 + alpha_imp * delT)
477+
vmp = vmp0 * (1 + eps0 * lamT * lnG + eps1 * (1 - g) + beta_vmp * delT)
478+
479+
return {
480+
'p_mp': vmp * imp,
481+
'i_mp': imp,
482+
'v_mp': vmp,
483+
'i_sc': isc,
484+
'v_oc': voc,
485+
}

0 commit comments

Comments
 (0)