Learn R Programming

solaR (version 0.14)

fSolD: Daily apparent movement of the Sun from the Earth

Description

Compute the daily apparent movement of the Sun from the Earth. This movement is mainly described (for the simulation of photovoltaic systems) by the declination angle, the sunset angle and the daily extra-atmospheric irradiation.

Usage

fSolD(lat,dn, BTd)

Arguments

lat
Latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator.
dn
Day of year as decimal number (1:366). It can be a unique number, a range of days or a set of individual ones.
BTd
Daily temporal base, data.frame which includes the variables Ano (year), DiaAno (day of year), Mes (month) and DiaMes (day of month). It may be the result of fBTd

Value

  • A data.frame with these components:
  • BTddata.frame, only when this argument was included in the call to this function
  • IDdnumeric, a value which identifies each day of the time series. It is only included when the dn argument was supplied.
  • DiaAnonumeric, the value of dn. It is only included when the dn argument was supplied.
  • latLatitude, now converted to radians.
  • declDeclination angle (radians) for each day of year in dn or BTd
  • eoFactor of correction due the eccentricity of orbit of the Earth around the Sun.
  • wsSunset angle (in radians) for each day of year. Due to the convention which considers that the solar hour angle is negative before midday, this angle is negative.
  • Bo0dExtra-atmospheric daily irradiation (watt-hour per squared meter) incident on a horizontal surface

encoding

UTF-8

References

Perpiñán, O, Energía Solar Fotovoltaica, 2010. (http://procomun.wordpress.com/documentos/libroesf/)

Examples

Run this code
lat=37.2
(fSolD(lat,dn=100))

lat=-37.2
(fSolD(lat,dn=283))

#Declination angle along the year
SolD<-fSolD(lat,BTd=fBTd())
library(lattice)
xyplot(decl~DiaAno,data=SolD,type='l')

#Calculation of the daylength for several latitudes
SolD<-data.frame()
for (i in c(-60,-40,-20,0,20,40,60)){
    if (i>0) {NomLat=paste(i,'N',sep='')} else 
    if (i<0) {NomLat=paste(abs(i),'S',sep='')} else NomLat="0";
    SolDaux<-fSolD(lat=i,BTd=fBTd(Modo='Serie'));
    SolD<-rbind(SolD,data.frame(SolDaux,Lat=NomLat));}
    
p<-xyplot(12/pi*2*abs(ws)~DiaAno,
        data=SolD,groups=factor(Lat), 
        xlab='dn',ylab=expression(omega[s] (h)), 
        type='l')

library(latticedl)
print(direct.label(p,method=last.points));

Run the code above in your browser using DataLab