8000 implement multi-MPPT inverter model by cwhanse · Pull Request #1085 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

implement multi-MPPT inverter model #1085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
put array back, edits from review
  • Loading branch information
cwhanse committed Nov 25, 2020
commit 699853ac04d93831e891770abda013e96dcaf3f9
27 changes: 14 additions & 13 deletions pvlib/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ def sandia_multi(v_dc, p_dc, inverter):

Parameters
----------
v_dc : tuple or list of numeric
DC voltage on each MPPT input of the inverter. [V]
v_dc : tuple, list or array of numeric
DC voltage on each MPPT input of the inverter. If type is array, must
be 2d with axis 0 being the MPPT inputs. [V]

p_dc : tuple or list of numeric
DC power on each MPPT input of the inverter. [W]
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. [W]

inverter : dict-like
Defines parameters for the inverter model in [1]_.
Expand Down Expand Up @@ -180,17 +182,16 @@ def sandia_multi(v_dc, p_dc, inverter):
pvlib.inverter.sandia
'''

if len(p_dc) == len(v_dc):
power_dc = sum(p_dc)
power_ac = 0. * power_dc
if len(p_dc) != len(v_dc):
raise ValueError('p_dc and v_dc have different lengths')
power_dc = sum(p_dc)
power_ac = 0. * power_dc

for vdc, pdc in zip(v_dc, p_dc):
power_ac += pdc / power_dc * _sandia_eff(vdc, power_dc, inverter)
for vdc, pdc in zip(v_dc, p_dc):
power_ac += pdc / power_dc * _sandia_eff(vdc, power_dc, inverter)

return _sandia_limits(power_ac, power_dc, inverter['Paco'],
inverter['Pnt'], inverter['Pso'])
else:
raise ValueError('p_dc and v_dc have different lengths')
return _sandia_limits(power_ac, power_dc, inverter['Paco'],
inverter['Pnt'], inverter['Pso'])


def adr(v_dc, p_dc, inverter, vtol=0.10):
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tests/test_inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_sandia_multi(cec_inverter_parameters):

def test_sandia_multi_length_error(cec_inverter_parameters):
vdcs = pd.Series(np.linspace(0, 50, 3))
idcs = pd.Series(np.linspace(0, 11, 3)) / 2
idcs = pd.Series(np.linspace(0, 11, 3))
pdcs = idcs * vdcs
with pytest.raises(ValueError, match='p_dc and v_dc have different'):
inverter.sandia_multi((vdcs,), (pdcs, pdcs), cec_inverter_parameters)
Expand Down
0