Skip to content

Commit 5e43be7

Browse files
echedey-lskandersolarcesarddcwhanseRDaxini
authored
NREL mismatch loss addendum (#2147)
* Preliminar implementation, tests, docs and gallery example I expect to extend the gallery example for a day's RMAD profiling. * Update versionadded * Add example * docstring update * Update v0.11.0.rst * who would have guessed it's always the linter? * Update plot_irradiance_nonuniformity_loss.py * equation fixes * RMAD properties application typo * does this fix the link? * yet another link * These links will never work, I suppose * Move some "Notes" equations to example and rearrange things there * give this equation it's space * eq rendering fixes? * maths are not mathing today * ??? * ??? x2 * ??? x3 * i feel stupid for this * Change preprint ref to published one Co-Authored-By: Kevin Anderson <[email protected]> * Published paper coeffs Co-Authored-By: Kevin Anderson <[email protected]> * Lots of improvements Pending second section of example, and checking docs Co-Authored-By: César Domínguez <[email protected]> Co-Authored-By: Kevin Anderson <[email protected]> * Linter - also missing Eq (7) Co-Authored-By: César Domínguez <[email protected]> Co-Authored-By: Kevin Anderson <[email protected]> * Test polynomial input Co-Authored-By: César Domínguez <[email protected]> * Math * Test exception * Update pvsystem.py * Update plot_irradiance_nonuniformity_loss.py * Add fill factor ratio Co-Authored-By: Kevin Anderson <[email protected]> * ª * Trying new things * Revert "Trying new things" This reverts commit 8a19a4d. * Update pvsystem.py * :( * :(( * I hope we dont miss that reference * Update pvsystem.py * Remove second section of the example * Minor text upgrade * Update pvsystem.py * Port to namespace `pvlib.bifacial` Co-Authored-By: Cliff Hansen <[email protected]> * Rename to ``power_mismatch_deline``, document in ``bifacial.rst`` Co-Authored-By: Cliff Hansen <[email protected]> * fillfactor only for predefined models Co-Authored-By: Cliff Hansen <[email protected]> * Docstring rewording Co-Authored-By: Cliff Hansen <[email protected]> * Linter * More docs rewording Co-Authored-By: Cliff Hansen <[email protected]> * Apply suggestions from Dax Co-authored-by: RDaxini <[email protected]> * Unneded image Dominguez_et_al_PVSC2023.png * Rename file * Fix equations * yup it didnt save * lintaaaaaaarrrr * Eq 7 numbering * Revert unintended changes * Adam code review Co-Authored-By: Adam R. Jensen <[email protected]> * Links? Co-Authored-By: Adam R. Jensen <[email protected]> * Referencing equations manually Co-Authored-By: Adam R. Jensen <[email protected]> * Polynomial links Co-Authored-By: Adam R. Jensen <[email protected]> * Dont abuse math mode * Update loss_models.py * I forgot * Adam Code Review Co-Authored-By: Adam R. Jensen <[email protected]> * whatsnews * Update v0.11.0.rst * Weird that some tests pass and others dont * Update loss_models.py * document * Update loss_models.py * Kevin's review (I) Co-Authored-By: Kevin Anderson <[email protected]> * Kevin's review (II) Co-Authored-By: Kevin Anderson <[email protected]> * Kevin's review (III) Co-Authored-By: Kevin Anderson <[email protected]> * Update v0.11.1.rst Co-Authored-By: Kevin Anderson <[email protected]> * minor changes * Forgot to update tests Co-Authored-By: Kevin Anderson <[email protected]> * Accordingly modify model, IO, docs to unitless model Co-Authored-By: Kevin Anderson <[email protected]> * Update loss_models.py * Update loss_models.py Co-Authored-By: Kevin Anderson <[email protected]> * Apply suggestions from code review Co-authored-by: Cliff Hansen <[email protected]> * Code review from Cliff Co-Authored-By: Cliff Hansen <[email protected]> * Rendering issues, code review from Kevin Co-Authored-By: Kevin Anderson <[email protected]> * Little missing newline * RMAD func definition addendum Co-Authored-By: Chris Deline <[email protected]> * Update v0.11.1.rst * Add RMAD eq to docstring * Cliff suggestion Co-Authored-By: Cliff Hansen <[email protected]> --------- Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: César Domínguez <[email protected]> Co-authored-by: Cliff Hansen <[email protected]> Co-authored-by: RDaxini <[email protected]> Co-authored-by: Adam R. Jensen <[email protected]> Co-authored-by: Cliff Hansen <[email protected]> Co-authored-by: Chris Deline <[email protected]>
1 parent 599c5d9 commit 5e43be7

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

docs/examples/bifacial/plot_irradiance_nonuniformity_loss.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,12 @@
100100
#
101101

102102

103-
def rmad(data, axis=None):
103+
def rmad(data):
104104
"""
105-
Relative Mean Absolute Difference. Output is [Unitless].
106-
https://stackoverflow.com/a/19472336/19371110
105+
Relative Mean Absolute Difference. Output is [Unitless]. Eq. (4) of [1]_.
107106
"""
108-
mean = np.mean(data, axis)
109-
mad = np.mean(np.absolute(data - mean), axis)
107+
mean = np.mean(data)
108+
mad = np.mean(np.absolute(np.subtract.outer(data, data)))
110109
return mad / mean
111110

112111

docs/sphinx/source/whatsnew/v0.11.1.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Requirements
4949

5050
Contributors
5151
~~~~~~~~~~~~
52+
* Echedey Luis (:ghuser:`echedey-ls`)
53+
* Chris Deline (:ghuser:`cdeline`)
5254
* Ioannis Sifnaios (:ghuser:`IoannisSifnaios`)
5355
* Leonardo Micheli (:ghuser:`lmicheli`)
5456
* Echedey Luis (:ghuser:`echedey-ls`)

pvlib/bifacial/loss_models.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def power_mismatch_deline(
7171
where the upper equation is in percentage (same as paper) and the lower
7272
one is unitless. The implementation uses the unitless version, where
7373
:math:`M[-]` is the mismatch power loss [unitless] and
74-
:math:`\Delta[-]` is the Relative Mean Absolute Difference [unitless]
74+
:math:`\Delta[-]` is the Relative Mean Absolute Difference (RMAD) [unitless]
7575
of the global irradiance, Eq. (4) of [1]_ and [2]_.
7676
Note that the n-th power coefficient is multiplied by :math:`100^{n-1}`
7777
to convert the percentage to unitless.
@@ -101,6 +101,14 @@ def power_mismatch_deline(
101101
The global irradiance RMAD is different from the backside irradiance
102102
RMAD.
103103
104+
RMAD of a variable :math:`G_{total}` is defined as:
105+
106+
.. math::
107+
108+
RMAD \left[ unitless \right] = \Delta \left[ unitless \right] =
109+
\frac{1}{n^2 \bar{G}_{total}} \sum_{i=1}^{n} \sum_{j=1}^{n}
110+
\lvert G_{total,i} - G_{total,j} \rvert
111+
104112
In case the RMAD of the backside irradiance is known, the global RMAD can
105113
be calculated as follows, assuming the front irradiance RMAD is
106114
negligible [2]_:

0 commit comments

Comments
 (0)