Skip to content

Commit 0af6fe0

Browse files
authored
Fix COSTT error in pvl_klucher1979.m (#14)
Closes #13
1 parent 1aab7fc commit 0af6fe0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pvl_klucher1979.m

+5
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,14 @@
7272
GHI(GHI < 1E-6) = 1E-6; % Prevent division by 0
7373
% Dec 2012: A bug was identified by Rob Andrews (Queens University) in this equation in PV_LIB
7474
% Version 1.0. Fixed in Version 1.1.
75+
% COSTT is cos(angle between sun vector and array normal)
7576
COSTT = cosd(SurfTilt).*cosd(SunZen) + sind(SurfTilt).* ...
7677
sind(SunZen).*cosd(SunAz-SurfAz);
7778

79+
% Aug 2018: Restrict COSTT>=0, so that circumsolar irradiance is not added
80+
% to total sky diffuse when the sun is behind the array
81+
COSTT(COSTT<0) = 0.0;
82+
7883
F = 1 - ((DHI./GHI).^2);
7984
SkyDiffuse = DHI ...
8085
.* (0.5 .* (1 + cosd(SurfTilt))) ...

0 commit comments

Comments
 (0)