-1

I want to calculate total solar irradiance using isotropic sky model.

My problem is calculation of Rb (beam radiation tilt factor) in which I reach some negative values which is nonsense.

Formula:

Rb = cos⁡(angle_of_incidence)/cos⁡(solar_zenith)

Code in Python:

Rb = np.cos(pvlib.irradiance.aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth))/np.cos(solar_zenith)

Could you help me to solve negative values in Rb?

(My reference: Solar Energy Engineering: Processes and Systems, Soteris A. Kalogirou)

Mohi
  • 31
  • 7

1 Answers1

1

The only way your fraction could be negative is if either the numerator or denominator were negative. For cosines, that only happens if the argument is greater than π/2.

When dealing with trig function problems, the most likely culprit is conversation from degrees to radians (or lack thereof). And it's spelled out in the docs:

Returns: aoi : numeric

Angle of incidence in degrees.

To fix the immediate problem:

R_b = np.cos(pvlib.irradiance.aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth) * np.pi / 180.0)/np.cos(solar_zenith)

Since you don't show the origin of solar_zenith, I can't tell you if it needs to be converted too.

And don't forget:

Input all angles in degrees.

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
  • Hi Mad Physicist, Thank you for the comments. From https://github.com/pvlib/pvlib-python/issues/641 I understood that when the sun is behind the plane `Rb` is negative. – Mohi Jan 27 '19 at 14:47
  • @Mohi. Yes that's true, but it doesn't alter the fact that you're passing in a quantity in degrees to a function that accepts radians – Mad Physicist Jan 27 '19 at 16:43
  • @Mohi. Put it another way, negative angles make sense physically, but the numbers you're going to get without the conversion are going to be wrong regardless. – Mad Physicist Jan 27 '19 at 16:44
  • Yes, You are right. I corrected it. Thank you for your clarification. – Mohi Jan 31 '19 at 08:16