diff --git a/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py b/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py index 9b02bfb58e..cb0d4c4634 100644 --- a/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py +++ b/docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py @@ -100,13 +100,12 @@ # -def rmad(data, axis=None): +def rmad(data): """ - Relative Mean Absolute Difference. Output is [Unitless]. - https://stackoverflow.com/a/19472336/19371110 + Relative Mean Absolute Difference. Output is [Unitless]. Eq. (4) of [1]_. """ - mean = np.mean(data, axis) - mad = np.mean(np.absolute(data - mean), axis) + mean = np.mean(data) + mad = np.mean(np.absolute(np.subtract.outer(data, data))) return mad / mean diff --git a/docs/sphinx/source/whatsnew/v0.11.1.rst b/docs/sphinx/source/whatsnew/v0.11.1.rst index 4ccc9687c3..bfd0d7f64e 100644 --- a/docs/sphinx/source/whatsnew/v0.11.1.rst +++ b/docs/sphinx/source/whatsnew/v0.11.1.rst @@ -41,6 +41,8 @@ Requirements Contributors ~~~~~~~~~~~~ +* Echedey Luis (:ghuser:`echedey-ls`) +* Chris Deline (:ghuser:`cdeline`) * Ioannis Sifnaios (:ghuser:`IoannisSifnaios`) * Leonardo Micheli (:ghuser:`lmicheli`) * Echedey Luis (:ghuser:`echedey-ls`) diff --git a/pvlib/bifacial/loss_models.py b/pvlib/bifacial/loss_models.py index cbcb2ba4d1..3582e8a6c9 100644 --- a/pvlib/bifacial/loss_models.py +++ b/pvlib/bifacial/loss_models.py @@ -71,7 +71,7 @@ def power_mismatch_deline( where the upper equation is in percentage (same as paper) and the lower one is unitless. The implementation uses the unitless version, where :math:`M[-]` is the mismatch power loss [unitless] and - :math:`\Delta[-]` is the Relative Mean Absolute Difference [unitless] + :math:`\Delta[-]` is the Relative Mean Absolute Difference (RMAD) [unitless] of the global irradiance, Eq. (4) of [1]_ and [2]_. Note that the n-th power coefficient is multiplied by :math:`100^{n-1}` to convert the percentage to unitless. @@ -101,6 +101,14 @@ def power_mismatch_deline( The global irradiance RMAD is different from the backside irradiance RMAD. + RMAD of a variable :math:`G_{total}` is defined as: + + .. math:: + + RMAD \left[ unitless \right] = \Delta \left[ unitless \right] = + \frac{1}{n^2 \bar{G}_{total}} \sum_{i=1}^{n} \sum_{j=1}^{n} + \lvert G_{total,i} - G_{total,j} \rvert + In case the RMAD of the backside irradiance is known, the global RMAD can be calculated as follows, assuming the front irradiance RMAD is negligible [2]_: