Skip to content

Commit 0c15443

Browse files
Add fill factor ratio
Co-Authored-By: Kevin Anderson <[email protected]>
1 parent c965225 commit 0c15443

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

pvlib/pvsystem.py

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,7 @@ def nonuniform_irradiance_deline_power_loss(
30373037
model: Literal[
30383038
"fixed-tilt", "single-axis-tracking"
30393039
] = "single-axis-tracking",
3040+
fillfactor_ratio: float = None,
30403041
):
30413042
r"""
30423043
Estimate the power loss due to irradiance non-uniformity.
@@ -3045,7 +3046,13 @@ def nonuniform_irradiance_deline_power_loss(
30453046
irradiance is less uniform due to mounting and site conditions.
30463047
30473048
Depending on the mounting type, the power loss is estimated with either
3048-
equation (11) or (12) of [1]_. Passing the polynomial is also valid.
3049+
equation (11) or (12) of [1]_. Passing a custom polynomial is also valid.
3050+
3051+
Use ``fillfactor_ratio`` to account for different fill factors between the
3052+
trained model and the module of interest. The fill factor used for
3053+
developing the models ``"single-axis-tracking" and "fixed-tilt"`` is
3054+
:math:`0.79`. For example, if the fill factor of the module of interest is
3055+
:math:`0.65`, then set ``fillfactor_ratio = 0.65 / 0.79``.
30493056
30503057
.. versionadded:: 0.11.0
30513058
@@ -3063,11 +3070,18 @@ def nonuniform_irradiance_deline_power_loss(
30633070
* ``"fixed-tilt"``: Eq. (11) of [1]_.
30643071
* ``"single-axis-tracking"``: Eq. (12) of [1]_.
30653072
3066-
If a :py:`numpy.polynomial.Polynomial`, it is evaluated as is.
3073+
If a :py:`numpy:numpy.polynomial.Polynomial`, it is evaluated as is.
3074+
3075+
If neither a string nor a ``Polynomial``, it must be a collection of
3076+
the coefficients of the model, where the first element is the constant
3077+
term and the last element is the highest order term. A
3078+
:py:`numpy:numpy.polynomial.Polynomial` will be created internally.
30673079
3068-
If neither a string nor a polynomial, it must be the coefficients of
3069-
polynomial model, with the first element being the constant term and
3070-
the last element the highest order term.
3080+
fillfactor_ratio : float, optional
3081+
The ratio of the fill factor of the module of interest to the fill
3082+
factor used for developing the models. Fill factor used for models
3083+
``"single-axis-tracking"`` and ``"fixed-tilt"`` is 0.79. For a module
3084+
with fill factor 0.65, set ``fillfactor_ratio = 0.65 / 0.79``.
30713085
30723086
Returns
30733087
-------
@@ -3093,8 +3107,9 @@ def nonuniform_irradiance_deline_power_loss(
30933107
output power:
30943108
30953109
.. math::
3110+
:eq: 1
30963111
3097-
M[\%] = 1 - \frac{P_{Array}}{\sum P_{Cells}}
3112+
M[\%] = 1 - \frac{P_{Array}}{\sum P_{Cells}}
30983113
30993114
It is recommended to see the example
31003115
:ref:`sphx_glr_gallery_bifacial_plot_irradiance_nonuniformity_loss.py`
@@ -3109,6 +3124,7 @@ def nonuniform_irradiance_deline_power_loss(
31093124
Calculate the irradiance at different points of the module.
31103125
`bifacial_radiance <https://github.com/NREL/bifacial_radiance>`_
31113126
Calculate the irradiance at different points of the module.
3127+
31123128
pvlib.pvsystem.combine_loss_factors
31133129
31143130
References
@@ -3135,6 +3151,11 @@ def nonuniform_irradiance_deline_power_loss(
31353151
)
31363152
elif isinstance(model, np.polynomial.Polynomial):
31373153
model_polynom = model
3138-
else:
3154+
else: # expect an iterable
31393155
model_polynom = np.polynomial.Polynomial(coef=model)
3156+
3157+
if fillfactor_ratio: # General fill factor ratio, so it's always used
3158+
# Eq. (9), [1]
3159+
model_polynom = model_polynom * fillfactor_ratio
3160+
31403161
return model_polynom(rmad)

pvlib/tests/test_pvsystem.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2525,7 +2525,6 @@ def test_Array_temperature_missing_parameters(model, keys):
25252525

25262526
def test_nonuniform_irradiance_deline_power_loss():
25272527
"""tests pvsystem.nonuniform_irradiance_deline_power_loss"""
2528-
# TODO: improve
25292528
premise_rmads = np.array([0.0, 0.05, 0.1, 0.15, 0.2, 0.25])
25302529
# default model result values
25312530
expected_sat_mms = np.array(
@@ -2569,6 +2568,18 @@ def test_nonuniform_irradiance_deline_power_loss():
25692568
)
25702569
assert isinstance(result_mms, pd.Series)
25712570

2571+
# test fillfactor_ratio
2572+
# straightforward
2573+
result_mms = pvsystem.nonuniform_irradiance_deline_power_loss(
2574+
premise_rmads, fillfactor_ratio=0.65/0.79
2575+
)
2576+
assert_allclose(result_mms, expected_sat_mms*0.65/0.79, atol=1e-5)
2577+
# with custom model
2578+
result_mms = pvsystem.nonuniform_irradiance_deline_power_loss(
2579+
premise_rmads, model=polynomial, fillfactor_ratio=0.24
2580+
)
2581+
assert_allclose(result_mms, (1+premise_rmads)*0.24, atol=1e-5)
2582+
25722583
# test raises error on inexistent model
25732584
with pytest.raises(ValueError, match="Invalid model 'foo'"):
25742585
pvsystem.nonuniform_irradiance_deline_power_loss(

0 commit comments

Comments
 (0)