| checkintrfr | R Documentation |
r f_r(r)This function is auxiliary to polyCub.iso
for the cubature of a radially symmetric function
f(x,y) = f_r(||(x,y)-\boldsymbol{\mu}||),
with \mu being the center of isotropy, over a polygonal domain.
The (analytical) integral of r f_r(r) from 0 to R, intrfr,
is checked against an integrate-based approximation
for various values (rs) of the upper bound R.
A warning is issued if inconsistencies are found.
checkintrfr(intrfr, f, ..., center, control = list(), rs = numeric(0L),
tolerance = control$rel.tol)
intrfr |
a
integrate(function(r, ...) r * f(cbind(x0 + r, y0), ...),
0, R, ..., control = control)
where |
f |
a two-dimensional real-valued function. As its first argument it must take a coordinate matrix, i.e., a numeric matrix with two columns, and it must return a numeric vector of length the number of coordinates. |
... |
further arguments for |
center |
numeric vector of length 2, the center of isotropy. |
control |
list of arguments passed to |
rs |
numeric vector of upper bounds for which to check the validity of
|
tolerance |
of |
The intrfr function, invisibly. If only f was given,
an integrate-based approximation of intrfr is returned.
f_const <- function (coords) rep(1, nrow(coords))
intrfr_const <- function (R) R^2/2 # = \int_0^R r f_r(r) dr
checkintrfr(intrfr_const, f = f_const, center = c(0,0), rs = 1:10) # OK
checkintrfr(function(R) R, f = f_const, center = c(0,0), rs = 1:10) # warns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.