Skip to content

Commit 8becc1a

Browse files
committed
switch to non-normalized temp coeffs
1 parent e7ec33c commit 8becc1a

File tree

4 files changed

+26
-22
lines changed

4 files changed

+26
-22
lines changed

pvlib/ivtools/sdm/desoto.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ def fit_desoto_batzelis(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc):
421421
i_sc : float
422422
Short-circuit current at STC. [A]
423423
alpha_sc : float
424-
Short-circuit current temperature coefficient at STC. [1/K]
424+
Short-circuit current temperature coefficient at STC. [A/K]
425425
beta_voc : float
426-
Open-circuit voltage temperature coefficient at STC. [1/K]
426+
Open-circuit voltage temperature coefficient at STC. [V/K]
427427
428428
Returns
429429
-------
@@ -447,6 +447,10 @@ def fit_desoto_batzelis(v_mp, i_mp, v_oc, i_sc, alpha_sc, beta_voc):
447447
IEEE Trans. Sustain. Energy, vol. 7, no. 2, pp. 504-512, Apr 2016.
448448
:doi:`10.1109/TSTE.2015.2503435`
449449
"""
450+
# convert temp coeffs from A/K and V/K to 1/K
451+
alpha_sc = alpha_sc / i_sc
452+
beta_voc = beta_voc / v_oc
453+
450454
# Equation numbers refer to [1]
451455
t0 = 298.15 # K
452456
del0 = (1 - beta_voc * t0) / (50.1 - alpha_sc * t0) # Eq 9

pvlib/pvarray.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ def batzelis(effective_irradiance, temp_cell,
423423
i_sc : float
424424
Short-circuit current at STC. [A]
425425
alpha_sc : float
426-
Short-circuit current temperature coefficient at STC. [1/K]
426+
Short-circuit current temperature coefficient at STC. [A/K]
427427
beta_voc : float
428-
Open-circuit voltage temperature coefficient at STC. [1/K]
428+
Open-circuit voltage temperature coefficient at STC. [V/K]
429429
430430
Returns
431431
-------
@@ -447,9 +447,6 @@ def batzelis(effective_irradiance, temp_cell,
447447
(taken from the De Soto model)
448448
3. estimating the MPP, OC, and SC points on the resulting I-V curve.
449449
450-
The ``alpha_sc`` and ``beta_voc`` temperature coefficient parameters
451-
must be given as normalized values.
452-
453450
At extremely low irradiance (e.g. 1e-10 Wm⁻²), this model can produce
454451
negative voltages. This function clips any negative voltages to zero.
455452
@@ -461,15 +458,18 @@ def batzelis(effective_irradiance, temp_cell,
461458
462459
Examples
463460
--------
464-
... 'alpha_sc': 0.00046, 'beta_voc': -0.0024}
465461
>>> params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
462+
... 'alpha_sc': 0.007351, 'beta_voc': -0.120624}
466463
>>> batzelis(np.array([1000, 800]), np.array([25, 30]), **params)
467-
{'p_mp': array([650.0439 , 512.99195952]),
468-
'i_mp': array([15.27 , 12.23049227]),
469-
'v_mp': array([42.57 , 41.94368864]),
470-
'i_sc': array([15.98 , 12.8134032]),
471-
'v_oc': array([50.26 , 49.26532905])}
464+
{'p_mp': array([650.0439 , 512.99199048]),
465+
'i_mp': array([15.27 , 12.23049303]),
466+
'v_mp': array([42.57 , 41.94368856]),
467+
'i_sc': array([15.98 , 12.813404]),
468+
'v_oc': array([50.26 , 49.26532902])}
472469
"""
470+
# convert temp coeffs from A/K and V/K to 1/K
471+
alpha_sc = alpha_sc / i_sc
472+
beta_voc = beta_voc / v_oc
473473

474474
t0 = 298.15
475475
delT = temp_cell - (t0 - 273.15)

tests/ivtools/sdm/test_desoto.py

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

9696

9797
def test_fit_desoto_batzelis():
98-
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
9998
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
99+
'alpha_sc': 0.007351, 'beta_voc': -0.120624}
100100
expected = { # calculated with the function itself
101-
'alpha_sc': 0.0073508,
102-
'a_ref': 1.7257631194825132,
103-
'I_L_ref': 15.985408869737098,
104-
'I_o_ref': 3.594300567343102e-12,
105-
'R_sh_ref': 389.4378389153357,
106-
'R_s': 0.1318159287478395
101+
'alpha_sc': 0.007351,
102+
'a_ref': 1.7257632483733483,
103+
'I_L_ref': 15.985408866796396,
104+
'I_o_ref': 3.594308384705643e-12,
105+
'R_sh_ref': 389.4379947026243,
106+
'R_s': 0.13181590981241956,
107107
}
108108
out = sdm.fit_desoto_batzelis(**params)
109109
for k in expected:

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-
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
122121
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
122+
'alpha_sc': 0.007351, 'beta_voc': -0.120624}
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-
'alpha_sc': 0.00046, 'beta_voc': -0.0024}
152151
params = {'i_sc': 15.98, 'v_oc': 50.26, 'i_mp': 15.27, 'v_mp': 42.57,
152+
'alpha_sc': 0.007351, 'beta_voc': -0.120624}
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)