Skip to content

Commit eaeb7b4

Browse files
committed
Version 1.4 release
1 parent 6a47273 commit eaeb7b4

File tree

304 files changed

+9511
-981
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+9511
-981
lines changed

Changelog.docx

-3.73 KB
Binary file not shown.

Contents.m

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
% pvl_absoluteairmass - Determine absolute (pressure corrected) airmass from relative airmass and pressure
2828
% pvl_disc - Estimate Direct Normal Irradiance from Global Horizontal Irradiance using the DISC model
2929
% pvl_dirint - Determine DNI and DHI from GHI using the DIRINT modification of the DISC model
30-
% pvl_erbs - Determine DNI and DHI from GHI using the Erbs model
3130
% pvl_louche - Determine DNI and DHI from GHI using the Louche model
3231
% pvl_orgill_hollands - Determine DNI and DHI from GHI using the Orgill and Hollands model
32+
% pvl_erbs - Determine DNI and DHI from GHI using the Erbs model
3333
% pvl_reindl_1 - Determine DNI and DHI from GHI using the Reindl_1 model
3434
% pvl_reindl_2 - Determine DNI and DHI from GHI using the Reindl_2 model
3535
% pvl_clearsky_haurwitz - Determine clear sky GHI using the Haurwitz model
@@ -45,15 +45,22 @@
4545
% pvl_klucher1979 - Determine diffuse irradiance from the sky on a tilted surface using Klucher's 1979 model
4646
% pvl_haydavies1980 - Determine diffuse irradiance from the sky on a tilted surface using Hay & Davies' 1980 model
4747
% pvl_getaoi - Determine angle of incidence from surface tilt/azimuth and apparent sun zenith/azimuth
48+
% pvl_Purdue_bifacial_irradiance - Calculate the irradiance on the front and rear sides of a bifacial solar module.
49+
% pvl_Purdue_albedo_model - Calculate the collection of ground-reflected albedo light on the rear surface of a PV module.
50+
51+
%% Irradiance Analysis Functions
52+
% pvl_detect_clear_times - Identify times with GHI consistent with clear sky conditions
53+
% pvl_detect_shadows - Identify shading on a GHI instrument from nearby structures such as wires and poles
4854

4955
%% Photovoltaic System Functions
5056
% pvl_sapmmoduledb - Retrieves Sandia Array Performance Model coefficients
5157
% pvl_SAMLibraryReader_CECModules - Open a System Advisor Model (SAM) CEC module library
5258
% pvl_SAMLibraryReader_SNLInverters - Open a System Advisor Model (SAM) v2014.1.14 or earlier inverter library
5359
% pvl_sapmcelltemp - Estimate cell temperature from irradiance, windspeed, ambient temperature, and module parameters (SAPM)
54-
% pvl_physicaliam - Determine the incidence angle modifier using refractive index, glazing thickness, and extinction coefficient
55-
% pvl_martinruiziam - Determine the incidence angle modifier using the Martin and Ruiz incident angle model
56-
% pvl_ashraeiam - Determine the incidence angle modifier using the ASHRAE incident angle model
60+
% pvl_iam_physical - Determine the incidence angle modifier using refractive index, glazing thickness, and extinction coefficient
61+
% pvl_iam_ashrae - Determine the incidence angle modifier using the ASHRAE incident angle model
62+
% pvl_iam_martinruiz - Determine the incidence angle modifier using the Martin and Ruiz incident angle model
63+
% pvl_iam_martinruiz_components - Determine the incidence angle modifiers separately for beam, sky diffuse and ground reflected diffuse irradiance using the Martin and Ruiz incident angle model
5764
% pvl_FSspeccorr - Calculate spectral mismatch modifier based on precipitable water and absolute airmass
5865
% pvl_calcparams_desoto - Calculate module performance model coefficients for the De Soto single diode model
5966
% pvl_calcparams_CEC - Create module performance model coefficients for the single diode model used by the CEC
@@ -66,16 +73,32 @@
6673
% pvl_singleaxis - Determine the rotation angle of a 1 axis tracker, and sun incident angle to tracked surface
6774

6875
%% Functions for parameter estimation for PV module models
76+
% pvl_huld_parameter_estimation - estimates parameters for the Huld module performance model
6977
% pvl_PVsyst_parameter_estimation - estimates parameters for the PVsyst version 6 module performance model
7078
% pvl_desoto_parameter_estimation - estimates parameters for the De Soto single diode module performance model
7179
% pvl_rectify_IV_curve - ensures that Isc and Voc are included in a IV curve and removes duplicate voltage and current points
80+
% pvl_est_diode_params_simple - estimates five parameters for an IV curve using a simplified sequential method
7281
% est_single_diode_param - estimates five parameters for an IV curve using a regression on the co-content
7382
% calc_theta_phi_exact - computes the arguments for the Lambert W function in the analytic solutions to the single diode equation
7483
% update_Io_known_n - iterative update to the dark current (Io) value for an IV curve to better fit Voc
7584
% update_Rsh_fixed_pt - iterative update to the parallel resistance (Rsh) value for an IV curve to better fit Vmp
7685
% Schumaker_QSpline - fit a non-increasing, concave downward quadratic spline to IV curve data
77-
%
7886

87+
%% Functions for analysis of module IV curves
88+
% pvl_est_Rs_Bowden - estimate series resistance from IV curves using the method of Bowden and Rohatgi
89+
% pvl_est_Rs_Swanson - estimate series resistance from IV curves using the method of Swanson
90+
% pvl_est_Rs_Pysch - estimate series resistance from IV curves using Pysch's extension of the method of Swanson
91+
% pvl_est_Rs_sunsVoc - estimate series resistance from IV curves using the suns-Voc method
92+
93+
%% Functions for translating IV curves to desired irradiance and temperature conditions
94+
% pvl_translate_IV_curve_IEC60891_1 - translate IV curve in irradiance and temperature using method 1 in IEC60891
95+
% pvl_est_Rs_IEC60891_1 - estimate Rs for curve translation method 1 in IEC60891
96+
% pvl_est_kappa_IEC60891_1 - estimate kappa for curve translation method 1 in IEC60891
97+
% pvl_translate_IV_curve_IEC60891_2 - translate IV curve in irradiance and temperature using method 2 in IEC60891
98+
% pvl_est_Rs_IEC60891_2 - estimate Rs for curve translation method 2 in IEC60891
99+
% pvl_est_kappa_IEC60891_2 - estimate kappa for curve translation method 2 in IEC60891
100+
%
79101
%% Numerical utilities
80102
% pvl_lambertw - Compute values for the Lambert W function W(z)
81103
% numdiff - Compute numerical derivatives for unequally spaced data
104+
% pvl_robustfit - Robust linear regression, requires either Matlab Statistics toolbox or python installation

html/PVL_Publish_Help.m

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Publish all help files
2-
addpath(genpath('S:\MATLAB_Solar_Functions\PV_LIB Version 1_32 Development'))
2+
%addpath(genpath('S:\MATLAB_Solar_Functions\PV_LIB Version 1_4 Release'))
33

44
%% Time and Location Utilities
55
publish('pvl_date2doy_help.m'); %1
@@ -44,19 +44,18 @@
4444

4545
%% Irradiance Analysis Functions
4646
publish('pvl_detect_clear_times_help.m');
47-
4847
publish('pvl_detect_shadows_help.m');
4948

5049
%% Photovoltaic System Functions
5150
publish('pvl_sapmmoduledb_help.m'); %37
52-
%publish('pvl_snlinverterdb_help.m'); %42
5351
publish('pvl_SAMLibraryReader_CECModules_help.m');
5452
publish('pvl_SAMLibraryReader_SNLInverters_help.m');
5553
publish('pvl_sapmcelltemp_help.m'); %38
5654

57-
publish('pvl_physicaliam_help.m'); %34
58-
publish('pvl_ashraeiam_help.m'); %35
59-
publish('pvl_martinruiziam_help.m'); %36
55+
publish('pvl_iam_physical_help.m'); %34
56+
publish('pvl_iam_ashrae_help.m'); %35
57+
publish('pvl_iam_martinruiz_help.m'); %36
58+
publish('pvl_iam_martinruiz_components_help.m');
6059

6160
publish('pvl_FSspeccorr_help.m');
6261

@@ -72,12 +71,26 @@
7271

7372
publish('pvl_singleaxis_help.m'); %44
7473

74+
publish('pvl_huld_parameter_estimation_help.m');
7575
publish('pvl_PVsyst_parameter_estimation_help.m');
7676
publish('pvl_desoto_parameter_estimation_help.m');
7777
publish('pvl_rectify_IV_curve_help.m');
78-
publish('pvl_huld_parameter_estimation.help.m');
79-
80-
78+
publish('pvl_est_single_diode_param_help.m');
79+
publish('pvl_est_diode_params_simple_help.m');
80+
81+
%% Functions for analysis of module IV cuves
82+
publish('pvl_est_Rs_Bowden_help.m');
83+
publish('pvl_est_Rs_Swanson_help.m');
84+
publish('pvl_est_Rs_Pysch_help.m');
85+
publish('pvl_est_Rs_sunsVoc_help.m');
86+
87+
%% Functions for translating IV curves to desired irradiance and temperature conditions
88+
publish('pvl_translate_IV_curve_IEC60891_1_help.m');
89+
publish('pvl_est_Rs_IEC60891_1_help.m');
90+
publish('pvl_est_kappa_IEC60891_1_help.m');
91+
publish('pvl_translate_IV_curve_IEC60891_2_help.m');
92+
publish('pvl_est_Rs_IEC60891_2_help.m');
93+
publish('pvl_est_kappa_IEC60891_2_help.m');
8194

8295
%% Numerical utilities
8396
publish('pvl_lambertw_help.m');
@@ -88,6 +101,9 @@
88101
%% Example Scripts
89102
publish('PVL_TestScript1.m');
90103
publish('PVL_TestScript2.m');
104+
publish('example_pvl_Purdue_albedo_model.m');
105+
publish('example_pvl_Purdue_bifacial_irradiance.m');
106+
91107

92108
%% Other Help
93109
publish('pvlib_features.m');
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
%% example_pvl_Purdue_albedo_model
2+
%
3+
% Example calculation of ground reflected diffuse irradiance on the rear
4+
% surface of a PV module.
5+
%
6+
7+
clc
8+
clearvars
9+
close all
10+
11+
%% Load weather data
12+
TMYData = pvl_readtmy3('723650TY.csv');
13+
TimeMatlab = TMYData.DateNumber;
14+
dv = datevec(TimeMatlab);
15+
16+
tfilter = and(dv(:,2) == 8, dv(:,3) == 2); % Select August 2
17+
18+
Time = pvl_maketimestruct(TimeMatlab(tfilter), ones(size(TimeMatlab(tfilter)))*TMYData.SiteTimeZone);
19+
20+
%% Sun position calculations
21+
HExtra = pvl_extraradiation(pvl_date2doy(Time.year,Time.month,Time.day));
22+
Location = pvl_makelocationstruct(TMYData.SiteLatitude,TMYData.SiteLongitude,TMYData.SiteElevation);
23+
PresPa = TMYData.Pressure(tfilter)*100; %Convert pressure from mbar to Pa
24+
[SunAz, SunEl, AppSunEl, SolarTime] = pvl_ephemeris(Time,Location,PresPa,TMYData.DryBulb(tfilter));
25+
SunZen = 90 - AppSunEl;
26+
AM = pvl_relativeairmass(SunZen);
27+
AM(isnan(AM)) = 20;
28+
29+
%% Describe system
30+
SurfTilt_Front = 30;
31+
SurfTilt_Rear = 180 - SurfTilt_Front;
32+
SurfAz_Front = 180;
33+
SurfAz_Rear = 180 + SurfAz_Front;
34+
Albedo = 0.25; % 25% albedo coefficient for concrete/vegetation
35+
36+
EtoH = [1 0]; % Elevated (EtoH = 1) and ground-mounted (EtoH = 0)
37+
38+
%% Run calculation
39+
for i = 1:length(EtoH)
40+
41+
I_Alb_Front(:,i) = pvl_Purdue_albedo_model(SurfTilt_Front, SurfAz_Front, EtoH(i), Albedo, ...
42+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM);
43+
I_Alb_Rear(:,i) = pvl_Purdue_albedo_model(SurfTilt_Rear, SurfAz_Rear, EtoH(i), Albedo, ...
44+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM);
45+
end
46+
47+
48+
%% Plot the results
49+
50+
figure
51+
hold all
52+
s = {'r-','b-','ro','bo'};
53+
for i=1:length(EtoH);
54+
plot(Time.hour, I_Alb_Rear(:,i), s{2*i})
55+
plot(Time.hour, I_Alb_Front(:,i), s{2*i-1})
56+
end
57+
58+
xlim([-5 22])
59+
xlabel('Hour of Day')
60+
ylabel('Albedo Irradiance (W/m^2)')
61+
legend('Rear (elevated)', 'Front (elevated)', 'Rear (Ground Mounted)', 'Front (Ground Mounted)', ...
62+
'Location', 'NorthWest')
63+
title({'Albedo Irradiance on a Bifacial Module';'Albuquerque - Aug 2'},'FontSize',14)
64+
65+
%%
66+
% Copyright 2018 Sandia National Laboratories
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
%% example_pvl_Purdue_albedo_model
2+
%
3+
% Example calculation of front and rear irradiance on a bifacial module.
4+
5+
clc
6+
clearvars
7+
close all
8+
9+
%% Load weather data
10+
TMYData = pvl_readtmy3('723650TY.csv');
11+
TimeMatlab = TMYData.DateNumber;
12+
dv = datevec(TimeMatlab);
13+
14+
tfilter = and(dv(:,2) == 8, dv(:,3) == 2); % Select August 2
15+
16+
Time = pvl_maketimestruct(TimeMatlab(tfilter), ones(size(TimeMatlab(tfilter)))*TMYData.SiteTimeZone);
17+
18+
%% Sun position calculations
19+
HExtra = pvl_extraradiation(pvl_date2doy(Time.year,Time.month,Time.day));
20+
Location = pvl_makelocationstruct(TMYData.SiteLatitude,TMYData.SiteLongitude,TMYData.SiteElevation);
21+
PresPa = TMYData.Pressure(tfilter)*100; %Convert pressure from mbar to Pa
22+
[SunAz, SunEl, AppSunEl, SolarTime] = pvl_ephemeris(Time,Location,PresPa,TMYData.DryBulb(tfilter));
23+
SunZen = 90 - AppSunEl;
24+
AM = pvl_relativeairmass(SunZen);
25+
AM(isnan(AM)) = 20;
26+
27+
%% Describe system
28+
SurfTilt = 90; %Vertical installation
29+
SurfAz = 90; %East-west facing
30+
EtoH = 0; %Ground-mounted
31+
Albedo = 0.25; % 25% albedo coefficient for concrete/vegetation
32+
Rloss_Para = [0.16 4/(3*pi) -0.074]; %Default parameters to calculate the reflection loss between the air/glass interface
33+
34+
%% Run the irradiance calculations
35+
[I_Front_R,I_Rear_R] = pvl_Purdue_bifacial_irradiance(SurfTilt, SurfAz, EtoH, Albedo,...
36+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM,'1990','Yes',Rloss_Para); %Consider reflection loss
37+
38+
[I_Front_NR,I_Rear_NR] = pvl_Purdue_bifacial_irradiance(SurfTilt, SurfAz, EtoH, Albedo,...
39+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM,'1990','No'); %Do NOT consider reflection loss
40+
41+
%% Plot the results
42+
43+
figure
44+
hold all
45+
s = {'r-','b-','k-','r--','b--','k--'};
46+
plot(Time.hour,I_Front_NR,s{4})
47+
plot(Time.hour,I_Rear_NR,s{5})
48+
plot(Time.hour,I_Front_NR+I_Rear_NR,s{6})
49+
plot(Time.hour,I_Front_R,s{1})
50+
plot(Time.hour,I_Rear_R,s{2})
51+
plot(Time.hour,I_Front_R+I_Rear_R,s{3})
52+
xlim([-5 22])
53+
xlabel('Hour of Day')
54+
ylabel('Total Irradiance (W/m^2)')
55+
legend('Front','Rear','Total', ...
56+
'Front red. by refl.','Rear red. by refl.','Total red. by refl.', ...
57+
'Location', 'NorthWest')
58+
title({'Irradiance on a east-facing vertical bifacial module';'Albuquerque - Aug 2'},'FontSize',14)
59+
60+
61+
%% Describe system
62+
Module_length = 1.4; % meters, dimension of module not parallel to the ground
63+
Module_elev = 0.5; % meters, distance from the ground to the bottom of the module
64+
SurfTilt = 35; % Latitude tilt installation
65+
SurfAz = 180; % South facing
66+
EtoH = Module_elev / Module_length;
67+
68+
Albedo = 0.25; % 25% albedo coefficient for concrete/vegetation
69+
Rloss_Para = [0.16 4/(3*pi) -0.074]; %Default parameters to calculate the reflection loss between the air/glass interface
70+
71+
%Running the calculation
72+
[I_Front_R,I_Rear_R] = pvl_Purdue_bifacial_irradiance(SurfTilt, SurfAz, EtoH, Albedo,...
73+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM,'1990','Yes',Rloss_Para); %Consider reflection loss
74+
75+
[I_Front_NR,I_Rear_NR] = pvl_Purdue_bifacial_irradiance(SurfTilt, SurfAz, EtoH, Albedo,...
76+
TMYData.DHI(tfilter), TMYData.DNI(tfilter), HExtra, SunZen, SunAz, AM,'1990','No'); %Do NOT consider reflection loss
77+
78+
%% Plot the results
79+
80+
figure
81+
hold all
82+
s = {'r-','b-','k-','r--','b--','k--'};
83+
plot(Time.hour,I_Front_NR,s{4})
84+
plot(Time.hour,I_Rear_NR,s{5})
85+
plot(Time.hour,I_Front_NR+I_Rear_NR,s{6})
86+
plot(Time.hour,I_Front_R,s{1})
87+
plot(Time.hour,I_Rear_R,s{2})
88+
plot(Time.hour,I_Front_R+I_Rear_R,s{3})
89+
xlim([-5 22])
90+
xlabel('Hour of Day')
91+
ylabel('Total Irradiance (W/m^2)')
92+
legend('Front','Rear','Total', ...
93+
'Front red. by refl.','Rear red. by refl.','Total red. by refl.', ...
94+
'Location', 'NorthWest')
95+
title({'Irradiance on a south-facing latitude tilt bifacial module';'Albuquerque - Aug 2'},'FontSize',14)
96+
97+
%%
98+
% Copyright 2018 Sandia National Laboratories

0 commit comments

Comments
 (0)