Learn R Programming

solaR (version 0.37)

A1_calcSol: Apparent movement of the Sun from the Earth

Description

Compute the apparent movement of the Sun from the Earth with the functions fSolD and fSolI.

Usage

calcSol(lat, BTd, sample='hour', BTi, EoT=TRUE, keep.night=TRUE, method='michalsky')

Arguments

lat
Latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator.
BTd
Daily time base, a POSIXct object which may be the result of fBTd. It is not considered if BTi is provided.
sample
Increment of the intradaily sequence. It is a character string, containing one of ‘"sec"’, ‘"min"’, ‘"hour"’. This can optionally be preceded by a (positive or negative) integer and a space, or followed by ‘"s"’. It is used by
BTi
Intradaily time base, a POSIXct object to be used by fSolI. It could be the index of the G0I argument to calcG0.
EoT
logical, if TRUE the Equation of Time is used. Default is TRUE.
keep.night
logical, if TRUE (default) the night is included in the time series.
method
character, method for the sun geometry calculations to be chosen from 'cooper', 'spencer', 'michalsky' and 'strous'. See references for details.

Value

encoding

UTF-8

References

  • Cooper, P.I., Solar Energy, 12, 3 (1969). "The Absorption of Solar Radiation in Solar Stills"
Spencer, Search 2 (5), 172, http://www.mail-archive.com/sundial@uni-koeln.de/msg01050.html Strous: http://www.astro.uu.nl/~strous/AA/en/reken/zonpositie.html Michalsky, J., 1988: The Astronomical Almanac's algorithm for approximate solar position (1950-2050), Solar Energy 40, 227-235, ftp://climate1.gsfc.nasa.gov/wiscombe/Solar_Rad/SunAngles/sunae.f Perpiñán, O, Energía Solar Fotovoltaica, 2012. http://procomun.wordpress.com/documentos/libroesf/ Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, http://www.jstatsoft.org/v50/i09/

Examples

Run this code
BTd=fBTd(mode='serie')

lat=37.2
sol=calcSol(lat, BTd[100])
print(as.zooD(sol))

library(lattice)
xyplot(as.zooI(sol))

solStrous=calcSol(lat, BTd[100], method='strous')
print(as.zooD(solStrous))

solSpencer=calcSol(lat, BTd[100], method='spencer')
print(as.zooD(solSpencer))

solCooper=calcSol(lat, BTd[100], method='cooper')
print(as.zooD(solCooper))

Run the code above in your browser using DataLab