Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/sphinx/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ Inverter models (DC to AC conversion)
inverter.sandia_multi
inverter.adr
inverter.pvwatts
inverter.pvwatts_multi

Functions for fitting inverter models

Expand Down
4 changes: 2 additions & 2 deletions docs/sphinx/source/whatsnew/v0.8.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Enhancements
option to :py:class:`~pvlib.modelchain.ModelChain`. (:pull:`1042`) (:issue:`1073`)
* Added :py:func:`pvlib.temperature.ross` for cell temperature modeling using
only NOCT. (:pull:`1045`)
* Added :py:func:`pvlib.inverter.sandia_multi` for modeling inverters with
multiple MPPTs (:issue:`457`, :pull:`1085`)
* Added :py:func:`pvlib.inverter.sandia_multi` and :py:func:`pvlib.inverter.pvwatts_multi`
for modeling inverters with multiple MPPTs (:issue:`457`, :pull:`1085`, :pull:`1103`)
* Added optional ``attributes`` parameter to :py:func:`pvlib.iotools.get_psm3`
and added the option of fetching 5- and 15-minute PSM3 data. (:pull:`1086`)
* Added :py:func:`pvlib.irradiance.campbell_norman` for estimating DNI, DHI and GHI
Expand Down
40 changes: 37 additions & 3 deletions pvlib/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def adr(v_dc, p_dc, inverter, vtol=0.10):

def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
r"""
Implements NREL's PVWatts inverter model.
NREL's PVWatts inverter model.

The PVWatts inverter model [1]_ calculates inverter efficiency :math:`\eta`
as a function of input DC power
Expand All @@ -348,8 +348,9 @@ def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):

Parameters
----------
pdc: numeric
DC power. Same unit as ``pdc0``.
p_dc : tuple, list or array of numeric
DC power on each MPPT input of the inverter. If type is array, must
be 2d with axis 0 being the MPPT inputs. Same unit as ``pdc0``.
pdc0: numeric
DC input limit of the inverter. Same unit as ``pdc``.
eta_inv_nom: numeric, default 0.96
Expand Down Expand Up @@ -396,6 +397,39 @@ def pvwatts(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
return power_ac


def pvwatts_multi(pdc, pdc0, eta_inv_nom=0.96, eta_inv_ref=0.9637):
r"""
Extends NREL's PVWatts inverter model for multiple MPP inputs.

DC input power is summed over MPP inputs to obtain the DC power
input to the PVWatts inverter model. See :py:func:`pvlib.inverter.pvwatts`
for details.

Parameters
----------
p_dc : tuple, list or array of numeric
DC power on each MPPT input of the inverter. If type is array, must
be 2d with axis 0 being the MPPT inputs. Same unit as ``pdc0``.
pdc0: numeric
DC input limit of the inverter. Same unit as ``pdc``.
eta_inv_nom: numeric, default 0.96
Nominal inverter efficiency. [unitless]
eta_inv_ref: numeric, default 0.9637
Reference inverter efficiency. PVWatts defines it to be 0.9637
and is included here for flexibility. [unitless]

Returns
-------
power_ac: numeric
AC power. Same unit as ``pdc0``.

See also
--------
pvlib.inverter.pvwatts
"""
return pvwatts(sum(pdc), pdc0, eta_inv_nom, eta_inv_ref)


def fit_sandia(ac_power, dc_power, dc_voltage, dc_voltage_level, p_ac_0, p_nt):
r'''
Determine parameters for the Sandia inverter model.
Expand Down
19 changes: 19 additions & 0 deletions pvlib/tests/test_inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,25 @@ def test_pvwatts_series():
assert_series_equal(expected, out)


def test_pvwatts_multi():
pdc = np.array([np.nan, 0, 50, 100]) / 2
pdc0 = 100
expected = np.array([np.nan, 0., 47.608436, 95.])
out = inverter.pvwatts_multi((pdc, pdc), pdc0, 0.95)
assert_allclose(expected, out)
# with 2D array
pdc_2d = np.array([pdc, pdc])
out = inverter.pvwatts_multi(pdc_2d, pdc0, 0.95)
assert_allclose(expected, out)
# with Series
pdc = pd.Series(pdc)
out = inverter.pvwatts_multi((pdc, pdc), pdc0, 0.95)
assert_series_equal(expected, out)
# with list instead of tuple
out = inverter.pvwatts_multi([pdc, pdc], pdc0, 0.95)
assert_series_equal(expected, out)


INVERTER_TEST_MEAS = DATA_DIR / 'inverter_fit_snl_meas.csv'
INVERTER_TEST_SIM = DATA_DIR / 'inverter_fit_snl_sim.csv'

Expand Down