Skip to content

Issue#144-fixed the azimuth calculation of rotated PV panel #145

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 12 commits into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 12 additions & 2 deletions docs/sphinx/source/whatsnew/v0.3.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ 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).

* Fixed the azimuth calculation of rotated PV panel in function
pvlib.tracking.singleaxis(...) so that the results are consistent
with PVsyst
Contributors
~~~~~~~~~~~~

* ejmiller2
* Yudong Ma
2 changes: 1 addition & 1 deletion pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 11 additions & 0 deletions pvlib/test/test_pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
28 changes: 24 additions & 4 deletions pvlib/test/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_axis_tilt():
max_angle=90, backtrack=True,
gcr=2.0/7.0)

expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 37.3427,
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 142.65730,
'surface_tilt': 35.98741, 'tracker_theta': -20.88121},
index=[0], dtype=np.float64)

Expand All @@ -118,7 +118,7 @@ def test_axis_tilt():
max_angle=90, backtrack=True,
gcr=2.0/7.0)

expect = pd.DataFrame({'aoi': 47.6632, 'surface_azimuth': 129.0303,
expect = pd.DataFrame({'aoi': 47.6632, 'surface_azimuth': 50.96969,
'surface_tilt': 42.5152, 'tracker_theta': 31.6655},
index=[0], dtype=np.float64)

Expand Down Expand Up @@ -188,12 +188,32 @@ def test_SingleAxisTracker_tracking():

tracker_data = system.singleaxis(apparent_zenith, apparent_azimuth)

expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 37.3427,
expect = pd.DataFrame({'aoi': 7.286245, 'surface_azimuth': 142.65730 ,
'surface_tilt': 35.98741, 'tracker_theta': -20.88121},
index=[0], dtype=np.float64)

assert_frame_equal(expect, tracker_data)

### results calculated using PVsyst
pvsyst_solar_azimuth = 7.1609
pvsyst_solar_height = 27.315
pvsyst_axis_tilt = 20.
pvsyst_axis_azimuth = 20.
pvsyst_system = tracking.SingleAxisTracker(max_angle=60.,
axis_tilt=pvsyst_axis_tilt,
axis_azimuth=180+pvsyst_axis_azimuth,
backtrack=False)
# the definition of azimuth is different from PYsyst
apparent_azimuth = pd.Series([180+pvsyst_solar_azimuth])
apparent_zenith = pd.Series([90-pvsyst_solar_height])
tracker_data = pvsyst_system.singleaxis(apparent_zenith, apparent_azimuth)
expect = pd.DataFrame({'aoi': 41.07852 , 'surface_azimuth': 180-18.432 ,
'surface_tilt': 24.92122 , 'tracker_theta': -15.18391},
index=[0], dtype=np.float64)

assert_frame_equal(expect, tracker_data)



def test_LocalizedSingleAxisTracker_creation():
localized_system = tracking.LocalizedSingleAxisTracker(latitude=32,
Expand Down Expand Up @@ -254,7 +274,7 @@ def test_get_irradiance():
surface_azimuth=tracker_data['surface_azimuth'])

expected = pd.DataFrame(data=np.array(
[[ 142.71652464, 87.50125991, 55.21526473, 44.68768982,
[[ 961.80070, 815.94490, 145.85580, 135.32820,
10.52757492],
[ nan, nan, nan, nan,
nan]]),
Expand Down
2 changes: 1 addition & 1 deletion pvlib/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def singleaxis(apparent_zenith, apparent_azimuth,

# 4. Rotate 0 reference from panel's x axis to it's y axis and
# then back to North.
surface_azimuth += 90 + axis_azimuth
surface_azimuth = 90-surface_azimuth + axis_azimuth

# 5. Map azimuth into [0,360) domain.
surface_azimuth[surface_azimuth<0] += 360
Expand Down