Skip to content

Fix COSTT error in pvl_klucher1979.m #14

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 1 commit into from
Aug 20, 2018
Merged
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
5 changes: 5 additions & 0 deletions pvl_klucher1979.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,14 @@
GHI(GHI < 1E-6) = 1E-6; % Prevent division by 0
% Dec 2012: A bug was identified by Rob Andrews (Queens University) in this equation in PV_LIB
% Version 1.0. Fixed in Version 1.1.
% COSTT is cos(angle between sun vector and array normal)
COSTT = cosd(SurfTilt).*cosd(SunZen) + sind(SurfTilt).* ...
sind(SunZen).*cosd(SunAz-SurfAz);

% Aug 2018: Restrict COSTT>=0, so that circumsolar irradiance is not added
% to total sky diffuse when the sun is behind the array
COSTT(COSTT<0) = 0.0;

F = 1 - ((DHI./GHI).^2);
SkyDiffuse = DHI ...
.* (0.5 .* (1 + cosd(SurfTilt))) ...
Expand Down