You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
power_mismatch_deline docstring: the rear-to-total RMAD conversion has an extra bifaciality factor #2929
Describe the bug
The Notes of pvlib.bifacial.power_mismatch_deline convert the RMAD of the rear irradiance to the RMAD of the total irradiance with one bifaciality factor too many. The docstring says
$$RMAD(k \cdot X + c) = RMAD(X) \cdot k \frac{k \bar{X}}{k \bar{X} + c} = RMAD(X) \cdot \frac{k}{1 + \frac{c}{k \bar{X}}}$$
Following the docstring understates the total RMAD by the factor $\phi_{Bifi}$, about 30 % for a bifaciality of 0.7, and so the mismatch loss as well. The function's code isn't affected: it takes the total RMAD as given. Only the formula in the Notes is.
To Reproduce
importnumpyasnprng=np.random.default_rng(0)
g_rear=rng.uniform(80, 160, 72) # W/m2, one value per cellg_front=900.0# W/m2, uniform frontphi=0.7# bifacialityg_total=g_front+phi*g_rear# Eq. (2) of Deline et al. (2020)defrmad(x):
x=np.asarray(x, dtype=float)
returnnp.abs(x[:, None] -x[None, :]).sum() / (x.size**2*x.mean())
rmad_rear=rmad(g_rear)
print(rmad(g_total)) # 0.0193862763print(rmad_rear/ (1+g_front/ (phi*g_rear.mean()))) # 0.0193862763print(rmad_rear*phi/ (1+g_front/ (phi*g_rear.mean()))) # 0.0135703934, the docstring's form
Expected behavior
The Notes would read $RMAD(k \cdot X + c) = RMAD(X) \cdot \frac{k \bar{X}}{k \bar{X} + c} = \frac{RMAD(X)}{1 + \frac{c}{k \bar{X}}}$, and $RMAD_{total} = \frac{RMAD_{rear}}{1 + \frac{G_{front}}{\phi_{Bifi} \bar{G}_{rear}}}$. The text is in pvlib/bifacial/loss_models.py, lines 118–132 on main today.
Versions:
pvlib.__version__: 0.16.1 (the same text is on main)
Dang it, I don't remember what I did to derive that. Well spotted and tested @anasnedos! Thanks!
The underestimation is exactly that of $$1 - \phi_{Bifi}$$. I will fix that in short.
Activity
cwhanse commentedon Oct 31, 2026
Confirmed, thanks for reporting. The docstring is incorrect; should be (unless I've mistyped here)
and
echedey-ls commentedon Nov 1, 2026
Dang it, I don't remember what I did to derive that. Well spotted and tested @anasnedos! Thanks!$$1 - \phi_{Bifi}$$ . I will fix that in short.
The underestimation is exactly that of