This document explicates the formulas employed in the R implementation to calculate the solar angle, day length, projected shadow, and other related astronomical parameters.
The following investigation will address the calculation of the solar angle.
The solar angle can be calculated using the following equation:
\[ h = \arcsin\left(\sin \varphi \cdot \sin \delta + \cos \varphi \cdot \cos \delta \cdot \cos H\right) \] Taken from Meeus (1991, p. 93).
where:
\(h\) is the solar altitude in degrees.
\(\varphi\) is the latitude in degrees.
\(\delta\) is the solar declination.
\(H\) is the hour angle in degrees.
The solar declination \(\delta\) is calculated using the equation:
\[ \delta = 23.44^\circ \cdot \sin\left(\frac{360}{365}(N - 81) \cdot \frac{\pi}{180}\right) \]
Taken from Cooper (1969).
The constant \(23.44^\circ\) represents the tilt of the Earth’s rotational axis relative to the plane of its orbit around the Sun (known as the ecliptic) (Meeus, 1991). This axial tilt is responsible for the seasonal variation in the sunlight received by the Earth.
The hour angle \(H\) is calculated as:
\[ H = 15(t - 12) \]
where \(t\) is the local time in solar hours.
Taken from Duffie and Beckman (2013, p. 30).
The central meridian of a time zone is obtained by dividing the longitude by 15 and rounding:
\[ M = 15 \times \text{round}\left(\frac{\lambda}{15}\right) \] where \(M\) is the central meridian and \(\lambda\) is the geographic longitude.
Taken from Duffie and Beckman (2013, p. 30).
Daylength depends on latitude and solar declination. It is calculated using the hour angle at sunrise and sunset:
\[ \cos H = -\tan \varphi \cdot \tan \delta \] Taken from Duffie and Beckman (2013, p. 17).
If \(|\cos H| > 1\), the phenomenon of midnight sun or polar night occurs.
Daylength is:
\[ \text{Duración} = \frac{2H}{15} \]
in solar hours.
Taken from Duffie and Beckman (2013, p. 89).
The length of the shadow cast by an object is obtained using:
\[ S = \frac{h_a}{\tan h} \] where \(S\) is the shadow length and \(h_a\) is the tree height.
Taken from Duffie and Beckman (2013, pp. 32).
# Funciones para el cálculo de sombra
calcular_angulo_solar <- function(latitud, fecha, hora) {
N <- as.numeric(strftime(as.Date(fecha), format = '%j'))
delta <- 23.44 * sin((360 / 365) * (N - 81) * pi / 180)
H <- 15 * (hora - 12)
h <- asin(sin(latitud * pi / 180) * sin(delta * pi / 180) +
cos(latitud * pi / 180) * cos(delta * pi / 180) * cos(H * pi / 180)) * 180 / pi
return(h)
}
calcular_duracion_dia <- function(latitud, fecha) {
N <- as.numeric(strftime(as.Date(fecha), format = '%j'))
delta <- 23.44 * sin((360 / 365) * (N - 81) * pi / 180)
cos_H <- -tan(latitud * pi / 180) * tan(delta * pi / 180)
if (cos_H < -1) {
H <- 180
} else if (cos_H > 1) {
H <- 0
} else {
H <- acos(cos_H) * 180 / pi
}
amanecer <- 12 - (H / 15)
atardecer <- 12 + (H / 15)
duracion_dia <- atardecer - amanecer
return(duracion_dia)
}
calcular_hora_sombra <- function(latitud, fecha, altura_objeto, longitud_sombra) {
N <- as.numeric(strftime(as.Date(fecha), format = '%j'))
delta <- 23.44 * sin((360 / 365) * (N - 81) * pi / 180)
theta <- atan(altura_objeto / longitud_sombra) * 180 / pi
sin_theta <- sin(theta * pi / 180)
sin_phi <- sin(latitud * pi / 180)
sin_delta <- sin(delta * pi / 180)
cos_phi <- cos(latitud * pi / 180)
cos_delta <- cos(delta * pi / 180)
H <- acos((sin_theta - sin_phi * sin_delta) / (cos_phi * cos_delta)) * 180 / pi
amanecer <- 12 - (H / 15)
atardecer <- 12 + (H / 15)
duracion_luz <- atardecer - amanecer
return(duracion_luz)
}
calcular_sombra_promedio <- function(longitud_sombra, latitud, altura_objeto, fecha_siembra,fecha_final) {
fechas <- seq(fecha_siembra, as.Date(fecha_final), by='day')
sombras <- sapply(fechas, function(fecha) {
duracion_dia <- calcular_duracion_dia(latitud, fecha)
duracion_luz <- calcular_hora_sombra(latitud, fecha, altura_objeto, longitud_sombra)
if (is.null(duracion_luz) || duracion_dia <= 0) {
return(NA)
}
return((1 - duracion_luz / duracion_dia)/2)
})
return(mean(sombras, na.rm = TRUE))
}
Cooper, P. I. (1969). The absorption of solar radiation in solar stills. Solar Energy, 12(3), 333-345. Duffie, J. A., & Beckman, W. A. (2013). Solar engineering of thermal processes (1st ed.). Wiley. https://doi.org/10.1002/9781118671603 Meeus, J. (1991). Astronomical algorithms—Jean meeus(1991) (2nd ed.). http://archive.org/details/astronomicalalgorithmsjeanmeeus1991