Learn R Programming

polyCub (version 0.5-2)

checkintrfr: Check the Integral of

Description

This function is auxiliary to polyCub.iso. The (analytical) integral of \(r f_r(r)\) from 0 to \(R\) is checked against a numeric approximation using integrate for various values of the upper bound \(R\). A warning is issued if inconsistencies are found.

Usage

checkintrfr(intrfr, f, ..., center, control = list(), rs = numeric(0L),
  tolerance = control$rel.tol)

Arguments

intrfr
analytical antiderivative of \(r f_r(r)\) from 0 to R (first argument, not necessarily named "R", must be vectorized). If missing, intrfr is approximated numerically using integrate configured with control.
f
a two-dimensional real 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 f or intrfr.
center
numeric vector of length 2, the center of isotropy.
control
list of arguments passed to integrate, the quadrature rule used for the line integral along the polygon boundary.
rs
numeric vector of upper bounds for which to check the validity of intrfr. If it has length 0, no checks are performed.
tolerance
of all.equal.numeric when comparing intrfr results with numerical integration. Defaults to the relative tolerance used for integrate.

Value

The intrfr function. If it was not supplied, its quadrature version using integrate is returned.