diff --git a/docs/sphinx/source/whatsnew/v0.15.1.rst b/docs/sphinx/source/whatsnew/v0.15.1.rst index 5e93232eed..a36ead8aba 100644 --- a/docs/sphinx/source/whatsnew/v0.15.1.rst +++ b/docs/sphinx/source/whatsnew/v0.15.1.rst @@ -20,7 +20,9 @@ Bug fixes Enhancements ~~~~~~~~~~~~ - +* Use ``k`` and ``cap_adjustment`` from :py:func:`pvlib.pvsystem.Array.module_parameters` in :py:func:`pvlib.pvsystem.PVSystem.pvwatts_dc` + (:issue:`2714`, :pull:`2715`) + Documentation ~~~~~~~~~~~~~ @@ -70,4 +72,5 @@ Contributors * Anton Driesse (:ghuser:`adriesse`) * Kevin Anderson (:ghuser:`kandersolar`) * Rohan Saxena (:ghuser:`r0hansaxena`) +* Marco Fumagalli (:ghuser:`fuma900`) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index fe85359b99..a2b29497c2 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -850,7 +850,10 @@ def pvwatts_dc(self, effective_irradiance, temp_cell): """ Calculates DC power according to the PVWatts model using :py:func:`pvlib.pvsystem.pvwatts_dc`, `self.module_parameters['pdc0']`, - and `self.module_parameters['gamma_pdc']`. + `self.module_parameters['gamma_pdc']`, + `self.module_parameters['temp_ref']`, and optionally, + `self.module_parameters['k']` and + `self.module_parameters['cap_adjustment']`. See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. """ @@ -860,7 +863,8 @@ def pvwatts_dc(self, effective_irradiance, temp_cell): pvwatts_dc(effective_irradiance, temp_cell, array.module_parameters['pdc0'], array.module_parameters['gamma_pdc'], - **_build_kwargs(['temp_ref'], array.module_parameters)) + **_build_kwargs(['temp_ref', 'k', 'cap_adjustment'], + array.module_parameters)) for array, effective_irradiance, temp_cell in zip(self.arrays, effective_irradiance, temp_cell) ) diff --git a/tests/test_pvsystem.py b/tests/test_pvsystem.py index 4fbd782e65..2f2c666554 100644 --- a/tests/test_pvsystem.py +++ b/tests/test_pvsystem.py @@ -2260,7 +2260,8 @@ def pvwatts_system_defaults(): @pytest.fixture def pvwatts_system_kwargs(): - module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20} + module_parameters = {'pdc0': 100, 'gamma_pdc': -0.003, 'temp_ref': 20, + 'k': 0.01, 'cap_adjustment': True} inverter_parameters = {'pdc0': 90, 'eta_inv_nom': 0.95, 'eta_inv_ref': 1.0} system = pvsystem.PVSystem(module_parameters=module_parameters, inverter_parameters=inverter_parameters)