Title: | Radiation and Photovoltaic Systems |
---|---|
Description: | Provides tools for calculating solar geometry, solar radiation on horizontal and inclined planes, and simulating the performance of various photovoltaic (PV) systems. Supports daily and intradaily irradiation data, enabling detailed analysis of grid-connected and water-pumping PV systems, including shading effects and solar angle calculations. |
Authors: | Oscar Perpiñán-Lamigueiro [aut]
|
Maintainer: | Francisco Delgado-López <[email protected]> |
License: | GPL-3 |
Version: | 0.11 |
Built: | 2025-02-19 12:45:38 UTC |
Source: | https://github.com/solarization/solar2 |
The solaR2
package allows for reproducible research both for
photovoltaics (PV) systems performance and solar radiation. It
includes a set of classes, methods and functions to calculate the sun
geometry and the solar radiation incident on a photovoltaic generator
and to simulate the performance of several applications of the
photovoltaic energy. This package performs the whole calculation
procedure from both daily and intradaily global horizontal irradiation
to the final productivity of grid-connected PV systems and water
pumping PV systems.
solaRd
is designed using a set of S4
classes whose core
is a group of slots with multivariate time series. The classes share a
variety of methods to access the information and several visualization
methods. In addition, the package provides a tool for the visual
statistical analysis of the performance of a large PV plant composed of
several systems.
Although solaRd
is primarily designed for time series associated
to a location defined by its latitude/longitude values and the
temperature and irradiation conditions, it can be easily combined with
spatial packages for space-time analysis.
Please note that this package needs to set the timezone to
UTC
. Every ‘data.table’ object created by the package will have an
index with this time zone as a synonym of mean solar time..
You can check it after loading solaR2
with:
Sys.getenv('TZ')
If you need to change it, use:
Sys.setenv(TZ = 'YourTimeZone')
Index of functions and classes:
G0-class Class "G0": irradiation and irradiance on the horizontal plane. Gef-class Class "Gef": irradiation and irradiance on the generator plane. HQCurve H-Q curves of a centrifugal pump Meteo-class Class "Meteo" NmgPVPS Nomogram of a photovoltaic pumping system ProdGCPV-class Class "ProdGCPV": performance of a grid connected PV system. ProdPVPS-class Class "ProdPVPS": performance of a PV pumping system. Shade-class Class "Shade": shadows in a PV system. Sol-class Class "Sol": Apparent movement of the Sun from the Earth aguiar Markov Transition Matrices for the Aguiar etal. procedure as.data.tableD Methods for Function as.data.frameD as.data.tableI Methods for Function as.data.frameI as.data.tableM Methods for Function as.data.frameM as.data.tableY Methods for Function as.data.frameY calcG0 Irradiation and irradiance on the horizontal plane. calcGef Irradiation and irradiance on the generator plane. calcShd Shadows on PV systems. calcSol Apparent movement of the Sun from the Earth compare Compare G0, Gef and ProdGCPV objects compareLosses Losses of a GCPV system corrFdKt Correlations between the fraction of diffuse irradiation and the clearness index. d2r Conversion between angle units. diff2Hours Small utilities for difftime objects. fBTd Daily time base fCompD Components of daily global solar irradiation on a horizontal surface fCompI Calculation of solar irradiance on a horizontal surface fInclin Solar irradiance on an inclined surface fProd Performance of a PV system fPump Performance of a centrifugal pump fSolD Daily apparent movement of the Sun from the Earth fSolI Instantaneous apparent movement of the Sun from the Earth fSombra Shadows on PV systems fTemp Intradaily evolution of ambient temperature fTheta Angle of incidence of solar irradiation on a inclined surface getData Methods for function getData getG0 Methods for function getG0 getLat Methods for Function getLat helios Daily irradiation and ambient temperature from the Helios-IES database hour Utilities for time indexes. indexD Methods for Function indexD indexI Methods for Function indexI levelplot-methods Methods for function levelplot. local2Solar Local time, mean solar time and UTC time zone. mergesolaR Merge solaR objects optimShd Shadows calculation for a set of distances between elements of a PV grid connected plant. prodEx Productivity of a set of PV systems of a PV plant. prodGCPV Performance of a grid connected PV system. prodPVPS Performance of a PV pumping system pumpCoef Coefficients of centrifugal pumps. readBD Daily or intradaily values of global horizontal irradiation and ambient temperature from a local file or a data.frame. readG0dm Monthly mean values of global horizontal irradiation. readSIAR Meteorological data exported from the SIAR network shadeplot Methods for Function shadeplot solaR.theme solaR theme window Methods for extracting a time window writeSolar Exporter of solaR results xyplot-methods Methods for function xyplot in Package 'solaR'
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Compute the apparent movement of the Sun from the Earth with the
functions fSolD
and fSolI
.
calcSol(lat, BTd, sample = 'hour', BTi, EoT = TRUE, keep.night = TRUE, method = 'michalsky')
calcSol(lat, BTd, sample = 'hour', BTi, EoT = TRUE, keep.night = TRUE, method = 'michalsky')
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 |
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 It is not considered if |
BTi |
Intradaily time base, a |
EoT |
logical, if |
keep.night |
logical, if |
method |
|
A Sol-class
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Cooper, P.I., Solar Energy, 12, 3 (1969). "The Absorption of Solar Radiation in Solar Stills"
Spencer, Search 2 (5), 172, https://www.mail-archive.com/[email protected]/msg01050.html
Michalsky, J., 1988: The Astronomical Almanac's algorithm for approximate solar position (1950-2050), Solar Energy 40, 227-235
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") BTd <- fBTd(mode <- 'serie') lat <- 37.2 sol <- calcSol(lat, BTd[100]) print(as.data.tableD(sol)) library(lattice) xyplot(as.data.tableI(sol)) solStrous <- calcSol(lat, BTd[100], method = 'strous') print(as.data.tableD(solStrous)) solSpencer <- calcSol(lat, BTd[100], method = 'spencer') print(as.data.tableD(solSpencer)) solCooper <- calcSol(lat, BTd[100], method = 'cooper') print(as.data.tableD(solCooper))
library("data.table") BTd <- fBTd(mode <- 'serie') lat <- 37.2 sol <- calcSol(lat, BTd[100]) print(as.data.tableD(sol)) library(lattice) xyplot(as.data.tableI(sol)) solStrous <- calcSol(lat, BTd[100], method = 'strous') print(as.data.tableD(solStrous)) solSpencer <- calcSol(lat, BTd[100], method = 'spencer') print(as.data.tableD(solSpencer)) solCooper <- calcSol(lat, BTd[100], method = 'cooper') print(as.data.tableD(solCooper))
This function obtains the global, diffuse and direct irradiation and
irradiance on the horizontal plane from the values of daily and
intradaily global irradiation on the horizontal plane.
It makes use of the functions calcSol
,
fCompD
, fCompI
, fBTd
and readBDd
(or equivalent).
Besides, if information about maximum and minimum temperatures values are available it obtains a series of temperature values with fTemp
.
calcG0(lat, modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, ...)
calcG0(lat, modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, ...)
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
modeRad |
A character string, describes the kind of source data of the global irradiation and ambient temperature. It can be
If If |
dataRad |
|
sample |
|
keep.night |
|
sunGeometry |
|
corr |
A character, the correlation between the fraction of diffuse irradiation and the clearness index to be used. With this version several options are available, as described in
If If |
f |
A function defininig a correlation between the fraction of
diffuse irradiation and the clearness index. It is only neccessary
when |
... |
A G0
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Aguiar, Collares-Pereira and Conde, "Simple procedure for generating sequences of daily radiation values using a library of Markov transition matrices", Solar Energy, Volume 40, Issue 3, 1988, Pages 269–279
calcSol
,
fCompD
,
fCompI
,
readG0dm
,
readBDd
,
readBDi
,
dt2Meteo
,
corrFdKt
.
library("data.table") G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) g0 <- calcG0(lat = 37.2, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta)) print(g0) xyplot(g0) ## Aguiar et al. g0 <- calcG0(lat = 37.2, modeRad = 'aguiar', dataRad = G0dm) print(g0) xyplot(g0) ##Now the G0I component of g0 is used as ##the bdI argument to calcG0 in order to ##test the intradaily correlations of fd-kt BDi = as.data.tableI(g0) BDi$Ta = 25 ##Information about temperature must be contained in BDi g02 <- calcG0(lat = 37.2, modeRad = 'bdI', dataRad = list(lat = 37.2, file = BDi), corr = 'none') print(g02) g03 <- calcG0(lat = 37.2, modeRad = 'bdI', dataRad = list(lat = 37.2, file = BDi), corr = 'BRL') print(g03) xyplot(Fd ~ Kt, data = g03, pch = 19, alpha = 0.3)
library("data.table") G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) g0 <- calcG0(lat = 37.2, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta)) print(g0) xyplot(g0) ## Aguiar et al. g0 <- calcG0(lat = 37.2, modeRad = 'aguiar', dataRad = G0dm) print(g0) xyplot(g0) ##Now the G0I component of g0 is used as ##the bdI argument to calcG0 in order to ##test the intradaily correlations of fd-kt BDi = as.data.tableI(g0) BDi$Ta = 25 ##Information about temperature must be contained in BDi g02 <- calcG0(lat = 37.2, modeRad = 'bdI', dataRad = list(lat = 37.2, file = BDi), corr = 'none') print(g02) g03 <- calcG0(lat = 37.2, modeRad = 'bdI', dataRad = list(lat = 37.2, file = BDi), corr = 'BRL') print(g03) xyplot(Fd ~ Kt, data = g03, pch = 19, alpha = 0.3)
This function obtains the global, diffuse and direct irradiation and
irradiance on the generator plane from the values of daily or intradaily global
irradiation on the horizontal plane. It makes use of the functions
calcG0
, fTheta
,
fInclin
. Besides, it can calculate the shadows effect with
the calcShd
function.
calcGef(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, modeShd = '', struct = list(), distances = data.table(), ...)
calcGef(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, modeShd = '', struct = list(), distances = data.table(), ...)
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
modeTrk |
character, to be chosen from |
modeRad , dataRad
|
Information about the source data of the
global irradiation. See |
sample , keep.night
|
See |
sunGeometry |
|
corr , f
|
See |
beta |
numeric, inclination angle of the surface
(degrees). It is only needed when |
betaLim |
numeric, maximum value of the inclination angle for a tracking surface. Its default value is 90 (no limitation)) |
alpha |
numeric, azimuth angle of the surface (degrees). It is
measured from the south ( |
iS |
integer, degree of dirtiness. Its value must be included in
the set (1,2,3,4). |
alb |
numeric, albedo reflection coefficient. Its default value is 0.2 |
modeShd , struct , distances
|
See |
horizBright |
logical, if TRUE, the horizon brightness correction proposed by Reind et al. is used. |
HCPV |
logical, if TRUE the diffuse and albedo components of the effective irradiance are set to zero. HCPV is the acronym of High Concentration PV system. |
... |
A Gef
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Hay, J. E. and McKay, D. C.: Estimating Solar Irradiance on Inclined Surfaces: A Review and Assessment of Methodologies. Int. J. Solar Energy, (3):pp. 203, 1985.
Martin, N. and Ruiz, J.M.: Calculation of the PV modules angular losses under field conditions by means of an analytical model. Solar Energy Materials & Solar Cells, 70:25–38, 2001.
D. T. Reindl and W. A. Beckman and J. A. Duffie: Evaluation of hourly tilted surface radiation models, Solar Energy, 45:9-17, 1990.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
calcG0
,
fTheta
,
fInclin
,
calcShd
.
library("data.table") lat <- 37.2 ###12 Average days. G0dm = c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta = c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) ##Fixed surface, default values of inclination and azimuth. gef <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta)) print(gef) xyplot(gef) ##Two-axis surface, no limitation angle. gef2 <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta), modeTrk = 'two') print(gef2) xyplot(gef2) struct = list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) distances = data.table(Lew = 40, Lns = 30, H = 0) gefShd <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta), modeTrk = 'two', modeShd = c('area', 'prom'), struct = struct, distances = distances) print(gefShd)
library("data.table") lat <- 37.2 ###12 Average days. G0dm = c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta = c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) ##Fixed surface, default values of inclination and azimuth. gef <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta)) print(gef) xyplot(gef) ##Two-axis surface, no limitation angle. gef2 <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta), modeTrk = 'two') print(gef2) xyplot(gef2) struct = list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) distances = data.table(Lew = 40, Lns = 30, H = 0) gefShd <- calcGef(lat = lat, modeRad = 'prom', dataRad = list(G0dm = G0dm, Ta = Ta), modeTrk = 'two', modeShd = c('area', 'prom'), struct = struct, distances = distances) print(gefShd)
Compute every step from solar angles to effective irradiance to calculate the performance of a grid connected PV system.
prodGCPV(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, module = list(), generator = list(), inverter = list(), effSys = list(), modeShd = '', struct = list(), distances = data.table(), ...)
prodGCPV(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, module = list(), generator = list(), inverter = list(), effSys = list(), modeShd = '', struct = list(), distances = data.table(), ...)
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
modeTrk |
A character string, describing the tracking method
of the generator. See |
modeRad , dataRad
|
Information about the source data of the
global irradiation. See |
sample , keep.night
|
See |
sunGeometry |
|
corr , f
|
See |
betaLim , beta , alpha , iS , alb , horizBright , HCPV
|
See |
module |
list of numeric values with information about the PV module,
|
generator |
list of numeric values with information about the generator,
|
inverter |
list of numeric values with information about the DC/AC inverter,
|
effSys |
list of numeric values with information about the system losses,
|
modeShd , struct , distances
|
See |
... |
The calculation of the irradiance on the horizontal plane is
carried out with the function calcG0
. The transformation
to the inclined surface makes use of the fTheta
and
fInclin
functions inside the calcGef
function. The shadows are computed with calcShd
while
the performance of the PV system is simulated with
fProd
.
A ProdGCPV
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
fProd
,
calcGef
,
calcShd
,
calcG0
,
compare
,
compareLosses
,
mergesolaR
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods prodFixed <- prodGCPV(lat = lat, dataRad = prom, keep.night = FALSE) prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) prodHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) ##Comparison of yearly productivities compare(prodFixed, prod2x, prodHoriz) compareLosses(prodFixed, prod2x, prodHoriz) ##Comparison of power time series ComparePac <- data.table(Dates = indexI(prod2x), two = as.data.tableI(prod2x)$Pac, horiz = as.data.tableI(prodHoriz)$Pac, fixed = as.data.tableI(prodFixed)$Pac) AngSol <- as.data.tableI(as(prodFixed, 'Sol')) ComparePac <- merge(AngSol, ComparePac, by = 'Dates') ComparePac[, Month := as.factor(month(Dates))] xyplot(two + horiz + fixed ~ AzS|Month, data = ComparePac, type = 'l', auto.key = list(space = 'right', lines = TRUE, points = FALSE), ylab = 'Pac') ###Shadows #Two-axis trackers struct2x <- list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) dist2x <- data.table(Lew = 40, Lns = 30, H = 0) prod2xShd <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', modeShd = 'area', struct = struct2x, distances = dist2x) print(prod2xShd) #Horizontal N-S tracker structHoriz <- list(L = 4.83); distHoriz <- data.table(Lew = structHoriz$L*4); #Without Backtracking prodHorizShd <- prodGCPV(lat = lat, dataRad = prom, sample = '10 min', modeTrk = 'horiz', modeShd = 'area', betaLim = 60, distances = distHoriz, struct = structHoriz) print(prodHorizShd) xyplot(r2d(Beta)~r2d(w), data = prodHorizShd, type = 'l', main = 'Inclination angle of a horizontal axis tracker', xlab = expression(omega (degrees)), ylab = expression(beta (degrees))) #With Backtracking prodHorizBT <- prodGCPV(lat = lat, dataRad = prom, sample = '10 min', modeTrk = 'horiz', modeShd = 'bt', betaLim = 60, distances = distHoriz, struct = structHoriz) print(prodHorizBT) xyplot(r2d(Beta)~r2d(w), data = prodHorizBT, type = 'l', main = 'Inclination angle of a horizontal axis tracker\n with backtracking', xlab = expression(omega (degrees)), ylab = expression(beta (degrees))) compare(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) compareLosses(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) compareYf2 <- mergesolaR(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) xyplot(prodFixed + prod2x +prodHoriz + prod2xShd + prodHorizShd + prodHorizBT ~ Dates, data = compareYf2, type = 'l', ylab = 'kWh/kWp', main = 'Daily productivity', auto.key = list(space = 'right'))
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods prodFixed <- prodGCPV(lat = lat, dataRad = prom, keep.night = FALSE) prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) prodHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) ##Comparison of yearly productivities compare(prodFixed, prod2x, prodHoriz) compareLosses(prodFixed, prod2x, prodHoriz) ##Comparison of power time series ComparePac <- data.table(Dates = indexI(prod2x), two = as.data.tableI(prod2x)$Pac, horiz = as.data.tableI(prodHoriz)$Pac, fixed = as.data.tableI(prodFixed)$Pac) AngSol <- as.data.tableI(as(prodFixed, 'Sol')) ComparePac <- merge(AngSol, ComparePac, by = 'Dates') ComparePac[, Month := as.factor(month(Dates))] xyplot(two + horiz + fixed ~ AzS|Month, data = ComparePac, type = 'l', auto.key = list(space = 'right', lines = TRUE, points = FALSE), ylab = 'Pac') ###Shadows #Two-axis trackers struct2x <- list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) dist2x <- data.table(Lew = 40, Lns = 30, H = 0) prod2xShd <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', modeShd = 'area', struct = struct2x, distances = dist2x) print(prod2xShd) #Horizontal N-S tracker structHoriz <- list(L = 4.83); distHoriz <- data.table(Lew = structHoriz$L*4); #Without Backtracking prodHorizShd <- prodGCPV(lat = lat, dataRad = prom, sample = '10 min', modeTrk = 'horiz', modeShd = 'area', betaLim = 60, distances = distHoriz, struct = structHoriz) print(prodHorizShd) xyplot(r2d(Beta)~r2d(w), data = prodHorizShd, type = 'l', main = 'Inclination angle of a horizontal axis tracker', xlab = expression(omega (degrees)), ylab = expression(beta (degrees))) #With Backtracking prodHorizBT <- prodGCPV(lat = lat, dataRad = prom, sample = '10 min', modeTrk = 'horiz', modeShd = 'bt', betaLim = 60, distances = distHoriz, struct = structHoriz) print(prodHorizBT) xyplot(r2d(Beta)~r2d(w), data = prodHorizBT, type = 'l', main = 'Inclination angle of a horizontal axis tracker\n with backtracking', xlab = expression(omega (degrees)), ylab = expression(beta (degrees))) compare(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) compareLosses(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) compareYf2 <- mergesolaR(prodFixed, prod2x, prodHoriz, prod2xShd, prodHorizShd, prodHorizBT) xyplot(prodFixed + prod2x +prodHoriz + prod2xShd + prodHorizShd + prodHorizBT ~ Dates, data = compareYf2, type = 'l', ylab = 'kWh/kWp', main = 'Daily productivity', auto.key = list(space = 'right'))
Compute every step from solar angles to effective irradiance to calculate the performance of a PV pumping system.
prodPVPS(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, pump , H, Pg, converter= list(), effSys = list(), ...)
prodPVPS(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', corr, f, betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE, pump , H, Pg, converter= list(), effSys = list(), ...)
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
modeTrk |
A character string, describing the tracking method
of the generator. See |
modeRad , dataRad
|
Information about the source data of the
global irradiation. See |
sample , keep.night
|
See |
sunGeometry |
|
corr , f
|
See |
betaLim , beta , alpha , iS , alb , horizBright , HCPV
|
See |
pump |
A |
H |
Total manometric head (m) |
Pg |
Nominal power of the PV generator (Wp) |
converter |
|
effSys |
list of numeric values with information about the system losses,
|
... |
The calculation of the irradiance on the generator is carried
out with the function calcGef
. The performance of the PV system is simulated with fPump
.
A ProdPVPS
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Abella, M. A., Lorenzo, E. y Chenlo, F.: PV water pumping systems based on standard frequency converters. Progress in Photovoltaics: Research and Applications, 11(3):179–191, 2003, ISSN 1099-159X.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Compute the irradiance and irradiation including shadows
for two-axis and horizontal N-S axis trackers and fixed surfaces. It
makes use of the function fSombra
for the shadows factor
calculation. It is used by the function calcGef
.
calcShd(radEf, modeShd = '', struct = list(), distances = data.table())
calcShd(radEf, modeShd = '', struct = list(), distances = data.table())
radEf |
|
modeShd |
character, defines the type of shadow calculation. In
this version of the package the effect of the shadow is calculated
as a proportional reduction of the circumsolar diffuse and direct
irradiances. This type of approach is selected with
|
struct |
When For two-axis trackers ( |
distances |
When When When The distances, in meters, are defined between axis of the trackers. |
A Gef
object including three additional variables
(Gef0
, Def0
and Bef0
) in the slots GefI
,
GefD
, Gefdm
and Gefy
with the
irradiance/irradiation without shadows as a reference.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
calcG0
, fTheta
,
fInclin
, calcShd
.
The optimum distance between trackers or static structures of a PV grid connected plant depends on two main factors: the ground requirement ratio (defined as the ratio of the total ground area to the generator PV array area), and the productivity of the system including shadow losses. Therefore, the optimum separation may be the one which achieves the highest productivity with the lowest ground requirement ratio.
However, this definition is not complete since the terrain characteristics and the costs of wiring or civil works could alter the decision. This function is a help for choosing this distance: it computes the productivity for a set of combinations of distances between the elements of the plant.
optimShd(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, HCPV = FALSE, module = list(), generator = list(), inverter = list(), effSys = list(), modeShd = '', struct = list(), distances = data.table(), res = 2, prog = TRUE)
optimShd(lat, modeTrk = 'fixed', modeRad = 'prom', dataRad, sample = 'hour', keep.night = TRUE, sunGeometry = 'michalsky', betaLim = 90, beta = abs(lat)-10, alpha = 0, iS = 2, alb = 0.2, HCPV = FALSE, module = list(), generator = list(), inverter = list(), effSys = list(), modeShd = '', struct = list(), distances = data.table(), res = 2, prog = TRUE)
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
modeTrk |
character, to be chosen from |
modeRad , dataRad
|
Information about the source data of the
global irradiation. See |
sample |
|
keep.night |
|
sunGeometry |
|
betaLim , beta , alpha , iS , alb , HCPV
|
See |
module |
list of numeric values with information about the PV module,
|
generator |
list of numeric values with information about the generator,
|
inverter |
list of numeric values with information about the DC/AC inverter,
|
effSys |
list of numeric values with information about the system losses,
|
modeShd |
character, defines the type of shadow calculation. In
this version of the package the effect of the shadow is calculated
as a proportional reduction of the circumsolar diffuse and direct
irradiances. This type of approach is selected with
|
struct |
|
distances |
These distances, in meters, are defined between the axis of the trackers. |
res |
numeric; |
prog |
logical, show a progress bar; default value is TRUE |
optimShd
calculates the energy produced for every
combination of distances as defined by distances
and
res
. The result of this function is a Shade-class
object. A method of shadeplot
for this class is defined
(shadeplot-methods
), and it shows the graphical relation
between the productivity and the distance between trackers or fixed
surfaces.
A Shade
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O.: Grandes Centrales Fotovoltaicas: producción, seguimiento y ciclo de vida. PhD Thesis, UNED, 2008. https://www.researchgate.net/publication/39419806_Grandes_Centrales_Fotovoltaicas_Produccion_Seguimiento_y_Ciclo_de_Vida.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Two-axis trackers library("latticeExtra") struct2x <- list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 3) dist2x <- list(Lew = c(30, 45),Lns = c(20, 40)) ShdM2x <- optimShd(lat = lat, dataRad = prom, modeTrk = 'two', modeShd = c('area','prom'), distances = dist2x, struct = struct2x, res = 5) shadeplot(ShdM2x) pLew <- xyplot(Yf ~ GRR,data = ShdM2x, groups = factor(Lew), type = c('l','g'), main = 'Productivity for each Lew value') pLew + glayer(panel.text(x[1], y[1], group.value)) pLns <- xyplot(Yf~GRR,data = ShdM2x,groups = factor(Lns),type = c('l','g'), main = 'Productivity for each Lns value') pLns + glayer(panel.text(x[1], y[1], group.value)) ## 1-axis tracker with Backtracking structHoriz <- list(L = 4.83); distHoriz <- list(Lew = structHoriz$L * c(2,5)); Shd12HorizBT <- optimShd(lat = lat, dataRad = prom, modeTrk = 'horiz', betaLim = 60, distances = distHoriz, res = 2, struct = structHoriz, modeShd = 'bt') shadeplot(Shd12HorizBT) xyplot(diff(Yf) ~ GRR[-1],data = Shd12HorizBT, type = c('l','g')) ###Fixed system structFixed = list(L = 5); distFixed <- list(D = structFixed$L*c(1,3)); Shd12Fixed <- optimShd(lat = lat, dataRad = prom, modeTrk = 'fixed', distances = distFixed, res = 2, struct = structFixed, modeShd = 'area') shadeplot(Shd12Fixed)
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Two-axis trackers library("latticeExtra") struct2x <- list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 3) dist2x <- list(Lew = c(30, 45),Lns = c(20, 40)) ShdM2x <- optimShd(lat = lat, dataRad = prom, modeTrk = 'two', modeShd = c('area','prom'), distances = dist2x, struct = struct2x, res = 5) shadeplot(ShdM2x) pLew <- xyplot(Yf ~ GRR,data = ShdM2x, groups = factor(Lew), type = c('l','g'), main = 'Productivity for each Lew value') pLew + glayer(panel.text(x[1], y[1], group.value)) pLns <- xyplot(Yf~GRR,data = ShdM2x,groups = factor(Lns),type = c('l','g'), main = 'Productivity for each Lns value') pLns + glayer(panel.text(x[1], y[1], group.value)) ## 1-axis tracker with Backtracking structHoriz <- list(L = 4.83); distHoriz <- list(Lew = structHoriz$L * c(2,5)); Shd12HorizBT <- optimShd(lat = lat, dataRad = prom, modeTrk = 'horiz', betaLim = 60, distances = distHoriz, res = 2, struct = structHoriz, modeShd = 'bt') shadeplot(Shd12HorizBT) xyplot(diff(Yf) ~ GRR[-1],data = Shd12HorizBT, type = c('l','g')) ###Fixed system structFixed = list(L = 5); distFixed <- list(D = structFixed$L*c(1,3)); Shd12Fixed <- optimShd(lat = lat, dataRad = prom, modeTrk = 'fixed', distances = distFixed, res = 2, struct = structFixed, modeShd = 'area') shadeplot(Shd12Fixed)
Functions for the class Meteo
that transforms an
intradaily Meteo
object into a daily and a daily into a
monthly.
Meteoi2Meteod(G0i) Meteod2Meteom(G0d)
Meteoi2Meteod(G0i) Meteod2Meteom(G0d)
G0i |
A |
G0d |
A |
A Meteo
object
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919, 7.027,5.369,3.562,2.814,2.179) * 1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) g0 <- calcG0(lat = 37.2, dataRad = prom, modeRad = 'aguiar') G0i <- as.data.tableI(g0) G0i <- dt2Meteo(G0i, lat = 37.2) G0i G0d <- Meteoi2Meteod(G0i) G0d G0m <- Meteod2Meteom(G0d) G0m
library("data.table") G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919, 7.027,5.369,3.562,2.814,2.179) * 1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) g0 <- calcG0(lat = 37.2, dataRad = prom, modeRad = 'aguiar') G0i <- as.data.tableI(g0) G0i <- dt2Meteo(G0i, lat = 37.2) G0i G0d <- Meteoi2Meteod(G0i) G0d G0m <- Meteod2Meteom(G0d) G0m
Constructor for the class Meteo
with values of
daily or intradaily values of global horizontal irradiation and ambient temperature
from a local file or a data.frame.
readBDd(file, lat, format = '%d/%m/%Y', header = TRUE, fill = TRUE, dec = '.', sep = ';', dates.col = 'Dates', ta.col = 'Ta', g0.col = 'G0', keep.cols = FALSE, ...) readBDi(file, lat, format = '%d/%m/%Y %H:%M:%S', header = TRUE, fill = TRUE, dec = '.', sep = ';', dates.col = 'Dates', times.col, ta.col = 'Ta', g0.col = 'G0', keep.cols = FALSE, ...) dt2Meteo(file, lat, source = '', type) zoo2Meteo(file, lat, source = '')
readBDd(file, lat, format = '%d/%m/%Y', header = TRUE, fill = TRUE, dec = '.', sep = ';', dates.col = 'Dates', ta.col = 'Ta', g0.col = 'G0', keep.cols = FALSE, ...) readBDi(file, lat, format = '%d/%m/%Y %H:%M:%S', header = TRUE, fill = TRUE, dec = '.', sep = ';', dates.col = 'Dates', times.col, ta.col = 'Ta', g0.col = 'G0', keep.cols = FALSE, ...) dt2Meteo(file, lat, source = '', type) zoo2Meteo(file, lat, source = '')
file |
The name of the file ( If the Only for daily data: if the ambient temperature is not available,
the file should include two columns named |
header , fill , dec , sep
|
See |
format |
character string with the format of the dates or time
index.
(Default for daily time bases: |
lat |
numeric, latitude (degrees) of the location. |
dates.col |
character string with the name of the column wich contains the dates of the time series. |
times.col |
character string with the name of the column wich contains the time index of the series in case is in a different column than the dates. |
source |
character string with information about the source of the values. (Default: the name of the file). |
ta.col , g0.col
|
character, the name of the columns with the information of ambient temperature and radiation in the provided file |
keep.cols |
If |
... |
Arguments for |
type |
character, type of the data in |
A Meteo
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") data(helios) names(helios) = c('Dates', 'G0d', 'TempMax', 'TempMin') bd = dt2Meteo(helios, lat = 41, source = 'helios-IES', type = 'bd') getData(bd) xyplot(bd)
library("data.table") data(helios) names(helios) = c('Dates', 'G0d', 'TempMax', 'TempMin') bd = dt2Meteo(helios, lat = 41, source = 'helios-IES', type = 'bd') getData(bd) xyplot(bd)
Constructor for the class Meteo
with 12 values of
monthly means of irradiation.
readG0dm(G0dm, Ta = 25, lat = 0, year= as.POSIXlt(Sys.Date())$year+1900, promDays = c(17,14,15,15,15,10,18,18,18,19,18,13), source = '')
readG0dm(G0dm, Ta = 25, lat = 0, year= as.POSIXlt(Sys.Date())$year+1900, promDays = c(17,14,15,15,15,10,18,18,18,19,18,13), source = '')
G0dm |
numeric, 12 values of monthly means of daily global horizontal irradiation (Wh/m²). |
Ta |
numeric, 12 values of monthly means of ambient temperature (degrees Celsius). |
lat |
numeric, latitude (degrees) of the location. |
year |
numeric (Default: current year). |
promDays |
numeric, set of the average days for each month. |
source |
character string with information about the source of the values. |
Meteo
object
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919,7.027,5.369,3.562,2.814,2.179) * 1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) BD <- readG0dm(G0dm = G0dm, Ta = Ta, lat = 37.2) print(BD) getData(BD) xyplot(BD)
library("data.table") G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919,7.027,5.369,3.562,2.814,2.179) * 1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) BD <- readG0dm(G0dm = G0dm, Ta = Ta, lat = 37.2) print(BD) getData(BD) xyplot(BD)
Download, interpolate and transform meteorological data fromm the SIAR network.
readSIAR(Lon = 0, Lat = 0, inicio = paste(year(Sys.Date())-1, '01-01', sep = '-'), final = paste(year(Sys.Date())-1, '12-31', sep = '-'), tipo = 'Mensuales', n_est = 3)
readSIAR(Lon = 0, Lat = 0, inicio = paste(year(Sys.Date())-1, '01-01', sep = '-'), final = paste(year(Sys.Date())-1, '12-31', sep = '-'), tipo = 'Mensuales', n_est = 3)
Lon |
numeric, longitude (degrees) of the location. |
Lat |
numeric, latitude (degrees) of the location. |
inicio |
character or Date, first day of the records. |
final |
character or Date, last day of the records. |
tipo |
character, tipe of the records. To choose between
|
n_est |
integer, select that number of stations closest to the given point and then perform an IDW (Inverse Distance Weighting) interpolation with these data. |
A Meteo
object
Francisco Delgado López, Oscar Perpiñán Lamigueiro.
library("data.table") library("httr2") library("jsonlite") SIAR = readSIAR(Lon = -3.603, Lat = 40.033, ## Aranjuez, Comunity of Madrid, Spain inicio = '2023-01-01', final = '2023-05-01', tipo = 'Mensuales', n_est = 3) SIAR
library("data.table") library("httr2") library("jsonlite") SIAR = readSIAR(Lon = -3.603, Lat = 40.033, ## Aranjuez, Comunity of Madrid, Spain inicio = '2023-01-01', final = '2023-05-01', tipo = 'Mensuales', n_est = 3) SIAR
A class for meteorological data.
Objects can be created by the family of readBDd
functions.
latm
:Latitude (degrees) of the meteorological station or source of the data.
data
:A data.table
object with the time series of
daily irradiation (G0
, Wh/m²), the ambient temperature (Ta
)
or the maximum and minimum ambient
temperature (TempMax
and TempMin
).
source
:A character with a short description of the source of the data.
type
:A character, prom
, bd
or
bdI
depending on the constructor.
signature(object = "Meteo")
: extracts the
data
slot as a data.table
object.
signature(object = "Meteo")
: extracts the
irradiation as vector.
signature(object = "Meteo")
: extracts the
latitude value.
signature(object = "Meteo")
: extracts the index
of the data
slot.
signature(x = "formula", data = "Meteo")
: plot
the content of the object according to the formula
argument.
signature(x = "Meteo", data = "missing")
: plot
the data
slot using the xyplot
method for zoo
objects.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
readBDd
,
readBDi
,
zoo2Meteo
,
dt2Meteo
,
readG0dm
,
A class which describe the apparent movement of the Sun from the Earth.
Objects can be created by calcSol
.
lat
:numeric, latitude (degrees) as defined in the
call to calcSol
.
solD
:Object of class "data.table"
created by
fSolD
.
solI
:Object of class "data,table"
created by
fSolI
.
method
:character, method for the sun geometry calculations.
sample
:difftime
, increment of the intradaily sequence.
signature(object = "Sol")
: conversion
to a data.table with daily values.
signature(object = "Sol")
: conversion
to a data.table with intradaily values.
signature(object = "Sol")
: latitude (degrees)
as defined in the call to calcSol
.
signature(object = "Sol")
: index of the
solD
slot.
signature(object = "Sol")
: index of the
solI
object.
signature(x = "formula", data = "Sol")
:
displays the contents of a Sol
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
This class contains the global, diffuse and direct irradiation and irradiance on the horizontal plane, and ambient temperature.
Objects can be created by the function calcG0
.
G0D
:Object of class data.table
created by
fCompD
. It includes daily
values of:
numeric, the diffuse fraction
numeric, the clearness index
numeric, the global irradiation on a horizontal surface (Wh/m²)
numeric, the diffuse irradiation on a horizontal surface (Wh/m²)
numeric, the direct irradiation on a horizontal surface (Wh/m²)
G0I
:Object of class data.table
created by
fCompI
. It includes values of:
numeric, clearness index
numeric, global irradiance on a horizontal surface, (W/m²)
numeric, diffuse irradiance on a horizontal surface, (W/m²)
numeric, direct irradiance on a horizontal surface, (W/m²)
G0dm
:Object of class data.table
with monthly mean
values of daily irradiation.
G0y
:Object of class data.table
with yearly sums of irradiation.
Ta
:Object of class data.table
with intradaily ambient
temperature values.
Besides, this class contains the slots from the Sol
and
Meteo
classes.
Class "Meteo"
, directly.
Class "Sol"
, directly.
signature(object = "G0")
: conversion
to a data.table with daily values.
signature(object = "G0")
: conversion
to a data.table with intradaily values.
signature(object = "G0")
: conversion
to a data.table with monthly values.
signature(object = "G0")
: conversion
to a data.frame with yearly values.
signature(object = "G0")
: index of the
solD
slot.
signature(object = "G0")
: index of the
solI
slot.
signature(object = "G0")
: latitude of the inherited
Sol
object.
signature(x = "G0", data = "missing")
: display
the time series of daily values of irradiation.
signature(x = "formula", data = "G0")
:
displays the contents of a G0
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
This class contains the global, diffuse and direct irradiation and irradiance on the horizontal plane, and ambient temperature.
Objects can be created by the function calcGef
.
GefI
:Object of class data.table
created by
fInclin
. It contains these components:
Extra-atmospheric irradiance on the inclined surface (W/m²)
Direct normal irradiance (W/m²)
Global, direct, diffuse (total, isotropic and anisotropic) and albedo irradiance incident on an inclined surface (W/m²)
Effective global, direct, diffuse (total, isotropic and anisotropic) and albedo irradiance incident on an inclined surface (W/m²)
Factor of angular losses for the direct, diffuse and albedo components
GefD
:Object of class data.table
with daily values
of global, diffuse and direct irradiation.
Gefdm
:Object of class data.table
with monthly means
of daily global, diffuse and direct irradiation.
Gefy
:Object of class data.table
with yearly sums of
global, diffuse and direct irradiation.
Theta
:Object of class data.table
created by
fTheta
. It contains these components:
Beta
: numeric, inclination angle of the surface
(radians). When modeTrk='fixed'
it is the value of the
argument beta
converted from degreesto radians.
Alpha
: numeric, azimuth angle of the surface
(radians). When modeTrk='fixed'
it is the value of the
argument alpha
converted from degrees to radians.
cosTheta
: numeric, cosine of the incidence angle of the solar irradiance on the surface
iS
:numeric, degree of dirtiness.
alb
:numeric, albedo reflection coefficient.
modeTrk
:character, mode of tracking.
modeShd
:character, mode of shadows.
angGen
:A list with the values of alpha
,
beta
and betaLim
.
struct
:A list with the dimensions of the structure.
distances
:A data.frame with the distances between structures.
Class "G0"
, directly.
Class "Meteo"
, by class "G0", distance 2.
Class "Sol"
, by class "G0", distance 2.
signature(object = "Gef")
: conversion
to a data.table with daily values.
signature(object = "Gef")
: conversion
to a data.table with intradaily values.
signature(object = "Gef")
: conversion
to a data.table with monthly values.
signature(object = "Gef")
: conversion
to a data.table with yearly values.
signature(object = "Gef")
: index of the
solD
slot.
signature(object = "Gef")
: index of the
solI
slot.
signature(object = "Gef")
: latitude of the inherited
Sol
object.
signature(x = "Gef", data = "missing")
: display
the time series of daily values of irradiation.
signature(x = "formula", data = "Gef")
:
displays the contents of a Gef
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
A class containing values of the performance of a grid connected PV system.
Objects can be created by prodGCPV
.
prodI
:Object of class data.table
created by
fProd
. It includes these components:
cell temperature, .
open circuit voltage, short circuit current, MPP voltage and current, respectively.
voltage and current at the input of the inverter.
power at the input of the inverter, W
power at the output of the inverter, W
efficiency of the inverter
prodD
:A data.table
object with daily values of AC (Eac
) and
DC (Edc
) energy (Wh), and
productivity (Yf
, Wh/Wp) of the system.
prodDm
:A data.table
object with monthly means of
daily values of AC and DC energy (kWh), and
productivity of the system.
prody
:A data.table
object with yearly sums of AC and
DC energy (kWh), and
productivity of the system.
module
:A list with the characteristics of the module.
generator
:A list with the characteristics of the PV generator.
inverter
:A list with the characteristics of the inverter.
effSys
:A list with the efficiency values of the system.
Besides, this class contains the slots from the
"Meteo"
, "Sol"
,
"G0"
and "Gef"
classes.
Class "Gef"
, directly.
Class "G0"
, by class "Gef", distance 2.
Class "Meteo"
, by class "Gef", distance 3.
Class "Sol"
, by class "Gef", distance 3.
signature(object = "ProdGCPV")
: conversion
to a data.table with daily values.
signature(object = "ProdGCPV")
: conversion
to a data.table with intradaily values.
signature(object = "ProdGCPV")
: conversion
to a data.table with monthly values.
signature(object = "ProdGCPV")
: conversion
to a data.table with yearly values.
signature(object = "ProdGCPV")
: index of the
solD
slot.
signature(object = "ProdGCPV")
: index of the
solI
object.
signature(object = "ProdGCPV")
: latitude of the inherited
Sol
object.
signature(x = "ProdGCPV", data = "missing")
: display
the time series of daily values.
signature(x = "formula", data = "ProdGCPV")
:
displays the contents of a ProdGCPV
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Performance of a PV pumping system with a centrifugal pump and a variable frequency converter.
Objects can be created by prodPVPS
.
prodI
:Object of class data.table
with these components:
Flow rate, (m³/h)
Pump shaft power and hydraulical power (W), respectively.
Motor and pump efficiency, respectively.
Frequency (Hz)
prodD
:A data.table
object with daily values of AC
energy (Wh), flow (m³) and productivity of the system.
prodDm
:A data.table
object with monthly means of
daily values of AC energy (kWh), flow (m³) and
productivity of the system.
prody
:A data.table
object with yearly sums of AC
energy (kWh), flow (m³) and productivity of the system.
pump
A list
extracted from pumpCoef
H
Total manometric head (m)
Pg
Nominal power of the PV generator (Wp)
converter
list
containing the nominal power of the
frequency converter, Pnom
, and Ki
, vector of three
values, coefficients of the efficiency curve.
effSys
list of numeric values with information about the system losses
Besides, this class contains the slots from the Gef
class.
Class "Gef"
, directly.
Class "G0"
, by class "Gef", distance 2.
Class "Meteo"
, by class "Gef", distance 3.
Class "Sol"
, by class "Gef", distance 3.
signature(object = "ProdPVPS")
: conversion
to a data.table with daily values.
signature(object = "ProdPVPS")
: conversion
to a data.table with intradaily values.
signature(object = "ProdPVPS")
: conversion
to a data.table with monthly values.
signature(object = "ProdPVPS")
: conversion
to a data.table with yearly values.
signature(object = "ProdPVPS")
: index of the
solD
slot.
signature(object = "ProdPVPS")
: index of the
solI
object.
signature(object = "ProdPVPS")
: latitude of the inherited
Sol
object.
signature(x = "ProdPVPS", data = "missing")
: display
the time series of daily values.
signature(x = "formula", data = "ProdPVPS")
:
displays the contents of a ProdPVPS
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Abella, M. A., Lorenzo, E. y Chenlo, F.: PV water pumping systems based on standard frequency converters. Progress in Photovoltaics: Research and Applications, 11(3):179–191, 2003, ISSN 1099-159X.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
A class for the optimization of shadows in a PV system.
Objects can be created by optimShd
.
FS
:numeric, shadows factor values for each combination of distances.
GRR
:numeric, Ground Requirement Ratio for each combination.
Yf
:numeric, final productivity for each combination.
FS.loess
:A local fitting of FS
with loess
.
Yf.loess
:A local fitting of Yf
with loess
.
modeShd
:character, mode of shadows.
struct
:A list with the dimensions of the structure.
distances
:A data.frame with the distances between structures.
res
numeric, difference (meters) between the different steps of the calculation.
Besides, as a reference, this class includes a ProdGCPV
object
with the performance of a PV systems without shadows.
Class "ProdGCPV"
, directly.
Class "Gef"
, by class "ProdGCPV", distance 2.
Class "G0"
, by class "ProdGCPV", distance 3.
Class "Meteo"
, by class "ProdGCPV", distance 4.
Class "Sol"
, by class "ProdGCPV", distance 4.
signature(x = "Shade")
: conversion to a
data.frame including columns for distances (Lew
,
Lns
, and D
) and results (FS
, GRR
and Yf
).
signature(x = "Shade")
: display the results of
the iteration with a level plot for the two-axis tracking, or with
conventional plot for horizontal tracking and fixed systems.
signature(x = "formula", data = "Shade")
:
display the content of the Shade
object with the
xyplot
method for formulas.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O.: Grandes Centrales Fotovoltaicas: producción, seguimiento y ciclo de vida. PhD Thesis, UNED, 2008. https://www.researchgate.net/publication/39419806_Grandes_Centrales_Fotovoltaicas_Produccion_Seguimiento_y_Ciclo_de_Vida.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
A set of correlations between the fraction of diffuse irradiation and the
clearness index used by fCompD
and fCompI
.
## Monthly means of daily values Ktm(sol, G0dm) FdKtPage(sol, G0dm) FdKtLJ(sol, G0dm) ## Daily values Ktd(sol, G0d) FdKtCPR(sol, G0d) FdKtEKDd(sol, G0d) FdKtCLIMEDd(sol, G0d) ## Intradaily values Kti(sol, G0i) FdKtEKDh(sol, G0i) FdKtCLIMEDh(sol, G0i) FdKtBRL(sol, G0i)
## Monthly means of daily values Ktm(sol, G0dm) FdKtPage(sol, G0dm) FdKtLJ(sol, G0dm) ## Daily values Ktd(sol, G0d) FdKtCPR(sol, G0d) FdKtEKDd(sol, G0d) FdKtCLIMEDd(sol, G0d) ## Intradaily values Kti(sol, G0i) FdKtEKDh(sol, G0i) FdKtCLIMEDh(sol, G0i) FdKtBRL(sol, G0i)
sol |
|
G0dm |
A |
G0d |
A |
G0i |
A |
A data.table, with two columns:
Fd |
A numeric, the diffuse fraction. |
Kt |
A numeric, the clearness index(provided by the Kt functions). |
Oscar Perpiñán Lamigueiro, Francisco Delgado López; The BRL model was suggested by Kevin Ummel.
Page, J. K., The calculation of monthly mean solar radiation for horizontal and inclined surfaces from sunshine records for latitudes 40N-40S. En U.N. Conference on New Sources of Energy, vol. 4, págs. 378–390, 1961.
Collares-Pereira, M. y Rabl, A., The average distribution of solar radiation: correlations between diffuse and hemispherical and between daily and hourly insolation values. Solar Energy, 22:155–164, 1979.
Erbs, D.G, Klein, S.A. and Duffie, J.A., Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation. Solar Energy, 28:293:302, 1982.
De Miguel, A. et al., Diffuse solar irradiation model evaluation in the north mediterranean belt area, Solar Energy, 70:143-153, 2001.
Ridley, B., Boland, J. and Lauret, P., Modelling of diffuse solar fraction with multiple predictors, Renewable Energy, 35:478-482, 2010.
library("data.table") lat <- 37.2 BTd <- fBTd(mode = 'prom') G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- readG0dm(G0dm = G0dm, Ta = Ta, lat = lat) sol <- calcSol(lat = lat, BTd = BTd) Kt <- Ktm(sol = sol, G0dm = prom) Kt Page <- FdKtPage(sol = sol, G0dm = prom) LJ <- FdKtLJ(sol = sol, G0dm = prom) Monthly <- merge(Page, LJ, by = 'Kt', suffixes = c('.Page', '.LJ')) Monthly xyplot(Fd.Page+Fd.LJ~Kt, data = Monthly, type = c('l', 'g'), auto.key = list(space = 'right')) Kt = Ktd(sol = sol, G0d = prom) Kt CPR <- FdKtCPR(sol = sol, G0d = prom) CLIMEDd <- FdKtCLIMEDd(sol = sol, G0d = prom) Daily <- merge(CPR, CLIMEDd, by = 'Kt', suffixes = c('.CPR', '.CLIMEDd')) Daily xyplot(Fd.CPR + Fd.CLIMEDd ~ Kt, data = Daily, type = c('l', 'g'), auto.key = list(space = 'right'))
library("data.table") lat <- 37.2 BTd <- fBTd(mode = 'prom') G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000; Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- readG0dm(G0dm = G0dm, Ta = Ta, lat = lat) sol <- calcSol(lat = lat, BTd = BTd) Kt <- Ktm(sol = sol, G0dm = prom) Kt Page <- FdKtPage(sol = sol, G0dm = prom) LJ <- FdKtLJ(sol = sol, G0dm = prom) Monthly <- merge(Page, LJ, by = 'Kt', suffixes = c('.Page', '.LJ')) Monthly xyplot(Fd.Page+Fd.LJ~Kt, data = Monthly, type = c('l', 'g'), auto.key = list(space = 'right')) Kt = Ktd(sol = sol, G0d = prom) Kt CPR <- FdKtCPR(sol = sol, G0d = prom) CLIMEDd <- FdKtCLIMEDd(sol = sol, G0d = prom) Daily <- merge(CPR, CLIMEDd, by = 'Kt', suffixes = c('.CPR', '.CLIMEDd')) Daily xyplot(Fd.CPR + Fd.CLIMEDd ~ Kt, data = Daily, type = c('l', 'g'), auto.key = list(space = 'right'))
Construction of a daily time base for solar irradiation calculation
fBTd(mode = "prom", year = as.POSIXlt(Sys.Date())$year+1900, start = paste('01-01-',year,sep = ''), end = paste('31-12-',year,sep = ''), format = '%d-%m-%Y')
fBTd(mode = "prom", year = as.POSIXlt(Sys.Date())$year+1900, start = paste('01-01-',year,sep = ''), end = paste('31-12-',year,sep = ''), format = '%d-%m-%Y')
mode |
character, controls the type of time base to be
created. With |
year |
which year is to be used for the time base when |
start |
first day of the time base for |
end |
last day of the time base for |
format |
format of |
This function is commonly used inside fSolD
.
This function returns a POSIXct
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
fSolD
,
as.POSIXct
,
seq.POSIXt
.
library("data.table") #Average days fBTd(mode = 'prom') #The day #100 of the year 2008 BTd = fBTd(mode = 'serie', year = 2008) BTd[100]
library("data.table") #Average days fBTd(mode = 'prom') #The day #100 of the year 2008 BTd = fBTd(mode = 'serie', year = 2008) BTd[100]
Construction of an intra-daily time base for solar irradiation calculation
fBTi(BTd, sample = 'hour')
fBTi(BTd, sample = 'hour')
BTd |
vector, it may be a result for |
sample |
character, identify the sample of the time set. Its default value is 'hour'. |
This function is commonly used inside fSolI
.
This function returns a POSIXct
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") #Average days BTd <- fBTd(mode = 'prom') #Intradaily base time for the first day BTi <- fBTi(BTd = BTd[1], sample = 'hour') BTi
library("data.table") #Average days BTd <- fBTd(mode = 'prom') #Intradaily base time for the first day BTi <- fBTi(BTd = BTd[1], sample = 'hour') BTi
Extract the diffuse and direct components from the daily global irradiation on a horizontal surface by means of regressions between the clearness index and the diffuse fraction parameters.
fCompD(sol, G0d, corr = "CPR",f)
fCompD(sol, G0d, corr = "CPR",f)
sol |
A |
G0d |
A |
corr |
A character, the correlation between the fraction of diffuse irradiation and the clearness index to be used. With this version several options are available, as described in
If If |
f |
A function defininig a correlation between the fraction of
diffuse irradiation and the clearness index. It is only neccessary when |
A data.table
object which includes:
Fd |
numeric, the diffuse fraction |
Ktd |
numeric, the clearness index |
G0d |
numeric, the global irradiation on a horizontal surface (Wh/m²) |
D0d |
numeric, the diffuse irradiation on a horizontal surface (Wh/m²) |
B0d |
numeric, the direct irradiation on a horizontal surface (Wh/m²) |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") lat <- 37.2; BTd <- fBTd(mode = 'serie') SolD <- fSolD(lat, BTd[100]) G0d <- 5000 fCompD(SolD, G0d, corr = "Page") fCompD(SolD, G0d, corr = "CPR") #define a function fKtd with the correlation of CPR fKTd <- function(sol, G0d){ Kt <- Ktm(sol, G0d) Fd <- (0.99*(Kt <= 0.17))+ (Kt>0.17)*(1.188 -2.272 * Kt + 9.473 * Kt^2 - 21.856 * Kt^3 + 14.648 * Kt^4) return(data.table(Fd, Kt))} #The same as with corr = "CPR" fCompD(SolD, G0d, corr = "user", f = fKTd) lat <- -37.2; SolDs <- fSolD(lat, BTd[283]) G0d <- data.table(Dates = SolDs$Dates, G0d = 5000) fCompD(SolDs, G0d, corr = "CPR") lat <- 37.2; G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919,7.027,5.369,3.562,2.814,2.179)*1000; Rad <- readG0dm(G0dm, lat = lat) solD <- fSolD(lat, fBTd(mode = 'prom')) fCompD(solD, Rad, corr = 'Page')
library("data.table") lat <- 37.2; BTd <- fBTd(mode = 'serie') SolD <- fSolD(lat, BTd[100]) G0d <- 5000 fCompD(SolD, G0d, corr = "Page") fCompD(SolD, G0d, corr = "CPR") #define a function fKtd with the correlation of CPR fKTd <- function(sol, G0d){ Kt <- Ktm(sol, G0d) Fd <- (0.99*(Kt <= 0.17))+ (Kt>0.17)*(1.188 -2.272 * Kt + 9.473 * Kt^2 - 21.856 * Kt^3 + 14.648 * Kt^4) return(data.table(Fd, Kt))} #The same as with corr = "CPR" fCompD(SolD, G0d, corr = "user", f = fKTd) lat <- -37.2; SolDs <- fSolD(lat, BTd[283]) G0d <- data.table(Dates = SolDs$Dates, G0d = 5000) fCompD(SolDs, G0d, corr = "CPR") lat <- 37.2; G0dm <- c(2.766,3.491,4.494,5.912,6.989,7.742,7.919,7.027,5.369,3.562,2.814,2.179)*1000; Rad <- readG0dm(G0dm, lat = lat) solD <- fSolD(lat, fBTd(mode = 'prom')) fCompD(solD, Rad, corr = 'Page')
From the daily global, diffuse and direct irradiation values supplied by fCompD
, the profile of the global, diffuse and direct irradiance is calculated with the rd
and rg
components of fSolI
.
fCompI(sol, compD, G0I, corr = 'none', f, filterG0 = TRUE)
fCompI(sol, compD, G0I, corr = 'none', f, filterG0 = TRUE)
sol |
A |
compD |
A |
G0I |
A See below for |
corr |
A character, the correlation between the the fraction of
intradaily diffuse irradiation and the clearness index to be
used. It is ignored if With this version several correlations are available, as described in
If If |
f |
A function defininig a correlation between the fraction of
diffuse irradiation and the clearness index. It is only neccessary
when |
filterG0 |
A logical. If |
A data.table
with these components:
kt |
numeric, clearness index. |
fd |
numeric, diffuse fraction. |
G0 |
numeric, global irradiance on a horizontal surface, (W/m²) |
D0 |
numeric, diffuse irradiance on a horizontal surface, (W/m²) |
B0 |
numeric, direct irradiance on a horizontal surface, (W/m²) |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Collares-Pereira, M. y Rabl, A., The average distribution of solar radiation: correlations between diffuse and hemispherical and between daily and hourly insolation values. Solar Energy, 22:155–164, 1979.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
fCompD
,
fSolI
,
calcSol
,
corrFdKt
.
library("data.table") lat <- 37.2 BTd <- fBTd(mode = 'serie') solD <- fSolD(lat, BTd[100]) solI <- fSolI(solD, sample = 'hour') G0d <- data.table(Dates = solD$Dates, G0d = 5000) compD <- fCompD(solD, G0d, corr = "Page") fCompI(solI, compD) sol <- calcSol(lat, fBTd(mode = 'prom'), sample = 'hour', keep.night = FALSE) G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000 Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) BD <- readG0dm(G0dm = G0dm, Ta = Ta, lat = lat) compD <- fCompD(sol, BD, corr = 'Page') compI <- fCompI(sol, compD) head(compI) ## Use of 'corr'. The help page of calcG0 includes additional examples ## with intradaily data xyplot(fd ~ kt, data = compI) climed <- fCompI(sol, G0I = compI, corr = 'CLIMEDh') xyplot(Fd ~ Kt, data = climed) ekdh <- fCompI(sol, G0I = compI, corr = 'EKDh') xyplot(Fd ~ Kt, data = ekdh) brl <- fCompI(sol, G0I = compI, corr = 'BRL') xyplot(Fd ~ Kt, data = brl)
library("data.table") lat <- 37.2 BTd <- fBTd(mode = 'serie') solD <- fSolD(lat, BTd[100]) solI <- fSolI(solD, sample = 'hour') G0d <- data.table(Dates = solD$Dates, G0d = 5000) compD <- fCompD(solD, G0d, corr = "Page") fCompI(solI, compD) sol <- calcSol(lat, fBTd(mode = 'prom'), sample = 'hour', keep.night = FALSE) G0dm <- c(2.766, 3.491, 4.494, 5.912, 6.989, 7.742, 7.919, 7.027, 5.369, 3.562, 2.814, 2.179)*1000 Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) BD <- readG0dm(G0dm = G0dm, Ta = Ta, lat = lat) compD <- fCompD(sol, BD, corr = 'Page') compI <- fCompI(sol, compD) head(compI) ## Use of 'corr'. The help page of calcG0 includes additional examples ## with intradaily data xyplot(fd ~ kt, data = compI) climed <- fCompI(sol, G0I = compI, corr = 'CLIMEDh') xyplot(Fd ~ Kt, data = climed) ekdh <- fCompI(sol, G0I = compI, corr = 'EKDh') xyplot(Fd ~ Kt, data = ekdh) brl <- fCompI(sol, G0I = compI, corr = 'BRL') xyplot(Fd ~ Kt, data = brl)
The solar irradiance incident on an inclined surface is calculated from the direct and diffuse irradiance on a horizontal surface, and from the evolution of the angles of the Sun and the surface. Moreover, the effect of the angle of incidence and dust on the PV module is included to obtain the effective irradiance.
This function is used by the calcGef
function.
fInclin(compI, angGen, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE)
fInclin(compI, angGen, iS = 2, alb = 0.2, horizBright = TRUE, HCPV = FALSE)
compI |
A |
angGen |
A |
iS |
integer, degree of dirtiness. Its value must be included in the set (1,2,3,4). |
alb |
numeric, albedo reflection coefficient. Its default value is 0.2 |
horizBright |
logical, if TRUE, the horizon brightness correction proposed by Reind et al. is used. |
HCPV |
logical, if TRUE the diffuse and albedo components of the effective irradiance are set to zero. HCPV is the acronym of High Concentration PV system. |
The solar irradiance incident on an inclined surface can be calculated from the direct and diffuse irradiance on a horizontal surface, and from the evolution of the angles of the Sun and the surface. The transformation of the direct radiation is straightforward since only geometric considerations are needed. However, the treatment of the diffuse irradiance is more complex since it involves the modelling of the atmosphere. There are several models for the estimation of diffuse irradiance on an inclined surface. The one which combines simplicity and acceptable results is the proposal of Hay and McKay. This model divides the diffuse component in isotropic and anisotropic whose values depends on a anisotropy index.
On the other hand, the effective irradiance, the fraction of the incident irradiance that reaches the cells inside a PV module, is calculated with the losses due to the angle of incidence and dirtiness. This behaviour can be simulated with a model proposed by Martin and Ruiz requiring information about the angles of the surface and the level of dirtiness (iS
) .
A data.table
object with these components:
Bo |
Extra-atmospheric irradiance on the inclined surface (W/m²) |
Bn |
Direct normal irradiance (W/m²) |
G , B , D , Di , Dc , R
|
Global, direct, diffuse (total, isotropic and anisotropic) and albedo irradiance incident on an inclined surface (W/m²) |
Gef , Bef , Def , Dief , Dcef , Ref
|
Effective global, direct, diffuse (total, isotropic and anisotropic) and albedo irradiance incident on an inclined surface (W/m²) |
FTb , FTd , FTr
|
Factor of angular losses for the direct, diffuse and albedo components |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Hay, J. E. and McKay, D. C.: Estimating Solar Irradiance on Inclined Surfaces: A Review and Assessment of Methodologies. Int. J. Solar Energy, (3):pp. 203, 1985.
Martin, N. and Ruiz, J.M.: Calculation of the PV modules angular losses under field conditions by means of an analytical model. Solar Energy Materials & Solar Cells, 70:25–38, 2001.
D. T. Reindl and W. A. Beckman and J. A. Duffie: Evaluation of hourly tilted surface radiation models, Solar Energy, 45:9-17, 1990.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Simulate the behaviour of a grid connected PV system under different
conditions of irradiance and temperature. This function is used by the
prodGCPV
function.
fProd(inclin, module, generator, inverter, effSys)
fProd(inclin, module, generator, inverter, effSys)
inclin |
A |
module |
list of numeric values with information about the PV module,
|
generator |
list of numeric values with information about the generator,
|
inverter |
list of numeric values with information about the DC/AC inverter,
|
effSys |
list of numeric values with information about the system losses,
|
If inclin
is data.table
or Gef
object, the result
is a data.table
object with these components:
Tc |
cell temperature, |
Voc , Isc , Vmpp , Impp
|
open circuit voltage, short circuit current, MPP voltage and current, respectively, in the conditions of irradiance and temperature provided by |
Vdc , Idc
|
voltage and current at the input of the inverter. If no voltage limitation occurs (according to the values of |
Pdc |
power at the input of the inverter, W |
Pac |
power at the output of the inverter, W |
EffI |
efficiency of the inverter |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Jantsch, M., Schmidt, H. y Schmid, J.: Results on the concerted action on power conditioning and control. 11th European photovoltaic Solar Energy Conference, 1992.
Baumgartner, F. P., Schmidt, H., Burger, B., Bründlinger, R., Haeberlin, H. and Zehner, M.: Status and Relevance of the DC Voltage Dependency of the Inverter Efficiency. 22nd European Photovoltaic Solar Energy Conference, 2007.
Alonso Garcia, M. C.: Caracterización y modelado de asociaciones de dispositivos fotovoltaicos. PhD Thesis, CIEMAT, 2005.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") inclin <- data.table(Gef = c(200,400,600,800,1000),Ta = 25) #using default values fProd(inclin) #Using a matrix for Ki (voltage dependence) inv1 <- list(Ki = rbind(c(-0.00019917, 7.513e-06, -5.4183e-09), c(0.00806, -4.161e-06, 2.859e-08), c(0.02118, 3.4002e-05, -4.8967e-08))) fProd(inclin, inverter = inv1) #Voltage limits of the inverter inclin <- data.table(Gef = 800,Ta = 30) gen1 <- list(Nms = 10, Nmp = 11) prod <- fProd(inclin,generator = gen1) print(prod) with(prod, Vdc * Idc / (Vmpp * Impp))
library("data.table") inclin <- data.table(Gef = c(200,400,600,800,1000),Ta = 25) #using default values fProd(inclin) #Using a matrix for Ki (voltage dependence) inv1 <- list(Ki = rbind(c(-0.00019917, 7.513e-06, -5.4183e-09), c(0.00806, -4.161e-06, 2.859e-08), c(0.02118, 3.4002e-05, -4.8967e-08))) fProd(inclin, inverter = inv1) #Voltage limits of the inverter inclin <- data.table(Gef = 800,Ta = 30) gen1 <- list(Nms = 10, Nmp = 11) prod <- fProd(inclin,generator = gen1) print(prod) with(prod, Vdc * Idc / (Vmpp * Impp))
Compute the performance of the different parts of a centrifugal pump fed by a frequency converter following the affinity laws.
fPump(pump, H)
fPump(pump, H)
pump |
|
H |
Total manometric head (m). |
lim |
Range of values of electrical power input |
fQ |
Function constructed with |
fPb |
Function constructed with |
fPh |
Function constructed with |
fFreq |
Function constructed with |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Abella, M. A., Lorenzo, E. y Chenlo, F.: PV water pumping systems based on standard frequency converters. Progress in Photovoltaics: Research and Applications, 11(3):179–191, 2003, ISSN 1099-159X.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
NmgPVPS
, prodPVPS
, pumpCoef
, splinefun
.
library("data.table") data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8 & stages == 44) fSP8A44 <- fPump(pump = CoefSP8A44,H = 40) SP8A44 = with(fSP8A44,{ Pac = seq(lim[1],lim[2],by = 100) Pb = fPb(Pac) etam = Pb/Pac Ph = fPh(Pac) etab = Ph/Pb f = fFreq(Pac) Q = fQ(Pac) result = data.frame(Q,Pac,Pb,Ph,etam,etab,f)}) #Efficiency of the motor, pump and the motor-pump library("latticeExtra") SP8A44$etamb = with(SP8A44,etab*etam) lab = c(expression(eta[motor]), expression(eta[pump]), expression(eta[mp])) p <- xyplot(etam + etab + etamb ~ Pac,data = SP8A44,type = 'l', ylab = 'Efficiency') p + glayer(panel.text(x[1], y[1], lab[group.number], pos = 3)) #Mechanical, hydraulic and electrical power lab <- c(expression(P[pump]), expression(P[hyd])) p <- xyplot(Pb + Ph ~ Pac,data = SP8A44,type = 'l', ylab = 'Power (W)', xlab = 'AC Power (W)') p + glayer(panel.text(x[length(x)], y[length(x)], lab[group.number], pos = 3)) #Flow and electrical power xyplot(Q ~ Pac,data = SP8A44,type = 'l')
library("data.table") data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8 & stages == 44) fSP8A44 <- fPump(pump = CoefSP8A44,H = 40) SP8A44 = with(fSP8A44,{ Pac = seq(lim[1],lim[2],by = 100) Pb = fPb(Pac) etam = Pb/Pac Ph = fPh(Pac) etab = Ph/Pb f = fFreq(Pac) Q = fQ(Pac) result = data.frame(Q,Pac,Pb,Ph,etam,etab,f)}) #Efficiency of the motor, pump and the motor-pump library("latticeExtra") SP8A44$etamb = with(SP8A44,etab*etam) lab = c(expression(eta[motor]), expression(eta[pump]), expression(eta[mp])) p <- xyplot(etam + etab + etamb ~ Pac,data = SP8A44,type = 'l', ylab = 'Efficiency') p + glayer(panel.text(x[1], y[1], lab[group.number], pos = 3)) #Mechanical, hydraulic and electrical power lab <- c(expression(P[pump]), expression(P[hyd])) p <- xyplot(Pb + Ph ~ Pac,data = SP8A44,type = 'l', ylab = 'Power (W)', xlab = 'AC Power (W)') p + glayer(panel.text(x[length(x)], y[length(x)], lab[group.number], pos = 3)) #Flow and electrical power xyplot(Q ~ Pac,data = SP8A44,type = 'l')
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 sunrise angle and the daily extra-atmospheric irradiation.
fSolD(lat, BTd, method = 'michalsky')
fSolD(lat, BTd, method = 'michalsky')
lat |
Latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
BTd |
Daily temporal base, a |
method |
|
A data.table
object with these components:
lat |
Latitude (degrees) |
decl |
Declination angle (radians) for each day of year in |
eo |
Factor of correction due the eccentricity of orbit of the Earth around the Sun. |
ws |
Sunrise 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. |
Bo0d |
Extra-atmospheric daily irradiation (watt-hour per squared meter) incident on a horizontal surface |
EoT |
Equation of Time. |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Cooper, P.I., Solar Energy, 12, 3 (1969). "The Absorption of Solar Radiation in Solar Stills"
Spencer, Search 2 (5), 172, https://www.mail-archive.com/[email protected]/msg01050.html
Michalsky, J., 1988: The Astronomical Almanac's algorithm for approximate solar position (1950-2050), Solar Energy 40, 227-235
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") BTd <- fBTd(mode = 'serie') lat <- 37.2 (fSolD(lat, BTd[100])) (fSolD(lat, BTd[100], method = 'strous')) (fSolD(lat, BTd[100], method = 'spencer')) (fSolD(lat, BTd[100], method = 'cooper')) lat <- -37.2 (fSolD(lat, BTd[283])) #Solar angles along the year SolD <- fSolD(lat, BTd = fBTd()) xyplot(SolD) #Calculation of the daylength for several latitudes library("latticeExtra") Lats <- c(-60, -40, -20, 0, 20, 40, 60) NomLats <- ifelse(Lats > 0, paste(Lats,'N', sep = ''), paste(abs(Lats), 'S', sep = '')) NomLats[Lats == 0] <- '0' BTd <- fBTd(mode = 'serie') mat <- matrix(nrow = length(BTd), ncol = length(Lats)) colnames(mat) <- NomLats WsZ <- data.table(Dates = BTd, mat) for (i in seq_along(Lats)){ SolDaux <- fSolD(lat = Lats[i], BTd = fBTd(mode = 'serie')); WsZ[,i+1] <- r2h(2*abs(SolDaux$ws))} p = xyplot(`60S` + `40S` + `20S` + `0` + `20N` + `40N` + `60N` ~ Dates, data = WsZ, type = "l", ylab = expression(omega[s] * (h))) plab = p+glayer(panel.text(x[1], y[1], NomLats[group.number], pos = 2)) print(plab)
library("data.table") BTd <- fBTd(mode = 'serie') lat <- 37.2 (fSolD(lat, BTd[100])) (fSolD(lat, BTd[100], method = 'strous')) (fSolD(lat, BTd[100], method = 'spencer')) (fSolD(lat, BTd[100], method = 'cooper')) lat <- -37.2 (fSolD(lat, BTd[283])) #Solar angles along the year SolD <- fSolD(lat, BTd = fBTd()) xyplot(SolD) #Calculation of the daylength for several latitudes library("latticeExtra") Lats <- c(-60, -40, -20, 0, 20, 40, 60) NomLats <- ifelse(Lats > 0, paste(Lats,'N', sep = ''), paste(abs(Lats), 'S', sep = '')) NomLats[Lats == 0] <- '0' BTd <- fBTd(mode = 'serie') mat <- matrix(nrow = length(BTd), ncol = length(Lats)) colnames(mat) <- NomLats WsZ <- data.table(Dates = BTd, mat) for (i in seq_along(Lats)){ SolDaux <- fSolD(lat = Lats[i], BTd = fBTd(mode = 'serie')); WsZ[,i+1] <- r2h(2*abs(SolDaux$ws))} p = xyplot(`60S` + `40S` + `20S` + `0` + `20N` + `40N` + `60N` ~ Dates, data = WsZ, type = "l", ylab = expression(omega[s] * (h))) plab = p+glayer(panel.text(x[1], y[1], NomLats[group.number], pos = 2)) print(plab)
Compute the angles which describe the intradaily apparent movement of the Sun from the Earth.
fSolI(solD, sample = 'hour', BTi, EoT = TRUE, keep.night = TRUE, method = 'michalsky')
fSolI(solD, sample = 'hour', BTi, EoT = TRUE, keep.night = TRUE, method = 'michalsky')
solD |
A |
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 It is not considered when |
BTi |
Intradaily time base, a |
EoT |
logical, if |
keep.night |
logical, if |
method |
|
A data.table
object is returned with these components:
lat |
numeric, latitude (degrees) |
w |
numeric, solar hour angle (radians) |
aman |
logical, |
cosThzS |
numeric, cosine of the solar zenith angle |
AzS |
numeric, solar acimuth angle (radians) |
AlS |
numeric, solar elevation angle (radians) |
Bo0 |
numeric, extra-atmospheric irradiance (W/m2) |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Cooper, P.I., Solar Energy, 12, 3 (1969). "The Absorption of Solar Radiation in Solar Stills"
Spencer, Search 2 (5), 172, https://www.mail-archive.com/[email protected]/msg01050.html
Michalsky, J., 1988: The Astronomical Almanac's algorithm for approximate solar position (1950-2050), Solar Energy 40, 227-235
Collares-Pereira, M. y Rabl, A., The average distribution of solar radiation: correlations between diffuse and hemispherical and between daily and hourly insolation values. Solar Energy, 22:155–164, 1979.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") ###Angles for one day BTd <- fBTd(mode = 'serie') #North hemisphere lat <- 37.2 solD <- fSolD(lat,BTd[100]) solI <- fSolI(solD, sample = 'hour') print(solI) #South hemisphere lat <- -37.2; solDs <- fSolD(lat,BTd[283]) solIs <- fSolI(solDs, sample = 'hour') print(solIs) ###Angles for the 12 average days lat <- 37.2; solD <- fSolD(lat,BTd = fBTd(mode = 'prom')) solI <- fSolI(solD, sample = '10 min', keep.night = FALSE) ###Solar elevation angle vs. azimuth. #This kind of graphics is useful for shadows calculations library("latticeExtra") mon <- month.abb p <- xyplot(r2d(AlS)~r2d(AzS), groups = month(Dates), data = solI, type = 'l', col = 'black', xlab = expression(psi[s]),ylab = expression(gamma[s])) plab <- p + glayer({ idx <- round(length(x)/2+1) panel.text(x[idx], y[idx], mon[group.value], pos = 3, offset = 0.2, cex = 0.8)}) print(plab)
library("data.table") ###Angles for one day BTd <- fBTd(mode = 'serie') #North hemisphere lat <- 37.2 solD <- fSolD(lat,BTd[100]) solI <- fSolI(solD, sample = 'hour') print(solI) #South hemisphere lat <- -37.2; solDs <- fSolD(lat,BTd[283]) solIs <- fSolI(solDs, sample = 'hour') print(solIs) ###Angles for the 12 average days lat <- 37.2; solD <- fSolD(lat,BTd = fBTd(mode = 'prom')) solI <- fSolI(solD, sample = '10 min', keep.night = FALSE) ###Solar elevation angle vs. azimuth. #This kind of graphics is useful for shadows calculations library("latticeExtra") mon <- month.abb p <- xyplot(r2d(AlS)~r2d(AzS), groups = month(Dates), data = solI, type = 'l', col = 'black', xlab = expression(psi[s]),ylab = expression(gamma[s])) plab <- p + glayer({ idx <- round(length(x)/2+1) panel.text(x[idx], y[idx], mon[group.value], pos = 3, offset = 0.2, cex = 0.8)}) print(plab)
Compute the shadows factor for two-axis and horizontal N-S axis trackers and fixed surfaces.
fSombra(angGen, distances, struct, modeTrk = 'fixed',prom = TRUE) fSombra6(angGen,distances,struct,prom = TRUE) fSombra2X(angGen,distances,struct) fSombraHoriz(angGen, distances,struct) fSombraEst(angGen, distances,struct)
fSombra(angGen, distances, struct, modeTrk = 'fixed',prom = TRUE) fSombra6(angGen,distances,struct,prom = TRUE) fSombra2X(angGen,distances,struct) fSombraHoriz(angGen, distances,struct) fSombraEst(angGen, distances,struct)
angGen |
A |
distances |
|
struct |
|
modeTrk |
character, to be chosen from |
prom |
logical, only needed for two-axis tracker mode. If |
fSombra
is only a wrapper for fSombra6
(two-axis trackers), fSombraEst
(fixed systems) and fSombraHoriz
(horizontal N-S axis trackers). Depending on the value of modeTrk
the corresponding function is selected.
fSombra6
calculates the shadows factor in a set of six two-axis trackers. If distances
has only one row, this function constructs a symmetric grid around a tracker located at (0,0,0). These five trackers are located at (-Lew, Lns, H), (0, Lns, H), (Lew, Lns, H), (-Lew, 0, H) and (Lns, 0, H). It is possible to define a irregular grid around (0,0,0) including five rows in distances
. When prom = TRUE
the shadows factor for each of the six trackers is calculated. Then, according to the distribution of trackers in the plant defined by struct$Nrow
and struct$Ncol
, a weighted average of the shadows factors is the result.
It is important to note that the distances are defined between axis for trackers and between similar points of the structure for fixed surfaces.
data.table
including angGen
and a variable named FS
, which is the shadows factor. This factor is the ratio between the area of the generator affected by shadows and the total area. Therefore its value is 1 when the PV generator is completely shadowed.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O.: Grandes Centrales Fotovoltaicas: producción, seguimiento y ciclo de vida. PhD Thesis, UNED, 2008. https://www.researchgate.net/publication/39419806_Grandes_Centrales_Fotovoltaicas_Produccion_Seguimiento_y_Ciclo_de_Vida.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
calcShd
, optimShd
, fTheta
, calcSol
library("data.table") lat <- 37.2; sol <- calcSol(lat, fBTd(mode = 'prom'), sample = '10 min', keep.night = FALSE) angGen <- fTheta(sol, beta = 35); Angles <- merge(as.data.tableI(sol), angGen) ###Two-axis tracker #Symmetric grid distances = data.table(Lew = 40,Lns = 30,H = 0) struct = list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) ShdFactor <- fSombra6(Angles, distances, struct, prom = FALSE) Angles$FS = ShdFactor xyplot(FS ~ w, groups = month(Dates), data = Angles, type = 'l', auto.key = list(space = 'right', lines = TRUE, points = FALSE)) #Symmetric grid defined with a five rows data.frame distances = data.table(Lew = c(-40,0,40,-40,40), Lns = c(30,30,30,0,0), H = 0) ShdFactor2 <- fSombra6(Angles, distances, struct,prom = FALSE) #of course, with the same result identical(ShdFactor, ShdFactor2)
library("data.table") lat <- 37.2; sol <- calcSol(lat, fBTd(mode = 'prom'), sample = '10 min', keep.night = FALSE) angGen <- fTheta(sol, beta = 35); Angles <- merge(as.data.tableI(sol), angGen) ###Two-axis tracker #Symmetric grid distances = data.table(Lew = 40,Lns = 30,H = 0) struct = list(W = 23.11, L = 9.8, Nrow = 2, Ncol = 8) ShdFactor <- fSombra6(Angles, distances, struct, prom = FALSE) Angles$FS = ShdFactor xyplot(FS ~ w, groups = month(Dates), data = Angles, type = 'l', auto.key = list(space = 'right', lines = TRUE, points = FALSE)) #Symmetric grid defined with a five rows data.frame distances = data.table(Lew = c(-40,0,40,-40,40), Lns = c(30,30,30,0,0), H = 0) ShdFactor2 <- fSombra6(Angles, distances, struct,prom = FALSE) #of course, with the same result identical(ShdFactor, ShdFactor2)
From the maximum and minimum daily values of ambient temperature, its evolution its calculated through a combination of cosine functions (ESRA method)
fTemp(sol, BD)
fTemp(sol, BD)
sol |
|
BD |
A |
The ESRA method estimates the dependence of the temperature on the time of the day (given as the local solar time) from only two inputs: minimum and maximum daily temperatures. It assumes that the temperature daily profile can be described using three piecewise cosine functions, dividing the day into three periods: from midnight to sunrise, from sunrise to the time of peak temperature (3 hours after midday), and to midnight.
A data.table
object with the profile of the ambient temperature.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Huld, T. , Suri, M., Dunlop, E. D., and Micale F., Estimating average daytime and daily temperature profiles within Europe, Environmental Modelling & Software 21 (2006) 1650-1661.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
The orientation, azimuth and incidence angle are calculated from the
results of fSolI
or calcSol
and from the information supplied by the
arguments beta
and alpha
when the surface is fixed
(modeTrk = 'fixed')
or the movement equations when a tracking
surface is chosen (modeTrk = 'horiz'
or modeTrk = 'two')
.
Besides, the modified movement of a horizontal NS tracker due to the
backtracking strategy is calculated if BT = TRUE
with information
about the tracker and the distance between the trackers included in the
system.
This function is used by the calcGef
function.
fTheta(sol, beta, alpha = 0, modeTrk = "fixed", betaLim = 90, BT = FALSE, struct, dist)
fTheta(sol, beta, alpha = 0, modeTrk = "fixed", betaLim = 90, BT = FALSE, struct, dist)
sol |
|
beta |
numeric, inclination angle of the surface (degrees). It is only needed when |
alpha |
numeric, azimuth angle of the surface (degrees). It is
measured from the south ( |
modeTrk |
character, to be chosen from |
betaLim |
numeric, maximum value of the inclination angle for a tracking surface. Its default value is 90 (no limitation)) |
BT |
logical, |
struct |
Only needed when |
dist |
Only needed when |
A data.table
object with these components:
Beta |
numeric, inclination angle of the surface (radians). When |
Alpha |
numeric, azimuth angle of the surface (radians). When |
cosTheta |
numeric, cosine of the incidence angle of the solar irradiance on the surface |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Panico, D., Garvison, P., Wenger, H. J., Shugar, D., Backtracking: a novel strategy for tracking PV systems, Photovoltaic Specialists Conference, 668-673, 1991
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Compute and display the H-Q curves of a centrifugal pump fed working at several frequencies, and the iso-efficiency curve as a reference.
HQCurve(pump)
HQCurve(pump)
pump |
|
result |
A |
plot |
The plot with several curves labelled with the correspondent frequencies, and the isoefficiency curve (named "ISO"). |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Abella, M. A., Lorenzo, E. y Chenlo, F.: PV water pumping systems based on standard frequency converters. Progress in Photovoltaics: Research and Applications, 11(3):179–191, 2003, ISSN 1099-159X.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8&stages == 44) CurvaSP8A44 <- HQCurve(pump = CoefSP8A44)
library("data.table") data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8&stages == 44) CurvaSP8A44 <- HQCurve(pump = CoefSP8A44)
The function local2Solar
converts the time zone of a POSIXct
object to
the mean solar time and set its time zone to UTC as a synonym of mean
solar time. It includes two corrections:
the difference of longitudes between the location and the time zone, and
the daylight saving time.
The function lonHH
calculates the longitude (radians) of a time zone.
local2Solar(x, lon = NULL) lonHH(tz)
local2Solar(x, lon = NULL) lonHH(tz)
x |
a |
lon |
A numeric value of the longitude (degrees) of the
location. If |
tz |
A character, a time zone as documented in https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. |
Since the result of local2Solar
is the mean solar time, the
Equation of Time correction is not calculated with this function. The
eot
function includes this correction if desired.
The function local2Solar
produces a POSIXct
object
with its time zone set to UTC.
The function lonHH
gives a numeric value.
It is important to note that the solaR2
package sets the system
time zone to UTC
with Sys.setenv(TZ = 'UTC')
.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") t.local <- as.POSIXct("2006-01-08 10:07:52", tz = 'Europe/Madrid') ##The local time zone and the location have the same longitude (15 degrees) local2Solar(t.local) ##But Madrid is at lon = -3 local2Solar(t.local, lon = -3) ##Daylight saving time t.local.dst <- as.POSIXct("2006-07-08 10:07:52", tz = 'Europe/Madrid') local2Solar(t.local.dst) local2Solar(t.local.dst, lon = -3)
library("data.table") t.local <- as.POSIXct("2006-01-08 10:07:52", tz = 'Europe/Madrid') ##The local time zone and the location have the same longitude (15 degrees) local2Solar(t.local) ##But Madrid is at lon = -3 local2Solar(t.local, lon = -3) ##Daylight saving time t.local.dst <- as.POSIXct("2006-07-08 10:07:52", tz = 'Europe/Madrid') local2Solar(t.local.dst) local2Solar(t.local.dst, lon = -3)
This function simulate the performance of a water pump fed by a frequency converter with several PV generators of different size during a day. The result is plotted as a nomogram which relates the nominal power of the PV generator, the total water flow and the total manometric head.
NmgPVPS(pump, Pg, H, Gd, Ta = 30, lambda = 0.0045, TONC = 47, eta = 0.95, Gmax = 1200, t0 = 6, Nm = 6, title = '', theme = custom.theme.2())
NmgPVPS(pump, Pg, H, Gd, Ta = 30, lambda = 0.0045, TONC = 47, eta = 0.95, Gmax = 1200, t0 = 6, Nm = 6, title = '', theme = custom.theme.2())
pump |
A |
Pg |
Sequence of values of the nominal power of the PV generator (Wp)) |
H |
Sequence of values of the total manometric head (m) |
Gd |
Global irradiation incident on the generator (Wh/m²) |
Ta |
Ambient temperature ( |
lambda |
Power losses factor due to temperature |
TONC |
Nominal operational cell temperature ( |
eta |
Average efficiency of the frequency converter |
Gmax |
Maximum value of irradiance (parameter of the IEC 61725) |
t0 |
Hours from midday to sunset (parameter of the IEC 61725) |
Nm |
Number of samples per hour |
title |
Main title of the plot. |
theme |
Theme of the lattice plot. |
This function computes the irradiance profile according to the IEC 61725 "Analytical Expression for Daily Solar Profiles", which is a common reference in the official documents regarding PV pumping systems.
At this version only pumps from the manufacturer Grundfos are included in pumpCoef
.
I |
|
D |
|
param |
|
plot |
|
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Abella, M. A., Lorenzo, E. y Chenlo, F.: PV water pumping systems based on standard frequency converters. Progress in Photovoltaics: Research and Applications, 11(3):179–191, 2003, ISSN 1099-159X.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") Pg = seq(4000, 8000,by = 100); H = seq(120, 150,by = 5); data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8 & stages == 44) NmgSP8A44 <- NmgPVPS(pump = CoefSP8A44,Pg = Pg,H = H,Gd = 5000, title = 'Choice of Pump', theme = custom.theme())
library("data.table") Pg = seq(4000, 8000,by = 100); H = seq(120, 150,by = 5); data(pumpCoef) CoefSP8A44 <- subset(pumpCoef, Qn == 8 & stages == 44) NmgSP8A44 <- NmgPVPS(pump = CoefSP8A44,Pg = Pg,H = H,Gd = 5000, title = 'Choice of Pump', theme = custom.theme())
diff2Hours
converts a difftime
object into its numeric
value with units = 'hours'
.
char2diff
converts a character description into a
difftime
object, following the code of
seq.POSIXt
.
sample2Hours
calculates the sampling time in hours described by a character
or a difftime
.
P2E
(power to energy) sums a series of power values (for
example, irradiance) to obtain energy aggregation (for example,
irradiation) using sample2Hours
for the units conversion.
diff2Hours(by) char2diff(by) sample2Hours(by) P2E(x, by)
diff2Hours(by) char2diff(by) sample2Hours(by) P2E(x, by)
by |
A character for |
x |
A numeric vector. |
A numeric value or a difftime
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") char2diff('min') char2diff('2 s') sample2Hours('s') sample2Hours('30 m') by1 <- char2diff('10 min') sample2Hours(by1)
library("data.table") char2diff('min') char2diff('2 s') sample2Hours('s') sample2Hours('30 m') by1 <- char2diff('10 min') sample2Hours(by1)
A set of functions that compute the apparent movement of the Sun from the Earth.
## Declination declination(d, method = 'michalsky') ## Eccentricity eccentricity(d, method = 'michalsky') ## Equation of time eot(d) ## Solar time sunrise(d, lat, method = 'michalsky', decl = declination(d, method = method)) ## Extraterrestrial irradiation bo0d(d, lat, method = 'michalsky', decl = declination(d, method = method), eo = eccentricity(d, method = method), ws = sunrise(d, lat, method = method)) ## Sun hour angle sunHour(d, BTi, sample = 'hour', EoT = TRUE, method = 'michalsky', eqtime = eot(d)) ## Cosine of the zenith angle zenith(d, lat, BTi, sample = 'hour', method = 'michalsky', decl = declination(d, method = method), w = sunHour(d, BTi, sample, method = method)) ## Azimuth angle azimuth(d, lat, BTi, sample = 'hour', method = 'michalsky', decl = declination(d, method = method), w = sunHour(d, BTi, sample, method = method), cosThzS = zenith(d, lat, BTi, sample, method = method, decl = decl, w = w))
## Declination declination(d, method = 'michalsky') ## Eccentricity eccentricity(d, method = 'michalsky') ## Equation of time eot(d) ## Solar time sunrise(d, lat, method = 'michalsky', decl = declination(d, method = method)) ## Extraterrestrial irradiation bo0d(d, lat, method = 'michalsky', decl = declination(d, method = method), eo = eccentricity(d, method = method), ws = sunrise(d, lat, method = method)) ## Sun hour angle sunHour(d, BTi, sample = 'hour', EoT = TRUE, method = 'michalsky', eqtime = eot(d)) ## Cosine of the zenith angle zenith(d, lat, BTi, sample = 'hour', method = 'michalsky', decl = declination(d, method = method), w = sunHour(d, BTi, sample, method = method)) ## Azimuth angle azimuth(d, lat, BTi, sample = 'hour', method = 'michalsky', decl = declination(d, method = method), w = sunHour(d, BTi, sample, method = method), cosThzS = zenith(d, lat, BTi, sample, method = method, decl = decl, w = w))
d |
Date, a daily time base, it may be the result of
|
method |
character, method for the sun geometry calculations, to be chosen from 'cooper', 'spencer', 'michalsky' and 'strous'. See references for details. |
lat |
numeric, latitude (degrees) of the point of the Earth where calculations are needed. It is positive for locations above the Equator. |
sample |
Character, increment of the intradaily sequence. |
BTi |
|
EoT |
logical, if |
decl , eo , ws , eqtime , w , cosThzS
|
Arguments that compute the variables they reference (default value). It can be replaced with previously calculated values to avoid calculating the same variable twice. |
A vector with the calculated elements. Its size varies depending on whether the calculations are daily or intradaily.
Francisco Delgado López, Oscar Perpiñán Lamigueiro.
Cooper, P.I., Solar Energy, 12, 3 (1969). "The Absorption of Solar Radiation in Solar Stills"
Spencer, Search 2 (5), 172, https://www.mail-archive.com/[email protected]/msg01050.html
Michalsky, J., 1988: The Astronomical Almanac's algorithm for approximate solar position (1950-2050), Solar Energy 40, 227-235
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") d = fBTd(mode = 'serie')[100] decl = declination(d, method = 'michalsky') decl w = sunHour(d, sample = 'hour', method = 'michalsky') w cosThzS = zenith(d, lat = 37.2, sample = 'hour', method = 'michalsky', decl = decl, w = w) cosThzS
library("data.table") d = fBTd(mode = 'serie')[100] decl = declination(d, method = 'michalsky') decl w = sunHour(d, sample = 'hour', method = 'michalsky') w cosThzS = zenith(d, lat = 37.2, sample = 'hour', method = 'michalsky', decl = decl, w = w) cosThzS
Several small functions to convert angle units.
d2r(x) r2d(x) h2r(x) h2d(x) r2h(x) d2h(x) r2sec(x)
d2r(x) r2d(x) h2r(x) h2d(x) r2h(x) d2h(x) r2sec(x)
x |
A numeric value. |
A numeric value:
Degrees to radians.
Radians to degrees.
Hours to radians.
Radians to hours.
Hours to degrees.
Degrees to hours.
Radians to seconds.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Several small functions to extract information from POSIXct
indexes.
hms(x) doy(x) dom(x) dst(x) truncDay(x)
hms(x) doy(x) dom(x) dst(x) truncDay(x)
x |
A |
doy
and dom
provide the (numeric) day of year and day of month,
respectively.
hms
gives the numeric value
hour(x)+minute(x)/60+second(x)/3600
dst
is +1 if the Daylight Savings Time flag is in force,
zero if not, -1 if unknown (DateTimeClasses
).
truncDay
truncates the POSIXct
object towards the day.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
as.POSIXct
Convert a Sol
, G0
, Gef
,
ProdGCPV
or ProdPVPS
object into a
data.table
object with daily values.
## S4 method for signature 'Sol' as.data.tableD(object, complete=FALSE, day=FALSE)
## S4 method for signature 'Sol' as.data.tableD(object, complete=FALSE, day=FALSE)
object |
A |
complete |
A logical. |
day |
A logical. |
signature(object = "Sol")
Conversion to a data.table
object with the content of the solD
slot. If day=TRUE
(default is FALSE
), the result includes three columns named
month
, day
(day of the year) and year
.
signature(object = "G0")
If complete=FALSE
(default) the result includes only
the columns of G0d
, D0d
and B0d
from the
G0D
slot. If
complete=TRUE
it returns the contents of the slots solD
and G0D
.
signature(object = "Gef")
If complete=FALSE
(default) the result includes only
the columns of Gefd
, Defd
and Befd
from the
GefD
slot. If
complete=TRUE
it returns the contents of the slots solD
,
G0D
and GefD
signature(object = "ProdGCPV")
If complete=FALSE
(default) the result includes only the columns of Eac
,
Edc
and Yf
from the prodD
slot. If
complete=TRUE
it returns the contents of the slots solD
,
G0D
, GefD
and prodD
.
signature(object = "ProdPVPS")
If complete=FALSE
(default) the result includes only the columns of Eac
,
Qd
and Yf
from the prodD
slot. If
complete=TRUE
it returns the contents of the slots solD
,
G0D
, GefD
and prodD
.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat = 37.2 BTd = fBTd(mode = 'prom') sol = calcSol(lat, BTd) solD = as.data.tableD(sol) solD solD2 = as.data.tableD(sol, day = TRUE) solD2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodD = as.data.tableD(prodfixed, complete = TRUE, day = TRUE) prodD
library("data.table") lat = 37.2 BTd = fBTd(mode = 'prom') sol = calcSol(lat, BTd) solD = as.data.tableD(sol) solD solD2 = as.data.tableD(sol, day = TRUE) solD2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodD = as.data.tableD(prodfixed, complete = TRUE, day = TRUE) prodD
Convert a Sol
, G0
, Gef
,
ProdGCPV
or ProdPVPS
object into a
data.table
object with daily values.
## S4 method for signature 'Sol' as.data.tableI(object, complete=FALSE, day=FALSE)
## S4 method for signature 'Sol' as.data.tableI(object, complete=FALSE, day=FALSE)
object |
A |
complete |
A logical. |
day |
A logical. |
signature(object = "Sol")
If complete=FALSE
and
day=FALSE
(default) the result includes only the content of the
solI
slot. If complete=TRUE
the contents of the
solD
slots are included.
signature(object = "G0")
If complete=FALSE
and
day=FALSE
(default) the result includes only the columns of
G0
, D0
and B0
of the G0I
slot.
If complete=TRUE
it returns the contents of the slots G0I
and solI
. If day=TRUE
the daily values (slots G0D
and solD
) are also included.)
signature(object = "Gef")
If complete=FALSE
and
day=FALSE
(default) the result includes only the columns of
Gef
, Def
and Bef
of the GefI
slot. If complete=TRUE
it
returns the contents of the slots GefI
, G0I
and
solI
. If day=TRUE
the daily values (slots GefD
, G0D
and solD
) are also included.)
signature(object = "ProdGCPV")
If complete=FALSE
and
day=FALSE
(default) the result includes only the columns of
Pac
and Pdc
of the prodI
slot. If complete=TRUE
it
returns the contents of the slots prodI
, GefI
, G0I
and
solI
. If day=TRUE
the daily values (slots prodD
, GefD
, G0D
and solD
) are also included.)
signature(object = "ProdPVPS")
If complete=FALSE
and
day=FALSE
(default) the result includes only the columns of
Pac
and Q
of the prodI
slot. If complete=TRUE
it
returns the contents of the slots prodI
, GefI
, G0I
and
solI
. If day=TRUE
the daily values (slots prodD
, GefD
, G0D
and solD
) are also included.)
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat = 37.2 BTd = fBTd(mode = 'prom')[1] sol = calcSol(lat, BTd, keep.night = FALSE) solI = as.data.tableI(sol) solI solI2 = as.data.tableI(sol, day = TRUE) solI2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodI = as.data.tableI(prodfixed, complete = TRUE, day = TRUE) prodI
library("data.table") lat = 37.2 BTd = fBTd(mode = 'prom')[1] sol = calcSol(lat, BTd, keep.night = FALSE) solI = as.data.tableI(sol) solI solI2 = as.data.tableI(sol, day = TRUE) solI2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodI = as.data.tableI(prodfixed, complete = TRUE, day = TRUE) prodI
Convert a G0
, Gef
,
ProdGCPV
or ProdPVPS
object into a
as.data.table
object with monthly average of daily values.
## S4 method for signature 'G0' as.data.tableM(object, complete=FALSE, day=FALSE)
## S4 method for signature 'G0' as.data.tableM(object, complete=FALSE, day=FALSE)
object |
A |
complete |
A logical. |
day |
A logical |
signature(object = "G0")
The result is the G0dm
slot. If day=TRUE
(default is FALSE
), the result
includes two columns names month
and year
.
signature(object = "Gef")
If complete=FALSE
(default) the result is the slot Gefdm
. If
complete=TRUE
it returns the slot G0dm
.
signature(object = "ProdGCPV")
If complete=FALSE
(default) the result is the prodDm
slot. If
complete=TRUE
the result includes the slots G0dm
and Gefdm
.
signature(object = "ProdPVPS")
If complete=FALSE
(default) the result is the prodDm
slot. If
complete=TRUE
the result includes the slots G0dm
and Gefdm
.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat <- 37.2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed <- prodGCPV(lat, dataRad = prom) prodM <- as.data.tableM(prodfixed, complete = TRUE, day = TRUE) prodM
library("data.table") lat <- 37.2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed <- prodGCPV(lat, dataRad = prom) prodM <- as.data.tableM(prodfixed, complete = TRUE, day = TRUE) prodM
Convert a G0
, Gef
,
ProdGCPV
or ProdPVPS
object into a
data.table
object with yearly values.
## S4 method for signature 'G0' as.data.tableY(object, complete=FALSE, day=FALSE)
## S4 method for signature 'G0' as.data.tableY(object, complete=FALSE, day=FALSE)
object |
A |
complete |
A logical. |
day |
A logical. |
signature(object = "G0")
The result is the G0y
slot. If day = TRUE
(default is FALSE
), the result
includes a column named year
.
signature(object = "Gef")
If complete=FALSE
(default) the result is the slot Gefy
. If
complete=TRUE
it returns the slot G0y
.
signature(object = "ProdGCPV")
If complete=FALSE
(default) the result is the prody
slot. If
complete=TRUE
the result includes the slots G0y
and Gefy
.
signature(object = "ProdPVPS")
If complete=FALSE
(default) the result is the prody
slot. If
complete=TRUE
the result includes the slots G0y
and Gefy
.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat <- 37.2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodY = as.data.tableY(prodfixed, complete = TRUE, day = TRUE) prodY
library("data.table") lat <- 37.2 G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodfixed = prodGCPV(lat, dataRad = prom) prodY = as.data.tableY(prodfixed, complete = TRUE, day = TRUE) prodY
Compare and plot the yearly values of several objects.
## S4 method for signature 'G0' compare(...)
## S4 method for signature 'G0' compare(...)
... |
A list of objects to be compared. |
The class of the first element of ...
is used to determine the
suitable method. The result is plotted with dotplot
:
signature(... = "G0")
yearly values of G0d
,
B0d
and D0d
.
signature(... = "Gef")
yearly values of Gefd
, Befd
and Defd
.
signature(... = "ProdGCPV")
yearly values of Yf
, Gefd
and G0d
.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods ProdFixed <- prodGCPV(lat = lat, dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) compare(ProdFixed, Prod2x, ProdHoriz) ##The first element rules the method GefFixed <- as(ProdFixed, 'Gef') compare(GefFixed, Prod2x, ProdHoriz)
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods ProdFixed <- prodGCPV(lat = lat, dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) compare(ProdFixed, Prod2x, ProdHoriz) ##The first element rules the method GefFixed <- as(ProdFixed, 'Gef') compare(GefFixed, Prod2x, ProdHoriz)
Meteorological source data of a Meteo
(or extended) object.
signature(object = "Meteo")
returns the meteorological
source data of the slot data
of the object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Global irradiation source data of a Meteo
(or extended) object.
signature(object = "Meteo")
returns the global irradiation
values stored in a Meteo
object.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Latitude angle of solaR
objects.
getLat(object, units='rad')
getLat(object, units='rad')
object |
A |
units |
A character, 'rad' or 'deg'. |
This function returns the latitude angle in radians
(units='rad'
, default) or degrees (units='deg'
).
signature(object = "Meteo")
Value of the latData
slot, which is defined by the argument lat
of the
readG0dm
and
readBDd
functions, or by the lat
component of the
dataRad
object passed to calcG0
(or equivalent) . It is the latitude of the
meteorological station (or equivalent) which provided the irradiation
source data. It may be different from the value used for the
calculation procedure.
signature(object = "Sol")
Value of the lat
slot,
which is defined by the argument lat
of the calcSol
function. It is the value used through the calculation procedure.
signature(object = "G0")
same as for the Sol
class.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Daily time index of solaR
objects.
signature(object = "Meteo")
returns the index of the
data
slot (a data.table
object.)
signature(object = "Sol")
returns the index of the
solD
slot (a data.table
object.)
signature(object = "G0")
same as for object='Sol'
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Intra-daily time index of solaR
objects.
signature(object = "Sol")
returns the index of the slot
solI
(a data.table
object).
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Methods for function levelplot
and zoo
and solaR
objects.
signature(x = "formula", data = "Meteo")
: The Meteo
object is converted into a data.table
object, and
the previous method is used.
signature(x = "formula", data = "Sol")
: idem
signature(x = "formula", data = "G0")
: idem
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
The function losses
calculates the yearly losses
from a Gef
or a ProdGCPV
object. The function
compareLosses
compares the losses from several ProdGCPV
objects and plots the result with dotplot
.
compareLosses(...) losses(object)
compareLosses(...) losses(object)
... |
A list of |
object |
An object of |
signature(... = "Gef")
shadows and angle of
incidence (AoI
) losses.
signature(... = "ProdGCPV")
shadows, AoI
,
generator (mainly temperature), DC and AC system (as detailed in
effSys
of fProd
) and inverter losses.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
library("data.table") setDTthreads(2) lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods ProdFixed <- prodGCPV(lat = lat,dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) losses(ProdFixed) losses(as(ProdFixed, 'Gef')) compareLosses(ProdFixed, Prod2x, ProdHoriz)
library("data.table") setDTthreads(2) lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Comparison of different tracker methods ProdFixed <- prodGCPV(lat = lat,dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) losses(ProdFixed) losses(as(ProdFixed, 'Gef')) compareLosses(ProdFixed, Prod2x, ProdHoriz)
Merge the daily time series of solaR objects
## S4 method for signature 'G0' mergesolaR(...)
## S4 method for signature 'G0' mergesolaR(...)
... |
A list of objects to be merged. |
The class of the first element of ...
is used to
determine the suitable method. Only the most important daily variable is
merged, depending on the class of the objects:
signature(... = "Meteo")
G0
signature(... = "G0")
G0d
signature(... = "Gef")
Gefd
signature(... = "ProdGCPV")
Yf
signature(... = "ProdPVPS")
Yf
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Different tracker methods ProdFixed <- prodGCPV(lat = lat,dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) prod <- mergesolaR(ProdFixed, Prod2x, ProdHoriz) head(prod)
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) ###Different tracker methods ProdFixed <- prodGCPV(lat = lat,dataRad = prom, keep.night = FALSE) Prod2x <- prodGCPV(lat = lat, dataRad = prom, modeTrk = 'two', keep.night = FALSE) ProdHoriz <- prodGCPV(lat = lat,dataRad = prom, modeTrk = 'horiz', keep.night = FALSE) prod <- mergesolaR(ProdFixed, Prod2x, ProdHoriz) head(prod)
Visualization of the content of a Shade
object.
signature(x = "Shade")
display the results of the iteration with a level plot for the two-axis tracking, or with conventional plot for horizontal tracking and fixed systems.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Method for extracting the subset of a solaR
object
whose daily time index (indexD
) is comprised between the
times i
and j
.
## S4 method for signature 'Meteo' x[i, j, ..., drop = TRUE] ## S4 method for signature 'Sol' x[i, j, ..., drop = TRUE] ## S4 method for signature 'G0' x[i, j, ..., drop = TRUE] ## S4 method for signature 'Gef' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ProdGCPV' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ProdPVPS' x[i, j, ..., drop = TRUE]
## S4 method for signature 'Meteo' x[i, j, ..., drop = TRUE] ## S4 method for signature 'Sol' x[i, j, ..., drop = TRUE] ## S4 method for signature 'G0' x[i, j, ..., drop = TRUE] ## S4 method for signature 'Gef' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ProdGCPV' x[i, j, ..., drop = TRUE] ## S4 method for signature 'ProdPVPS' x[i, j, ..., drop = TRUE]
x |
A |
i |
an index/time value ( |
j |
an index/time value ( |
... , drop
|
Additional arguments for |
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
library("data.table") lat <- 37.2 sol <- calcSol(lat, BTd = fBTd(mode = 'serie')) range(indexD(sol)) start <- as.Date(indexD(sol)[1]) end <- start + 30 solWindow <- sol[start, end] range(indexD(solWindow))
library("data.table") lat <- 37.2 sol <- calcSol(lat, BTd = fBTd(mode = 'serie')) range(indexD(sol)) start <- as.Date(indexD(sol)[1]) end <- start + 30 solWindow <- sol[start, end] range(indexD(solWindow))
Exports the results of the solaR
functions as text
files using write.table
## S4 method for signature 'Sol' writeSolar(object, file, complete = FALSE, day = FALSE, timeScales = c('i', 'd', 'm', 'y'), sep = ',', ...)
## S4 method for signature 'Sol' writeSolar(object, file, complete = FALSE, day = FALSE, timeScales = c('i', 'd', 'm', 'y'), sep = ',', ...)
object |
A |
file |
A character with the name of the file. |
complete |
A logical. Should all the variables be exported? |
day |
A logical. Should be daily values included in the intradaily file? |
timeScales |
A character. Use 'i' to export intradaily values, 'd' for daily values, 'm' for monthly values and 'y' for yearly values. A different file will be created for each choice. |
sep |
The field separator character. |
... |
Additional arguments for |
signature(object = "Sol")
This function exports the
slots with results using write.table
. If complete
= FALSE
and day = FALSE
(default) the result includes only the
content of the solI
slot. It day = TRUE
the contents of
the solD
slot are included.
signature(object = "G0")
If complete = FALSE
and
day = FALSE
(default) the result includes only the columns of
G0
, D0
and B0
of the G0I
slot. If
complete = TRUE
it returns the contents of the slots G0I
and solI
. If day = TRUE
the daily values (slots
G0D
and solD
) are also included.
signature(object = "Gef")
If complete = FALSE
and
day = FALSE
(default) the result includes only the columns of
Gef
, Def
and Bef
of the GefI
slot. If
complete = TRUE
it returns the contents of the slots GefI
,
G0I
and solI
. If day = TRUE
the daily values (slots
GefD
, G0D
and solD
) are also included.
signature(object = "ProdGCPV")
If complete = FALSE
and day = FALSE
(default) the result includes only the columns of
Pac
and Pdc
of the prodI
slot. If
complete = TRUE
it returns the contents of the slots
prodI
, GefI
, G0I
and solI
. If
day = TRUE
the daily values (slots prodD
, GefD
,
G0D
and solD
) are also included.
signature(object = "ProdPVPS")
If complete = FALSE
and day = FALSE
(default) the result includes only the columns of
Pac
and Q
of the prodI
slot. If
complete = TRUE
it returns the contents of the slots
prodI
, GefI
, G0I
and solI
. If
day = TRUE
the daily values (slots prodD
, GefD
,
G0D
and solD
) are also included.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
write.table
,
fread
,
as.data.tableI
,
as.data.tableD
,
as.data.tableM
,
as.data.tableY
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodFixed <- prodGCPV(lat = lat, dataRad = prom, modeRad = 'aguiar', keep.night = FALSE) old <- setwd(tempdir()) writeSolar(prodFixed, 'prodFixed.csv') dir() zI <- fread("prodFixed.csv", header = TRUE, sep = ",") zI zD <- fread("prodFixed.D.csv", header = TRUE, sep = ",") zD zM <- fread("prodFixed.M.csv", header = TRUE, sep = ",") zM zY <- fread("prodFixed.Y.csv", header = TRUE, sep = ",") zY setwd(old)
library("data.table") lat <- 37.2; G0dm <- c(2766, 3491, 4494, 5912, 6989, 7742, 7919, 7027, 5369, 3562, 2814, 2179) Ta <- c(10, 14.1, 15.6, 17.2, 19.3, 21.2, 28.4, 29.9, 24.3, 18.2, 17.2, 15.2) prom <- list(G0dm = G0dm, Ta = Ta) prodFixed <- prodGCPV(lat = lat, dataRad = prom, modeRad = 'aguiar', keep.night = FALSE) old <- setwd(tempdir()) writeSolar(prodFixed, 'prodFixed.csv') dir() zI <- fread("prodFixed.csv", header = TRUE, sep = ",") zI zD <- fread("prodFixed.D.csv", header = TRUE, sep = ",") zD zM <- fread("prodFixed.M.csv", header = TRUE, sep = ",") zM zY <- fread("prodFixed.Y.csv", header = TRUE, sep = ",") zY setwd(old)
Methods for function xyplot
in Package ‘solaR’
signature(x = "data.table", data = "missing")
: This method creates an XY plot for objects of class
data.table
without specifying a data
argument. It
must contain a column named Dates
with the time information.
signature(x = "formula", data = "Meteo")
: The Meteo
object is converted into a data.table
object with
getData(x)
and displayed with the method for data.table
.
signature(x = "formula", data = "Sol")
: The Sol
object is converted into a data.table
object
with as.data.tableI(x, complete = TRUE, day = TRUE)
and
displayed with the method for data.table
.
signature(x = "formula", data = "G0")
: Idem.
signature(x = "Meteo", data = "missing")
: The Meteo
object is converted into a data.table
object with getData(data)
. This data.table
is the
x
argument for a call to xyplot
, using the S4
method for signature(x = "data.table", data = "missing")
.
signature(x = "G0", data = "missing")
: The G0
object is converted into a data.table
object
with indexD(data)
. This data.table
is the x
argument for a call to xyplot
, using the S4 method for
signature(x = 'data.table', data = 'missing')
.
signature(x = "ProdGCPV", data = "missing")
: Idem, but the variables are not superposed.
signature(x = "ProdPVPS", data = "missing")
: Idem.
signature(x = "formula", data = "Shade")
: Idem.
Oscar Perpiñán Lamigueiro, Francisco Delgado López.
Markov Transition Matrices and auxiliary data for generating sequences of daily radiation values.
data(MTM)
data(MTM)
MTM
is a data.frame
with the collection of Markov
Transition Matrices defined in the paper "Simple procedure for
generating sequences of daily radiation values using a library of
Markov transition matrices", Aguiar et al., Solar Energy,
1998. Ktlim
(matrix) and Ktmtm
(vector) are auxiliary data
to choose the correspondent matrix of the collection.
Oscar Perpiñán Lamiguiero, Francisco Delgado López.
A year of irradiation, maximum and minimum ambient temperature from the HELIOS-IES database.
data(helios)
data(helios)
A data frame with 355 observations on the following 4 variables:
yyyy.mm.dd
a factor: year, month and day.
G.0.
a numeric vector, daily global horizontal irradiation.
TambMax
a numeric vector, maximum ambient temperature.
TambMin
a numeric vector, minimum ambient temperature.
http://helios.ies-def.upm.es/consulta.aspx
A data.table
object with the time evolution of the final productivity of a set
of 22 systems of a large PV plant.
data(prodEx)
data(prodEx)
O. Perpiñán, Statistical analysis of the performance and simulation of a two-axis tracking PV system, Solar Energy, 83:11(2074–2085), 2009.https://oa.upm.es/1843/1/PERPINAN_ART2009_01.pdf
Coefficients of centrifugal pumps
data(pumpCoef)
data(pumpCoef)
A data.table
with 13 columns:
rated flux
number of stages
maximum flux
rated motor power
Coefficients of the equation .
Coefficients of the efficiency curve of the motor (50 Hz): .
Coefficients of the efficiency curve of the pump (50 Hz): .
With this version only pumps from the manufacturer Grundfos are included.
https://product-selection.grundfos.com/
Perpiñán, O, Energía Solar Fotovoltaica, 2015. (https://oscarperpinan.github.io/esf/)
Perpiñán, O. (2012), "solaR: Solar Radiation and Photovoltaic Systems with R", Journal of Statistical Software, 50(9), 1-32, doi:10.18637/jss.v050.i09
Information about the location and operational status of the stations that make up the SIAR network
data(SIAR)
data(SIAR)
est_SIAR
is a data.table
with 625 estations containing the following information:
Estacion
character, name of the station.
Codigo
character, code of the station.
Longitud
numeric, longitude of the station in degrees (negative is for locations in the west).
Latitud
numeric, latitud of the station in degrees.
Altitud
integer, altitude of the station in meters.
Fecha_Instalacion
Date, day the station was installed, and therefore, the start of its records.
Fecha_Baja
Date, day the station was decommisioned,
and therefore, the end of its records (if its value is NA
,
it means it is still operational).
https://servicio.mapa.gob.es/websiar/
A customized theme for lattice. It is based on the custom.theme.2
function of the latticeExtra
package with the next values:
pch = 19
cex = 0.7
region = rev(brewer.pal(9, 'YlOrRd'))
strip.background$col = 'lightgray'
strip.shingle$col = 'transparent'