Skip to content

Commit e7ec33c

Browse files
committed
rename parameters
1 parent e641956 commit e7ec33c

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

pvlib/ivtools/sdm/desoto.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def _fit_desoto_sandia_diode(ee, voc, vth, tc, specs, const):
402402
return np.array(res.params)[1]
403403

404404

405-
def fit_desoto_batzelis(isc0, voc0, imp0, vmp0, alpha_sc, beta_voc):
405+
def fit_desoto_batzelis(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc):
406406
"""
407407
Determine De Soto single-diode model parameters from datasheet values
408408
using Batzelis's method.
@@ -412,14 +412,14 @@ def fit_desoto_batzelis(isc0, voc0, imp0, vmp0, alpha_sc, beta_voc):
412412
413413
Parameters
414414
----------
415-
isc0 : float
416-
Short-circuit current at STC. [A]
417-
voc0 : float
418-
Open-circuit voltage at STC. [V]
419-
imp0 : float
420-
Maximum power point current at STC. [A]
421-
vmp0 : float
415+
v_mp : float
422416
Maximum power point voltage at STC. [V]
417+
i_mp : float
418+
Maximum power point current at STC. [A]
419+
v_oc : float
420+
Open-circuit voltage at STC. [V]
421+
i_sc : float
422+
Short-circuit current at STC. [A]
423423
alpha_sc : float
424424
Short-circuit current temperature coefficient at STC. [1/K]
425425
beta_voc : float
@@ -453,14 +453,14 @@ def fit_desoto_batzelis(isc0, voc0, imp0, vmp0, alpha_sc, beta_voc):
453453
w0 = np.real(lambertw(np.exp(1/del0 + 1)))
454454

455455
# Eqs 11-15
456-
a0 = del0 * voc0
457-
Rs0 = (a0 * (w0 - 1) - vmp0) / imp0
458-
Rsh0 = a0 * (w0 - 1) / (isc0 * (1 - 1/w0) - imp0)
459-
Iph0 = (1 + Rs0 / Rsh0) * isc0
456+
a0 = del0 * v_oc
457+
Rs0 = (a0 * (w0 - 1) - v_mp) / i_mp
458+
Rsh0 = a0 * (w0 - 1) / (i_sc * (1 - 1/w0) - i_mp)
459+
Iph0 = (1 + Rs0 / Rsh0) * i_sc
460460
Isat0 = Iph0 * np.exp(-1/del0)
461461

462462
return {
463-
'alpha_sc': alpha_sc * isc0, # convert 1/K to A/K
463+
'alpha_sc': alpha_sc * i_sc, # convert 1/K to A/K
464464
'a_ref': a0,
465465
'I_L_ref': Iph0,
466466
'I_o_ref': Isat0,

pvlib/pvarray.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def huld(effective_irradiance, temp_mod, pdc0, k=None, cell_type=None,
398398

399399

400400
def batzelis(effective_irradiance, temp_cell,
401-
isc0, voc0, imp0, vmp0, alpha_sc, beta_voc):
401+
v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc):
402402
"""
403403
Compute maximum power point, open circuit, and short circuit
404404
values using Batzelis's method.
@@ -414,14 +414,14 @@ def batzelis(effective_irradiance, temp_cell,
414414
Effective irradiance incident on the PV module. [Wm⁻²]
415415
temp_cell : numeric
416416
PV module operating temperature. [°C]
417-
isc0 : float
418-
Short-circuit current at STC. [A]
419-
voc0 : float
420-
Open-circuit voltage at STC. [V]
421-
imp0 : float
422-
Maximum power point current at STC. [A]
423-
vmp0 : float
417+
v_mp : float
424418
Maximum power point voltage at STC. [V]
419+
i_mp : float
420+
Maximum power point current at STC. [A]
421+
v_oc : float
422+
Open-circuit voltage at STC. [V]
423+
i_sc : float
424+
Short-circuit current at STC. [A]
425425
alpha_sc : float
426426
Short-circuit current temperature coefficient at STC. [1/K]
427427
beta_voc : float
@@ -461,8 +461,8 @@ def batzelis(effective_irradiance, temp_cell,
461461
462462
Examples
463463
--------
464-
>>> params = {'isc0': 15.98, 'voc0': 50.26, 'imp0': 15.27, 'vmp0': 42.57,
465464
... 'alpha_sc': 0.00046, 'beta_voc': -0.0024}
465+
>>> params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
466466
>>> batzelis(np.array([1000, 800]), np.array([25, 30]), **params)
467467
{'p_mp': array([650.0439 , 512.99195952]),
468468
'i_mp': array([15.27 , 12.23049227]),
@@ -487,20 +487,20 @@ def batzelis(effective_irradiance, temp_cell,
487487

488488
# Eqs 27-28
489489
alpha_imp = alpha_sc + (beta_voc - 1/t0) / (w0 - 1)
490-
beta_vmp = (voc0 / vmp0) * (
490+
beta_vmp = (v_oc / v_mp) * (
491491
beta_voc / (1 + del0) +
492492
(del0 * (w0 - 1) - 1/(1 + del0)) / t0
493493
)
494494

495495
# Eq 26
496-
eps0 = (del0 / (1 + del0)) * (voc0 / vmp0)
497-
eps1 = del0 * (w0 - 1) * (voc0 / vmp0) - 1
496+
eps0 = (del0 / (1 + del0)) * (v_oc / v_mp)
497+
eps1 = del0 * (w0 - 1) * (v_oc / v_mp) - 1
498498

499499
# Eqs 22-25
500-
isc = g * isc0 * (1 + alpha_sc * delT)
501-
voc = voc0 * (1 + del0 * lamT * lnG + beta_voc * delT)
502-
imp = g * imp0 * (1 + alpha_imp * delT)
503-
vmp = vmp0 * (1 + eps0 * lamT * lnG + eps1 * (1 - g) + beta_vmp * delT)
500+
isc = g * i_sc * (1 + alpha_sc * delT)
501+
voc = v_oc * (1 + del0 * lamT * lnG + beta_voc * delT)
502+
imp = g * i_mp * (1 + alpha_imp * delT)
503+
vmp = v_mp * (1 + eps0 * lamT * lnG + eps1 * (1 - g) + beta_vmp * delT)
504504

505505
# handle negative voltages from zero and extremely small irradiance
506506
vmp = np.clip(vmp, a_min=0, a_max=None)

tests/ivtools/sdm/test_desoto.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ def test_fit_desoto_sandia(cec_params_cansol_cs5p_220p):
9595

9696

9797
def test_fit_desoto_batzelis():
98-
params = {'isc0': 15.98, 'voc0': 50.26, 'imp0': 15.27, 'vmp0': 42.57,
9998
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
99+
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
100100
expected = { # calculated with the function itself
101101
'alpha_sc': 0.0073508,
102102
'a_ref': 1.7257631194825132,
@@ -112,7 +112,7 @@ def test_fit_desoto_batzelis():
112112
# ensure the STC values are reproduced
113113
iv = pvsystem.singlediode(out['I_L_ref'], out['I_o_ref'], out['R_s'],
114114
out['R_sh_ref'], out['a_ref'])
115-
assert iv['i_sc'] == pytest.approx(params['isc0'])
116-
assert iv['i_mp'] == pytest.approx(params['imp0'], rel=3e-3)
117-
assert iv['v_oc'] == pytest.approx(params['voc0'], rel=3e-4)
118-
assert iv['v_mp'] == pytest.approx(params['vmp0'], rel=4e-3)
115+
assert iv['i_sc'] == pytest.approx(params['i_sc'])
116+
assert iv['i_mp'] == pytest.approx(params['i_mp'], rel=3e-3)
117+
assert iv['v_oc'] == pytest.approx(params['v_oc'], rel=3e-4)
118+
assert iv['v_mp'] == pytest.approx(params['v_mp'], rel=4e-3)

tests/test_pvarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def test_huld_errors():
118118

119119

120120
def test_batzelis():
121-
params = {'isc0': 15.98, 'voc0': 50.26, 'imp0': 15.27, 'vmp0': 42.57,
122121
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
122+
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
123123
g = np.array([1000, 500, 1200, 500, 1200, 0, nan, 1000])
124124
t = np.array([25, 20, 20, 50, 50, 25, 0, nan])
125125
expected = { # these values were computed using pvarray.batzelis itself
@@ -148,8 +148,8 @@ def test_batzelis():
148148

149149

150150
def test_batzelis_negative_voltage():
151-
params = {'isc0': 15.98, 'voc0': 50.26, 'imp0': 15.27, 'vmp0': 42.57,
152151
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
152+
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
153153
actual = pvarray.batzelis(1e-10, 25, **params)
154154
assert actual['v_mp'] == 0
155155
assert actual['v_oc'] == 0

0 commit comments

Comments
 (0)