39
39
temperature = greensboro .DryBulb )
40
40
41
41
# %%
42
+ # pvlib Decomposition Functions
43
+ # -----------------------------
42
44
# Methods for separating DHI into diffuse and direct components include:
43
- # ** DISC**, ** DIRINT**, ** Erbs** and ** Boland** .
45
+ # ` DISC`_, ` DIRINT`_, ` Erbs`_, and ` Boland`_ .
44
46
45
47
# %%
46
48
# DISC
89
91
90
92
# %%
91
93
# Boland
92
- # ----
94
+ # ------
93
95
#
94
96
# The Boland method, :py:func:`~pvlib.irradiance.boland` is a single logistic
95
97
# exponential correlation that is continuously differentiable and bounded
103
105
# Combine everything together.
104
106
105
107
dni_renames = {
106
- 'DNI' : 'TMY ' , 'dni_disc' : 'DISC' , 'dni_dirint' : 'DIRINT' ,
108
+ 'DNI' : 'TMY3 ' , 'dni_disc' : 'DISC' , 'dni_dirint' : 'DIRINT' ,
107
109
'dni_erbs' : 'Erbs' , 'dni_boland' : 'Boland' }
108
110
dni = [
109
111
greensboro .DNI , out_disc .dni_disc , out_dirint .dni_dirint ,
110
112
out_erbs .dni_erbs , out_boland .dni_boland ]
111
113
dni = pd .concat (dni , axis = 1 ).rename (columns = dni_renames )
112
114
dhi_renames = {
113
- 'DHI' : 'TMY ' , 'dhi_disc' : 'DISC' , 'dhi_dirint' : 'DIRINT' ,
115
+ 'DHI' : 'TMY3 ' , 'dhi_disc' : 'DISC' , 'dhi_dirint' : 'DIRINT' ,
114
116
'dhi_erbs' : 'Erbs' , 'dhi_boland' : 'Boland' }
115
117
dhi = [
116
118
greensboro .DHI , out_disc .dhi_disc , out_dirint .dhi_dirint ,
117
119
out_erbs .dhi_erbs , out_boland .dhi_boland ]
118
120
dhi = pd .concat (dhi , axis = 1 ).rename (columns = dhi_renames )
119
- ghi_kt = pd .concat ([greensboro .GHI / 1366.1 , out_erbs .kt ], axis = 1 )
121
+ ghi_kt = pd .concat ([greensboro .GHI / 1000.0 , out_erbs .kt ], axis = 1 )
120
122
121
123
# %%
122
124
# Finally, let's plot them for a few winter days and compare
132
134
ax [1 ].set_ylabel ('DHI $[W/m^2]$' )
133
135
ghi_kt [JAN6AM :JAN6PM ].plot (ax = ax [2 ])
134
136
ax [2 ].grid (which = 'both' )
135
- ax [2 ].set_ylabel (r'$\frac{GHI}{G_{SC} }, k_t$' )
137
+ ax [2 ].set_ylabel (r'$\frac{GHI}{E0 }, k_t$' )
136
138
f .tight_layout ()
137
139
138
140
# %%
172
174
# %%
173
175
# Conclusion
174
176
# ----------
177
+ # This example has compared several decomposition models to a TMY3 file for
178
+ # Greensboro, North Carolina. However, DNI and DHI in the TMY3 file are
179
+ # themselves the output of a model (either METSTAT or SUNY), and so differences
180
+ # between *e.g.* DISC output and TMY3 shouldn't be regarded as an error in the
181
+ # DISC model. Therefore, it's not a reasonable expectation to assume that the
182
+ # four models should reproduce the TMY3 values. We refer those interested to
183
+ # the `TMY3`_ and `NSRDB`_ user manuals.
184
+ #
175
185
# The Erbs and Boland are correlations with only kt, which is derived from the
176
186
# horizontal component of the extra-terrestrial irradiance. Therefore at low
177
187
# sun elevation (zenith ~ 90-deg), especially near sunset, this causes kt to
178
188
# explode as the denominator approaches zero. This is controlled in pvlib by
179
189
# setting ``min_cos_zenith`` and ``max_clearness_index`` which each have
180
190
# reasonable defaults, but there are still concerning spikes at sunset for Jan.
181
191
# 5th & 7th, April 4th, 5th, & 7th, and July 6th & 7th. The DISC & DIRINT
182
- # methods differ from Erbs and Boland be including airmass, which seems to
192
+ # methods differ from Erbs and Boland by including airmass, which seems to
183
193
# reduce DNI spikes over 1000[W/m^2], but still have errors at other times.
184
194
#
185
195
# Another difference is that DISC & DIRINT return DNI whereas Erbs & Boland
186
196
# calculate the diffuse fraction which is then used to derive DNI from GHI and
187
197
# the solar zenith, which exacerbates errors at low sun elevation due to the
188
- # relation: DNI = GHI*(1 - DF)/cos(zenith).
198
+ # relation:
199
+ # :math:`DNI = GHI \frac{1 - \mathit{DF}}{\cos \left(\mathit{zenith} \right)}`.
200
+ #
201
+ # .. _TMY3: https://www.nrel.gov/docs/fy08osti/43156.pdf
202
+ # .. _NSRDB: https://www.nrel.gov/docs/fy12osti/54824.pdf
0 commit comments