You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to clarify how correct my calculations are and whether I used the function correctly to calculate the zenith of the sun?
import pvlib
import pandas
import calendar
import re
f = open('_dni.txt','w')
#set year
y=2017
doy = 0#day of year counter
for m in range(1,2):
dc=calendar.monthrange(y,m)[1]
for d in range(1,dc+1):
doy=doy+1
for h in range(0,24):
s_time='{0}-{1}-{2} {3}:00'.format(y,m,d,h)
time = pandas.Timestamp(s_time,tz='America/Phoenix')
zenith=pvlib.solarposition.get_solarposition(time=time,
latitude=33.4333,
longitude=-112.017,
altitue=None,
pressure=None,
method='nrel_numpy',
temperature=12)
f_zenith=float(zenith.zenith)
print(s_time+"\t"+str(f_zenith)+"\n")
f.write(s_time+"\t"+str(f_zenith)+"\n")
f.close()
As the source data (coordinates, time zone and GHI), I use the model data of the SAM application (System Advisor Model).
But when I try to calc DNI and DHI via pvlib, my findings are completely different from those of the model.
For example, in the model on the first day of the year at 10 o'clock, the values of GHI, DNI, DHI are as follows:
GHI: 457
DNI: 901
DHI: 53
The calculated zenith angle is equal to 66.9732005775
I try to calculate the DNI and GHI as follows:
#---------------------
#day of year
doy=1
i_ghi=457
f_zenith=66.9732005775
It appears that you are comparing the output of a model (Erbs) to TMY values. I would not expect the Erbs output to be the same as the TMY values. Erbs operates on GHI to estimate DNI and DHI: Erbs(GHI = 475) gives the values you posted. The TMY values are hourly averages mostly likely from a different model. I don't know why the TMY2 values for AZ/Phoenix don't 'close' : GHI = 457 <> DNI * cosd(69) + DHI. But that's a problem with TMY2, not with pvlib or the way you are using it.
Happy to help. For the future, we prefer that user help questions go to the google group
I would like to clarify how correct my calculations are and whether I used the function correctly to calculate the zenith of the sun?
import pvlib
import pandas
import calendar
import re
f = open('_dni.txt','w')
#set year
y=2017
doy = 0#day of year counter
for m in range(1,2):
dc=calendar.monthrange(y,m)[1]
f.close()
As the source data (coordinates, time zone and GHI), I use the model data of the SAM application (System Advisor Model).
But when I try to calc DNI and DHI via pvlib, my findings are completely different from those of the model.
For example, in the model on the first day of the year at 10 o'clock, the values of GHI, DNI, DHI are as follows:
GHI: 457
DNI: 901
DHI: 53
The calculated zenith angle is equal to 66.9732005775
I try to calculate the DNI and GHI as follows:
#---------------------
#day of year
doy=1
i_ghi=457
f_zenith=66.9732005775
f_dni=pvlib.irradiance.erbs(i_ghi,f_zenith,doy)["dni"]
f_dhi=pvlib.irradiance.erbs(i_ghi,f_zenith,doy)["dhi"]
#---------------------
The values of DNI and GHI are as follows:
DNI: 975.5429981466746
GHI: 75.405
These values are far from the values of model.
How much do I correctly calculate?
The text was updated successfully, but these errors were encountered: