question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PVsystem.get_irradiance ignores surface tilt and surface azimuth

See original GitHub issue

Describe the bug PVsystem.get_irradiance is a wrapper for irradiance.get_total_irradiance but when using PVsystem.get_total_irradiance the values of ‘poa_global’ do not change if the PV panel surface tilt and surface azimuth are changed whereas it seems to work as expected when using irradiance.get_total_irradiance.

On a related note, the method FixedMount.get_orientation is called with the arguments solar_zenith, solar_azimuth. The two arguments aren’t necessary as the method just returns the attributes for surface tilt and azimuth.

To Reproduce

import pandas as pd
from pvlib import pvsystem, irradiance
from datetime import datetime

surface_tilt = 45
surface_azimuth = 180
module_capacity = 6000
data = {
  'zenith': 34,
  'azimuth': 180,
  'dni': 588,
  'dhi': 234,
  'ghi': 722
}

data = pd.DataFrame(data, index = [datetime.now()])

module_parameters = {
  'pdc0': module_capacity, 
  'gamma_pdc': -0.004, 
  'surface_tilt': surface_tilt, 
  'surface_azimuth': surface_azimuth
}

system = pvsystem.PVSystem(
  module_parameters=module_parameters
)

plane_of_array_irradiance = system.get_irradiance(
  data['zenith'], 
  data['azimuth'], 
  data['dni'], 
  data['ghi'], 
  data['dhi'], 
  model='perez', 
  model_perez='allsitescomposite1990'
)
plane_of_array_irradiance2 = irradiance.get_total_irradiance(
  surface_tilt, 
  surface_azimuth, 
  data['zenith'], 
  data['azimuth'], 
  data['dni'], 
  data['ghi'], 
  data['dhi']
)

print(f'Global PoA Irradiance (PVsystem calculation) = {plane_of_array_irradiance["poa_global"]}')
print(f'Global PoA Irradiance (Irradiance calculation) = {plane_of_array_irradiance2["poa_global"]}')

The two printed values will be different. Changing surface_tilt to 90 will change the calculation from the irradiance class to be the same as the PV system class calculation so I think PVsystem is always taking surface_tilt as 90.

Expected behavior PVsystem.get_irradiance should give different values as surface_tilt and surface_azimuth change, in the same way that irradiance.get_total_irradiance does.

Versions: pvlib == 0.9.0 pandas == 1.2.4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kanderso-nrelcommented, Feb 2, 2022

Hi @andrewmckayeaton, surface_tilt and surface_azimuth are direct parameters to PVsystem, not something to include in module_parameters. See the discussion here: https://github.com/pvlib/pvlib-python/discussions/1326

You should also be sure that the comparison is apples-to-apples – right now you’re using the perez model in one case and the isotropic model (by default) in the other.

Changing surface_tilt to 90 will change the calculation from the irradiance class to be the same as the PV system class calculation so I think PVsystem is always taking surface_tilt as 90.

This is unexpected. The default surface tilt is 0 for PVSystem, so if you’re supplying surface_tilt in the wrong place then it should default to 0. Is it possible you meant 0 instead of 90?

On a related note, the method FixedMount.get_orientation is called with the arguments solar_zenith, solar_azimuth. The two arguments aren’t necessary as the method just returns the attributes for surface tilt and azimuth.

It does seem a bit silly for the fixed-tilt case, but it might make more sense if you think about other types of Mount. The Array and PVSystem classes are supposed to work for any mounting strategy, which means they don’t know ahead of time what the Mount needs to calculate orientation. SingleAxisTrackerMount needs the solar position inputs, so to have a common interface across all mounts (i.e., being able to call mount.get_orientation(solar_zenith, solar_azimuth) no matter what type of Mount it is), we do the same for FixedMount.

1reaction
andrewmckayeatoncommented, Feb 2, 2022

Just to add to the discussion, my mistake came from feeling that surface_tilt and surface_azimuth were properties of the module since they definitely weren’t properties of the inverter but if I understand correctly, they are properties of the mount. If that’s the case then I would be in favour of @wholmgren’s suggestion and requiring a mount_parameters dict as an argument to PVSystem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pvlib.pvsystem.PVSystem — pvlib-python 0.4.3+0.ge77dfee ...
function to calculate the plane of array irradiance components on a tilted surface defined by self.surface_tilt , self.surface_azimuth , and self.albedo .
Read more >
Solar Radiation on a Tilted Surface - PVEducation
The following figure shows how to calculate the radiation incident on a tilted surface (Smodule) given either the solar radiation measured on horizontal...
Read more >
Solcast Data API
Total irradiance received on a surface with defined tilt and azimuth (sum of direct, diffuse and reflected components), fixed or tracking (90th percentile ......
Read more >
The Effect of Azimuth and Tilt Angle Changes on the Energy ...
In this article the effect of tilt and azimuth angle changes of the photovoltaic ... by the surface of the PV modules and...
Read more >
pvlib_python Documentation - Read the Docs
provided to PVSystem, the PVSystem attributes are ignored. ... surface tilt value at 30 degrees, ignoring whatever value is used for irradi-.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found