Skip to content

Commit 566a1e1

Browse files
committed
Merge pull request #141 from ejmiller2/master
Resolve #140 snlinverter night tare power issue
2 parents 00dd124 + 2a9d4cc commit 566a1e1

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

docs/sphinx/source/whatsnew/v0.3.1.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ Enhancements
1515
Bug fixes
1616
~~~~~~~~~
1717

18+
* Fixes night tare issue in snlinverter. When the DC input power (p_dc)
19+
to an inverter is below the inversion startup power (Ps0), the model
20+
should set the AC output (ac_power) to the night tare value (Pnt).
21+
The night tare power indicates the power consumed by the inverter to
22+
sense PV array voltage. The model was erroneously comparing Ps0 with
23+
the AC output power (ac_power), rather than the DC input power (p_dc).
1824

1925

2026
Contributors
2127
~~~~~~~~~~~~
2228

29+
* ejmiller2

pvlib/pvsystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,7 @@ def snlinverter(inverter, v_dc, p_dc):
16621662

16631663
ac_power = (Paco/(A-B) - C*(A-B)) * (p_dc-B) + C*((p_dc-B)**2)
16641664
ac_power[ac_power > Paco] = Paco
1665-
ac_power[ac_power < Pso] = - 1.0 * abs(Pnt)
1665+
ac_power[p_dc < Pso] = - 1.0 * abs(Pnt)
16661666

16671667
if len(ac_power) == 1:
16681668
ac_power = ac_power.ix[0]

pvlib/test/test_pvsystem.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,17 @@ def test_snlinverter_float():
384384
assert_almost_equals(pacs, 132.004278, 5)
385385

386386

387+
def test_snlinverter_Pnt_micro():
388+
inverters = sam_data['cecinverter']
389+
testinv = 'Enphase_Energy__M250_60_2LL_S2x___ZC____NA__208V_208V__CEC_2013_'
390+
vdcs = pd.Series(np.linspace(0,50,3))
391+
idcs = pd.Series(np.linspace(0,11,3))
392+
pdcs = idcs * vdcs
393+
394+
pacs = pvsystem.snlinverter(inverters[testinv], vdcs, pdcs)
395+
assert_series_equal(pacs, pd.Series([-0.043000, 132.545914746, 240.000000]))
396+
397+
387398
def test_PVSystem_creation():
388399
pv_system = pvsystem.PVSystem(module='blah', inverter='blarg')
389400

0 commit comments

Comments
 (0)