Skip to content

PVSystem.pvwatts_dc ignores k and cap_adjustment in module_parameters #2714

@fuma900

Description

@fuma900

Is your feature request related to a problem? Please describe.
In version 0.14.0 the Marion 2008 non-linear irradiance adjustment factor was added to pvlib.pvsystem.pvwatts_dc() but the new k and cap_adjustment parameters are ignored in pvlib.pvsystem.PVSystem.pvwatts_dc() since the current implementation is only using pdc0, gamma_pdc and temp_ref.

@renamed_kwarg_warning(
"0.13.0", "g_poa_effective", "effective_irradiance")
@_unwrap_single_value
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']`.
See :py:func:`pvlib.pvsystem.pvwatts_dc` for details.
"""
effective_irradiance = self._validate_per_array(effective_irradiance)
temp_cell = self._validate_per_array(temp_cell)
return tuple(
pvwatts_dc(effective_irradiance, temp_cell,
array.module_parameters['pdc0'],
array.module_parameters['gamma_pdc'],
**_build_kwargs(['temp_ref'], array.module_parameters))
for array, effective_irradiance, temp_cell
in zip(self.arrays, effective_irradiance, temp_cell)
)

Describe the solution you'd like
I'd like to be able to specify k and cap_adjustment in the module_parameters dictionary.

Simply adding k and cap_adjustment to the list of keys used with _build_kwargs should work (tested locally on version 0.15.0).

class PVSystem:
    ...
    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']`. 
  
         See :py:func:`pvlib.pvsystem.pvwatts_dc` for details. 
         """ 
         effective_irradiance = self._validate_per_array(effective_irradiance) 
         temp_cell = self._validate_per_array(temp_cell) 
         return tuple( 
             pvwatts_dc(effective_irradiance, temp_cell, 
                        array.module_parameters['pdc0'], 
                        array.module_parameters['gamma_pdc'], 
                        **_build_kwargs(['temp_ref', 'k', 'cap_adjustment'], array.module_parameters)) 
             for array, effective_irradiance, temp_cell 
             in zip(self.arrays, effective_irradiance, temp_cell) 
         ) 

Describe alternatives you've considered
I've temporarily created a subclass of PVSystem to implement the modified pvwatts_dc but it's patchy and prone to break with newer versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions