From c90b7d0263c94d526f4c70613a75c16421e7897b Mon Sep 17 00:00:00 2001 From: ejmiller2 Date: Tue, 22 Mar 2016 18:09:53 -0700 Subject: [PATCH 1/5] Resolve #140 snlinverter night tare power issue Fixing #140 by changing the start power (Pso) comparison to use the DC input power (p_dc) instead of the calculated AC power (ac_power). --- pvlib/pvsystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pvlib/pvsystem.py b/pvlib/pvsystem.py index bc158b8652..3c9eb03aed 100644 --- a/pvlib/pvsystem.py +++ b/pvlib/pvsystem.py @@ -1662,7 +1662,7 @@ def snlinverter(inverter, v_dc, p_dc): ac_power = (Paco/(A-B) - C*(A-B)) * (p_dc-B) + C*((p_dc-B)**2) ac_power[ac_power > Paco] = Paco - ac_power[ac_power < Pso] = - 1.0 * abs(Pnt) + ac_power[p_dc < Pso] = - 1.0 * abs(Pnt) if len(ac_power) == 1: ac_power = ac_power.ix[0] From e5d591d2e674533b7c8cecc7007dd0074cb21ab1 Mon Sep 17 00:00:00 2001 From: Ed Miller Date: Wed, 23 Mar 2016 10:20:54 -0700 Subject: [PATCH 2/5] Test for Pnt error with microinverter Testing for issue #140. --- pvlib/test/test_pvsystem.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pvlib/test/test_pvsystem.py b/pvlib/test/test_pvsystem.py index f2b4974a47..7253dfcbbb 100644 --- a/pvlib/test/test_pvsystem.py +++ b/pvlib/test/test_pvsystem.py @@ -384,6 +384,17 @@ def test_snlinverter_float(): assert_almost_equals(pacs, 132.004278, 5) +def test_snlinverter_Pnt_micro(): + inverters = sam_data['cecinverter'] + testinv = 'Enphase_Energy__M250_60_2LL_S2x___ZC____NA__208V_208V__CEC_2013_' + vdcs = pd.Series(np.linspace(0,50,3)) + idcs = pd.Series(np.linspace(0,11,3)) + pdcs = idcs * vdcs + + pacs = pvsystem.snlinverter(inverters[testinv], vdcs, pdcs) + assert_series_equal(pacs, pd.Series([-0.043000, 132.545914746, 240.000000])) + + def test_PVSystem_creation(): pv_system = pvsystem.PVSystem(module='blah', inverter='blarg') From 1371b4dc196c3f28971dc90380bb8443f6da4764 Mon Sep 17 00:00:00 2001 From: Ed Miller Date: Wed, 23 Mar 2016 10:26:37 -0700 Subject: [PATCH 3/5] Update v0.3.1.txt Added note and contribution for fix to issue #140. --- docs/sphinx/source/whatsnew/v0.3.1.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sphinx/source/whatsnew/v0.3.1.txt b/docs/sphinx/source/whatsnew/v0.3.1.txt index d2b91c2e77..2806373ad3 100644 --- a/docs/sphinx/source/whatsnew/v0.3.1.txt +++ b/docs/sphinx/source/whatsnew/v0.3.1.txt @@ -15,8 +15,10 @@ Enhancements Bug fixes ~~~~~~~~~ +* Fixes snlinverter Pnt problem (:issue:`140`) Contributors ~~~~~~~~~~~~ +* ejmiller2 From edc41775220b65825bbb21750121ad149920e3c4 Mon Sep 17 00:00:00 2001 From: Ed Miller Date: Thu, 24 Mar 2016 10:26:46 -0700 Subject: [PATCH 4/5] Update night tare issue description. Improved the night tare issue description. --- docs/sphinx/source/whatsnew/v0.3.1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.3.1.txt b/docs/sphinx/source/whatsnew/v0.3.1.txt index 2806373ad3..fd4a47133f 100644 --- a/docs/sphinx/source/whatsnew/v0.3.1.txt +++ b/docs/sphinx/source/whatsnew/v0.3.1.txt @@ -15,7 +15,7 @@ Enhancements Bug fixes ~~~~~~~~~ -* Fixes snlinverter Pnt problem (:issue:`140`) +* Fixes night tare issue in snlinverter. When the DC input power (p_dc) to an inverter is below the inversion startup power (Ps0), the model should set the AC output (ac_power) to the night tare value (Pnt). The night tare power indicates the power consumed by the inverter to sense PV array voltage. The model was erroneously comparing Ps0 with the AC output power (ac_power), rather than the DC input power (p_dc). Contributors From 2a9d4cc5c01036b5a559ac1f67e60c88ef8c9879 Mon Sep 17 00:00:00 2001 From: Ed Miller Date: Thu, 24 Mar 2016 10:42:02 -0700 Subject: [PATCH 5/5] Reformatted bug fix description. Added carriage returns for improved readability. --- docs/sphinx/source/whatsnew/v0.3.1.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/sphinx/source/whatsnew/v0.3.1.txt b/docs/sphinx/source/whatsnew/v0.3.1.txt index fd4a47133f..f375781fef 100644 --- a/docs/sphinx/source/whatsnew/v0.3.1.txt +++ b/docs/sphinx/source/whatsnew/v0.3.1.txt @@ -15,7 +15,12 @@ Enhancements Bug fixes ~~~~~~~~~ -* Fixes night tare issue in snlinverter. When the DC input power (p_dc) to an inverter is below the inversion startup power (Ps0), the model should set the AC output (ac_power) to the night tare value (Pnt). The night tare power indicates the power consumed by the inverter to sense PV array voltage. The model was erroneously comparing Ps0 with the AC output power (ac_power), rather than the DC input power (p_dc). +* Fixes night tare issue in snlinverter. When the DC input power (p_dc) + to an inverter is below the inversion startup power (Ps0), the model + should set the AC output (ac_power) to the night tare value (Pnt). + The night tare power indicates the power consumed by the inverter to + sense PV array voltage. The model was erroneously comparing Ps0 with + the AC output power (ac_power), rather than the DC input power (p_dc). Contributors